/* ══════════════════════════════════════════════════════════════════════════
   BOOKSDRIVE ADMIN PANEL — COMPLETE ULTRA MODERN & RESPONSIVE STYLES
   ══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Brand & Accent Colors */
    --primary: #8B5CF6;
    --primary-light: #A78BFA;
    --primary-dark: #6D28D9;
    --primary-glow: rgba(139, 92, 246, 0.35);
    
    --secondary: #EC4899;
    --secondary-light: #F472B6;
    
    --accent-gradient: linear-gradient(135deg, #8B5CF6 0%, #D946EF 50%, #EC4899 100%);
    --accent-gradient-hover: linear-gradient(135deg, #7C3AED 0%, #C026D3 50%, #DB2777 100%);
    --card-gradient: linear-gradient(145deg, rgba(26, 20, 56, 0.75) 0%, rgba(15, 11, 34, 0.85) 100%);
    
    --emerald: #10B981;
    --emerald-bg: rgba(16, 185, 129, 0.15);
    --amber: #F59E0B;
    --amber-bg: rgba(245, 158, 11, 0.15);
    --sky: #0EA5E9;
    --sky-bg: rgba(14, 165, 233, 0.15);
    --rose: #F43F5E;
    --rose-bg: rgba(244, 63, 94, 0.15);

    /* Backgrounds & Canvas */
    --bg-app: #080614;
    --bg-card: rgba(19, 15, 40, 0.88);
    --bg-card-hover: rgba(28, 22, 58, 0.95);
    --bg-surface: #140F2D;
    --bg-input: #100C24;
    --bg-modal: #110D28;

    /* Borders & Glass */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.28);
    --border-card: rgba(139, 92, 246, 0.16);

    /* Typography */
    --text-main: #FFFFFF;
    --text-muted: #A3A0C2;
    --text-dim: #6E6A94;

    /* Layout Dimensions */
    --sidebar-width: 260px;
    --topbar-height: 68px;
    --mobile-nav-height: 64px;
    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 9999px;

    /* Shadows & Elevation */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px rgba(139, 92, 246, 0.25);
}

html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 50, 240, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 60%, rgba(236, 72, 153, 0.08), transparent);
    background-attachment: fixed;
}

a { cursor: pointer; text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; outline: none; border: none; }
input, select, textarea { font-family: inherit; outline: none; }
.hidden { display: none !important; }

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(10, 8, 24, 0.5); }
::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.6); }

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 20%, rgba(139, 92, 246, 0.25) 0%, var(--bg-app) 70%);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-xl);
    padding: 44px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
}

