/* =========================================================================
   AKONTEC PORTAL — Premium Design System
   Brand: #c00000 deep red + warm stone neutrals + gold accent
   ========================================================================= */

/* ---------- Design Tokens ---------- */
:root {
    /* Brand */
    --red:           #c00000;
    --red-dark:      #8b0000;
    --red-darker:    #6b0000;
    --red-light:     #dc2626;
    --red-50:        #fef2f2;
    --red-100:       #fee2e2;
    --red-soft:      rgba(192, 0, 0, 0.06);
    --red-tint:      rgba(192, 0, 0, 0.03);

    /* Gold accent (premium / high-payout) */
    --gold:          #d97706;
    --gold-light:    #f59e0b;
    --gold-50:       #fffbeb;
    --gold-100:      #fef3c7;

    /* Warm stone neutrals (premium feel) */
    --stone-25:      #fdfcfb;
    --stone-50:      #fafaf9;
    --stone-100:     #f5f5f4;
    --stone-150:     #ebe9e6;
    --stone-200:     #e7e5e4;
    --stone-300:     #d6d3d1;
    --stone-400:     #a8a29e;
    --stone-500:     #78716c;
    --stone-600:     #57534e;
    --stone-700:     #44403c;
    --stone-800:     #292524;
    --stone-900:     #1c1917;
    --stone-950:     #0c0a09;

    /* Semantic */
    --success:       #059669;
    --success-50:    #ecfdf5;
    --warning:       #d97706;
    --warning-50:    #fffbeb;
    --danger:        #dc2626;
    --danger-50:     #fef2f2;
    --info:          #2563eb;
    --info-50:       #eff6ff;

    /* Shadows — multi-layered for depth */
    --shadow-xs:     0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-sm:     0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md:     0 4px 12px rgba(28, 25, 23, 0.06), 0 2px 4px rgba(28, 25, 23, 0.04);
    --shadow-lg:     0 12px 32px rgba(28, 25, 23, 0.08), 0 4px 12px rgba(28, 25, 23, 0.04);
    --shadow-xl:     0 24px 64px rgba(28, 25, 23, 0.12), 0 8px 24px rgba(28, 25, 23, 0.06);
    --shadow-red:    0 8px 24px rgba(192, 0, 0, 0.18);
    --shadow-red-sm: 0 2px 8px rgba(192, 0, 0, 0.16);

    /* Radius */
    --r-xs:          4px;
    --r-sm:          6px;
    --r-md:          10px;
    --r-lg:          14px;
    --r-xl:          20px;
    --r-2xl:         28px;
    --r-full:        9999px;

    /* Typography */
    --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display:  'Playfair Display', 'Georgia', 'Times New Roman', serif;
    --font-mono:     'JetBrains Mono', 'SF Mono', 'Monaco', 'Consolas', monospace;

    /* Layout */
    --header-h:      72px;
    --sidebar-w:     264px;
    --container-xl:  1340px;
    --container-lg:  1140px;
    --container-md:  860px;
    --container-sm:  540px;

    /* Transitions */
    --t-fast:        120ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base:        200ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow:        320ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-bounce:      400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--stone-900);
    background: var(--stone-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    min-height: 100vh;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--red); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--red-dark); }

ul, ol { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }

::selection { background: var(--red); color: white; }

/* Hide scrollbar in fullscreen viewer */
.scroll-hide::-webkit-scrollbar { width: 8px; }
.scroll-hide::-webkit-scrollbar-track { background: transparent; }
.scroll-hide::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ---------- Typography ---------- */
.h-display {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }

.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg   { font-size: 17px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }
.text-3xl  { font-size: 30px; }
.text-4xl  { font-size: 36px; }

.muted     { color: var(--stone-500); }
.muted-2   { color: var(--stone-400); }
.subtle    { color: var(--stone-600); }
.hint      { font-size: 12px; color: var(--stone-400); font-weight: 400; }

.link-red  { color: var(--red); font-weight: 500; }
.link-red:hover { text-decoration: underline; }

.mono      { font-family: var(--font-mono); }

