/* ==========================================================================
   Global Variables & Themes
   ========================================================================== */
:root {
    --font-primary: 'Inter', 'Noto Sans Thai', sans-serif;
    
    /* Light Mode Variables */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-sidebar: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: #1e293b;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    
    /* System Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    
    /* Status HSL Values (for easy alpha blending) */
    --status-pending: 38, 92%, 50%;     /* Amber */
    --status-progress: 217, 91%, 60%;   /* Blue */
    --status-completed: 142, 71%, 45%;  /* Green */
    --status-cancelled: 0, 72%, 51%;     /* Red */
    
    /* Urgency Colors */
    --urgency-high: 0, 72%, 51%;        /* Red */
    --urgency-medium: 38, 92%, 50%;      /* Amber */
    --urgency-low: 142, 71%, 45%;       /* Green */

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --bg-primary: #0b0f19;
    --bg-secondary: #161f30;
    --bg-sidebar: #070a13;
    --sidebar-text: #64748b;
    --sidebar-text-active: #3b82f6;
    --sidebar-hover: #131b2e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #1e293b;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.2), 0 2px 4px -2px rgb(0 0 0 / 0.2);
    --card-shadow-hover: 0 12px 20px -3px rgb(0 0 0 / 0.3), 0 4px 8px -4px rgb(0 0 0 / 0.3);
    
    --primary-light: rgba(59, 130, 246, 0.1);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   App Layout
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    padding: 24px;
    display: flex;
    flex-direction: column;
    color: var(--sidebar-text);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-icon {
    background-color: var(--primary);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.sidebar-logo h2 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}

.menu-item svg {
    transition: transform 0.2s;
}

.menu-item:hover {
    background-color: var(--sidebar-hover);
    color: white;
}

.menu-item:hover svg {
    transform: translateX(2px);
}

.menu-item.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    background-color: var(--sidebar-hover);
    border-color: white;
}

/* Theme Icon Switching logic */
body.light-mode .dark-icon { display: block; }
body.light-mode .light-icon { display: none; }
body.dark-mode .dark-icon { display: none; }
body.dark-mode .light-icon { display: block; }

