/* =============================================
   RoboAi Admin Dashboard - Styles v2
   Mobile-first, Multi-project
   ============================================= */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-hover: #1e1e1e;
    --bg-input: #1a1a1a;
    --border: #222;
    --border-hover: #333;
    --text-primary: #e8e8e8;
    --text-secondary: #888;
    --text-muted: #555;
    --accent: #FE2C55;
    --accent-hover: #e0284d;
    --accent-glow: rgba(254, 44, 85, 0.12);
    --tiktok-blue: #25F4EE;
    --success: #00C853;
    --warning: #FFB300;
    --danger: #FF1744;
    --info: #2979FF;
    --sidebar-width: 230px;
    --nav-height: 52px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   Login Page
   ============================================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at top, #1a0a15, #0a0a0a 60%);
    padding: 16px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.logo-icon { font-size: 44px; display: block; margin-bottom: 6px; }

.logo-text {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--tiktok-blue));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.admin-badge, .nav-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group label i { width: 16px; text-align: center; margin-right: 4px; color: var(--text-muted); }

.form-group input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder { color: var(--text-muted); }

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 44px; }

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s;
}

.toggle-password:hover { color: var(--text-primary); }

.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(254, 44, 85, 0.4);
}

.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.status-message {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.status-message.error {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid rgba(255, 23, 68, 0.25);
    color: #FF6B6B;
}

.status-message.success {
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.25);
    color: #69F0AE;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* =============================================
   Top Navigation
   ============================================= */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    padding: 0 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.menu-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-logo-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.nav-logo-link:hover { opacity: 0.75; }

.nav-logo { font-size: 22px; }

.nav-title {
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--tiktok-blue));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-name {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.admin-name i { color: var(--warning); margin-right: 3px; }

.btn-logout {
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* =============================================
   Sidebar
   ============================================= */
.main-content {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--nav-height);
    bottom: 0;
    z-index: 150;
    transition: transform 0.3s ease;
}

.sidebar-inner {
    height: 100%;
    overflow-y: auto;
    padding: 12px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 140;
    backdrop-filter: blur(2px);
}

.sidebar-section { margin-bottom: 4px; }

.section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 8px 12px 6px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 8px;
}

/* =============================================
   Project List (Sidebar)
   ============================================= */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    position: relative;
}

.project-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.project-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
}

.project-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}

.project-icon { font-size: 18px; flex-shrink: 0; }
.project-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.project-count {
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-hover);
    color: var(--text-muted);
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.project-item.active .project-count {
    background: rgba(254, 44, 85, 0.2);
    color: var(--accent);
}

/* =============================================
   Navigation Menu
   ============================================= */
.nav-menu { list-style: none; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
}

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

.nav-item i { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-item span { flex: 1; }

.badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.badge:empty, .badge[data-count="0"] { display: none; }

/* =============================================
   Page Content
   ============================================= */
.page-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header h2 i { margin-right: 6px; color: var(--text-muted); font-size: 16px; }

.active-project-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(254, 44, 85, 0.2);
}

.page { display: none; }
.page.active { display: block; }

/* =============================================
   Stats Grid
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
}

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

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-total .stat-icon { background: rgba(41, 121, 255, 0.12); color: var(--info); }
.stat-pending .stat-icon { background: rgba(255, 179, 0, 0.12); color: var(--warning); }
.stat-approved .stat-icon { background: rgba(0, 200, 83, 0.12); color: var(--success); }
.stat-admin .stat-icon { background: rgba(254, 44, 85, 0.12); color: var(--accent); }

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* =============================================
   Card
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.card-header h3 i { margin-right: 6px; color: var(--text-muted); }

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

.btn-refresh {
    padding: 6px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-refresh:hover { border-color: var(--tiktok-blue); color: var(--tiktok-blue); }

.btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-approve-all { background: var(--success); color: #fff; }
.btn-approve-all:hover { background: #00E676; box-shadow: 0 3px 10px rgba(0, 200, 83, 0.3); }

/* =============================================
   Search Box
   ============================================= */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.search-box input {
    padding: 7px 10px 7px 30px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    width: 160px;
    outline: none;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    width: 220px;
}

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

/* =============================================
   User List
   ============================================= */
.user-list { padding: 0; }

.loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.loading i { margin-right: 6px; }

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.4;
}

.empty-state p { font-size: 13px; }

/* User Row — card-style for mobile */
.user-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    gap: 12px;
}