/* ---------- Buttons (premium) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    transition: all var(--t-base);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.005em;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.btn-primary {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: white;
    box-shadow: var(--shadow-red-sm);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--red-dark) 0%, var(--red-darker) 100%);
    color: white;
    box-shadow: var(--shadow-red);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    background: white;
    color: var(--stone-700);
    border-color: var(--stone-200);
}
.btn-ghost:hover {
    background: var(--stone-50);
    border-color: var(--stone-300);
    color: var(--stone-900);
}

.btn-soft {
    background: var(--stone-100);
    color: var(--stone-700);
}
.btn-soft:hover { background: var(--stone-150); color: var(--stone-900); }

.btn-danger {
    background: white;
    color: var(--danger);
    border-color: #fecaca;
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-dark {
    background: var(--stone-900);
    color: white;
}
.btn-dark:hover { background: var(--stone-800); color: white; }

.btn-sm  { padding: 7px 14px; font-size: 13px; }
.btn-xs  { padding: 5px 10px; font-size: 12px; }
.btn-lg  { padding: 14px 28px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-icon { padding: 9px; aspect-ratio: 1; }

/* ---------- Brand mark (logo fallback) ---------- */
.brand-mark {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    border-radius: var(--r-md);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    box-shadow: var(--shadow-red-sm);
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.brand-mark.lg  { width: 56px; height: 56px; font-size: 30px; border-radius: var(--r-lg); }
.brand-mark.xl  { width: 72px; height: 72px; font-size: 40px; border-radius: var(--r-lg); }

/* ---------- Toast notifications (flash messages) ---------- */
.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: white;
    padding: 14px 16px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--stone-150);
    border-left: 4px solid var(--info);
    font-size: 14px;
    color: var(--stone-800);
    animation: toastSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 300px;
}
@keyframes toastSlide {
    from { transform: translateX(20px) scale(0.96); opacity: 0; }
    to   { transform: translateX(0) scale(1); opacity: 1; }
}
.toast.info    { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error   { border-left-color: var(--danger); }
.toast-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
}
.toast.info    .toast-icon { background: var(--success); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.error   .toast-icon { background: var(--danger); }
.toast-body  { flex: 1; line-height: 1.4; }
.toast-close {
    background: none;
    border: none;
    color: var(--stone-400);
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    margin-left: 4px;
}
.toast-close:hover { color: var(--stone-700); }

/* =========================================================================
   AUTH PAGES (login + register)
   ========================================================================= */
.auth-page { min-height: 100vh; background: var(--stone-50); }
.auth-shell {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    min-height: 100vh;
}

.auth-art {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-darker) 100%);
    color: white;
    padding: 60px 64px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* Decorative pattern overlay */
.auth-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0,0,0,0.18) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(255,255,255,0.04) 0%, transparent 40%);
    pointer-events: none;
}
.auth-art::after {
    content: '';
    position: absolute;
    bottom: -200px; right: -200px;
    width: 600px; height: 600px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    pointer-events: none;
}
.auth-art-inner {
    position: relative;
    z-index: 2;
    max-width: 480px;
    width: 100%;
    margin: auto;
}

.auth-logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 56px;
}
.auth-logo-img {
    max-width: 180px;
    max-height: 50px;
    filter: brightness(0) invert(1);
}
.auth-brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: 0.02em;
}

.auth-art h1 {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
}
.auth-art h1 em { font-style: italic; color: var(--gold-light); }
.auth-tagline {
    font-size: 18px;
    line-height: 1.5;
    opacity: 0.92;
    margin-bottom: 48px;
    max-width: 420px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.auth-feature-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.2);
}
.auth-feature-text {
    line-height: 1.45;
}
.auth-feature-text strong {
    font-weight: 600;
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}
.auth-feature-text span {
    font-size: 13px;
    opacity: 0.78;
}

.auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: white;
}
.auth-card {
    width: 100%;
    max-width: 400px;
}
.auth-card.wide { max-width: 480px; }