.login-brand-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px auto;
    background: var(--accent-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.login-brand-icon svg { width: 30px; height: 30px; fill: #ffffff; }

.login-title {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFFFFF 40%, #C4B5FD 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
    font-size: 13.5px;
}

/* ══════════════════════════════════════════════════════════════════════════
   APP LAYOUT & SIDEBAR
   ══════════════════════════════════════════════════════════════════════════ */
.app {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 3, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    width: var(--sidebar-width);
    background: rgba(14, 11, 30, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.sidebar-brand-icon svg { width: 20px; height: 20px; fill: #fff; }

.sidebar-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-close {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
}

.sidebar-nav {
    flex: 1;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 14px 4px 14px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13.5px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item:hover svg { transform: translateX(2px); }

.nav-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(217, 70, 239, 0.15) 100%);
    color: #FFFFFF;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

.nav-item.active svg {
    color: var(--primary-light);
    stroke: var(--primary-light);
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(10, 7, 22, 0.6);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.35);
}

.admin-details { min-width: 0; flex: 1; }
.admin-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-role { font-size: 11px; color: var(--primary-light); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT & TOPBAR
   ══════════════════════════════════════════════════════════════════════════ */
.main-content {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 30px;
    overflow-x: hidden;
}

.topbar {
    height: var(--topbar-height);
    background: rgba(12, 9, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.menu-btn:hover { background: rgba(255, 255, 255, 0.12); }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-badge-live {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10B981;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.live-dot {
    width: 7px;
    height: 7px;
    background: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10B981;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* ══════════════════════════════════════════════════════════════════════════
   SECTIONS & PAGE HEADERS
   ══════════════════════════════════════════════════════════════════════════ */
.section {
    padding: 28px;
    display: none;
    animation: fadeIn 0.25s ease-out;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 3px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════
   STATS GRID (DASHBOARD)
   ══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
    box-sizing: border-box;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--primary));
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stat-bg, rgba(139, 92, 246, 0.15));
    color: var(--stat-accent, var(--primary-light));
}

.stat-icon-box svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.stat-trend {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #FFFFFF;
    line-height: 1.2;
}

.stat-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════════
   CARDS & CONTAINERS
   ══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 700;
    font-size: 15px;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.recent-list {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.recent-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-glow);
    transform: translateX(3px);
}

.recent-cover {
    width: 38px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    background: #1F1B3B;
    flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }
.recent-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.recent-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════════════════
   DATA TABLES (DESKTOP) & TOOLBARS
   ══════════════════════════════════════════════════════════════════════════ */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    background: rgba(14, 11, 30, 0.4);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-input-wrap {
    position: relative;
    flex: 2 1 220px;
    min-width: 180px;
}

.search-input-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 38px !important;
}

.table-toolbar select {
    flex: 1 1 140px;
    min-width: 130px;
}

/* Horizontal Table Swipe Cue on Mobile */
.table-scroll-hint {
    display: none;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary-light);
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid var(--border-card);
    align-items: center;
    gap: 6px;
}

.table-scroll-hint svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    animation: swipeRight 1.5s infinite ease-in-out;
}

@keyframes swipeRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    position: relative;
}

.data-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background: rgba(14, 10, 28, 0.85);
    padding: 13px 18px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.table-cover {
    width: 40px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    background: #1C1738;
}

.table-title {
    font-weight: 600;
    color: #FFFFFF;
    max-width: 260px;
}

.table-secondary { color: var(--text-muted); }

.table-footer {
    padding: 14px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   BADGES & CHIPS
   ══════════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}

.badge-featured { background: rgba(244, 63, 94, 0.15); color: #FB7185; border: 1px solid rgba(244, 63, 94, 0.35); }
.badge-normal   { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }
.badge-admin    { background: rgba(139, 92, 246, 0.18); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, 0.35); }
.badge-user     { background: rgba(14, 165, 233, 0.15); color: #38BDF8; border: 1px solid rgba(14, 165, 233, 0.35); }
.badge-active   { background: rgba(16, 185, 129, 0.15); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-inactive { background: rgba(239, 68, 68, 0.15); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.35); }

.cat-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.15);
    color: #C4B5FD;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s ease;
    line-height: 1.2;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-glow);
    color: #FFFFFF;
}

.btn-danger {
    background: rgba(244, 63, 94, 0.18);
    color: #FB7185;
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.btn-danger:hover {
    background: #F43F5E;
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-sm svg { width: 14px; height: 14px; }

.btn-full { width: 100%; }

.action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit { background: rgba(14, 165, 233, 0.15); color: #38BDF8; border: 1px solid rgba(14, 165, 233, 0.3); }
.btn-edit:hover { background: #0EA5E9; color: #fff; }
.btn-delete { background: rgba(244, 63, 94, 0.15); color: #FB7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.btn-delete:hover { background: #F43F5E; color: #fff; }

/* ══════════════════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ══════════════════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-label .required { color: var(--rose); margin-left: 2px; }

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    font-size: 13.5px;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: #140E2C;
}

.form-input::placeholder { color: var(--text-dim); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-top: 5px;
}

/* ══════════════════════════════════════════════════════════════════════════
   MODALS & OVERLAYS
   ══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 3, 12, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal, .modal-card {
    background: var(--bg-modal);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(139, 92, 246, 0.2);
    transform: scale(0.96) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-sm { max-width: 480px; }
.modal-lg { max-width: 820px; }

.modal-overlay:not(.hidden) .modal,
.modal-overlay:not(.hidden) .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    background: var(--bg-modal);
    z-index: 10;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.2s;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.modal-body {
    padding: 24px;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(12, 9, 26, 0.6);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Live Cover Preview Container */
.cover-preview-box {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-card);
    border-radius: var(--radius-md);
    margin-top: 8px;
}

.cover-preview-img {
    width: 54px;
    height: 76px;
    border-radius: 6px;
    object-fit: cover;
    background: #1B1535;
    flex-shrink: 0;
}

.cover-preview-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   CATEGORIES GRID & ENHANCED ACTION BAR
   ══════════════════════════════════════════════════════════════════════════ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
    border-color: var(--border-glow);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(139, 92, 246, 0.2);
}

.category-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 11, 28, 0.75) 0%, rgba(14, 11, 28, 0.95) 100%);
    z-index: 1;
}

