/* public/css/admin.css */

/* ============================================
   ADMIN CSS VARIABLES
   ============================================ */
:root {
    --adm-primary: #1e3a5f;
    --adm-primary-light: #2c5282;
    --adm-secondary: #c9a84c;
    --adm-accent: #2563eb;
    --adm-success: #10b981;
    --adm-warning: #f59e0b;
    --adm-danger: #ef4444;
    --adm-info: #06b6d4;
    --adm-purple: #8b5cf6;

    --adm-sidebar-w: 268px;
    --adm-sidebar-collapsed: 72px;
    --adm-topbar-h: 64px;

    --adm-bg: #f0f4f8;
    --adm-surface: #ffffff;
    --adm-surface-2: #f8fafc;
    --adm-border: #e2e8f0;
    --adm-text: #1e293b;
    --adm-text-muted: #64748b;
    --adm-text-light: #94a3b8;

    --adm-sidebar-bg: #0f1923;
    --adm-sidebar-text: rgba(255,255,255,0.65);
    --adm-sidebar-active: rgba(201,168,76,0.12);
    --adm-sidebar-hover: rgba(255,255,255,0.05);

    --font-body: 'Inter', -apple-system, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

    --transition: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --adm-bg: #0d1117;
    --adm-surface: #161b22;
    --adm-surface-2: #1c2128;
    --adm-border: #30363d;
    --adm-text: #e6edf3;
    --adm-text-muted: #8b949e;
    --adm-text-light: #484f58;
    --adm-sidebar-bg: #010409;
}

/* ============================================
   BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.admin-body {
    font-family: var(--font-body);
    background: var(--adm-bg);
    color: var(--adm-text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--adm-secondary); color: #fff; }

/* ============================================
   SIDEBAR
   ============================================ */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--adm-sidebar-w);
    height: 100vh;
    background: var(--adm-sidebar-bg);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow), transform var(--transition-slow);
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.04);
}

.admin-sidebar.collapsed { width: var(--adm-sidebar-collapsed); }

/* Sidebar Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: var(--adm-topbar-h);
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--adm-secondary) 0%, #b8922e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(201,168,76,0.4);
}

.sidebar-brand-text { display: flex; flex-direction: column; overflow: hidden; }

.sidebar-brand-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    white-space: nowrap;
}

.sidebar-brand-sub {
    font-size: 10px;
    color: var(--adm-secondary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    padding: 16px 12px 6px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
}

.admin-sidebar.collapsed .nav-section-label { opacity: 0; }

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--adm-sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-nav-item:hover {
    background: var(--adm-sidebar-hover);
    color: rgba(255,255,255,0.9);
}

.sidebar-nav-item.active {
    background: var(--adm-sidebar-active);
    color: var(--adm-secondary);
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--adm-secondary);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-nav-text { flex: 1; transition: opacity var(--transition); }
.admin-sidebar.collapsed .sidebar-nav-text { opacity: 0; pointer-events: none; }

.sidebar-nav-badge {
    background: var(--adm-danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
    transition: opacity var(--transition);
}

.admin-sidebar.collapsed .sidebar-nav-badge { opacity: 0; }

.sidebar-nav-arrow {
    font-size: 11px;
    transition: transform 0.3s ease, opacity var(--transition);
    color: rgba(255,255,255,0.3);
}

.admin-sidebar.collapsed .sidebar-nav-arrow { opacity: 0; }

.sidebar-nav-item.has-sub.open .sidebar-nav-arrow { transform: rotate(90deg); }

.sidebar-sub-menu {
    display: none;
    padding: 4px 0 4px 32px;
}

.sidebar-sub-menu.open { display: block; }

.sidebar-sub-link {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
}

.sidebar-sub-link:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.04); }
.sidebar-sub-link.active { color: var(--adm-secondary); }

/* Sidebar User */
.sidebar-user {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: background var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,0.03); }

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(201,168,76,0.4);
    flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--adm-secondary);
    white-space: nowrap;
}

/* Sidebar Tooltip (collapsed state) */
.admin-sidebar.collapsed .sidebar-nav-item {
    position: relative;
}

