/* ==========================================================================
   PORTAL LEMBAR KERJA - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & THEMES
   -------------------------------------------------------------------------- */
:root {
    /* Fonts */
    --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Common System Colors */
    --color-success: #10b981;
    --color-success-rgb: 16, 185, 129;
    --color-warning: #f59e0b;
    --color-warning-rgb: 245, 158, 11;
    --color-danger: #ef4444;
    --color-primary: #f5a623;
    --color-primary-rgb: 245, 166, 35;
    --color-primary-hover: #e09214;
    
    /* Theme Colors (Light Theme default) */
    --bg-app: #f4f7fa;
    --bg-gradient: linear-gradient(135deg, #f4f7fa 0%, #e9eff5 100%);
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-sidebar: rgba(255, 255, 255, 0.8);
    --bg-modal: #ffffff;
    --bg-input: #f9fafb;
    
    --border-color: rgba(0, 0, 0, 0.06);
    --border-color-hover: rgba(245, 166, 35, 0.4);
    --border-input: rgba(0, 0, 0, 0.1);
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    
    --glass-opacity: 0.45;
    --glass-blur: 10px;
    --glow-opacity: 0.05;
    
    /* Animation Speeds */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Box Shadows */
    --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 16px -6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px 0 rgba(var(--color-primary-rgb), 0.15);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE STYLES
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg-app);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Decorative background glowing blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
    opacity: var(--glow-opacity);
    transition: opacity var(--transition-normal);
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.5) 0%, transparent 70%);
}

.blob-3 {
    top: 40%;
    left: 45%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
}

/* --------------------------------------------------------------------------
   3. APP LAYOUT
   -------------------------------------------------------------------------- */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   4. SIDEBAR COMPONENT
   -------------------------------------------------------------------------- */
.sidebar-header {
    display: none; /* Sembunyikan sidebar secara default untuk publik */
    width: 300px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 2.5rem 1.5rem 1.5rem 1.5rem;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    transition: background-color var(--transition-normal), border var(--transition-normal);
}

/* Tampilkan sidebar saat mode Admin aktif */
body.is-admin .sidebar-header {
    display: flex;
}

/* Sembunyikan sidebar/side menu saat login modal admin aktif */
body.admin-login-open .sidebar-header {
    display: none !important;
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 0.5rem 0;
}

.brand-logo {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(245, 166, 35, 0.15));
    transition: filter var(--transition-normal);
}