.user-row:last-child { border-bottom: none; }
.user-row:hover { background: var(--bg-hover); }

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.user-avatar.admin { border-color: var(--warning); background: rgba(255, 179, 0, 0.08); }
.user-avatar.pending { border-color: var(--warning); background: rgba(255, 179, 0, 0.04); }
.user-avatar.approved { border-color: var(--success); background: rgba(0, 200, 83, 0.04); }

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.role-tag.admin { background: linear-gradient(135deg, #FFD700, #FFA000); color: #000; }
.role-tag.user { background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border); }

.user-project-tag {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.status-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-tag.approved { background: rgba(0, 200, 83, 0.12); color: var(--success); }
.status-tag.pending { background: rgba(255, 179, 0, 0.12); color: var(--warning); }

.user-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.user-date i { margin-right: 3px; font-size: 10px; }

.user-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-approve { background: var(--success); color: #fff; }
.btn-approve:hover { background: #00E676; }

.btn-reject { background: rgba(255, 23, 68, 0.12); color: var(--danger); }
.btn-reject:hover { background: var(--danger); color: #fff; }

.btn-promote { background: rgba(255, 179, 0, 0.12); color: var(--warning); }
.btn-promote:hover { background: var(--warning); color: #000; }

.btn-demote { background: var(--bg-hover); color: var(--text-muted); border: 1px solid var(--border); }
.btn-demote:hover { border-color: var(--text-muted); color: var(--text-primary); }

.btn-password { background: rgba(33, 150, 243, 0.12); color: #2196F3; }
.btn-password:hover { background: #2196F3; color: #fff; }

/* =============================================
   Modal
   ============================================= */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 16px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-icon { font-size: 36px; margin-bottom: 10px; }

.modal-content h3 { font-size: 16px; margin-bottom: 8px; }

.modal-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-actions { display: flex; gap: 10px; justify-content: center; }

.btn-cancel {
    padding: 9px 20px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-cancel:hover { border-color: var(--text-muted); color: var(--text-primary); }

.btn-confirm {
    padding: 9px 20px;
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-confirm:hover { background: var(--accent-hover); }
.btn-confirm.confirm-approve { background: var(--success); }
.btn-confirm.confirm-approve:hover { background: #00E676; }
.btn-confirm.confirm-danger { background: var(--danger); }
.btn-confirm.confirm-danger:hover { background: #FF5252; }

/* =============================================
   Password Modal
   ============================================= */
.password-modal-content {
    max-width: 400px;
    text-align: left;
}

.password-modal-content > .modal-icon,
.password-modal-content > h3,
.password-modal-content > p {
    text-align: center;
}

.password-form {
    margin-bottom: 16px;
}

.form-group-modal {
    margin-bottom: 12px;
}

.form-group-modal label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group-modal label i {
    margin-right: 4px;
}

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

.password-input-wrap input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.password-input-wrap input:focus {
    border-color: var(--accent);
}

.toggle-pw-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

.toggle-pw-btn:hover {
    color: var(--text-primary);
}

.pw-error {
    background: rgba(255, 23, 68, 0.1);
    color: var(--danger);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 8px;
    border: 1px solid rgba(255, 23, 68, 0.2);
}

/* =============================================
   Toast
   ============================================= */
.toast-container {
    position: fixed;
    top: 60px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
    width: calc(100% - 32px);
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease;
    cursor: pointer;
    word-break: break-word;
}

.toast.success { background: #0a2e15; border: 1px solid rgba(0, 200, 83, 0.25); color: #69F0AE; }
.toast.error { background: #2e0a0a; border: 1px solid rgba(255, 23, 68, 0.25); color: #FF6B6B; }
.toast.info { background: #0a152e; border: 1px solid rgba(41, 121, 255, 0.25); color: #82B1FF; }
.toast.warning { background: #2e250a; border: 1px solid rgba(255, 179, 0, 0.25); color: #FFE082; }

@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* =============================================
   Hide on Mobile
   ============================================= */
.hide-mobile { display: inline; }

/* =============================================
   Responsive — Tablet
   ============================================= */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   Responsive — Mobile
   ============================================= */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }

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

    .page-content {
        margin-left: 0;
        padding: 16px;
    }

    .page-header { margin-bottom: 14px; }
    .page-header h2 { font-size: 16px; }

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

    .stat-card { padding: 12px; gap: 10px; }
    .stat-icon { width: 36px; height: 36px; font-size: 15px; }
    .stat-number { font-size: 20px; }
    .stat-label { font-size: 10px; }

    .hide-mobile { display: none; }

    .admin-name span { display: none; }

    .nav-title { font-size: 15px; }
    .nav-badge { font-size: 8px; padding: 2px 6px; }

    /* User row — stack on mobile */
    .user-row {
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
    }

    .user-meta {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }

    .user-actions {
        order: 4;
        width: 100%;
        margin-top: 4px;
    }

    .user-actions .btn-sm {
        flex: 1;
        justify-content: center;
    }

    .card-header {
        padding: 12px;
        gap: 6px;
    }

    .card-header h3 { font-size: 13px; }

    .search-box input { width: 120px; font-size: 12px; }
    .search-box input:focus { width: 160px; }

    .toast-container { right: 8px; max-width: 300px; width: calc(100% - 16px); }
}

@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .stat-card { padding: 10px; }
    .stat-number { font-size: 18px; }
    .stat-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
    
    .top-nav { padding: 0 10px; }
    .nav-logo { font-size: 18px; }

    .btn-sm { padding: 6px 8px; font-size: 10px; }
    .btn-sm span { display: none; }
}