/* ============================================
   TOPBAR
   ============================================ */
.admin-topbar {
    position: fixed;
    top: 0;
    left: var(--adm-sidebar-w);
    right: 0;
    height: var(--adm-topbar-h);
    background: var(--adm-surface);
    border-bottom: 1px solid var(--adm-border);
    z-index: 1040;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    transition: left var(--transition-slow);
    box-shadow: var(--shadow-sm);
}

.admin-sidebar.collapsed ~ .admin-main .admin-topbar,
.admin-topbar.sidebar-collapsed {
    left: var(--adm-sidebar-collapsed);
}

.topbar-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1.5px solid var(--adm-border);
    color: var(--adm-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    flex-shrink: 0;
}

.topbar-toggle:hover { background: var(--adm-bg); color: var(--adm-primary); }

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.topbar-breadcrumb-item {
    font-size: 13px;
    color: var(--adm-text-muted);
}

.topbar-breadcrumb-item a { color: var(--adm-text-muted); }
.topbar-breadcrumb-item a:hover { color: var(--adm-primary); }
.topbar-breadcrumb-item.active { color: var(--adm-text); font-weight: 600; }
.topbar-breadcrumb-sep { color: var(--adm-text-light); font-size: 10px; }

.topbar-search {
    position: relative;
    flex: 1;
    max-width: 340px;
}

.topbar-search-input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 1.5px solid var(--adm-border);
    border-radius: var(--radius-full);
    background: var(--adm-bg);
    color: var(--adm-text);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition);
}

.topbar-search-input:focus {
    border-color: var(--adm-secondary);
    background: var(--adm-surface);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--adm-text-muted);
    font-size: 14px;
}

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

.topbar-action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--adm-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 17px;
    position: relative;
}

.topbar-action-btn:hover { background: var(--adm-bg); color: var(--adm-primary); }

.topbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--adm-danger);
    border-radius: 50%;
    font-size: 9px;
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--adm-surface);
}

.topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--adm-border);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.topbar-user:hover { background: var(--adm-bg); }

.topbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--adm-secondary);
}

.topbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--adm-text);
}

.topbar-user-role {
    font-size: 11px;
    color: var(--adm-text-muted);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.admin-main {
    margin-left: var(--adm-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-slow);
}

.admin-main.collapsed { margin-left: var(--adm-sidebar-collapsed); }

.admin-content {
    flex: 1;
    padding: calc(var(--adm-topbar-h) + 28px) 28px 28px;
}

.admin-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--adm-border);
    font-size: 12px;
    color: var(--adm-text-muted);
    background: var(--adm-surface);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.page-header-left { flex: 1; }

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--adm-text);
    margin: 0 0 4px;
    font-family: var(--font-display);
}

.page-subtitle {
    font-size: 13px;
    color: var(--adm-text-muted);
    margin: 0;
}

.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   CARDS
   ============================================ */
.adm-card {
    background: var(--adm-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--adm-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.adm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--adm-border);
    gap: 12px;
    flex-wrap: wrap;
}

.adm-card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--adm-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adm-card-title i { color: var(--adm-secondary); }

.adm-card-body { padding: 22px; }

/* ============================================
   STAT CARDS
   ============================================ */
.stat-widget {
    background: var(--adm-surface);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--adm-border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    cursor: default;
}

.stat-widget:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--adm-primary));
}

.stat-widget-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-widget-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--stat-bg, rgba(30,58,95,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--stat-color, var(--adm-primary));
}

.stat-widget-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.stat-widget-badge.up { background: rgba(16,185,129,0.1); color: var(--adm-success); }
.stat-widget-badge.down { background: rgba(239,68,68,0.1); color: var(--adm-danger); }
.stat-widget-badge.neutral { background: rgba(100,116,139,0.1); color: var(--adm-text-muted); }

.stat-widget-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--adm-text);
    line-height: 1;
    font-family: var(--font-display);
    margin-bottom: 6px;
}

.stat-widget-label {
    font-size: 13px;
    color: var(--adm-text-muted);
    font-weight: 500;
}