[data-theme="light"] .brand-logo {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.page-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Stats panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

[data-theme="light"] .stats-panel {
    background: rgba(0, 0, 0, 0.03);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }

/* Categories Nav */
.categories-nav {
    flex-grow: 1;
    margin-bottom: 2rem;
}

.categories-nav h3 {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.categories-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.categories-nav li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.categories-nav li i {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.categories-nav li:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .categories-nav li:hover {
    background: rgba(0, 0, 0, 0.03);
}

.categories-nav li.active {
    color: white;
    background: var(--color-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

[data-theme="light"] .categories-nav li.active {
    color: white;
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

/* Theme Toggle Button */
.btn-theme {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

[data-theme="light"] .btn-theme {
    background: rgba(0, 0, 0, 0.05);
}

.btn-theme:hover {
    border-color: var(--border-color-hover);
    transform: scale(1.05);
}

.btn-theme i {
    width: 18px;
    height: 18px;
    position: absolute;
    transition: transform var(--transition-normal) ease, opacity var(--transition-fast);
}

[data-theme="dark"] .sun-icon {
    transform: translateY(30px);
    opacity: 0;
}

[data-theme="dark"] .moon-icon {
    transform: translateY(0);
    opacity: 1;
}

[data-theme="light"] .sun-icon {
    transform: translateY(0);
    opacity: 1;
}

[data-theme="light"] .moon-icon {
    transform: translateY(-30px);
    opacity: 0;
}

/* --------------------------------------------------------------------------
   5. MAIN CONTENT COMPONENT
   -------------------------------------------------------------------------- */
.main-content {
    margin-left: 0; /* Lebar penuh secara default untuk publik */
    flex-grow: 1;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    transition: margin var(--transition-normal), max-width var(--transition-normal);
}

/* Penyesuaian main content saat mode Admin aktif */
body.is-admin .main-content {
    margin: 0 0 0 300px;
    max-width: none;
    padding: 2.5rem;
}

/* Navigasi atas khusus tampilan publik (ketika sidebar tersembunyi) */
.public-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.public-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.1));
}

.btn-admin-login-public {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    font-size: 0.85rem;
    border-radius: 10px;
    padding: 0 1rem;
}

/* Sembunyikan topbar publik saat masuk mode admin */
body.is-admin .public-navbar {
    display: none !important;
}

/* Kontainer Kategori Horizontal (Pills) */
.horizontal-filter-container {
    display: block;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sembunyikan filter horizontal saat masuk mode admin */
body.is-admin .horizontal-filter-container {
    display: none !important;
}

.horizontal-categories {
    display: flex;
    gap: 0.65rem;
    list-style: none;
    padding-bottom: 0.5rem;
}

.horizontal-categories li {
    padding: 0.6rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.horizontal-categories li:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
}

.horizontal-categories li.active {
    background: var(--color-primary);
    color: var(--text-inverse);
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.25);
}

/* Top search & sorting bar */
.top-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.search-box {
    position: relative;
    flex-grow: 1;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0 3rem 0 3.25rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.clear-btn {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.sort-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 14px;
    padding: 0 1rem;
    height: 52px;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: border var(--transition-fast);
}

.sort-box label {
    margin-right: 0.5rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.sort-box label i {
    width: 18px;
    height: 18px;
}

.sort-box select {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    height: 100%;
}

.sort-box select:focus {
    outline: none;
}

/* --------------------------------------------------------------------------
   6. GRID & CARDS
   -------------------------------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Worksheet Card */
.worksheet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    display: flex;
    flex-direction: column;
    min-height: 270px;
    height: auto;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

/* Color thematic glow on top-right */
.worksheet-card::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--accent-theme, var(--color-primary));
    filter: blur(40px);
    opacity: 0.08;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.worksheet-card:hover {
    border-color: var(--border-color-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), 0 0 25px -5px rgba(var(--accent-theme-rgb, var(--color-primary-rgb)), 0.15);
}

.worksheet-card:hover::after {
    opacity: 0.15;
}

/* Card Header: Icon, Tags, Status */
.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(var(--accent-theme-rgb, var(--color-primary-rgb)), 0.1);
    color: var(--accent-theme, var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--accent-theme-rgb, var(--color-primary-rgb)), 0.15);
    transition: all var(--transition-normal);
}

.worksheet-card:hover .card-icon-wrapper {
    background: var(--accent-theme, var(--color-primary));
    color: white;
    box-shadow: 0 4px 12px rgba(var(--accent-theme-rgb, var(--color-primary-rgb)), 0.3);
}

.card-icon-wrapper i {
    width: 22px;
    height: 22px;
}

/* Badge list */
.card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.badge-category {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .badge-category {
    background: rgba(0, 0, 0, 0.04);
}

.badge-active {
    background: rgba(var(--color-success-rgb), 0.1);
    color: var(--color-success);
}

.badge-draft {
    background: rgba(var(--color-warning-rgb), 0.1);
    color: var(--color-warning);
}

.badge-archived {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

/* Card Body */
.card-body {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: 1.35;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer Actions */
.card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: auto;
}

.btn-card-go {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 38px;
    border-radius: 10px;
    background: rgba(var(--accent-theme-rgb, var(--color-primary-rgb)), 0.1);
    color: var(--accent-theme, var(--color-primary));
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-card-go:hover {
    background: var(--accent-theme, var(--color-primary));
    color: white;
    box-shadow: 0 4px 10px rgba(var(--accent-theme-rgb, var(--color-primary-rgb)), 0.2);
}

.btn-card-go i {
    width: 16px;
    height: 16px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .btn-icon:hover {
    background: rgba(0, 0, 0, 0.03);
}

.btn-icon-danger:hover {
    color: white;
    background: var(--color-danger);
    border-color: var(--color-danger);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.btn-icon i {
    width: 16px;
    height: 16px;
}

/* --------------------------------------------------------------------------
   7. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    height: 46px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.03);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------------
   8. MODAL DIALOG
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 580px;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.required {
    color: var(--color-danger);
}

input[type="text"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

input[type="text"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

textarea {
    resize: vertical;
}

.form-help {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Color radio selector */
.color-presets {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    height: 42px;
}

.color-preset {
    position: relative;
    cursor: pointer;
    display: block;
    width: 24px;
    height: 24px;
}

.color-preset input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.color-preset span {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.1);
}

.color-preset:hover span {
    transform: scale(1.15);
}

.color-preset input:checked + span {
    transform: scale(1.15);
    box-shadow: 0 0 0 2px var(--bg-modal), 0 0 0 4px var(--color-primary);
}

.color-gold span { background-color: #f5a623; }
.color-emerald span { background-color: #10b981; }
.color-amber span { background-color: #f59e0b; }
.color-rose span { background-color: #f43f5e; }
.color-cyan span { background-color: #06b6d4; }
.color-violet span { background-color: #8b5cf6; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   9. EMPTY & TOAST NOTIFICATION STATES
   -------------------------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    margin: auto;
    max-width: 450px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.empty-icon i {
    width: 36px;
    height: 36px;
}

.empty-state h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Toast container & popup notification */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 110;
}

.toast {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 400px;
    backdrop-filter: blur(10px);
    transform: translateY(20px);
    opacity: 0;
    animation: toast-in var(--transition-normal) forwards;
}

.toast-success { border-left-color: var(--color-success); }
.toast-success i { color: var(--color-success); }

.toast-info { border-left-color: var(--color-primary); }
.toast-info i { color: var(--color-primary); }

.toast-danger { border-left-color: var(--color-danger); }
.toast-danger i { color: var(--color-danger); }

.toast i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 0.85rem;
    font-weight: 500;
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE DESIGN
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar-header {
        position: relative;
        width: 100%;
        padding: 1.5rem;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .brand {
        margin-bottom: 1.5rem;
    }
    
    .stats-panel {
        margin-bottom: 1.5rem;
    }
    
    .categories-nav {
        margin-bottom: 1.5rem;
    }

    .categories-nav ul {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .categories-nav li {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }

    .sidebar-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .sidebar-footer .btn-block {
        width: auto;
        flex-grow: 1;
        max-width: 250px;
    }

    .main-content,
    body.is-admin .main-content {
        margin: 0;
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .sidebar-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sidebar-footer .btn-block {
        max-width: none;
    }
    
    .top-bar {
        flex-direction: column;
    }
    
    .sort-box {
        width: 100%;
        justify-content: space-between;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
}

/* ==========================================================================
   11. ADMIN-ONLY VISIBILITY UTILITY
   ========================================================================== */
.admin-only {
    display: none !important;
}
body.is-admin .admin-only {
    display: inline-flex !important;
}
body.is-admin button.admin-only {
    display: flex !important;
}