.category-card-content {
    padding: 20px 20px 14px 20px;
    position: relative;
    z-index: 2;
}

.category-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.22);
    border: 1px solid rgba(139, 92, 246, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.category-name {
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.category-count {
    font-size: 12.5px;
    color: #C4B5FD;
    font-weight: 500;
}

/* Solid Frosted Action Bar on Category Card Footer */
.category-actions-bar {
    position: relative;
    z-index: 2;
    background: #0E0A22;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-btn-order {
    background: #1E1938;
    color: #FFFFFF;
    border: 1px solid #3F3366;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    transition: background 0.15s;
}
.cat-btn-order:hover { background: var(--primary); }

.cat-btn-subcat {
    background: #4F46E5;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 11.5px;
    padding: 6px 12px;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
    transition: background 0.15s;
}
.cat-btn-subcat:hover { background: #4338CA; }

.cat-btn-edit {
    background: #0284C7;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 11.5px;
    padding: 6px 12px;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
    transition: background 0.15s;
}
.cat-btn-edit:hover { background: #0369A1; }

.cat-btn-delete {
    background: #E11D48;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 11.5px;
    padding: 6px 12px;
    border-radius: 7px;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.4);
    transition: background 0.15s;
}
.cat-btn-delete:hover { background: #BE123C; }

/* ══════════════════════════════════════════════════════════════════════════
   USER PROFILE MODAL & USER MANAGEMENT UI
   ══════════════════════════════════════════════════════════════════════════ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 34px;
    height: 34px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #FFFFFF;
    flex-shrink: 0;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    margin-bottom: 18px;
}

.user-avatar-xl {
    width: 58px;
    height: 58px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    color: #FFFFFF;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.user-profile-info { flex: 1; min-width: 0; }
.user-profile-name { font-size: 18px; font-weight: 800; color: #FFFFFF; }
.user-profile-email { font-size: 13.5px; color: #A78BFA; margin-top: 2px; }
.user-profile-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.user-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.user-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 18px;
    overflow-x: auto;
}

.user-tab {
    padding: 9px 16px;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.user-tab:hover { color: var(--text-main); }
.user-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
    border-radius: 6px 6px 0 0;
}

.user-tab-content { display: none; }
.user-tab-content.active { display: block; animation: fadeIn 0.2s ease-out; }

.user-stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.user-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.user-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: #FFFFFF;
}

.user-stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.user-activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.user-act-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.user-act-title { font-weight: 600; font-size: 13px; color: #FFFFFF; flex: 1; }
.user-act-time { font-size: 11.5px; color: var(--text-dim); }

.an-detail-summary {
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    color: #C4B5FD;
    font-size: 13px;
    margin-bottom: 14px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #2A244D;
    transition: 0.3s;
    border-radius: 22px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .toggle-slider { background-color: var(--primary); }
input:checked + .toggle-slider:before { transform: translateX(16px); }

.admin-label { font-size: 11.5px; font-weight: 600; margin-left: 8px; }
.admin-yes { color: #A78BFA; }
.admin-no { color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════════════════
   TAGS & MULTI-CATEGORY SELECTOR
   ══════════════════════════════════════════════════════════════════════════ */
.multi-cat-container, .keyword-tags-wrap {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    cursor: text;
    transition: border-color 0.2s;
}

.multi-cat-container:focus-within, .keyword-tags-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.multi-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--primary-light);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
}

.multi-cat-tag button, .keyword-tag button {
    background: none;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.multi-cat-tag button:hover, .keyword-tag button:hover { opacity: 1; }

.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34D399;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
}

.keyword-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 13px;
    min-width: 120px;
    flex: 1;
}

.multi-cat-dropdown {
    background: var(--bg-surface);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    max-height: 190px;
    overflow-y: auto;
    margin-top: 6px;
    box-shadow: var(--shadow-lg);
}

.multi-cat-option {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.multi-cat-option:hover { background: rgba(255, 255, 255, 0.05); }
.multi-cat-option.selected { color: var(--primary-light); font-weight: 600; background: rgba(139, 92, 246, 0.12); }

/* ══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1B1538;
    border: 1px solid var(--border-glow);
    color: #FFFFFF;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13.5px;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(139, 92, 246, 0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION BAR
   ══════════════════════════════════════════════════════════════════════════ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: rgba(13, 10, 28, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-card);
    z-index: 90;
    padding: 0 6px;
    align-items: center;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.mobile-nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.2s;
}

.mobile-nav-item.active {
    color: var(--primary-light);
}

.mobile-nav-item.active svg {
    stroke: var(--primary-light);
    transform: scale(1.15);
}

/* Floating Action Button (FAB) on Mobile */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: calc(var(--mobile-nav-height) + 16px);
    right: 18px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    z-index: 85;
    align-items: center;
    justify-content: center;
}

.mobile-fab svg { width: 24px; height: 24px; stroke: #fff; stroke-width: 2.5; fill: none; }

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS & BREAKPOINTS (< 1024px, < 768px, < 480px, < 360px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .dash-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .ratings-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    /* Layout & Sidebar */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close { display: flex; }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        padding-bottom: calc(var(--mobile-nav-height) + 26px + env(safe-area-inset-bottom, 0px)) !important;
        overflow-x: hidden !important;
    }

    /* Topbar */
    .topbar {
        padding: 0 14px;
        height: 60px;
    }
    .menu-btn { display: flex; }
    .topbar-badge-live { display: none; }
    .topbar-title {
        font-size: 17px;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mobile Navigation & FAB */
    .mobile-bottom-nav {
        display: flex;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    }
    .mobile-fab {
        display: flex;
        bottom: calc(var(--mobile-nav-height) + 16px + env(safe-area-inset-bottom, 0px));
    }

    /* Sections & Headers */
    .section {
        padding: 14px 10px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }
    .page-header h2 {
        font-size: 19px;
    }
    .page-subtitle {
        font-size: 12px;
    }
    .header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-actions .btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
        padding: 8px 12px;
        font-size: 12.5px;
        justify-content: center;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    .ratings-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .stat-card {
        padding: 12px 14px;
    }
    .stat-value {
        font-size: 20px;
    }
    .stat-label {
        font-size: 11px;
    }
    .stat-icon-box {
        width: 36px;
        height: 36px;
    }
    .stat-icon-box svg {
        width: 18px;
        height: 18px;
    }

    /* Cards & Containers */
    .card {
        border-radius: var(--radius-md);
        margin-bottom: 16px;
    }
    .card-header {
        padding: 14px 16px;
        font-size: 14px;
    }
    .dash-grid {
        gap: 14px;
        margin-bottom: 16px;
    }

    /* Forms & Toolbars */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .table-toolbar {
        padding: 12px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .search-input-wrap {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }
    .table-toolbar select,
    .table-toolbar .form-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }

    /* Table Scroll & Responsive Table */
    .table-scroll-hint {
        display: flex;
    }
    .table-wrapper {
        border-radius: 0;
        width: 100% !important;
        max-width: 100% !important;
    }
    .data-table {
        min-width: 600px;
    }
    .data-table th {
        padding: 10px 12px;
        font-size: 10.5px;
    }
    .data-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
    .table-title {
        max-width: 140px;
        min-width: 100px;
        white-space: normal;
        word-break: break-word;
    }
    .table-footer {
        padding: 10px 14px;
        font-size: 11px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Categories Grid */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .category-card-content {
        padding: 16px 14px 12px 14px;
    }
    .category-name {
        font-size: 16px;
    }
    .category-actions-bar {
        padding: 8px 10px;
        gap: 6px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .category-actions-bar > div {
        flex: 1 1 auto;
        display: flex;
        justify-content: flex-end;
        gap: 4px;
    }
    .category-actions-bar > div:first-child {
        justify-content: flex-start;
    }
    .cat-btn-order, .cat-btn-subcat, .cat-btn-edit, .cat-btn-delete {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* User Management & Details */
    .user-profile-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 14px;
    }
    .user-profile-meta {
        justify-content: center;
        gap: 8px;
        font-size: 11px;
    }
    .user-admin-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding-bottom: 12px;
        margin-bottom: 14px;
    }
    .user-admin-actions .btn {
        font-size: 11px;
        padding: 7px 8px;
        justify-content: center;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
    .user-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding-bottom: 4px;
        margin-bottom: 14px;
    }
    .user-tab {
        padding: 7px 12px;
        font-size: 12px;
    }
    .user-stat-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 14px;
    }
    .user-stat-card {
        padding: 8px;
    }
    .user-stat-val {
        font-size: 16px;
    }
    .user-act-item {
        padding: 8px 10px;
        gap: 8px;
        font-size: 12px;
    }
    .user-act-title {
        font-size: 12px;
        word-break: break-word;
    }

    /* Mobile Sheet Style Modal */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
        z-index: 999;
    }
    .modal, .modal-card {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        width: 100% !important;
        max-width: 100vw !important;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateY(100%);
    }
    .modal-overlay:not(.hidden) .modal,
    .modal-overlay:not(.hidden) .modal-card {
        transform: translateY(0);
    }
    .modal-header {
        padding: 16px 18px;
    }
    .modal-title {
        font-size: 16px;
    }
    .modal-body {
        padding: 16px 14px;
    }
    .modal-footer {
        padding: 12px 14px;
        display: flex;
        gap: 8px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .modal-footer .btn {
        flex: 1;
        justify-content: center;
    }

    /* Cover Preview */
    .cover-preview-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Action Buttons in Tables */
    .action-btns {
        gap: 4px;
    }
    .btn-icon {
        width: 28px;
        height: 28px;
    }
    .cat-btn-order {
        padding: 5px 7px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    .ratings-stats-grid {
        grid-template-columns: 1fr !important;
    }
    .stat-card {
        padding: 10px 12px;
    }
    .stat-value {
        font-size: 18px;
    }
    .header-actions .btn {
        flex: 1 1 100%;
    }
    .login-card {
        padding: 28px 18px;
        border-radius: var(--radius-lg);
    }
    .login-title {
        font-size: 22px;
    }
    .btn {
        font-size: 12.5px;
    }
    .user-admin-actions {
        grid-template-columns: 1fr;
    }
    .category-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .category-actions-bar > div {
        width: 100%;
        justify-content: space-between;
    }
    .category-actions-bar > div:first-child {
        justify-content: flex-start;
    }
    .cat-btn-subcat, .cat-btn-edit, .cat-btn-delete {
        flex: 1;
        text-align: center;
        padding: 6px 8px;
    }
}

@media (max-width: 360px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .topbar-title {
        font-size: 15px;
        max-width: 140px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   STREAKS & BADGES ADMIN CONSOLE
   ══════════════════════════════════════════════════════════════════════════ */
.badge-streak {
    background: rgba(255, 87, 34, 0.15);
    color: #FF7043;
    border: 1px solid rgba(255, 87, 34, 0.35);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.streak-mgr-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
}

.streak-mgr-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.badge-admin-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.badge-admin-card.unlocked {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
}

.badge-admin-card:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.badge-admin-icon {
    font-size: 22px;
    margin-right: 10px;
}

.badge-admin-info {
    flex: 1;
}

.badge-admin-name {
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
}

.badge-admin-sub {
    font-size: 10.5px;
    color: var(--text-hint);
}

.quick-adj-btn {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #FFF;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: 0.15s ease;
}

.quick-adj-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ══════════════════════════════════════════════════════════════════════════
   BULK BOOK IMPORTER & STARTER PACKS STYLING
   ══════════════════════════════════════════════════════════════════════════ */
.bulk-tab-btn {
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
}

.bulk-tab-btn.active {
    color: #818CF8;
    border-bottom-color: #6366F1;
}

.starter-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.starter-pack-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    position: relative;
}

.starter-pack-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pack-badge {
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
}

.pack-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.pack-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
    flex-grow: 1;
    margin-bottom: 12px;
}

.pack-meta {
    font-size: 11.5px;
    color: var(--text-dim);
    margin-bottom: 12px;
    font-weight: 600;
}

.bulk-dropzone {
    border: 2px dashed rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.03);
    border-radius: 14px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bulk-dropzone:hover {
    border-color: #6366F1;
    background: rgba(99, 102, 241, 0.08);
}