.stat-widget-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--adm-border);
    font-size: 12px;
    color: var(--adm-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================
   TABLES
   ============================================ */
.adm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.adm-table thead th {
    background: var(--adm-surface-2);
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--adm-text-muted);
    border-bottom: 1px solid var(--adm-border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.adm-table thead th:hover { color: var(--adm-text); }

.adm-table tbody tr {
    border-bottom: 1px solid var(--adm-border);
    transition: background var(--transition);
}

.adm-table tbody tr:hover { background: var(--adm-surface-2); }
.adm-table tbody tr:last-child { border-bottom: none; }

.adm-table td {
    padding: 14px 16px;
    color: var(--adm-text);
    vertical-align: middle;
}

.adm-table .td-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ============================================
   BADGES
   ============================================ */
.adm-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

.adm-badge-success { background: rgba(16,185,129,0.1); color: var(--adm-success); }
.adm-badge-danger { background: rgba(239,68,68,0.1); color: var(--adm-danger); }
.adm-badge-warning { background: rgba(245,158,11,0.1); color: var(--adm-warning); }
.adm-badge-info { background: rgba(6,182,212,0.1); color: var(--adm-info); }
.adm-badge-primary { background: rgba(30,58,95,0.1); color: var(--adm-primary); }
.adm-badge-gold { background: rgba(201,168,76,0.1); color: var(--adm-secondary); }
.adm-badge-purple { background: rgba(139,92,246,0.1); color: var(--adm-purple); }
.adm-badge-muted { background: rgba(100,116,139,0.1); color: var(--adm-text-muted); }

/* ============================================
   BUTTONS
   ============================================ */
.adm-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.adm-btn:hover { transform: translateY(-1px); }
.adm-btn:active { transform: translateY(0); }

.adm-btn-primary { background: var(--adm-primary); color: white; }
.adm-btn-primary:hover { background: var(--adm-primary-light); box-shadow: 0 4px 12px rgba(30,58,95,0.3); }

.adm-btn-gold { background: linear-gradient(135deg, var(--adm-secondary) 0%, #b8922e 100%); color: white; }
.adm-btn-gold:hover { box-shadow: 0 4px 12px rgba(201,168,76,0.4); }

.adm-btn-success { background: var(--adm-success); color: white; }
.adm-btn-success:hover { box-shadow: 0 4px 12px rgba(16,185,129,0.3); }

.adm-btn-danger { background: var(--adm-danger); color: white; }
.adm-btn-danger:hover { box-shadow: 0 4px 12px rgba(239,68,68,0.3); }

.adm-btn-warning { background: var(--adm-warning); color: white; }
.adm-btn-info { background: var(--adm-info); color: white; }

.adm-btn-outline {
    background: transparent;
    border: 1.5px solid var(--adm-border);
    color: var(--adm-text);
}
.adm-btn-outline:hover { border-color: var(--adm-primary); color: var(--adm-primary); background: rgba(30,58,95,0.04); }

.adm-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.adm-btn-lg { padding: 12px 24px; font-size: 14px; }
.adm-btn-icon { padding: 8px; min-width: 34px; min-height: 34px; justify-content: center; }

/* Action Buttons in Table */
.action-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: var(--transition);
}

.action-btn-view { background: rgba(6,182,212,0.1); color: var(--adm-info); }
.action-btn-view:hover { background: var(--adm-info); color: white; }

.action-btn-edit { background: rgba(245,158,11,0.1); color: var(--adm-warning); }
.action-btn-edit:hover { background: var(--adm-warning); color: white; }

.action-btn-delete { background: rgba(239,68,68,0.1); color: var(--adm-danger); }
.action-btn-delete:hover { background: var(--adm-danger); color: white; }

.action-btn-approve { background: rgba(16,185,129,0.1); color: var(--adm-success); }
.action-btn-approve:hover { background: var(--adm-success); color: white; }

/* ============================================
   FORMS
   ============================================ */
.adm-form-group { margin-bottom: 20px; }

.adm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--adm-text);
    margin-bottom: 7px;
}

.adm-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--adm-border);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    color: var(--adm-text);
    background: var(--adm-surface);
    font-family: var(--font-body);
    transition: var(--transition);
    outline: none;
}

