:root {
    /* === Premium Red + Grey Palette === */
    --primary: #91292A;
    --primary-dark: #7a1f20;
    --text-dark: #0f172a;
    --text-light: #64748b;
    --background: #ffffff;
    
    /* Extended color palette */
    --navy-900: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --navy-600: #475569;
    --navy-500: #64748b;
    --navy-400: #94a3b8;
    --navy-300: #cbd5e1;
    --navy-200: #e2e8f0;
    --navy-100: #f1f5f9;
    --navy-50: #f8fafc;
    
    --gold-500: #64748b;
    --gold-400: #94a3b8;
    --gold-300: #cbd5e1;
    --gold-200: #e2e8f0;
    --gold-100: #f1f5f9;
    --gold-50: #f8fafc;
    
    --indigo-600: #7a1f20;
    --indigo-500: #91292A;
    --indigo-400: #b93a3b;
    --indigo-300: #d47576;
    --indigo-200: #e8b0b1;
    --indigo-100: #f5dcdc;
    --indigo-50: #fdf5f5;
    
    /* Enhanced shadows with depth */
    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 40px rgba(145, 41, 42, 0.15);
    --shadow-gold: 0 0 30px rgba(100, 116, 139, 0.2);
    
    /* Refined border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    
    /* Smooth transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    letter-spacing: -0.01em;
}

/* ===== Typography ===== */

.logo {
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--indigo-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo span {
    color: var(--gold-500);
    -webkit-text-fill-color: var(--gold-500);
    background: none;
}

.muted,
.subtitle {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 400;
}

/* ===== Card Component ===== */

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    background: linear-gradient(180deg, #ffffff 0%, var(--navy-50) 100%);
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: var(--navy-200);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm), inset 0 2px 4px rgba(15, 23, 42, 0.06);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(145, 41, 42, 0.25), var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--indigo-500) 0%, var(--indigo-600) 50%, var(--navy-800) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(122, 31, 32, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary::before {
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, var(--indigo-500) 50%, var(--indigo-600) 100%);
    box-shadow: 0 6px 20px rgba(122, 31, 32, 0.5), 0 0 30px rgba(145, 41, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(145, 41, 42, 0.35), 0 4px 14px rgba(122, 31, 32, 0.4);
}

.btn-ghost {
    background: transparent;
    border-color: var(--navy-200);
    box-shadow: none;
    color: var(--navy-600);
}

.btn-ghost:hover {
    background: var(--navy-50);
    border-color: var(--navy-300);
    color: var(--navy-800);
    box-shadow: var(--shadow-sm);
}

/* Gold accent button variant */
.btn-gold {
    background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%);
    color: var(--navy-900);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(100, 116, 139, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-weight: 700;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-300) 0%, var(--gold-400) 100%);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.45), var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ===== Form Inputs ===== */

.input,
.textarea,
select.input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--navy-200);
    background: linear-gradient(180deg, #ffffff 0%, var(--navy-50) 100%);
    outline: none;
    transition: all var(--transition-base);
    font-size: 14px;
    color: var(--text-dark);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.input:focus,
.textarea:focus,
select.input:focus {
    border-color: var(--indigo-400);
    box-shadow: 0 0 0 3px rgba(145, 41, 42, 0.12), inset 0 1px 2px rgba(15, 23, 42, 0.04);
    background: #ffffff;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--navy-400);
}

.mono {
    font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    letter-spacing: -0.02em;
}

/* ===== Icons ===== */

.ms-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.btn:hover .ms-icon {
    transform: translateX(1px);
}

/* ===== Layout ===== */

.app-body {
    display: flex;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy-50) 0%, #ffffff 50%, var(--indigo-50) 100%);
    position: relative;
}