.auth-card-header { margin-bottom: 32px; }
.auth-card-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--red);
    margin-bottom: 12px;
}
.auth-card h2 {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--stone-900);
    margin-bottom: 8px;
    line-height: 1.15;
}
.auth-card-sub { color: var(--stone-500); font-size: 14px; }

/* Form fields */
.field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--stone-700);
    display: flex;
    align-items: center;
    gap: 6px;
}
.field-label .req { color: var(--red); font-weight: 700; }
.field-input,
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--stone-900);
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
    font-family: inherit;
}
.field input::placeholder, .field textarea::placeholder { color: var(--stone-400); }
.field input:hover, .field select:hover, .field textarea:hover {
    border-color: var(--stone-300);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--stone-400);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--stone-200);
}

.auth-foot {
    text-align: center;
    margin-top: 24px;
    color: var(--stone-500);
    font-size: 13px;
    line-height: 1.6;
}
.auth-foot strong { color: var(--stone-700); }

@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-art {
        padding: 32px 24px;
        min-height: auto;
    }
    .auth-art h1 { font-size: 36px; }
    .auth-features { display: none; }
    .auth-tagline { margin-bottom: 0; font-size: 15px; }
    .field-row { grid-template-columns: 1fr; }
}

/* =========================================================================
   APP HEADER (client pages)
   ========================================================================= */
.app-header {
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--stone-150);
    display: flex;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--stone-900);
}
.app-brand:hover { color: var(--stone-900); }
.app-brand-img {
    max-height: 40px;
    max-width: 130px;
    object-fit: contain;
}
.app-brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--stone-900);
}
.app-brand-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 4px;
    display: block;
}

.app-header-spacer { flex: 1; }
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    background: var(--stone-50);
    border: 1px solid var(--stone-150);
    border-radius: var(--r-full);
    font-size: 13px;
    color: var(--stone-700);
    font-weight: 500;
    transition: all var(--t-fast);
}
.user-chip:hover { background: var(--stone-100); border-color: var(--stone-200); }
.user-chip-avatar {
    width: 28px; height: 28px;
    background: var(--red);
    color: white;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

/* =========================================================================
   DASHBOARD
   ========================================================================= */
.dashboard-main {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 32px 32px 80px;
}

/* Hero — premium gradient with stats */
.hero {
    background:
        radial-gradient(circle at 0% 0%, rgba(255,255,255,0.1) 0%, transparent 40%),
        linear-gradient(135deg, var(--red) 0%, var(--red-darker) 100%);
    color: white;
    padding: 44px 48px;
    border-radius: var(--r-2xl);
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.hero::before {
    content: '';
    position: absolute;
    top: -120px; right: -120px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -160px; left: 30%;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(0,0,0,0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}
.hero-content { max-width: 720px; }
.hero-eyebrow {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 12px;
}
.hero h1 em { font-style: italic; color: var(--gold-light); }
.hero-sub {
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.94;
    max-width: 620px;
}

.hero-stats {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}
.hero-stat {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 18px 24px;
    border-radius: var(--r-lg);
    text-align: center;
    min-width: 120px;
}
.hero-stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}
.hero-stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.86;
    margin-top: 6px;
    font-weight: 500;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.search-field {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 480px;
}
.search-field svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--stone-400);
}
.search-field input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    font-size: 14px;
    background: white;
    border: 1px solid var(--stone-200);
    border-radius: var(--r-md);
    transition: all var(--t-fast);
    color: var(--stone-900);
}
.search-field input::placeholder { color: var(--stone-400); }
.search-field input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}

.legend {
    display: flex;
    gap: 18px;
    font-size: 12px;
    color: var(--stone-500);
    margin-left: auto;
    flex-wrap: wrap;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--stone-300);
}
.legend-dot.unlocked { background: var(--success); }