.adm-input:focus {
    border-color: var(--adm-secondary);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.1);
}

.adm-input::placeholder { color: var(--adm-text-light); }
.adm-input.is-invalid { border-color: var(--adm-danger); }

.adm-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

.adm-textarea { resize: vertical; min-height: 100px; }

.adm-form-error { font-size: 12px; color: var(--adm-danger); margin-top: 4px; }
.adm-form-hint { font-size: 12px; color: var(--adm-text-muted); margin-top: 4px; }

/* Image Upload */
.adm-img-upload {
    border: 2px dashed var(--adm-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--adm-surface-2);
    position: relative;
}

.adm-img-upload:hover { border-color: var(--adm-secondary); background: rgba(201,168,76,0.03); }
.adm-img-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.adm-img-upload-icon { font-size: 2rem; color: var(--adm-text-light); margin-bottom: 12px; }
.adm-img-upload-text { font-size: 14px; color: var(--adm-text-muted); }
.adm-img-upload-hint { font-size: 12px; color: var(--adm-text-light); margin-top: 6px; }
.adm-img-preview { max-height: 200px; border-radius: var(--radius-md); margin-top: 12px; }

/* Switch Toggle */
.adm-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.adm-switch input { opacity: 0; width: 0; height: 0; }

.adm-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--adm-border);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.adm-switch-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.adm-switch input:checked + .adm-switch-slider { background: var(--adm-success); }
.adm-switch input:checked + .adm-switch-slider:before { transform: translateX(20px); }

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    background: var(--adm-surface);
}

.modal-header {
    border-bottom: 1px solid var(--adm-border);
    padding: 20px 24px;
    background: var(--adm-surface-2);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--adm-text);
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title i { color: var(--adm-secondary); }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--adm-border); padding: 16px 24px; }

/* ============================================
   DROPDOWNS
   ============================================ */
.adm-dropdown-menu {
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    min-width: 180px;
}

.adm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--adm-text);
    cursor: pointer;
    transition: var(--transition);
}

.adm-dropdown-item:hover { background: var(--adm-bg); }
.adm-dropdown-item i { color: var(--adm-text-muted); font-size: 14px; width: 16px; }
.adm-dropdown-item.danger { color: var(--adm-danger); }
.adm-dropdown-item.danger i { color: var(--adm-danger); }
.adm-dropdown-divider { height: 1px; background: var(--adm-border); margin: 4px 0; }

/* ============================================
   TABS
   ============================================ */
.adm-tabs {
    display: flex;
    gap: 4px;
    background: var(--adm-surface-2);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--adm-border);
}

.adm-tab {
    flex: 1;
    padding: 9px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--adm-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-family: var(--font-body);
}

.adm-tab.active {
    background: var(--adm-surface);
    color: var(--adm-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.adm-tab:hover:not(.active) { color: var(--adm-text); }

/* ============================================
   ALERTS
   ============================================ */
.adm-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    border: 1px solid transparent;
}

.adm-alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.adm-alert-success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); color: #047857; }
.adm-alert-danger { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: #b91c1c; }
.adm-alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); color: #92400e; }
.adm-alert-info { background: rgba(6,182,212,0.08); border-color: rgba(6,182,212,0.2); color: #0e7490; }

/* ============================================
   AVATAR
   ============================================ */
.adm-avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--adm-border);
    flex-shrink: 0;
}

.adm-avatar-sm { width: 32px; height: 32px; }
.adm-avatar-md { width: 44px; height: 44px; }
.adm-avatar-lg { width: 64px; height: 64px; }
.adm-avatar-xl { width: 100px; height: 100px; border-width: 3px; }

.adm-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--adm-primary) 0%, var(--adm-primary-light) 100%);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    border: 2px solid var(--adm-border);
    flex-shrink: 0;
}

/* ============================================
   PAGINATION
   ============================================ */