.app-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(145, 41, 42, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(100, 116, 139, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.app-main {
    flex: 1;
    padding: 28px;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

/* ===== Sidebar ===== */

.sidebar {
    width: 280px;
    padding: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
    flex-shrink: 0;
    transition: transform var(--transition-slow);
    z-index: 10;
}

.sidebar-card {
    height: calc(100vh - 32px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-2xl);
    box-shadow: 
        var(--shadow-xl),
        0 0 0 1px rgba(145, 41, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.sidebar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--indigo-500) 0%, var(--gold-400) 50%, var(--indigo-500) 100%);
    opacity: 0.8;
}

.sidebar-header {
    padding: 16px;
    position: relative;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, var(--navy-50) 100%);
    border: 1px solid var(--navy-200);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-base);
}

.sidebar-toggle:hover {
    background: #ffffff;
    transform: scale(1.05) rotate(5deg);
    box-shadow: var(--shadow-xl);
}

/* User Chip */

.user-chip {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--navy-200);
    background: linear-gradient(180deg, #ffffff 0%, var(--navy-50) 100%);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.user-chip:hover {
    background: #ffffff;
    box-shadow: var(--shadow-md);
    border-color: var(--indigo-300);
    transform: translateY(-1px);
}

.user-chip:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(145, 41, 42, 0.15), var(--shadow-md);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--indigo-500) 0%, var(--indigo-600) 100%);
    flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(122, 31, 32, 0.3);
    position: relative;
    overflow: hidden;
}

.avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}

.avatar.sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.user-chip-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.user-chip-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-800);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip-email {
    font-size: 12px;
    color: var(--navy-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chev {
    color: var(--navy-400);
    font-size: 14px;
    flex: 0 0 auto;
    transition: all var(--transition-fast);
}

.user-chip:hover .chev {
    transform: translateX(3px);
    color: var(--indigo-500);
}

/* User Menu */

.user-menu {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(145, 41, 42, 0.05);
    overflow: hidden;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.sidebar-header:focus-within .user-menu {
    display: block;
    animation: menuFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes menuFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-12px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.user-menu-top {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--indigo-50) 0%, var(--gold-50) 100%);
}

.user-menu-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--navy-800);
}

.user-menu-email {
    font-size: 12px;
    color: var(--navy-500);
}

.user-menu-sep {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--navy-200) 50%, transparent 100%);
}

.user-menu-item {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--navy-700);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.user-menu-item:hover {
    background: linear-gradient(90deg, var(--indigo-50) 0%, transparent 100%);
    padding-left: 20px;
    color: var(--indigo-600);
}

.user-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--indigo-500);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.user-menu-item:hover::before {
    opacity: 1;
}

.user-menu-item.danger {
    color: #dc2626;
    font-weight: 600;
}

.user-menu-item.danger:hover {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.05) 0%, transparent 100%);
}

.user-menu-item.danger::before {
    background: #dc2626;
}

/* Sidebar Navigation */

.sidebar-section {
    padding: 12px 16px 16px 16px;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--navy-600);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-base);
    position: relative;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--navy-300);
    flex: 0 0 auto;
    transition: all var(--transition-base);
    position: relative;
}

.nav-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--indigo-400);
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-base);
}

.nav-item:hover {
    background: linear-gradient(90deg, var(--indigo-50) 0%, transparent 100%);
    color: var(--navy-800);
}

.nav-item:hover .nav-dot {
    background: var(--indigo-400);
    transform: scale(1.1);
}

.nav-item:hover .nav-dot::after {
    opacity: 0.5;
    transform: scale(1);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--indigo-100) 0%, rgba(145, 41, 42, 0.05) 100%);
    color: var(--indigo-600);
    font-weight: 600;
}

.nav-item.active .nav-dot {
    background: var(--indigo-500);
    width: 10px;
    height: 10px;
    box-shadow: 0 0 12px rgba(145, 41, 42, 0.5);
}

.nav-item.active .nav-dot::after {
    opacity: 1;
    transform: scale(1.5);
    border-color: var(--indigo-300);
}