/* Project grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.project-card {
    background: white;
    border: 1px solid var(--stone-150);
    border-radius: var(--r-lg);
    overflow: hidden;
    color: var(--stone-900);
    box-shadow: var(--shadow-xs);
    transition: all var(--t-base);
    display: flex;
    flex-direction: column;
}
.project-card:hover {
    border-color: var(--stone-200);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: var(--stone-900);
}

.card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--stone-100), var(--stone-200));
    overflow: hidden;
}
.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover .card-cover img { transform: scale(1.05); }

.cover-badges {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: var(--r-xs);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}
.badge-high {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}
.badge-region {
    background: rgba(0, 0, 0, 0.65);
    color: white;
}
.badge-soft {
    background: var(--stone-100);
    color: var(--stone-700);
    border: 1px solid var(--stone-200);
}

.cover-state {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 2;
}
.lock-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}
.lock-pill.locked {
    background: rgba(0, 0, 0, 0.7);
    color: white;
}
.lock-pill.unlocked {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}

.card-body {
    padding: 20px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--stone-900);
    line-height: 1.3;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
    /* clamp 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}
.card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--stone-500);
    margin-bottom: 14px;
}
.card-meta-dot {
    width: 3px; height: 3px;
    background: var(--stone-300);
    border-radius: 50%;
}
.card-payout {
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--stone-100);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 80px 24px;
}
.empty-icon {
    width: 72px; height: 72px;
    margin: 0 auto 20px;
    background: var(--stone-100);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--stone-400);
}
.empty h3 {
    font-size: 18px;
    color: var(--stone-700);
    margin-bottom: 6px;
    font-weight: 600;
}
.empty p { color: var(--stone-500); font-size: 14px; }

/* =========================================================================
   PROJECT UNLOCK PAGE (access code entry)
   ========================================================================= */
.unlock-page-wrap {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--stone-500);
    margin-bottom: 16px;
    font-weight: 500;
    transition: color var(--t-fast);
}
.back-link:hover { color: var(--red); }

.unlock-card {
    background: white;
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid var(--stone-150);
    box-shadow: var(--shadow-md);
}

.unlock-cover {
    aspect-ratio: 16 / 5;
    background: linear-gradient(135deg, var(--stone-100), var(--stone-200));
    overflow: hidden;
}
.unlock-cover img { width: 100%; height: 100%; object-fit: cover; }

.unlock-body { padding: 36px 44px 44px; }

.unlock-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.unlock-body h1 {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--stone-900);
    margin-bottom: 14px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.unlock-desc {
    color: var(--stone-600);
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 28px;
}

.unlock-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    background: var(--stone-50);
    border: 1px solid var(--stone-150);
    border-radius: var(--r-md);
    padding: 20px 24px;
    margin-bottom: 36px;
}
.unlock-fact-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--stone-400);
    font-weight: 700;
    margin-bottom: 4px;
}
.unlock-fact-value {
    font-size: 15px;
    color: var(--stone-900);
    font-weight: 600;
}

.unlock-divider {
    height: 1px;
    background: var(--stone-150);
    margin: 32px 0;
}

.lock-icon-wrap {
    width: 88px; height: 88px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--red-soft), var(--red-tint));
    color: var(--red);
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--red-100);
}