/* Main Content Styles */
.main-content {
    flex-grow: 1;
    margin-left: 260px; /* offset sidebar */
    padding: 40px;
    max-width: 1600px;
    width: calc(100% - 260px);
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.current-date {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* ==========================================================================
   Stats Overview
   ========================================================================== */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.stat-info h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper svg {
    width: 22px;
    height: 22px;
}

/* Card Specific Colors */
.stat-card.total .stat-icon-wrapper {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.stat-card.pending {
    border-left: 4px solid hsl(var(--status-pending));
}
.stat-card.pending .stat-icon-wrapper {
    background-color: rgba(245, 158, 11, 0.1);
    color: hsl(var(--status-pending));
}

.stat-card.in-progress {
    border-left: 4px solid hsl(var(--status-progress));
}
.stat-card.in-progress .stat-icon-wrapper {
    background-color: rgba(59, 130, 246, 0.1);
    color: hsl(var(--status-progress));
}

.stat-card.completed {
    border-left: 4px solid hsl(var(--status-completed));
}
.stat-card.completed .stat-icon-wrapper {
    background-color: rgba(16, 185, 129, 0.1);
    color: hsl(var(--status-completed));
}

.stat-card.cancelled {
    border-left: 4px solid hsl(var(--status-cancelled));
}
.stat-card.cancelled .stat-icon-wrapper {
    background-color: rgba(239, 68, 68, 0.1);
    color: hsl(var(--status-cancelled));
}

/* ==========================================================================
   Controls Panel
   ========================================================================== */
.controls-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    flex-grow: 1;
    min-width: 250px;
}

.search-box svg {
    color: var(--text-muted);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    width: 100%;
}

.filters {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    border-color: var(--primary);
}

.view-toggle {
    display: flex;
    background-color: var(--bg-primary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn.active {
    background-color: var(--bg-secondary);
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* ==========================================================================
   Kanban Board View
   ========================================================================== */
.board-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

.board-column {
    background-color: rgba(226, 232, 240, 0.2); /* very light tint */
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.dark-mode .board-column {
    background-color: rgba(30, 41, 59, 0.2);
}

.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.pending { background-color: hsl(var(--status-pending)); }
.status-indicator.in-progress { background-color: hsl(var(--status-progress)); }
.status-indicator.completed { background-color: hsl(var(--status-completed)); }
.status-indicator.cancelled { background-color: hsl(var(--status-cancelled)); }

.column-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
}

.task-count {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    min-height: 400px; /* makes it easy to drag/drop inside empty cols */
}

/* Ticket Cards */
.ticket-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary);
}

.ticket-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ticket-id {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.urgency-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.urgency-badge.high {
    background-color: rgba(239, 68, 68, 0.1);
    color: hsl(var(--urgency-high));
}

.urgency-badge.medium {
    background-color: rgba(245, 158, 11, 0.1);
    color: hsl(var(--urgency-medium));
}

.urgency-badge.low {
    background-color: rgba(16, 185, 129, 0.1);
    color: hsl(var(--urgency-low));
}

.ticket-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-word;
}

.ticket-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.meta-item .value {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.technician-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.technician-tag svg {
    color: var(--primary);
}

/* ==========================================================================
   Table List View
   ========================================================================== */
.table-view {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th {
    background-color: rgba(226, 232, 240, 0.2);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.dark-mode th {
    background-color: rgba(30, 41, 59, 0.4);
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:hover td {
    background-color: rgba(226, 232, 240, 0.1);
}

.dark-mode tr:hover td {
    background-color: rgba(30, 41, 59, 0.2);
}

.table-ticket-id {
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
    font-size: 13px;
}

.table-user-info {
    display: flex;
    flex-direction: column;
}

.table-user-name {
    font-weight: 600;
}

.table-user-dept {
    font-size: 12px;
    color: var(--text-muted);
}

.device-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 500;
}

.issue-summary {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status Pill in Table */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
}

.status-pill.pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: hsl(var(--status-pending));
}
.status-pill.in-progress {
    background-color: rgba(59, 130, 246, 0.1);
    color: hsl(var(--status-progress));
}
.status-pill.completed {
    background-color: rgba(16, 185, 129, 0.1);
    color: hsl(var(--status-completed));
}
.status-pill.cancelled {
    background-color: rgba(239, 68, 68, 0.1);
    color: hsl(var(--status-cancelled));
}

.status-pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.text-center {
    text-align: center;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* No data styling */
.no-data {
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 12px;
}

.no-data svg {
    color: var(--border-color);
}

.no-data p {
    font-size: 15px;
    font-weight: 500;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5); /* backdrop tint */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 680px;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: var(--bg-primary);
}

/* Form Styling inside Modals */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Custom Urgency Selector (Chips layout) */
.urgency-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.urgency-option {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    background-color: var(--bg-primary);
    user-select: none;
}

.urgency-option input[type="radio"] {
    display: none;
}

.urgency-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.urgency-option.low .urgency-dot { background-color: hsl(var(--urgency-low)); }
.urgency-option.medium .urgency-dot { background-color: hsl(var(--urgency-medium)); }
.urgency-option.high .urgency-dot { background-color: hsl(var(--urgency-high)); }

/* Checked State styles for urgency chips */
.urgency-option.low:has(input:checked) {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: hsl(var(--urgency-low));
    color: hsl(var(--urgency-low));
}

.urgency-option.medium:has(input:checked) {
    background-color: rgba(245, 158, 11, 0.08);
    border-color: hsl(var(--urgency-medium));
    color: hsl(var(--urgency-medium));
}

.urgency-option.high:has(input:checked) {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: hsl(var(--urgency-high));
    color: hsl(var(--urgency-high));
}

/* Modal Divider */
.modal-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 4px 0 20px 0;
}

/* ==========================================================================
   Details Modal Custom View
   ========================================================================== */
.detail-section {
    margin-bottom: 8px;
}

.detail-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ticket-id-badge {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    font-family: monospace;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.issue-description-box {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-line;
    max-height: 150px;
    overflow-y: auto;
}

.tech-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.status-select {
    font-weight: 600;
}

.status-select:has(option[value="pending"]:checked) { border-color: hsl(var(--status-pending)); }
.status-select:has(option[value="in-progress"]:checked) { border-color: hsl(var(--status-progress)); }
.status-select:has(option[value="completed"]:checked) { border-color: hsl(var(--status-completed)); }
.status-select:has(option[value="cancelled"]:checked) { border-color: hsl(var(--status-cancelled)); }

.tech-footer-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    margin-top: 10px;
}

.main-tech-btns {
    display: flex;
    gap: 12px;
}

/* ==========================================================================
   Toasts (Notification System)
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 300;
}

.toast {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: opacity 0.3s, transform 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast.hide {
    opacity: 0;
    transform: translateY(-10px);
}

.toast-success {
    border-left-color: hsl(var(--status-completed));
}
.toast-info {
    border-left-color: var(--primary);
}
.toast-warning {
    border-left-color: hsl(var(--status-pending));
}
.toast-danger {
    border-left-color: hsl(var(--status-cancelled));
}

.toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon { color: hsl(var(--status-completed)); }
.toast-info .toast-icon { color: var(--primary); }
.toast-warning .toast-icon { color: hsl(var(--status-pending)); }
.toast-danger .toast-icon { color: hsl(var(--status-cancelled)); }

.toast-message {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ==========================================================================
   Mobile UI Elements (Hidden on Desktop)
   ========================================================================== */
.mobile-bottom-nav {
    display: none; /* Hidden on desktop */
}

.mobile-column-tabs {
    display: none; /* Hidden on desktop */
}

/* ==========================================================================
   Responsive Design & Media Queries
   ========================================================================== */
@media (max-width: 1200px) {
    .board-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 80px;
        padding: 24px 10px;
        align-items: center;
    }
    
    .sidebar-logo h2,
    .menu-item span,
    .theme-text {
        display: none;
    }
    
    .logo-icon {
        margin-bottom: 0;
    }
    
    .menu-item {
        padding: 12px;
        justify-content: center;
    }
    
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions button {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .urgency-selector {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Transform Table View into card lists on mobile */
    #table-view table, 
    #table-view thead, 
    #table-view tbody, 
    #table-view th, 
    #table-view td, 
    #table-view tr {
        display: block;
    }

    #table-view thead {
        display: none; /* Hide headers */
    }

    #table-view tr {
        margin-bottom: 16px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background-color: var(--bg-secondary);
        padding: 16px;
        box-shadow: var(--card-shadow);
        position: relative;
    }

    #table-view td {
        border-bottom: 1px dashed var(--border-color);
        padding: 10px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }

    #table-view td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        padding-top: 14px;
    }

    /* Inject labels using custom data attribute */
    #table-view td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 12px;
        color: var(--text-secondary);
        text-align: left;
        margin-right: 12px;
    }
}

