@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6366F1;
    /* Modern Indigo */
    --primary-hover: #4F46E5;
    --secondary: #F59E0B;
    --secondary-hover: #D97706;
    --accent: #10B981;
    --background: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --primary-light: #EEF2FF;
    --danger-light: #FEF2F2;
    --success-light: #F0FDF4;
    --warning-light: #FFFBEB;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-left p {
    font-size: 14px;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-role {
    font-size: 13px;
    opacity: 0.8;
}

.btn-danger {
    background: #EF4444;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ── Left Sidebar Navigation ── */
.nav {
    background: var(--gray-800);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-right: 1px solid var(--gray-700);
    grid-column: 1;
    grid-row: 1 / span 999;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Sidebar branding block */
.nav::before {
    content: 'IECC';
    display: block;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    padding: 24px 20px 8px;
    line-height: 1;
}

.nav::after {
    content: 'HELP DESK CENTER';
    display: block;
    font-size: 10px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--gray-700);
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: all 0.18s;
    box-shadow: none;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: transparent;
    transform: none;
    box-shadow: none;
    border-left-color: rgba(255, 255, 255, 0.3);
}

.nav-item.active {
    color: #fff;
    background: rgba(124, 58, 237, 0.35);
    border-color: transparent;
    border-left-color: #a78bfa;
    box-shadow: none;
    font-weight: 600;
}

.nav-item span {
    font-size: 17px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Sidebar dropdown structure */
.nav-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.dropdown-arrow {
    font-size: 9px;
    transition: transform 0.2s ease;
    opacity: 0.7;
    margin-left: auto;
}

.nav-group.open > .nav-dropdown-toggle > .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.nav-group.open > .nav-dropdown-content {
    max-height: 600px;
}

.nav-subgroup-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 20px 4px 32px;
}

.nav-sub-item {
    padding: 8px 20px 8px 44px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-sub-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(255, 255, 255, 0.2);
}

.nav-sub-item.active {
    color: #fff;
    background: rgba(124, 58, 237, 0.2);
    border-left-color: #a78bfa;
    font-weight: 600;
}

.container {
    grid-column: 2;
    grid-row: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    animation: fadeIn 0.5s ease-out;
    width: 100%;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--gray-100);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.dashboard-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

.kpi-board {
    display: grid;
    gap: 12px;
    margin-bottom: 32px;
}

.kpi-section {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.kpi-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.kpi-section-title::-webkit-details-marker {
    display: none;
}

.kpi-section-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    border-radius: 8px;
    background: var(--gray-900);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.kpi-section-title h2 {
    flex: 1;
    color: var(--gray-800);
    font-size: 16px;
    font-weight: 800;
    margin: 0;
}

.kpi-section-title b {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.kpi-section-title b::after {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 16px;
    line-height: 1;
}

.kpi-section[open] .kpi-section-title {
    border-bottom: 1px solid var(--gray-200);
}

.kpi-section[open] .kpi-section-title b {
    color: var(--primary);
}

.kpi-section[open] .kpi-section-title b span {
    font-size: 0;
}

.kpi-section[open] .kpi-section-title b span::before {
    content: 'Hide KPI';
    font-size: 12px;
}

.kpi-section[open] .kpi-section-title b::after {
    content: '-';
    background: #ede9fe;
    color: var(--primary);
}

.kpi-section > .dashboard-kpi-grid {
    padding: 16px;
}

.stat-card {
    background: #fff;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    display: block;
    min-height: 154px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-card > div:first-child {
    min-width: 0;
    padding-right: 0;
}

.stat-card:hover {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    border-color: var(--gray-300);
}

.stat-card.blue {
    border-left: 4px solid var(--info);
}

.stat-card.yellow {
    border-left: 4px solid var(--warning);
}

.stat-card.purple {
    border-left: 4px solid var(--primary);
}

.stat-card.green {
    border-left: 4px solid var(--success);
}

.stat-value {
    font-size: 29px;
    font-weight: 800;
    color: var(--gray-900);
    margin: 28px 0 8px;
    line-height: 1.05;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.stat-label {
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.25;
    max-width: 100%;
}

.stat-icon {
    position: absolute;
    top: 14px;
    left: 18px;
    min-width: 0;
    padding: 5px 8px;
    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.stat-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 16px;
}

.stat-split.three {
    grid-template-columns: 1fr;
    gap: 6px;
}

.stat-split span {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    font-weight: 800;
    padding: 9px 11px;
    line-height: 1.2;
    min-height: 40px;
}

.stat-split strong {
    color: var(--gray-900);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    text-align: right;
    overflow-wrap: anywhere;
}

.stat-progress {
    height: 10px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 18px;
}

.stat-progress span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
}

.stat-note {
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 700;
    margin-top: 9px;
    line-height: 1.35;
}

.dashboard-kpi-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.dashboard-kpi-tile {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dashboard-kpi-tile:hover {
    border-color: var(--gray-300);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    text-decoration: none;
}

.dashboard-kpi-wide {
    grid-column: 1 / -1;
}

.dashboard-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
}

.dashboard-kpi-content {
    min-width: 0;
}

.dashboard-kpi-label {
    margin-bottom: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.dashboard-kpi-value {
    color: #0f172a;
    font-size: 23px;
    font-weight: 900;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.dashboard-kpi-value.emphasized {
    font-size: 29px;
}

.dashboard-kpi-value.small {
    font-size: 20px;
}

.dashboard-kpi-note {
    margin-top: 5px;
    color: #536b8a;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.dashboard-kpi-badge {
    align-self: start;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.dashboard-kpi-badge.positive {
    color: #16a34a;
}

.dashboard-kpi-badge.neutral {
    color: #64748b;
}

.dashboard-kpi-badge.negative {
    color: #dc2626;
}

.dashboard-kpi-progress {
    position: absolute;
    right: 16px;
    bottom: 12px;
    left: 64px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.dashboard-kpi-progress span {
    display: block;
    height: 100%;
    background: currentColor;
    border-radius: inherit;
}

.kpi-tone-blue {
    color: #2563eb;
}

.kpi-tone-blue .dashboard-kpi-icon {
    background: #eef4ff;
}

.kpi-tone-orange {
    color: #f97316;
}

.kpi-tone-orange .dashboard-kpi-icon {
    background: #fff7ed;
}

.kpi-tone-purple {
    color: #7c3aed;
}

.kpi-tone-purple .dashboard-kpi-icon {
    background: #f3e8ff;
}

.kpi-tone-green {
    color: #16a34a;
}

.kpi-tone-green .dashboard-kpi-icon {
    background: #ecfdf5;
}

.kpi-tone-red {
    color: #dc2626;
}

.kpi-tone-red .dashboard-kpi-icon {
    background: #fef2f2;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.staff-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.staff-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.15);
}

.staff-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.staff-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 3px solid white;
    outline: 2px solid var(--primary);
}

.staff-avatar-img.large {
    width: 48px;
    height: 48px;
    margin: 0;
    border-width: 2px;
}

.staff-avatar.large {
    margin: 0;
}

.staff-name {
    font-weight: 600;
    font-size: 18px;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.staff-email {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 16px;
}

.staff-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.staff-stat-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-800);
}

.staff-stat-label {
    font-size: 12px;
    color: var(--gray-500);
}

.staff-workload-grid {
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 16px;
}

.staff-workload-grid .staff-card {
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    padding: 18px;
    text-align: left;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.staff-workload-grid .staff-card:hover {
    border-color: rgba(124, 58, 237, 0.32);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.09);
    transform: translateY(-1px);
}

.staff-workload-grid .staff-card-header {
    align-items: center;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 24px;
    gap: 12px;
    margin-bottom: 16px;
}

.staff-workload-grid .staff-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.26);
}

.staff-workload-grid .staff-avatar-img {
    width: 56px;
    height: 56px;
    margin: 0;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.18);
}

.staff-workload-grid .staff-identity {
    min-width: 0;
}

.staff-workload-grid .staff-name {
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.staff-workload-grid .staff-email {
    font-size: 12px;
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-more {
    align-items: center;
    appearance: none;
    background: transparent;
    border: 0;
    color: #64748b;
    cursor: default;
    display: inline-flex;
    font-size: 20px;
    font-weight: 900;
    height: 24px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 24px;
}

.staff-metric-panel {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 14px;
    overflow: hidden;
}

.staff-metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 70px;
}

.staff-metric-row + .staff-metric-row {
    border-top: 1px solid var(--gray-100);
}

.staff-metric {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 8px 6px;
    text-align: center;
}

.staff-metric + .staff-metric {
    border-left: 1px solid var(--gray-100);
}

.staff-metric-value {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 9px;
}

.staff-metric-value.blue {
    color: #2563eb;
}

.staff-metric-value.green {
    color: #059669;
}

.staff-metric-value.purple {
    color: #7c3aed;
}

.staff-metric-value.amber {
    color: #d97706;
}

.staff-metric-value.orange {
    color: #ea580c;
}

.staff-metric-value.red {
    color: #dc2626;
}

.staff-metric-label {
    color: #475569;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.staff-workload-note {
    align-items: center;
    color: #475569;
    display: flex;
    font-size: 12px;
    font-weight: 600;
    gap: 8px;
    line-height: 1.3;
    margin: 2px 0 16px;
}

.staff-workload-note strong {
    color: #2563eb;
    font-weight: 900;
}

.staff-workload-icon {
    color: #7c3aed;
    display: inline-flex;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: -1px;
    transform: rotate(180deg);
}

.staff-details-btn {
    align-items: center;
    background: #fff;
    border: 1.5px solid #8b5cf6;
    border-radius: 7px;
    color: #7c3aed;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    gap: 8px;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
    width: 100%;
}

.staff-details-btn:hover,
.staff-details-btn:focus-visible {
    background: #6d5dfc;
    border-color: #6d5dfc;
    box-shadow: 0 9px 18px rgba(109, 93, 252, 0.24);
    color: #fff;
    outline: none;
    text-decoration: none;
    transform: translateY(-1px);
}

.staff-details-icon {
    font-size: 14px;
    line-height: 1;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.task-card:hover {
    border-color: var(--primary);
    background-color: #FDFBFF;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-id {
    font-weight: 700;
    color: var(--primary);
}

.badge {
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.pending {
    background: #fee2e2;
    color: #991b1b;
}

.badge.unassigned {
    background: #fee2e2;
    color: #991b1b;
}

.badge.assigned {
    background: #fef3c7;
    color: #92400e;
}

.badge.in-progress {
    background: #e0e7ff;
    color: #3730a3;
}

.badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.badge.released {
    background: #e0e7ff;
    color: #3730a3;
}

.revenue-card {
    background: linear-gradient(135deg, var(--primary) 0%, #A855F7 40%, #F59E0B 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(124, 58, 237, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.revenue-card h3 {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 4px;
}

.revenue-card::after {
    content: '⏱️';
    font-size: 48px;
    opacity: 0.5;
}

.revenue-amount {
    font-size: 48px;
    font-weight: 800;
    margin-top: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.action-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--gray-100);
    color: var(--gray-600);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.action-btn:hover {
    background: var(--gray-200);
    color: var(--gray-900);
    transform: translateY(-1.5px);
    box-shadow: var(--shadow-md);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.delete:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F9FAFB 0%, #E5E7EB 100%);
    background-image: radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.1) 0px, transparent 50%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-header {
    margin-bottom: 32px;
}

.login-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
    transform: rotate(-5deg);
    transition: transform 0.3s;
}

.login-card:hover .login-icon {
    transform: rotate(0deg) scale(1.05);
}

.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), #4C1D95);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--gray-500);
    font-size: 15px;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.login-form input {
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s;
}

.login-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.track-link {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-100);
}

.track-link p {
    color: var(--gray-500);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FEE2E2;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #D1FAE5;
}

/* Enhanced Buttons */
.btn {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6D28D9);
    box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3), 0 2px 4px -1px rgba(124, 58, 237, 0.15);
}

.btn-primary:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(124, 58, 237, 0.05);
}

/* Settings Page Styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.settings-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.settings-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.settings-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.settings-input-group input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.settings-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.settings-list {
    list-style: none;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.settings-item:hover {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.02);
}

.settings-item-name {
    font-weight: 500;
    color: var(--gray-700);
}

/* Password Form Styles */
.password-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.password-form .form-group {
    margin-bottom: 0;
}

.password-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.password-form .form-group input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.password-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Card Styles */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

/* Search and Filter Styles */
.search-filter {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-width: 220px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.search-box .search-icon {
    align-items: center;
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    color: var(--gray-600);
    display: inline-flex;
    flex: 0 0 72px;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    line-height: 1;
}

.search-box input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.search-box input:focus {
    outline: none;
    box-shadow: none;
}

.filter-select {
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 14px;
    background: white;
    min-width: 140px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.iecc-filter-shell {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 24px;
    position: relative;
    z-index: 8;
}

.iecc-filter-details {
    position: relative;
}

.iecc-filter-details[open] {
    flex-basis: 100%;
    width: 100%;
}

.iecc-filter-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.btn.filter-icon-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    flex: 0 0 44px;
}

.btn.filter-icon-button svg {
    width: 20px;
    height: 20px;
    display: block;
}

.iecc-filter-summary::-webkit-details-marker {
    display: none;
}

.iecc-filter-panel {
    position: static;
    z-index: 30;
    width: 100%;
    margin-top: 8px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
    overflow: visible;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.iecc-filter-panel > .filter-select,
.iecc-filter-panel > select,
.iecc-filter-panel > input:not([type="hidden"]) {
    flex: 1 1 180px;
    min-width: 160px;
}

.iecc-filter-panel > .btn,
.iecc-filter-panel > button,
.iecc-filter-panel > a.btn {
    flex: 0 0 auto;
    margin: 0;
}

.iecc-filter-panel form {
    margin-bottom: 0 !important;
}

.iecc-filter-panel .search-filter,
.iecc-filter-panel .filter-grid,
.iecc-filter-panel .filter-bar,
.iecc-filter-panel .filter-form,
.iecc-filter-panel .queue-filter,
.iecc-filter-panel .rma-list-tools,
.iecc-filter-panel .rma-tracking-filter,
.iecc-filter-panel .rma-parts-filter,
.iecc-filter-panel .rma-print-filter,
.iecc-filter-panel .rma-filters,
.iecc-filter-panel .iw-filter,
.iecc-filter-panel .jr-filter,
.iecc-filter-panel .sd-search-form,
.iecc-filter-panel .parts-list-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.iecc-filter-panel .filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.iecc-filter-shell-inline {
    display: block;
}

.iecc-filter-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px !important;
}

.iecc-filter-inline-form > .search-box,
.iecc-filter-inline-form > input[type="search"],
.iecc-filter-inline-form > input[name="search"] {
    flex: 1 1 280px;
    min-width: 220px;
}

.iecc-filter-inline-form > .iecc-filter-details {
    flex: 1 1 100%;
    min-width: 220px;
}

.iecc-search-submit {
    flex: 0 0 auto;
}

@media (max-width: 760px) {
    .iecc-filter-shell {
        width: 100%;
    }

    .iecc-filter-details {
        width: 100%;
    }

    .iecc-filter-summary {
        width: 44px;
    }

    .iecc-filter-panel {
        left: 0;
        right: auto;
        width: calc(100vw - 36px);
        padding: 14px;
        gap: 12px;
    }

    .iecc-filter-panel > .filter-select,
    .iecc-filter-panel > select,
    .iecc-filter-panel > input:not([type="hidden"]),
    .iecc-filter-panel > .btn,
    .iecc-filter-panel > button,
    .iecc-filter-panel > a.btn {
        flex-basis: 100%;
        width: 100%;
    }

    .iecc-filter-inline-form > .search-box,
    .iecc-filter-inline-form > input[type="search"],
    .iecc-filter-inline-form > input[name="search"],
    .iecc-filter-inline-form > .iecc-filter-details,
    .iecc-search-submit {
        flex-basis: 100%;
        width: 100%;
    }
}

/* Table Styles */
table,
.table {
    width: 100%;
    border-collapse: collapse;
}

.table-container {
    overflow-x: auto;
}

.table thead {
    background: var(--gray-100);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(124, 58, 237, 0.02);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge.unassigned {
    background: #FEF3C7;
    color: #92400E;
}

.badge.assigned {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge.in-progress {
    background: #E0E7FF;
    color: #3730A3;
}

.badge.completed {
    background: #D1FAE5;
    color: #065F46;
}


/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Alert Styles */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
}

/* Form Group */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ══════════════════════════════════════════════
   LAYOUT: Left sidebar via CSS Grid.
   No wrapper div needed — each element is
   assigned to its grid cell by class name.
══════════════════════════════════════════════ */

html {
    height: 100%;
    scroll-behavior: smooth;
}

/* 2-column grid: sidebar | remaining content */
body {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
}

/* ── Sidebar: column 1, all rows ── */
.nav {
    grid-column: 1;
    grid-row: 1 / span 999;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ── Header: column 2, row 1 ── */
.header {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

/* ── Main content: column 2, row 2 ── */
.container {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 0;
}

/* Pages with own full-page layout (track, login) */
.track-page,
.login-page {
    grid-column: 1 / -1;
    /* span all columns */
    grid-row: 1 / -1;
    min-height: 100vh;
}

/* Cards — prevent overflow */
.card,
.stat-card,
.staff-card,
.task-card {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Tables always scroll horizontally */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Modals scroll internally if tall */
.modal {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay {
    align-items: flex-start;
    padding-top: 40px;
}

/* Grids wrap gracefully */
.staff-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.form-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.filter-form,
.search-filter {
    flex-wrap: wrap;
}

.mobile-bottom-nav,
.mobile-nav-backdrop,
.mobile-nav-sheet {
    display: none;
}

@media (max-width: 1200px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile: page content with bottom navigation */
@media (max-width: 1023px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    body.has-mobile-bottom-nav {
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    html.flow-ready body.has-mobile-bottom-nav,
    html.flow-leaving body.has-mobile-bottom-nav {
        animation: none;
        filter: none;
        opacity: 1;
        transform: none;
    }

    html.flow-ready body:has(.mobile-bottom-nav),
    html.flow-leaving body:has(.mobile-bottom-nav) {
        animation: none;
        filter: none;
        opacity: 1;
        transform: none;
    }

    .nav {
        display: none !important;
    }

    .mobile-bottom-nav {
        align-items: stretch;
        background: rgba(15, 23, 42, 0.97);
        border-top: 1px solid rgba(148, 163, 184, 0.28);
        bottom: 0;
        box-shadow: 0 -14px 32px rgba(15, 23, 42, 0.26);
        display: flex;
        gap: 4px;
        left: 0;
        max-width: 100vw;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        position: fixed;
        right: 0;
        scrollbar-width: none;
        z-index: 9000;
    }

    .mobile-bottom-nav::-webkit-scrollbar {
        display: none;
    }

    .mobile-bottom-nav-item {
        align-items: center;
        appearance: none;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 8px;
        color: rgba(226, 232, 240, 0.78);
        cursor: pointer;
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        font: inherit;
        gap: 3px;
        justify-content: center;
        min-height: 48px;
        min-width: 72px;
        max-width: 108px;
        padding: 6px 8px;
        text-align: center;
        text-decoration: none;
        white-space: normal;
    }

    .mobile-bottom-nav-item.active {
        background: rgba(99, 102, 241, 0.28);
        border-color: rgba(167, 139, 250, 0.42);
        color: #fff;
    }

    .mobile-nav-icon {
        align-items: center;
        display: inline-flex;
        flex-shrink: 0;
        font-size: 15px;
        font-weight: 800;
        height: 18px;
        justify-content: center;
        line-height: 1;
    }

    .mobile-nav-icon svg {
        fill: none;
        height: 18px;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.8;
        width: 18px;
    }

    .mobile-nav-label {
        display: block;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0;
        line-height: 1.12;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-nav-backdrop {
        background: rgba(15, 23, 42, 0.42);
        bottom: 0;
        display: block;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 8998;
    }

    .mobile-nav-backdrop[hidden] {
        display: none !important;
    }

    .mobile-nav-sheet {
        background: #fff;
        border-radius: 16px 16px 0 0;
        bottom: calc(68px + env(safe-area-inset-bottom));
        box-shadow: 0 -18px 38px rgba(15, 23, 42, 0.28);
        display: flex;
        flex-direction: column;
        left: 0;
        max-height: min(70vh, 560px);
        overflow: hidden;
        position: fixed;
        right: 0;
        z-index: 8999;
    }

    .mobile-nav-sheet[hidden] {
        display: none !important;
    }

    .mobile-nav-sheet-header {
        align-items: center;
        border-bottom: 1px solid var(--gray-200);
        display: flex;
        gap: 12px;
        justify-content: space-between;
        padding: 14px 16px;
    }

    .mobile-nav-sheet-header h2 {
        color: var(--gray-900);
        font-size: 16px;
        font-weight: 900;
        margin: 0;
    }

    .mobile-nav-close {
        align-items: center;
        appearance: none;
        background: var(--gray-100);
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        color: var(--gray-700);
        cursor: pointer;
        display: inline-flex;
        font-size: 24px;
        font-weight: 700;
        height: 38px;
        justify-content: center;
        line-height: 1;
        width: 38px;
    }

    .mobile-nav-sheet-body {
        overflow-y: auto;
        padding: 10px 12px 16px;
    }

    .mobile-nav-sheet-link,
    .mobile-nav-sheet-group-title {
        border-radius: 8px;
        display: flex;
        min-height: 44px;
        padding: 11px 12px;
        text-decoration: none;
    }

    .mobile-nav-sheet-link {
        align-items: center;
        border: 1px solid transparent;
        color: var(--gray-800);
        font-size: 14px;
        font-weight: 700;
    }

    .mobile-nav-sheet-link.active {
        background: var(--primary-light);
        border-color: rgba(99, 102, 241, 0.28);
        color: var(--primary);
    }

    .mobile-nav-sheet-nested {
        margin: 2px 0;
    }

    .mobile-nav-sheet-nested summary {
        cursor: pointer;
        list-style: none;
        position: relative;
    }

    .mobile-nav-sheet-nested summary::-webkit-details-marker {
        display: none;
    }

    .mobile-nav-sheet-nested summary::after {
        content: '▾';
        margin-left: auto;
        transition: transform 0.2s ease;
    }

    .mobile-nav-sheet-nested[open] summary::after {
        transform: rotate(180deg);
    }

    .mobile-nav-sheet-nested > a.mobile-nav-sheet-link {
        margin-left: 14px;
        min-height: 38px;
        padding: 9px 12px;
    }

    .mobile-nav-sheet-group-title {
        align-items: flex-end;
        color: var(--gray-500);
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.5px;
        margin-top: 8px;
        min-height: 34px;
        padding-bottom: 7px;
        text-transform: uppercase;
    }

    .header {
        grid-column: 1;
        grid-row: 1;
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 20px;
    }

    .container {
        grid-column: 1;
        grid-row: 2;
        max-width: none;
        overflow-x: hidden;
        padding: 12px;
        width: 100%;
    }

    .card {
        border-radius: 8px;
        margin-bottom: 16px;
        min-width: 0;
        overflow: visible;
        padding: 14px;
        width: 100%;
    }

    .card-title {
        font-size: 18px;
        line-height: 1.2;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-board {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 20px;
    }

    .dashboard-kpi-tile,
    .dashboard-kpi-wide {
        grid-column: auto;
    }

    .dashboard-kpi-tile {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        min-height: 78px;
        padding: 13px 14px;
    }

    .dashboard-kpi-value.emphasized {
        font-size: 26px;
    }

    .dashboard-kpi-badge {
        position: static;
    }

    .dashboard-kpi-progress {
        left: 62px;
        right: 14px;
        bottom: 10px;
    }

    .kpi-section-title {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .kpi-section-title b {
        width: 100%;
        justify-content: space-between;
    }

    .stat-card {
        min-height: 0;
        padding: 18px;
    }

    .stat-split {
        grid-template-columns: 1fr;
    }

    .staff-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
        width: 100%;
    }

    .form-grid,
    .settings-grid,
    .staff-grid,
    .stats-grid,
    .dashboard-kpi-grid,
    .master-data-layout {
        grid-template-columns: 1fr !important;
    }

    .receipt-section {
        min-width: 0;
        overflow: visible;
    }

    .receipt-section-title {
        align-items: flex-start;
        flex-wrap: wrap;
        font-size: 16px;
        line-height: 1.25;
    }

    .form-group,
    .form-row > *,
    .receipt-section .form-group,
    .receipt-section [style*="max-width"],
    .receipt-section [style*="width:220px"],
    .receipt-section [style*="width:260px"],
    .receipt-section [style*="width: 220px"],
    .receipt-section [style*="width: 260px"] {
        max-width: none !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .search-filter,
    .filter-form,
    .settings-input-group,
    .actions,
    .card-header,
    .header,
    .header-right {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .header {
        position: static;
    }

    .header-left,
    .header-right,
    .user-info {
        text-align: left;
        width: 100%;
    }

    .btn,
    .action-btn,
    .filter-select,
    .search-box,
    .search-box input {
        width: 100%;
    }

    .service-row,
    .parts-row,
    .technician-row,
    .tech-time-grid,
    .technician-time-row {
        grid-template-columns: 1fr !important;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .receipt-section [style*="display:flex"],
    .receipt-section [style*="display: flex"] {
        flex-wrap: wrap !important;
        max-width: 100% !important;
    }

    .receipt-section .form-group [style*="display:flex"],
    .receipt-section .form-group [style*="display: flex"] {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .table-responsive,
    .table-container {
        max-width: 100%;
    }

    .job-orders-table-container {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        overflow-y: visible;
        padding-bottom: 8px;
        width: 100%;
    }

    .job-orders-table-container .table {
        min-width: 1120px;
        width: 1120px;
    }

    .job-orders-table-container .btn,
    .job-orders-table-container .action-btn {
        width: auto;
    }

    .job-orders-table-container td,
    .job-orders-table-container th {
        white-space: normal;
    }

    .table-responsive {
        overflow-x: visible;
    }

    .table-responsive .data-table,
    .master-data-table {
        border-collapse: separate;
        border-spacing: 0 10px;
        display: block;
        width: 100%;
    }

    .table-responsive .data-table thead,
    .master-data-table thead {
        display: none;
    }

    .table-responsive .data-table tbody,
    .table-responsive .data-table tr,
    .table-responsive .data-table td,
    .master-data-table tbody,
    .master-data-table tr,
    .master-data-table td {
        display: block;
        width: 100%;
    }

    .table-responsive .data-table tr,
    .master-data-table tr {
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
        margin-bottom: 10px;
        overflow: hidden;
    }

    .table-responsive .data-table td,
    .master-data-table td {
        border-bottom: 1px solid var(--gray-100);
        padding: 10px 12px;
        word-break: break-word;
    }

    .table-responsive .data-table td:last-child,
    .master-data-table td:last-child {
        border-bottom: 0;
    }

    .iecc-table-wrap,
    .table-responsive.iecc-table-wrap,
    .table-container.iecc-table-wrap {
        -webkit-overflow-scrolling: touch !important;
        display: block !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        padding-bottom: 8px;
        width: 100% !important;
    }

    .iecc-table-wrap .iecc-table,
    .table-responsive.iecc-table-wrap .iecc-table,
    .table-container.iecc-table-wrap .iecc-table {
        border-collapse: collapse !important;
        display: table !important;
        width: max-content !important;
    }

    .iecc-table-wrap .iecc-table thead {
        display: table-header-group !important;
    }

    .iecc-table-wrap .iecc-table tbody {
        display: table-row-group !important;
    }

    .iecc-table-wrap .iecc-table tr {
        display: table-row !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .iecc-table-wrap .iecc-table th,
    .iecc-table-wrap .iecc-table td {
        display: table-cell !important;
        min-width: 120px;
        white-space: normal;
        width: auto !important;
    }

    .iecc-table-wrap .btn,
    .iecc-table-wrap .action-btn,
    .iecc-table-wrap .iecc-btn,
    .iecc-table-wrap button,
    .iecc-table-wrap input[type="date"] {
        width: auto !important;
    }

    .modal {
        max-width: calc(100vw - 32px);
        margin: 16px;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media print {
    .mobile-bottom-nav,
    .mobile-nav-sheet,
    .mobile-nav-backdrop {
        display: none !important;
    }
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 4px 4px;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--gray-600);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    transition: all 0.18s ease;
    cursor: pointer;
    white-space: nowrap;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pagination-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.pagination-btn.disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    font-size: 14px;
    color: var(--gray-400);
    user-select: none;
}

/* Interaction flow polish */
html {
    scroll-behavior: smooth;
}

body {
    opacity: 1;
    transition: opacity 0.16s ease, filter 0.16s ease;
}

html.flow-ready body {
    animation: page-enter 0.18s ease-out both;
}

html.flow-leaving body {
    filter: saturate(0.98);
    opacity: 0.82;
}

.container,
.card,
.table-container,
.modal,
.alert,
.task-card,
.staff-card,
.stat-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.table tbody tr {
    transition: background-color 0.16s ease, opacity 0.16s ease, transform 0.16s ease;
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.035);
}

button,
a,
input,
select,
textarea {
    transition-duration: 0.18s;
    transition-timing-function: ease;
}

button:disabled,
.btn:disabled,
.action-btn:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none !important;
}

.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    z-index: 10000 !important;
    overflow-y: auto !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 1;
    transition: opacity 0.18s ease;
}

.modal-overlay[style*="display: none"] {
    opacity: 0;
}

body.modal-open,
body.staff-modal-open,
body.workload-modal-open {
    overflow: hidden;
}

/* Master Data */
.master-data-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.master-data-sidebar {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.master-data-menu-item {
    appearance: none;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--gray-700);
    cursor: pointer;
    display: block;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    min-height: 40px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.master-data-menu-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-900);
}

.master-data-menu-item.active {
    background: var(--primary-light);
    border-color: rgba(124, 58, 237, 0.22);
    color: var(--primary);
}

.master-data-content {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
    overflow: hidden;
}

.master-data-toolbar {
    align-items: stretch;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
}

.master-data-toolbar h2 {
    color: var(--gray-900);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0;
}

.master-data-toolbar p {
    color: var(--gray-500);
    font-size: 13px;
    margin: 4px 0 0;
}

.master-data-toolbar-actions {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
    min-width: 0;
}

.master-data-primary-actions,
.master-data-bulk-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    max-width: 100%;
    min-width: 0;
    width: 100%;
}

.master-data-primary-actions {
    flex-wrap: wrap;
}

.master-data-primary-actions .search-box {
    flex: 1 1 280px;
    max-width: 520px;
    min-width: min(100%, 220px);
}

.master-data-primary-actions .iecc-btn,
.master-data-bulk-actions .iecc-btn {
    min-width: 132px;
    white-space: nowrap;
}

.master-data-bulk-actions {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    display: none;
    flex-wrap: wrap;
    padding: 10px;
}

.master-data-bulk-actions .iecc-btn {
    flex: 0 1 auto;
}

.master-data-bulk-actions .master-data-search {
    flex: 1 1 180px;
    max-width: 240px;
    min-width: 160px;
}

.master-data-search {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    min-height: 40px;
    padding: 9px 12px;
    width: 100%;
}

.master-data-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
    outline: none;
}

.master-data-table {
    border-collapse: collapse;
    width: 100%;
}

.master-data-table th,
.master-data-table td {
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

.master-data-table th {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.master-data-table td {
    color: var(--gray-700);
    font-size: 14px;
}

.master-data-table tr.is-selected td {
    background: rgba(124, 58, 237, 0.06);
}

.master-data-select-cell {
    text-align: center !important;
    width: 46px;
}

.master-data-select-cell input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
    height: 16px;
    margin: 0;
    width: 16px;
}

.master-data-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    min-width: 150px;
}

.master-data-empty {
    color: var(--gray-500);
    padding: 28px 16px !important;
    text-align: center !important;
}

.master-data-message {
    display: none;
    margin-bottom: 16px;
}

.master-data-message.success,
.master-data-message.error {
    border-radius: 8px;
    display: block;
    font-weight: 600;
    padding: 12px 14px;
}

.master-data-message.success {
    background: var(--success-light);
    color: var(--success);
}

.master-data-message.error {
    background: var(--danger-light);
    color: var(--danger);
}

.master-data-modal {
    max-width: 560px;
    width: calc(100vw - 32px);
}

.master-data-checklist {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    max-height: 190px;
    overflow: auto;
    padding: 12px;
}

.master-data-checklist legend {
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 700;
    padding: 0 6px;
}

.master-data-checklist label,
.master-data-checkbox {
    align-items: center;
    display: flex;
    gap: 8px;
}

.master-data-exclusive-checklist {
    grid-template-columns: 1fr;
}

.master-data-checklist label {
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    margin: 0;
}

.master-data-checklist input[type="checkbox"],
.master-data-checkbox input[type="checkbox"] {
    flex: 0 0 auto;
    height: 16px;
    margin: 0;
    padding: 0;
    width: 16px;
}

.master-data-checklist label span,
.master-data-checkbox span {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 900px) {
    .master-data-layout {
        grid-template-columns: 1fr;
    }

    .master-data-sidebar {
        display: grid;
        gap: 6px;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .master-data-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .master-data-toolbar-actions {
        min-width: 0;
        width: 100%;
    }

    .master-data-primary-actions,
    .master-data-bulk-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .master-data-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .master-data-primary-actions,
    .master-data-bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .master-data-primary-actions .search-box,
    .master-data-primary-actions .iecc-btn,
    .master-data-bulk-actions .master-data-search,
    .master-data-bulk-actions .iecc-btn {
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    .master-data-actions {
        justify-content: flex-start;
    }
}

.modal-overlay:not([style*="display: none"]) .modal {
    animation: modal-enter 0.18s ease-out both;
}

.task-card-focus,
.user-card-focus {
    outline: 3px solid rgba(124, 58, 237, 0.35);
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(124, 58, 237, 0.08), 0 18px 35px rgba(15, 23, 42, 0.12) !important;
}

.modal-close,
.action-btn,
.btn,
.pagination-btn {
    will-change: transform;
}

.search-box input,
.filter-select,
.form-group input,
.form-group select,
.form-group textarea {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.search-box:focus-within,
.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    outline: none;
}

.search-box input:focus {
    box-shadow: none;
    outline: none;
}

/* Unified IECC UI polish
   Keep legacy .btn pages and Tailwind-flavored .iecc-btn pages visually aligned. */
.btn,
.iecc-btn {
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    justify-content: center;
    letter-spacing: 0;
    line-height: 1.15;
    min-height: 40px;
    padding: 10px 16px;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
}

.btn:hover,
.iecc-btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible,
.iecc-btn:focus-visible {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.16);
    outline: none;
}

.btn-sm {
    font-size: 12px;
    min-height: 34px;
    padding: 8px 12px;
}

.btn-primary,
.iecc-btn-primary,
.iecc-search-submit,
.search-filter button[type="submit"].btn,
.filter-form button[type="submit"].btn,
.parts-list-filter button[type="submit"].btn,
.iecc-filter-panel button[type="submit"].btn {
    background: var(--primary);
    border-color: var(--primary-hover);
    color: #fff;
}

.btn-primary:hover,
.iecc-btn-primary:hover,
.iecc-search-submit:hover,
.search-filter button[type="submit"].btn:hover,
.filter-form button[type="submit"].btn:hover,
.parts-list-filter button[type="submit"].btn:hover,
.iecc-filter-panel button[type="submit"].btn:hover {
    background: var(--primary-hover);
    border-color: #4338CA;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.22);
    color: #fff;
}

.btn-outline,
.iecc-btn-secondary {
    background: #fff;
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover,
.iecc-btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-danger,
.iecc-btn-danger,
.btn-clear,
.iecc-btn-clear {
    background: var(--danger);
    border-color: #DC2626;
    color: #fff;
}

.btn-danger:hover,
.iecc-btn-danger:hover,
.btn-clear:hover,
.iecc-btn-clear:hover {
    background: #DC2626;
    border-color: #B91C1C;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.24);
    color: #fff;
}

.search-filter,
.filter-form,
.iecc-filter-inline-form,
.parts-list-filter {
    align-items: center;
    gap: 10px;
}

.search-box,
.filter-select,
.master-data-search,
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    border-color: var(--gray-300);
    border-radius: 8px;
    min-height: 40px;
}

.search-box .search-icon {
    background: var(--gray-50);
    color: var(--gray-600);
    flex-basis: 76px;
    font-size: 12px;
    letter-spacing: 0;
}

.search-box input {
    min-height: 40px;
}

.card,
.table-container,
.table-responsive,
.stat-card,
.staff-card,
.task-card {
    border-color: var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.card:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    transform: none;
}

.table th,
.master-data-table th {
    background: var(--gray-50);
    letter-spacing: 0;
}

.table td,
.master-data-table td {
    border-color: var(--gray-100);
}

@keyframes page-enter {
    from {
        opacity: 0.94;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* Back navigation is always the first, left-aligned control in its action row. */
.iecc-back-button {
    flex: 0 0 auto;
    margin-left: 0 !important;
    margin-right: auto !important;
    order: -1000 !important;
}
/* ──────────────────────────────────────────────────────────────────────────── */