.unlock-h2 {
    text-align: center;
    font-size: 22px;
    color: var(--stone-900);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.unlock-helper {
    text-align: center;
    color: var(--stone-500);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 28px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.unlock-form {
    max-width: 380px;
    margin: 0 auto;
}

.code-input {
    padding: 16px 18px !important;
    font-family: var(--font-mono) !important;
    font-size: 18px !important;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    border: 2px solid var(--stone-200) !important;
    border-radius: var(--r-md) !important;
    font-weight: 600;
}
.code-input:focus {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 4px var(--red-soft) !important;
}

.unlock-foot {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--stone-150);
    font-size: 13px;
    color: var(--stone-500);
    line-height: 1.6;
}
.unlock-foot strong { color: var(--stone-700); }

/* =========================================================================
   PROJECT FILES PAGE
   ========================================================================= */
.files-main {
    max-width: var(--container-lg);
    margin: 0 auto;
    padding: 24px 32px 80px;
}

.project-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
    background: white;
    border: 1px solid var(--stone-150);
    border-radius: var(--r-xl);
    overflow: hidden;
    margin-bottom: 36px;
    box-shadow: var(--shadow-sm);
}
.project-hero-cover {
    background: var(--stone-100);
    overflow: hidden;
    min-height: 220px;
}
.project-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-hero-body {
    padding: 28px 32px 28px 0;
}
.project-hero-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.project-hero-body h1 {
    font-family: var(--font-display);
    font-size: 30px;
    color: var(--stone-900);
    margin-bottom: 10px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.project-hero-desc {
    color: var(--stone-600);
    line-height: 1.6;
    margin-bottom: 18px;
}
.project-hero-facts {
    display: flex;
    gap: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--stone-100);
    flex-wrap: wrap;
}
.fact-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fact-block-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--stone-400);
    font-weight: 700;
}
.fact-block-value {
    font-size: 16px;
    color: var(--stone-900);
    font-weight: 600;
}
.fact-block-value.red { color: var(--red); }

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--stone-900);
    letter-spacing: -0.01em;
}
.section-meta {
    font-size: 13px;
    color: var(--stone-500);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.file-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    border: 1px solid var(--stone-150);
    border-radius: var(--r-md);
    padding: 16px 18px;
    color: var(--stone-900);
    transition: all var(--t-fast);
    box-shadow: var(--shadow-xs);
}
.file-card:hover {
    border-color: var(--red-100);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--stone-900);
}
.file-icon {
    flex-shrink: 0;
    width: 48px; height: 56px;
    border-radius: var(--r-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.file-icon-pdf  {
    background: linear-gradient(140deg, var(--red), var(--red-dark));
}
.file-icon-xlsx {
    background: linear-gradient(140deg, #16a34a, #15803d);
}
.file-icon-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-top: 3px;
}
.file-info { flex: 1; min-width: 0; }
.file-title-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--stone-900);
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.005em;
}
.file-meta {
    font-size: 12px;
    color: var(--stone-500);
}
.file-action-pill {
    flex-shrink: 0;
    padding: 6px 12px;
    background: var(--red-soft);
    color: var(--red);
    border-radius: var(--r-xs);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.file-card:hover .file-action-pill {
    background: var(--red);
    color: white;
}

@media (max-width: 760px) {
    .project-hero { grid-template-columns: 1fr; }
    .project-hero-cover { aspect-ratio: 16/9; min-height: auto; }
    .project-hero-body { padding: 24px; }
    .unlock-facts { grid-template-columns: 1fr; }
    .unlock-body { padding: 24px; }
    .unlock-body h1 { font-size: 26px; }
}

/* =========================================================================
   DOCUMENT VIEWER — premium dark theme
   ========================================================================= */
.viewer-page {
    background: #1a1614;
    min-height: 100vh;
    overflow-x: hidden;
}

.viewer-header {
    height: 60px;
    background: rgba(20, 16, 14, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.viewer-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
}
.viewer-back:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.viewer-doc-info {
    flex: 1;
    text-align: center;
    color: white;
    overflow: hidden;
}
.viewer-doc-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.005em;
}
.viewer-doc-project {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
    font-weight: 600;
}

.viewer-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}
.viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 11px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
    min-height: 32px;
}
.viewer-btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    border-color: rgba(255,255,255,0.15);
}
.viewer-btn.icon { width: 32px; padding: 0; }
.viewer-page-counter {
    font-variant-numeric: tabular-nums;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    padding: 0 12px;
    min-width: 70px;
    text-align: center;
    font-weight: 500;
}

/* Pages */
.viewer-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: calc(100vh - 60px);
}

.viewer-sidebar {
    background: rgba(20, 16, 14, 0.6);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255,255,255,0.08);
    overflow-y: auto;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    padding: 18px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.viewer-sidebar::-webkit-scrollbar { width: 6px; }
.viewer-sidebar::-webkit-scrollbar-track { background: transparent; }
.viewer-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