/* Sidebar Footer */

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--navy-200);
    display: grid;
    gap: 8px;
    background: linear-gradient(180deg, transparent 0%, rgba(248, 250, 252, 0.5) 100%);
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--navy-600);
    background: linear-gradient(180deg, #ffffff 0%, var(--navy-50) 100%);
    border: 1px solid var(--navy-200);
    transition: all var(--transition-base);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.footer-btn:hover {
    background: #ffffff;
    border-color: var(--indigo-300);
    color: var(--indigo-600);
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

.footer-ico {
    width: 18px;
    display: inline-flex;
    justify-content: center;
    opacity: 0.6;
    transition: all var(--transition-fast);
}

.footer-btn:hover .footer-ico {
    opacity: 1;
    transform: scale(1.1);
    color: var(--gold-500);
}

/* ===== Page Layout ===== */

.page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--navy-200);
}

.page-title {
    font-size: clamp(28px, 4vw, 36px);
    line-height: 1.2;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--indigo-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    margin: 10px 0 0 0;
    color: var(--navy-500);
    font-size: 15px;
    font-weight: 400;
}

/* ===== Table Component ===== */

.table-card {
    padding: 24px;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    max-width: 400px;
}

.toolbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--navy-400);
    pointer-events: none;
}

.toolbar-search .search-input {
    width: 100%;
    padding-left: 42px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

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

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--navy-600);
}

.filter-select {
    min-width: 140px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--navy-200);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.6);
    -webkit-overflow-scrolling: touch;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    min-width: 600px;
}

.table thead th {
    text-align: left;
    font-size: 11px;
    color: var(--navy-500);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 16px;
    background: linear-gradient(180deg, var(--navy-50) 0%, var(--navy-100) 100%);
    border-bottom: 2px solid var(--indigo-200);
    white-space: nowrap;
    user-select: none;
}

.table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--navy-100);
    font-size: 14px;
    vertical-align: middle;
    transition: all var(--transition-fast);
    color: var(--navy-700);
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: linear-gradient(90deg, var(--indigo-50) 0%, transparent 50%);
}

.table tbody tr:hover td {
    color: var(--navy-800);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.td-empty {
    color: var(--navy-400);
    text-align: center;
    padding: 40px 16px !important;
    font-style: italic;
}

.td-strong {
    font-weight: 600;
    color: var(--navy-800);
}

.th-actions {
    text-align: right;
    width: auto;
    min-width: 160px;
}

.td-actions {
    text-align: right;
    white-space: nowrap;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.th-sort {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.th-sort:hover {
    color: var(--indigo-600);
    background: linear-gradient(180deg, var(--indigo-50) 0%, var(--indigo-100) 100%);
}

/* Table Footer / Pagination */

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--navy-200);
}

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

.pager-info {
    font-size: 13px;
    color: var(--navy-500);
    min-width: 80px;
    text-align: center;
    font-weight: 500;
}

/* ===== Status Badges ===== */

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status:hover {
    transform: scale(1.03) translateY(-1px);
    box-shadow: var(--shadow-md);
}

.status.audit {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.15) 100%);
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.25);
}

.status.audit::before {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status.off {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.1) 0%, rgba(148, 163, 184, 0.15) 100%);
    color: var(--navy-600);
    border-color: rgba(148, 163, 184, 0.3);
}

.status.off::before {
    background: var(--navy-400);
}

.status.warn {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.1) 0%, rgba(100, 116, 139, 0.15) 100%);
    color: #b45309;
    border-color: rgba(100, 116, 139, 0.3);
}

.status.warn::before {
    background: var(--gold-500);
    box-shadow: 0 0 8px rgba(100, 116, 139, 0.5);
}

.status.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.12) 100%);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.25);
}

.status.error::before {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ===== Modal ===== */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9000;
    padding: 20px;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
}

.modal[aria-hidden="false"] {
    display: flex;
    animation: modalBackdropFadeIn 0.25s ease;
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: auto;
    overflow: hidden;
    animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.96); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--navy-200);
    background: linear-gradient(180deg, #ffffff 0%, var(--navy-50) 100%);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--navy-800);
}

.modal-subtitle {
    margin-top: 6px;
    font-size: 14px;
    color: var(--navy-500);
    line-height: 1.5;
}