.adm-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 20px;
}

.adm-pagination .page-link {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--adm-border);
    background: var(--adm-surface);
    color: var(--adm-text-muted);
    font-size: 13px;
    transition: var(--transition);
}

.adm-pagination .page-item.active .page-link {
    background: var(--adm-primary);
    border-color: var(--adm-primary);
    color: white;
}

.adm-pagination .page-link:hover:not(.active) {
    background: var(--adm-bg);
    color: var(--adm-primary);
    border-color: var(--adm-primary);
}

/* ============================================
   SIDEBAR OVERLAY
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1049;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.show { display: block; }

/* ============================================
   CHART CONTAINERS
   ============================================ */
.chart-container { position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--adm-text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ============================================
   TIMELINE
   ============================================ */
.adm-timeline { position: relative; padding-left: 28px; }
.adm-timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--adm-border); }
.adm-timeline-item { position: relative; padding-bottom: 24px; }
.adm-timeline-item:last-child { padding-bottom: 0; }
.adm-timeline-dot { position: absolute; left: -24px; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--adm-surface); flex-shrink: 0; }
.adm-timeline-content { background: var(--adm-surface-2); border-radius: var(--radius-md); padding: 14px 16px; border: 1px solid var(--adm-border); }
.adm-timeline-title { font-size: 13px; font-weight: 600; color: var(--adm-text); margin-bottom: 4px; }
.adm-timeline-time { font-size: 11.5px; color: var(--adm-text-muted); }

/* ============================================
   PROGRESS
   ============================================ */
.adm-progress { height: 6px; background: var(--adm-border); border-radius: var(--radius-full); overflow: hidden; }
.adm-progress-bar { height: 100%; border-radius: var(--radius-full); transition: width 1s ease; }

/* ============================================
   MEDIA LIBRARY
   ============================================ */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { border-radius: var(--radius-md); overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: var(--transition); position: relative; aspect-ratio: 1; background: var(--adm-surface-2); }
.media-item:hover { border-color: var(--adm-secondary); }
.media-item.selected { border-color: var(--adm-accent); }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item-info { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.7); padding: 6px 8px; font-size: 11px; color: white; opacity: 0; transition: var(--transition); }
.media-item:hover .media-item-info { opacity: 1; }
.media-item-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--adm-accent); color: white; display: none; align-items: center; justify-content: center; font-size: 11px; }
.media-item.selected .media-item-check { display: flex; }

/* ============================================
   KANBAN (Applications)
   ============================================ */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-column { min-width: 280px; background: var(--adm-surface-2); border-radius: var(--radius-lg); border: 1px solid var(--adm-border); }
.kanban-column-header { padding: 16px; border-bottom: 1px solid var(--adm-border); display: flex; align-items: center; justify-content: space-between; }
.kanban-column-title { font-size: 13px; font-weight: 700; color: var(--adm-text); }
.kanban-column-count { background: var(--adm-border); padding: 2px 8px; border-radius: var(--radius-full); font-size: 12px; color: var(--adm-text-muted); }
.kanban-cards { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.kanban-card { background: var(--adm-surface); border-radius: var(--radius-md); padding: 14px; border: 1px solid var(--adm-border); cursor: pointer; transition: var(--transition); }
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] .adm-table thead th { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .modal-header { background: var(--adm-surface-2); }
[data-theme="dark"] .adm-img-upload { background: var(--adm-surface-2); }
[data-theme="dark"] .topbar-search-input { background: var(--adm-surface-2); color: var(--adm-text); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); width: var(--adm-sidebar-w) !important; }
    .admin-sidebar.mobile-open { transform: translateX(0); }
    .admin-main { margin-left: 0 !important; }
    .admin-topbar { left: 0 !important; }
    .sidebar-overlay.show { display: block; }
    .admin-content { padding: calc(var(--adm-topbar-h) + 20px) 16px 20px; }
}

@media (max-width: 576px) {
    .topbar-search { display: none; }
    .page-header { flex-direction: column; }
    .adm-card-header { flex-direction: column; align-items: flex-start; }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