.viewer-sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 14px;
}
.viewer-sidebar-header h3 {
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}
.viewer-sidebar-project {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    /* clamp 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.doc-count {
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--r-full);
    border: 1px solid rgba(255,255,255,0.06);
}

.viewer-doc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--r-md);
    transition: all var(--t-fast);
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    border: 1px solid transparent;
    position: relative;
}
.doc-list-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    border-color: rgba(255,255,255,0.06);
}
.doc-list-item.active {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(192,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.1);
}

.doc-thumb {
    flex-shrink: 0;
    width: 50px;
    height: 66px;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.doc-list-item.active .doc-thumb {
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    pointer-events: none;
    -webkit-user-drag: none;
}
.doc-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: white;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.doc-thumb-fallback.file-icon-pdf  { background: linear-gradient(140deg, var(--red), var(--red-dark)); }
.doc-thumb-fallback.file-icon-xlsx { background: linear-gradient(140deg, #16a34a, #15803d); }

.doc-list-info {
    flex: 1;
    min-width: 0;
}
.doc-list-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
    margin-bottom: 5px;
    letter-spacing: -0.005em;
    /* clamp 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.doc-list-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: inherit;
    opacity: 0.65;
}
.doc-list-item.active .doc-list-meta { opacity: 0.92; }
.doc-type-badge {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    font-size: 9px;
}
.doc-list-item.active .doc-type-badge {
    background: rgba(255,255,255,0.18);
}
.doc-type-badge.type-pdf  { color: #fca5a5; }
.doc-type-badge.type-xlsx { color: #86efac; }
.doc-list-item.active .doc-type-badge.type-pdf,
.doc-list-item.active .doc-type-badge.type-xlsx { color: white; }

.doc-list-active-marker {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
}

.viewer-stage {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 16px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
}

@media (max-width: 880px) {
    .viewer-layout { grid-template-columns: 1fr; }
    .viewer-sidebar {
        position: relative;
        top: 0;
        height: auto;
        max-height: 280px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
}

.page-frame {
    width: 100%;
    position: relative;
    background: white;
    box-shadow: 0 12px 48px rgba(0,0,0,0.45), 0 4px 12px rgba(0,0,0,0.3);
    border-radius: 2px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}
.page-frame img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 200px;
    pointer-events: none;
    -webkit-user-drag: none;
}
.page-shield {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: transparent;
}

/* Diagonal watermark overlay */
.watermark-grid {
    position: absolute;
    inset: -25%;
    z-index: 4;
    pointer-events: none;
    transform: rotate(-30deg);
    transform-origin: center;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 50px;
    opacity: 0.10;
    overflow: hidden;
    padding: 60px;
}
.watermark-grid span {
    color: var(--red);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.page-num {
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    margin-top: 4px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* =========================================================================
   ERROR PAGE
   ========================================================================= */
.error-page {
    min-height: 100vh;
    background: var(--stone-50);
    display: grid;
    place-items: center;
    padding: 32px;
}
.error-card {
    background: white;
    padding: 56px 64px;
    border-radius: var(--r-xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    border: 1px solid var(--stone-150);
}
.error-card h1 {
    font-family: var(--font-display);
    font-size: 80px;
    color: var(--red);
    margin: 16px 0 8px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.error-card p {
    color: var(--stone-500);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.app-footer {
    text-align: center;
    padding: 32px 24px;
    background: white;
    border-top: 1px solid var(--stone-150);
    color: var(--stone-500);
    font-size: 12px;
}
.app-footer a { color: var(--stone-700); }

/* =========================================================================
   ADMIN PANEL
   ========================================================================= */
.admin-page { background: var(--stone-50); }

.admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(180deg, var(--stone-900) 0%, var(--stone-950) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    padding: 0 22px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}
.admin-brand:hover { color: white; }
.admin-brand-img {
    max-height: 36px;
    max-width: 100px;
    filter: brightness(0) invert(1);
}
.admin-brand-text-name {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.02em;
    line-height: 1;
}
.admin-brand-text-tag {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,255,255,0.4);
    margin-top: 5px;
    font-weight: 600;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 12px;
    gap: 2px;
}
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.65);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--t-fast);
}
.admin-nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}
.admin-nav-item.active {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    box-shadow: var(--shadow-red-sm);
}
.admin-nav-item svg { opacity: 0.85; }

.admin-user-card {
    margin: 16px 12px 0;
    padding: 14px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--r-md);
}
.admin-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.admin-user-avatar {
    width: 32px; height: 32px;
    background: var(--red);
    color: white;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-user-role {
    color: rgba(255,255,255,0.45);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.admin-logout-btn {
    width: 100%;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 8px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: all var(--t-fast);
}
.admin-logout-btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.admin-main {
    padding: 36px 44px 80px;
    overflow-x: hidden;
    min-width: 0;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.admin-page-header h1 {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--stone-900);
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 6px;
}
.admin-page-header .header-sub-text {
    color: var(--stone-400);
    font-weight: 400;
    font-size: 24px;
}
.admin-page-header p { color: var(--stone-500); font-size: 14px; }

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: white;
    border: 1px solid var(--stone-150);
    border-radius: var(--r-md);
    padding: 22px;
    box-shadow: var(--shadow-xs);
    transition: all var(--t-fast);
}
.stat-card:hover {
    border-color: var(--stone-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-icon {
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: white;
}
.stat-icon.red    { background: linear-gradient(135deg, var(--red), var(--red-dark)); }
.stat-icon.gold   { background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.stat-icon.green  { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

.stat-num {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--stone-900);
    line-height: 1;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 12px;
    color: var(--stone-500);
    margin-top: 6px;
    font-weight: 500;
}

/* Admin section */
.admin-card {
    background: white;
    border: 1px solid var(--stone-150);
    border-radius: var(--r-lg);
    padding: 26px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-xs);
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 16px;
    flex-wrap: wrap;
}
.admin-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--stone-900);
    letter-spacing: -0.005em;
}

/* Data table */
.table-wrap {
    overflow-x: auto;
    margin: 0 -28px;
    padding: 0 28px;
}
.dt {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.dt th {
    text-align: left;
    padding: 11px 14px;
    background: var(--stone-50);
    color: var(--stone-500);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    border-bottom: 1px solid var(--stone-150);
    white-space: nowrap;
}
.dt th:first-child { border-top-left-radius: var(--r-sm); }
.dt th:last-child  { border-top-right-radius: var(--r-sm); }
.dt td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--stone-100);
    color: var(--stone-700);
    vertical-align: middle;
}
.dt tr:hover td { background: var(--stone-50); }
.dt tr:last-child td { border-bottom: none; }
.dt strong { color: var(--stone-900); font-weight: 600; }