.icon-btn {
    border: 1px solid var(--navy-200);
    background: linear-gradient(180deg, #ffffff 0%, var(--navy-50) 100%);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
    color: var(--navy-500);
}

.icon-btn:hover {
    background: #ffffff;
    border-color: var(--indigo-300);
    color: var(--indigo-600);
    transform: rotate(90deg) scale(1.05);
    box-shadow: var(--shadow-md);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label {
    font-size: 13px;
    color: var(--navy-600);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-wrapper .input {
    width: 100%;
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--navy-400);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .input {
    width: 100%;
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--navy-400);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--navy-600);
}

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

.section-icon {
    color: var(--indigo-500);
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--navy-700);
}

/* ===== Toast Notifications ===== */

.toast {
    margin-top: 12px;
    font-size: 14px;
    color: var(--navy-500);
    line-height: 1.5;
}

.toast.ok {
    color: #15803d;
    font-weight: 600;
}

.toast.error {
    color: #dc2626;
    font-weight: 600;
}

.toast-float {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-900) 100%);
    color: #fff;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: 420px;
    font-size: 14px;
    font-weight: 500;
    animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

@keyframes toastSlideIn {
    from { 
        opacity: 0; 
        transform: translateX(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
    }
}

.toast-float.ok { 
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(34, 197, 94, 0.3);
}

.toast-float.error { 
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(239, 68, 68, 0.3);
}

.toast-float.info { 
    background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(145, 41, 42, 0.3);
}

/* ===== Responsive Breakpoints ===== */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .sidebar {
        width: 260px;
        padding: 12px;
    }
    
    .sidebar-card {
        height: calc(100vh - 24px);
        border-radius: var(--radius-xl);
    }
    
    .app-main {
        padding: 20px;
    }
    
    .table-card {
        padding: 20px;
    }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
    /* Sidebar becomes collapsible overlay */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 300px;
        z-index: 100;
        transform: translateX(-100%);
        padding: 16px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        z-index: 99;
        backdrop-filter: blur(4px);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .app-main {
        padding: 80px 16px 16px 16px;
    }
    
    /* Page header adjustments */
    .page-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .page-title {
        font-size: 26px;
    }
    
    /* Table adjustments */
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-right {
        min-width: auto;
        width: 100%;
    }
    
    .table-wrap {
        border-radius: var(--radius-md);
        margin: 0 -4px;
    }
    
    .table {
        min-width: 100%;
    }
    
    .table thead th,
    .table tbody td {
        padding: 14px;
        font-size: 13px;
    }
    
    .th-actions,
    .td-actions {
        min-width: 120px;
    }
    
    .td-actions .btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .table-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .pager {
        justify-content: center;
    }
    
    /* Modal adjustments */
    .modal {
        padding: 16px;
        align-items: center;
    }
    
    .modal-card {
        margin: 0;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
    
    .modal-head {
        padding: 20px 20px 14px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .grid2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    /* Toast adjustments */
    .toast-float {
        left: 16px;
        right: 16px;
        max-width: none;
        top: auto;
        bottom: 20px;
        animation: toastSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    @keyframes toastSlideUp {
        from { 
            opacity: 0; 
            transform: translateY(20px) scale(0.95); 
        }
        to { 
            opacity: 1; 
            transform: translateY(0) scale(1); 
        }
    }
    
    /* Status badges */
    .status {
        padding: 5px 12px;
        font-size: 11px;
    }
}

/* Small Mobile (up to 479px) */
@media (max-width: 479px) {
    .app-main {
        padding: 76px 12px 12px 12px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .table-card {
        padding: 16px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 12px;
        font-size: 12px;
    }
    
    .td-actions {
        gap: 6px;
    }
    
    .td-actions .btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .input,
    .textarea,
    select.input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Large screens (1200px+) */
@media (min-width: 1200px) {
    .sidebar {
        width: 300px;
    }
    
    .app-main {
        padding: 32px 40px;
    }
    
    .grid2 {
        gap: 24px;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .sidebar-toggle,
    .modal-backdrop,
    .toast-float {
        display: none !important;
    }
    
    .app-main {
        padding: 0;
        margin: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--navy-200);
    }
    
    .table-wrap {
        border: 1px solid var(--navy-200);
    }
    
    body {
        background: white;
    }
}