@media (max-width: 600px) {
    /* Hide desktop Sidebar & display mobile Bottom Nav */
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px 16px 90px 16px; /* extra bottom padding for mobile menu space */
    }

    .header-actions {
        display: none; /* Hide duplicate create button from main content */
    }

    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    .view-toggle {
        justify-content: center;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-number {
        font-size: 24px;
    }

    /* Mobile Bottom Navigation Bar styling */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background-color: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        z-index: 150;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
        padding: 0 16px;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px 12px;
        font-family: var(--font-primary);
        transition: var(--transition);
    }

    .mobile-nav-item:focus {
        outline: none;
    }

    .mobile-nav-item.active {
        color: var(--primary);
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }

    /* Floating action button in mobile navigation */
    .btn-floating-add {
        background-color: var(--primary);
        color: white;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
        transform: translateY(-16px);
        transition: var(--transition);
        border: 4px solid var(--bg-secondary);
    }

    .btn-floating-add:hover {
        background-color: var(--primary-hover);
        transform: translateY(-18px) scale(1.05);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    }

    .btn-floating-add svg {
        width: 24px;
        height: 24px;
        color: white;
    }

    /* Mobile Kanban tab switcher styles */
    .mobile-column-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 4px 0 16px 0;
        margin-bottom: 8px;
        scrollbar-width: none; /* Firefox */
    }

    .mobile-column-tabs::-webkit-scrollbar {
        display: none; /* Safari and Chrome */
    }

    .mobile-tab-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: 20px;
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        color: var(--text-secondary);
        font-family: var(--font-primary);
        font-weight: 600;
        font-size: 12px;
        white-space: nowrap;
        cursor: pointer;
        transition: var(--transition);
    }

    .mobile-tab-btn.active {
        background-color: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }

    .tab-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
    }

    .tab-dot.pending { background-color: hsl(var(--status-pending)); }
    .tab-dot.in-progress { background-color: hsl(var(--status-progress)); }
    .tab-dot.completed { background-color: hsl(var(--status-completed)); }
    .tab-dot.cancelled { background-color: hsl(var(--status-cancelled)); }

    .tab-badge {
        font-size: 10px;
        background-color: var(--bg-primary);
        border: 1px solid var(--border-color);
        color: var(--text-secondary);
        padding: 1px 6px;
        border-radius: 8px;
    }

    .mobile-tab-btn.active .tab-badge {
        background-color: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    /* Kanban layout adjustments on mobile: show only active column */
    .board-view {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .board-column {
        display: none; /* Hide all columns by default on mobile */
        min-height: auto;
        padding: 0;
        background: transparent;
        border: none;
    }

    .board-column.active-mobile {
        display: flex; /* Only show active tab's column */
    }

    .board-column .column-header {
        display: none; /* Hide redundant column headers on mobile since tabs show it */
    }

    .toast-container {
        left: 24px;
        right: 24px;
        bottom: 84px; /* offset bottom nav */
    }
}