.cell-mono {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--stone-500);
    white-space: nowrap;
}
.cell-sub {
    font-size: 11px;
    color: var(--stone-400);
    margin-top: 3px;
    font-family: var(--font-mono);
}
.cell-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}
.cell-extra {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--stone-400);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-thumb {
    width: 64px; height: 40px;
    object-fit: cover;
    border-radius: var(--r-xs);
    box-shadow: var(--shadow-xs);
}
.row-thumb-ph {
    width: 64px; height: 40px;
    border-radius: var(--r-xs);
    background: linear-gradient(135deg, var(--red), var(--red-darker));
    color: white;
    font-weight: 700;
    display: grid;
    place-items: center;
    font-size: 13px;
    box-shadow: var(--shadow-xs);
}

/* Tags & pills (admin) */
.tag-soft {
    display: inline-block;
    background: var(--stone-100);
    color: var(--stone-700);
    font-size: 11px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    margin-right: 4px;
    font-weight: 500;
}
.code-pill {
    display: inline-block;
    background: var(--stone-900);
    color: var(--gold-light);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--r-xs);
    letter-spacing: 0.05em;
    font-weight: 600;
}
.btn-copy {
    background: none;
    border: none;
    color: var(--stone-400);
    cursor: pointer;
    font-size: 14px;
    padding: 3px 6px;
    border-radius: var(--r-xs);
    transition: all var(--t-fast);
}
.btn-copy:hover { color: var(--red); background: var(--red-soft); }

.status-pill {
    display: inline-block;
    padding: 3px 11px;
    border-radius: var(--r-full);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.status-pill.on    { background: var(--success-50); color: var(--success); }
.status-pill.off   { background: var(--stone-100); color: var(--stone-500); }
.status-pill.admin { background: var(--red); color: white; }

.event-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--r-xs);
    font-size: 10px;
    font-weight: 600;
    background: var(--stone-100);
    color: var(--stone-700);
    font-family: var(--font-mono);
    letter-spacing: 0;
}
.event-pill.event-login_success    { background: var(--success-50); color: var(--success); }
.event-pill.event-login_fail       { background: var(--danger-50); color: var(--danger); }
.event-pill.event-register         { background: var(--info-50); color: var(--info); }
.event-pill.event-logout           { background: var(--stone-100); color: var(--stone-600); }
.event-pill.event-document_view    { background: var(--red-soft); color: var(--red); }
.event-pill.event-project_unlocked { background: var(--gold-50); color: var(--gold); }
.event-pill.event-project_unlock_fail { background: var(--danger-50); color: var(--danger); }
.event-pill.event-project_open     { background: var(--info-50); color: var(--info); }
.event-pill.event-PDF, .event-pill.event-pdf  { background: var(--red); color: white; }
.event-pill.event-XLSX, .event-pill.event-xlsx { background: #16a34a; color: white; }

/* Admin form */
.admin-form { display: flex; flex-direction: column; gap: 16px; }
.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 36px;
}
.form-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--stone-400);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--stone-150);
}
.checkbox-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: var(--stone-50);
    border: 1px solid var(--stone-150);
    border-radius: var(--r-md);
    margin-bottom: 16px;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--stone-700);
    cursor: pointer;
}
.check-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
    cursor: pointer;
    flex-shrink: 0;
}
.cover-preview {
    margin-bottom: 18px;
    padding: 14px;
    background: var(--stone-50);
    border-radius: var(--r-md);
    border: 1px solid var(--stone-150);
}
.cover-preview img {
    width: 100%;
    border-radius: var(--r-sm);
    margin-bottom: 8px;
}
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--stone-150);
    margin-top: 8px;
}

@media (max-width: 920px) {
    .form-grid { grid-template-columns: 1fr; }
}

/* Upload form */
.upload-drop {
    display: block;
    border: 2px dashed var(--stone-200);
    border-radius: var(--r-md);
    background: var(--stone-50);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--t-fast);
}
.upload-drop:hover, .upload-drop.dragging {
    border-color: var(--red);
    background: var(--red-tint);
}
.upload-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--stone-500);
}
.upload-drop-inner svg { color: var(--red); margin-bottom: 4px; }
.upload-drop-inner strong {
    color: var(--stone-900);
    font-size: 15px;
    font-weight: 600;
}
.upload-file-list {
    list-style: none;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 580px;
}
.upload-file-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--stone-150);
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--stone-700);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 22px;
    flex-wrap: wrap;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--stone-100);
}
.filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
    color: var(--stone-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.filter-bar select {
    padding: 9px 12px;
    font-family: inherit;
    font-size: 13px;
    border: 1px solid var(--stone-200);
    border-radius: var(--r-sm);
    background: white;
    color: var(--stone-900);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    min-width: 200px;
}

/* Mobile admin */
@media (max-width: 760px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: relative;
        height: auto;
        padding: 16px;
    }
    .admin-nav {
        flex-direction: row;
        flex-wrap: wrap;
        flex: initial;
        padding: 0;
    }
    .admin-user-card { display: none; }
    .admin-main { padding: 24px 20px; }
    .table-wrap { margin: 0 -20px; padding: 0 20px; }
}

/* =========================================================================
   PRINT — block printing entirely
   ========================================================================= */
@media print {
    body { display: none !important; }
    body::after {
        content: "Printing is disabled for AKONTEC confidential documents.";
        display: block !important;
        font-size: 24px;
        text-align: center;
        padding: 100px;
    }
}
