/* ============================================================
   Ayakkabı Tasarımı Terminoloji Sözlüğü
   Tema: Modern, akademik, sıcak
   ============================================================ */

:root {
    /* Renkler */
    --c-bg: #f8f7f4;
    --c-surface: #ffffff;
    --c-surface-2: #f1efea;
    --c-border: #e7e4dd;
    --c-border-2: #d6d2c8;

    --c-text: #1a1715;
    --c-text-soft: #4d4843;
    --c-muted: #8a847b;

    --c-brand: #0f172a;
    --c-brand-2: #1e293b;
    --c-brand-3: #334155;

    --c-accent: #c2410c;
    --c-accent-2: #9a3412;
    --c-accent-soft: #fef3c7;
    --c-accent-bg: #fff7ed;

    --c-success: #15803d;
    --c-success-bg: #dcfce7;
    --c-warn: #b45309;
    --c-warn-bg: #fef3c7;
    --c-danger: #b91c1c;
    --c-danger-bg: #fee2e2;
    --c-info: #1d4ed8;
    --c-info-bg: #dbeafe;

    /* Radius / Shadow */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 999px;

    --sh-1: 0 1px 2px rgba(15,23,42,.05);
    --sh-2: 0 4px 16px rgba(15,23,42,.08);
    --sh-3: 0 12px 32px rgba(15,23,42,.12);
    --sh-up: 0 -6px 24px rgba(15,23,42,.06);

    /* Fonts */
    --f-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --f-display: 'Fraunces', Georgia, serif;

    /* Layout */
    --sidebar-w: 264px;
    --appbar-h: 72px;
    --bottombar-h: 64px;

    /* Transition */
    --t: .2s cubic-bezier(.4,0,.2,1);
}

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

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

body {
    font-family: var(--f-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--c-brand); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4 {
    font-family: var(--f-display);
    color: var(--c-brand);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { color: var(--c-text-soft); }

.ic { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.15rem;
    border-radius: var(--r-md);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--c-text);
    line-height: 1.2;
    transition: var(--t);
    white-space: nowrap;
    user-select: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--c-brand);
    color: #fff;
    border-color: var(--c-brand);
}
.btn-primary:hover { background: var(--c-brand-2); box-shadow: var(--sh-2); }

.btn-accent {
    background: var(--c-accent);
    color: #fff;
    border-color: var(--c-accent);
}
.btn-accent:hover { background: var(--c-accent-2); box-shadow: var(--sh-2); }

.btn-outline {
    background: var(--c-surface);
    color: var(--c-brand);
    border-color: var(--c-border-2);
}
.btn-outline:hover { border-color: var(--c-brand); background: var(--c-surface-2); }

.btn-ghost {
    background: transparent;
    color: var(--c-text-soft);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-brand); }

.btn-success { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.btn-warn    { background: var(--c-warn); color: #fff; border-color: var(--c-warn); }
.btn-danger  { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }

.btn-sm { padding: .45rem .85rem; font-size: .82rem; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ============================================================
   PUBLIC TOPBAR (Visitor + login)
   ============================================================ */
.topbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: var(--appbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: var(--c-brand);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-3) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .9rem;
    letter-spacing: -.02em;
    flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: .95rem; font-family: var(--f-display); font-weight: 600; }
.brand-text small { font-size: .7rem; color: var(--c-accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.topnav {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.topnav > a {
    padding: .55rem .9rem;
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--c-text-soft);
    font-size: .9rem;
    font-weight: 500;
    transition: var(--t);
}

.topnav > a:hover { background: var(--c-surface-2); color: var(--c-brand); }
.topnav > a.active { background: var(--c-brand); color: #fff; }

.topnav-toggle {
    display: none;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: .55rem;
    color: var(--c-brand);
}

@media (max-width: 768px) {
    .topnav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .topnav {
        position: absolute;
        top: 100%;
        right: 1rem;
        left: 1rem;
        background: var(--c-surface);
        border: 1px solid var(--c-border);
        border-radius: var(--r-lg);
        padding: .75rem;
        flex-direction: column;
        align-items: stretch;
        box-shadow: var(--sh-2);
        gap: .25rem;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: var(--t);
    }
    .topnav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .topnav > a, .topnav > .btn { text-align: left; justify-content: flex-start; }
    .brand-text small { display: none; }
}

.main-public {
    min-height: calc(100vh - var(--appbar-h));
}

.site-foot {
    background: var(--c-brand);
    color: rgba(255,255,255,.85);
    margin-top: 4rem;
    padding: 2.5rem 0 2rem;
}

.site-foot-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 2rem;
    align-items: center;
}

.site-foot strong { color: #fff; font-family: var(--f-display); font-size: 1.05rem; display: block; }
.site-foot p { color: rgba(255,255,255,.7); font-size: .85rem; margin-top: .25rem; }
.site-foot small { color: rgba(255,255,255,.55); font-size: .8rem; }
.foot-links { display: flex; flex-direction: column; gap: .35rem; }
.foot-links a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .9rem; }
.foot-links a:hover { color: #fff; }

@media (max-width: 768px) {
    .site-foot-inner { grid-template-columns: 1fr; text-align: center; }
    .foot-links { align-items: center; }
}

/* ============================================================
   APP SHELL (Auth: Admin + Student)
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--c-brand);
    color: rgba(255,255,255,.9);
    padding: 1.25rem 0 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 1rem;
}

.brand-sidebar { color: #fff; }
.brand-sidebar .brand-mark { background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%); }
.brand-sidebar .brand-text strong { color: #fff; }
.brand-sidebar .brand-text small { color: var(--c-accent-soft); }

.sidebar-close {
    display: none;
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    border-radius: var(--r-md);
    padding: .5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 1rem;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }
.sidebar-user-info strong {
    display: block;
    font-size: .9rem;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info span {
    font-size: .7rem;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: 0 .75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .85rem;
    border-radius: var(--r-md);
    text-decoration: none;
    color: rgba(255,255,255,.7);
    font-size: .9rem;
    font-weight: 500;
    transition: var(--t);
}

.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--c-accent);
}

.sidebar-link .ic { opacity: .8; }
.sidebar-link.active .ic { opacity: 1; }

.sidebar-foot {
    padding: 1rem .75rem 0;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-link-danger:hover { background: rgba(185,28,28,.25); color: #fff; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 40;
    border: none;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.appbar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--c-border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.appbar-burger {
    display: none;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: .55rem;
    color: var(--c-brand);
    align-items: center;
    justify-content: center;
}

.appbar-titles { flex: 1; min-width: 0; }
.appbar-title {
    font-size: 1.25rem;
    line-height: 1.25;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appbar-sub {
    color: var(--c-muted);
    font-size: .82rem;
    margin: .15rem 0 0;
}

.appbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.appbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-3) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}

.app-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1280px;
    width: 100%;
}

.app-foot {
    text-align: center;
    color: var(--c-muted);
    font-size: .8rem;
    padding: 1.5rem;
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
}

.bottombar { display: none; }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: min(280px, 86vw);
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: var(--sh-3);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-backdrop.show { display: block; }

    .appbar-burger { display: inline-flex; }
    .appbar { padding: .85rem 1rem; }
    .app-content { padding: 1rem; padding-bottom: calc(var(--bottombar-h) + 1.5rem); }
    .appbar-hide-mobile { display: none; }
    .appbar-avatar { display: none; }

    .bottombar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--c-surface);
        border-top: 1px solid var(--c-border);
        box-shadow: var(--sh-up);
        z-index: 30;
        padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
        justify-content: space-around;
    }

    .bottombar-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .15rem;
        padding: .4rem .35rem;
        text-decoration: none;
        color: var(--c-muted);
        font-size: .65rem;
        font-weight: 600;
        min-width: 0;
    }
    .bottombar-link:hover, .bottombar-link.active { color: var(--c-brand); }
    .bottombar-link .ic { width: 20px; height: 20px; }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    box-shadow: var(--sh-1);
}

.card + .card { margin-top: 1.25rem; }
.card-pad-lg { padding: 2rem; }
.card-pad-sm { padding: 1rem; }

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.card-head h2 { margin: 0; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1.25rem;
    box-shadow: var(--sh-1);
    transition: var(--t);
}

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

.stat-label {
    font-size: .75rem;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.stat-num {
    font-family: var(--f-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--c-brand);
    line-height: 1.1;
    margin: .35rem 0;
    display: block;
}

.stat-hint { font-size: .78rem; color: var(--c-muted); margin: 0; }

.stat-accent {
    background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-2) 100%);
    border: none;
    color: #fff;
}
.stat-accent .stat-label, .stat-accent .stat-hint { color: rgba(255,255,255,.7); }
.stat-accent .stat-num { color: #fff; }

.stat-warm {
    background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
    border: none;
    color: #fff;
}
.stat-warm .stat-label, .stat-warm .stat-hint { color: rgba(255,255,255,.8); }
.stat-warm .stat-num { color: #fff; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .6rem;
    border-radius: var(--r-full);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-taslak     { background: #f1efea; color: #6b6259; }
.badge-beklemede  { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-revizyon   { background: #fef3c7; color: #92400e; }
.badge-onay       { background: var(--c-success-bg); color: var(--c-success); }
.badge-red        { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-yayin      { background: var(--c-info-bg); color: var(--c-info); }
.badge-soft       { background: var(--c-surface-2); color: var(--c-text-soft); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 1rem 1.15rem;
    border-radius: var(--r-md);
    border-left: 3px solid;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.alert .ic { width: 20px; height: 20px; flex-shrink: 0; }
.alert-success { background: var(--c-success-bg); color: var(--c-success); border-color: var(--c-success); }
.alert-error   { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger); }
.alert-warn    { background: var(--c-warn-bg); color: var(--c-warn); border-color: var(--c-warn); }
.alert-info    { background: var(--c-info-bg); color: var(--c-info); border-color: var(--c-info); }
.alert-link    { margin-left: auto; color: inherit; font-weight: 700; text-decoration: none; white-space: nowrap; }
.alert-link:hover { text-decoration: underline; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-group > label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--c-brand);
    margin-bottom: .35rem;
}

.input, .select, .textarea {
    width: 100%;
    padding: .7rem 1rem;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-md);
    background: var(--c-surface);
    color: var(--c-text);
    font-size: .95rem;
    transition: var(--t);
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px rgba(15,23,42,.08);
}

.input:disabled, .textarea:disabled, .select:disabled {
    background: var(--c-surface-2);
    color: var(--c-muted);
    cursor: not-allowed;
}

.textarea { resize: vertical; min-height: 120px; line-height: 1.6; font-family: inherit; }

.form-hint { color: var(--c-muted); font-size: .8rem; margin-top: .35rem; display: block; }

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

.form-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--c-border);
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 1rem;
    background: var(--c-surface-2);
    border-radius: var(--r-md);
    cursor: pointer;
    margin-bottom: .75rem;
}

.checkbox-row input { margin-top: .15rem; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--c-brand); }
.checkbox-row-text strong { display: block; color: var(--c-brand); font-size: .92rem; }
.checkbox-row-text small { color: var(--c-muted); font-size: .82rem; }

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
}

/* File upload */
.file-drop {
    display: block;
    border: 2px dashed var(--c-border-2);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--t);
    background: var(--c-surface-2);
}
.file-drop:hover { border-color: var(--c-brand); background: var(--c-surface); }
.file-drop .ic { width: 32px; height: 32px; margin: 0 auto .5rem; color: var(--c-brand); }
.file-drop strong { display: block; color: var(--c-brand); font-size: .95rem; }
.file-drop small { color: var(--c-muted); font-size: .82rem; }
.file-drop input { display: none; }

.current-image {
    margin-bottom: .85rem;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--c-border);
    background: var(--c-surface-2);
    max-width: 320px;
}
.current-image img { width: 100%; height: auto; display: block; }

/* ============================================================
   DICTIONARY (Public)
   ============================================================ */
.hero {
    background: linear-gradient(160deg, var(--c-brand) 0%, var(--c-brand-2) 60%, #0c2a4d 100%);
    color: #fff;
    padding: 3rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(194,65,12,.15), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.05), transparent 40%);
}

.hero-inner {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: .85rem;
    letter-spacing: -.02em;
}

.hero p {
    color: rgba(255,255,255,.8);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    max-width: 560px;
    margin-inline: auto;
}

.hero-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 2rem;
}

.hero-pill {
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.18);
    padding: .35rem .9rem;
    border-radius: var(--r-full);
    font-size: .78rem;
    font-weight: 500;
    color: #fff;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,.15);
    flex-wrap: wrap;
}

.hero-stat strong {
    display: block;
    font-family: var(--f-display);
    font-size: 1.75rem;
    color: #fff;
    line-height: 1;
}

.hero-stat span {
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: .25rem;
    display: block;
}

.dict-shell {
    max-width: 1200px;
    margin: -2rem auto 0;
    padding: 0 1.5rem 3rem;
    position: relative;
    z-index: 5;
}

.dict-toolbar {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1rem;
    box-shadow: var(--sh-2);
    margin-bottom: 1.25rem;
}

.search-box {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.search-input-wrap {
    flex: 1;
    min-width: 240px;
    position: relative;
}

.search-input-wrap .ic {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
}

.search-input-wrap input {
    width: 100%;
    padding: .75rem 1rem .75rem 2.75rem;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-md);
    font-size: .95rem;
    background: var(--c-surface);
}

.search-input-wrap input:focus {
    outline: none;
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px rgba(15,23,42,.08);
}

.az-bar {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
    padding: .75rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--sh-1);
}

.az-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 .5rem;
    border-radius: var(--r-sm);
    text-decoration: none;
    font-size: .8rem;
    font-weight: 700;
    color: var(--c-brand);
    background: var(--c-surface-2);
    transition: var(--t);
    border: 1px solid transparent;
}

.az-btn:hover { background: var(--c-accent-bg); color: var(--c-accent); border-color: var(--c-accent); }
.az-btn.active { background: var(--c-brand); color: #fff; }

.results-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
    color: var(--c-muted);
    font-size: .9rem;
}
.results-bar strong { color: var(--c-brand); font-weight: 700; }

/* Term grid */
.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.term-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-1);
    transition: var(--t);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.term-card[data-yayinda="1"] { cursor: pointer; }
.term-card[data-yayinda="1"]:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-3);
    border-color: var(--c-accent);
}

.term-card-img {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #ebe7df 0%, #d6d2c8 100%);
    position: relative;
    overflow: hidden;
}

.term-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.term-card:hover .term-card-img img { transform: scale(1.05); }

.term-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .35rem;
    color: var(--c-muted);
    font-size: .82rem;
    height: 100%;
}

.term-card-empty .ic { width: 36px; height: 36px; opacity: .5; }

.term-card-body { padding: 1rem 1.15rem 1.15rem; flex: 1; display: flex; flex-direction: column; }

.term-card-title {
    font-family: var(--f-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--c-brand);
    margin-bottom: .25rem;
}

.term-card-tr {
    color: var(--c-accent);
    font-size: .88rem;
    font-weight: 500;
}

.term-card-de {
    color: var(--c-muted);
    font-size: .78rem;
    margin-top: .25rem;
}

.term-card-foot {
    margin-top: auto;
    padding-top: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    font-size: .75rem;
    color: var(--c-muted);
}

.term-card-author { display: inline-flex; align-items: center; gap: .35rem; }
.term-card-author::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-accent);
}

/* ============================================================
   STEP FORM (Öğrenci terim doldurma)
   ============================================================ */
.task-card {
    background: linear-gradient(135deg, var(--c-accent-bg) 0%, #fff 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--r-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.task-card h3 {
    font-size: 1rem;
    color: var(--c-accent-2);
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.task-card ol { padding-left: 1.25rem; margin: 0; color: var(--c-text-soft); line-height: 1.8; font-size: .9rem; }
.task-card ol li { margin-bottom: .2rem; }

.term-info-card {
    background: var(--c-brand);
    color: #fff;
    border-radius: var(--r-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.term-info-card-cell { min-width: 0; }
.term-info-card-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-accent-soft);
    font-weight: 700;
    margin-bottom: .25rem;
}
.term-info-card-value {
    font-family: var(--f-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
}
.term-info-card-hint {
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    margin-top: .25rem;
}

@media (max-width: 600px) {
    .term-info-card { grid-template-columns: 1fr; gap: 1rem; padding: 1.15rem; }
    .term-info-card-value { font-size: 1.4rem; }
}

/* Step accordion */
.step {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--sh-1);
    position: relative;
}
.step-head {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: 1rem;
}
.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-brand);
    color: #fff;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.step-num.optional { background: var(--c-surface-2); color: var(--c-muted); }
.step-title {
    flex: 1;
    min-width: 0;
}
.step-title h3 {
    font-size: 1.1rem;
    color: var(--c-brand);
    margin-bottom: .25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.step-title h3 .badge { font-size: .65rem; padding: .15rem .5rem; }
.step-title p {
    font-size: .88rem;
    color: var(--c-text-soft);
    margin: 0;
    line-height: 1.55;
}

.example-box {
    background: var(--c-surface-2);
    border-left: 3px solid var(--c-accent);
    padding: .75rem 1rem;
    border-radius: var(--r-sm);
    margin-top: .75rem;
    font-size: .85rem;
    color: var(--c-text-soft);
    line-height: 1.6;
}
.example-box strong {
    color: var(--c-accent);
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .25rem;
    font-weight: 700;
}

.char-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    color: var(--c-muted);
    margin-top: .35rem;
}
.char-counter.warn { color: var(--c-warn); }
.char-counter.ok { color: var(--c-success); }

.upload-tips {
    margin-top: .75rem;
    padding: .85rem 1rem;
    background: var(--c-info-bg);
    border-radius: var(--r-md);
    font-size: .85rem;
    color: #1e40af;
    line-height: 1.65;
}
.upload-tips strong { display: block; margin-bottom: .35rem; font-size: .82rem; }
.upload-tips ul { margin: 0; padding-left: 1.25rem; }
.upload-tips a { color: #1e40af; font-weight: 600; }

/* Sticky bottom action bar */
.action-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 2px solid var(--c-border);
    margin: 1.5rem -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    display: flex;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
    z-index: 20;
    box-shadow: 0 -8px 24px rgba(15,23,42,.06);
}
.action-bar-hint {
    flex: 1;
    font-size: .82rem;
    color: var(--c-muted);
    min-width: 200px;
}
.action-bar-hint strong { color: var(--c-brand); }

@media (max-width: 900px) {
    .action-bar {
        margin: 1rem -1rem -1rem;
        padding: .85rem 1rem calc(.85rem + var(--bottombar-h));
    }
    .action-bar .btn { flex: 1; min-width: 0; }
    .action-bar-hint { width: 100%; flex: 0 0 100%; order: -1; }
}

/* AI helper inline (smaller version inside form) */
.ai-helper {
    background: linear-gradient(135deg, #fff 0%, var(--c-accent-bg) 100%);
    border: 1px dashed #fed7aa;
    border-radius: var(--r-md);
    padding: 1rem 1.15rem;
    margin-top: 1rem;
}
.ai-helper-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--c-accent-2);
}
.ai-helper-head .ic { width: 16px; height: 16px; }

/* Advanced details accordion */
.advanced-block {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    margin-bottom: 1rem;
    box-shadow: var(--sh-1);
    overflow: hidden;
}
.advanced-block > summary {
    list-style: none;
    cursor: pointer;
    padding: 1.15rem 1.5rem;
    transition: var(--t);
}
.advanced-block > summary::-webkit-details-marker { display: none; }
.advanced-block > summary:hover { background: var(--c-surface-2); }

.advanced-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.advanced-summary-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: var(--c-surface-2);
    color: var(--c-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.advanced-summary-icon .ic { width: 20px; height: 20px; }
.advanced-summary strong {
    display: block;
    font-family: var(--f-display);
    font-size: 1rem;
    color: var(--c-brand);
    line-height: 1.3;
}
.advanced-summary small {
    color: var(--c-muted);
    font-size: .82rem;
    line-height: 1.4;
}
.advanced-chevron {
    color: var(--c-muted);
    font-size: 1.5rem;
    transition: transform .2s;
}
.advanced-block[open] .advanced-chevron { transform: rotate(180deg); }

.advanced-body {
    padding: .5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--c-border);
}

/* details textarea (ai-helper içinde) */
details > summary { outline: none; }
details > textarea { width: 100%; padding: .65rem 1rem; border: 1px solid var(--c-border-2); border-radius: var(--r-md); font-family: inherit; font-size: .9rem; }

/* Image step tabs */
.img-tabs {
    display: flex;
    gap: .25rem;
    background: var(--c-surface-2);
    padding: .25rem;
    border-radius: var(--r-md);
    margin-bottom: 1rem;
}
.img-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem .85rem;
    border: none;
    background: transparent;
    color: var(--c-text-soft);
    border-radius: var(--r-sm);
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: var(--t);
}
.img-tab:hover:not(:disabled):not(.active) { color: var(--c-brand); }
.img-tab.active {
    background: var(--c-surface);
    color: var(--c-brand);
    box-shadow: var(--sh-1);
}
.img-tab:disabled { opacity: .4; cursor: not-allowed; }
.img-tab .ic { width: 16px; height: 16px; }

.img-tab-content { display: none; }
.img-tab-content.active { display: block; }

@media (max-width: 500px) {
    .img-tab { font-size: .78rem; padding: .55rem .5rem; }
    .img-tab span { display: none; }
}

/* Image preview after AI generation */
.img-gen-preview {
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--c-surface);
}
.img-gen-preview img {
    width: 100%;
    height: auto;
    display: block;
}
.img-gen-preview-foot {
    padding: .75rem 1rem;
    background: var(--c-success-bg);
    color: var(--c-success);
    font-size: .82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.img-gen-preview-cost {
    margin-left: auto;
    font-family: monospace;
    background: rgba(21,128,61,.15);
    padding: .2rem .5rem;
    border-radius: var(--r-sm);
}

/* Stats table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.stats-table th {
    background: var(--c-surface-2);
    padding: .85rem 1rem;
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--c-border);
}
.stats-table td {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
.stats-table tbody tr:hover { background: var(--c-surface-2); }
.stats-table tbody tr:last-child td { border-bottom: none; }

/* Day chart (basit bar) */
.day-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .75rem;
    align-items: end;
    height: 220px;
    padding: 1rem .5rem 0;
}
.day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.day-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-height: 0;
}
.day-bar-val {
    font-size: .7rem;
    font-weight: 700;
    color: var(--c-brand);
    margin-bottom: .25rem;
    white-space: nowrap;
}
.day-bar {
    width: 100%;
    max-width: 56px;
    background: linear-gradient(180deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    min-height: 4px;
    transition: height .4s ease;
}
.day-label {
    margin-top: .5rem;
    font-size: .72rem;
    color: var(--c-muted);
    text-align: center;
    line-height: 1.3;
}
.day-label span {
    display: block;
    font-size: .65rem;
    color: var(--c-muted);
}

@media (max-width: 600px) {
    .day-chart { height: 160px; gap: .35rem; padding: .5rem .25rem 0; }
    .day-bar-val { font-size: .6rem; }
    .day-label { font-size: .65rem; }
}

/* Dictionary promo (Yakında bilgisi) */
.dict-promo {
    margin-top: 2rem;
    background: linear-gradient(135deg, var(--c-surface) 0%, var(--c-surface-2) 100%);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.dict-promo-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    background: var(--c-accent-bg);
    color: var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dict-promo-icon .ic { width: 28px; height: 28px; }
.dict-promo-text { flex: 1; min-width: 220px; }
.dict-promo-text h3 { font-size: 1.1rem; margin-bottom: .25rem; }
.dict-promo-text p { font-size: .9rem; margin: 0; }
.dict-promo-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 600px) {
    .dict-promo { padding: 1.25rem; }
    .dict-promo-actions { width: 100%; }
    .dict-promo-actions .btn { flex: 1; }
}

/* Empty state */
.empty {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--c-surface);
    border: 2px dashed var(--c-border-2);
    border-radius: var(--r-lg);
}

.empty .ic { width: 48px; height: 48px; margin: 0 auto 1rem; color: var(--c-muted); opacity: .6; }
.empty h2 { margin-bottom: .5rem; }
.empty p { color: var(--c-muted); margin-bottom: 1rem; }

/* ============================================================
   TERM DETAIL
   ============================================================ */
.term-detail {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.crumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--c-muted);
    margin-bottom: 1.25rem;
}

.crumb a { color: var(--c-brand); text-decoration: none; font-weight: 500; }
.crumb a:hover { text-decoration: underline; }

.term-detail-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: var(--sh-2);
}

.term-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
}

.term-detail-img {
    background: linear-gradient(135deg, var(--c-surface-2) 0%, #d6d2c8 100%);
    min-height: 400px;
}

.term-detail-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.term-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: var(--c-muted);
}

.term-detail-empty .ic { width: 64px; height: 64px; opacity: .4; margin-bottom: .75rem; }

.term-detail-content { padding: 2rem 2.25rem; }

.term-detail-content h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: .25rem;
}

.term-detail-tr {
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--c-accent);
    margin-bottom: 1rem;
}

.term-detail-de {
    color: var(--c-text-soft);
    font-size: .92rem;
    margin-bottom: .75rem;
}

.term-meta-line {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    font-size: .85rem;
    color: var(--c-muted);
}

.term-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--c-border);
}

.term-section h2 { font-size: 1.1rem; margin-bottom: .5rem; }

.prose { color: var(--c-text-soft); font-size: 1rem; line-height: 1.7; }

.prompt-block {
    background: var(--c-surface-2);
    padding: 1rem 1.15rem;
    border-radius: var(--r-md);
    border-left: 3px solid var(--c-accent);
    font-size: .88rem;
    white-space: pre-wrap;
    line-height: 1.6;
    font-family: 'SF Mono', Menlo, monospace;
}

@media (max-width: 900px) {
    .term-detail-grid { grid-template-columns: 1fr; }
    .term-detail-img, .term-detail-empty { min-height: 240px; }
    .term-detail-content { padding: 1.5rem; }
}

/* ============================================================
   AI PROMPT TOOL
   ============================================================ */
.ai-box {
    background: linear-gradient(135deg, #fff 0%, var(--c-accent-bg) 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--r-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--sh-1);
}

.ai-box-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
}

.ai-box-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-box-icon .ic { width: 22px; height: 22px; }

.ai-box-head h2 { margin: 0; font-size: 1.1rem; }
.ai-box-head p { margin: 0; font-size: .82rem; }

.ai-form {
    display: grid;
    gap: .75rem;
}

.ai-form textarea {
    width: 100%;
    padding: .85rem 1rem;
    border: 1px solid var(--c-border-2);
    border-radius: var(--r-md);
    font-family: inherit;
    background: #fff;
    resize: vertical;
    min-height: 80px;
}

.ai-form-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.ai-form-row select {
    padding: .65rem 1rem;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border-2);
    background: #fff;
    min-width: 160px;
}

.ai-result {
    margin-top: 1rem;
    padding: 1.15rem;
    background: #fff;
    border-radius: var(--r-md);
    border-left: 3px solid var(--c-accent);
    font-size: .9rem;
    line-height: 1.65;
    position: relative;
}

.ai-result-actions {
    display: flex;
    gap: .5rem;
    margin-top: .85rem;
}

.ai-result.hidden { display: none; }

/* ============================================================
   TABLE & LIST
   ============================================================ */
.list-cards {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.list-item {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--sh-1);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    transition: var(--t);
}

.list-item:hover { box-shadow: var(--sh-2); border-color: var(--c-border-2); }
.list-item-alert { border-color: var(--c-warn); background: #fffbeb; }

.list-item-main { flex: 1; min-width: 200px; }
.list-item-title {
    font-family: var(--f-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--c-brand);
    margin-bottom: .2rem;
    line-height: 1.3;
}
.list-item-sub {
    color: var(--c-accent);
    font-size: .85rem;
    font-weight: 500;
}
.list-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .82rem;
    color: var(--c-muted);
    margin-top: .35rem;
}
.list-item-meta-item { display: inline-flex; align-items: center; gap: .35rem; }

.list-item-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.list-item-note {
    width: 100%;
    background: var(--c-warn-bg);
    padding: .75rem 1rem;
    border-radius: var(--r-md);
    font-size: .85rem;
    color: #92400e;
    margin-top: .5rem;
}
.list-item-note strong { display: block; margin-bottom: .25rem; }
.list-item-note-warn {
    border: 1.5px solid #f59e0b;
    font-weight: 600;
}

/* Filter chips */
.chips {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    margin: -.25rem -.25rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { height: 4px; }
.chips::-webkit-scrollbar-thumb { background: var(--c-border-2); border-radius: 4px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem 1rem;
    border-radius: var(--r-full);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text-soft);
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--t);
}

.chip:hover { border-color: var(--c-brand); color: var(--c-brand); }
.chip.active { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.chip-count {
    background: rgba(255,255,255,.2);
    padding: 0 .4rem;
    border-radius: var(--r-full);
    font-size: .7rem;
    font-weight: 700;
}

/* ============================================================
   PANEL DASHBOARD COMPONENTS
   ============================================================ */
.welcome-card {
    background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-2) 60%, var(--c-brand-3) 100%);
    color: #fff;
    border-radius: var(--r-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(194,65,12,.25), transparent 50%);
}

.welcome-content { position: relative; max-width: 600px; }
.welcome-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--c-accent-soft);
    font-weight: 600;
    margin-bottom: .5rem;
}
.welcome-card h2 {
    color: #fff;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: .5rem;
}
.welcome-card p {
    color: rgba(255,255,255,.85);
    font-size: .95rem;
    margin: 0;
}

.welcome-actions { position: relative; display: flex; gap: .5rem; }
.welcome-actions .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.25); }
.welcome-actions .btn:hover { background: rgba(255,255,255,.25); }

.section-title {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-muted);
    margin: 2rem 0 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.section-title::before {
    content: '';
    width: 16px;
    height: 2px;
    background: var(--c-accent);
}

/* Action card grid (admin home) */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.action-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--sh-1);
    transition: var(--t);
    display: block;
    position: relative;
    overflow: hidden;
}

.action-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--c-brand), var(--c-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}

.action-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.action-card:hover::after { transform: scaleX(1); }

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    background: var(--c-surface-2);
    color: var(--c-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}
.action-icon .ic { width: 24px; height: 24px; }
.action-card h3 { font-size: 1.05rem; margin-bottom: .35rem; color: var(--c-brand); }
.action-card p { font-size: .85rem; color: var(--c-muted); margin: 0; }

.action-badge {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: var(--c-bg);
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
}

.auth-side {
    background: linear-gradient(160deg, var(--c-brand) 0%, var(--c-brand-2) 50%, #0c2a4d 100%);
    color: #fff;
    padding: 3rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 20%, rgba(194,65,12,.2), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.05), transparent 50%);
}

.auth-side-content { position: relative; max-width: 440px; }
.auth-side .brand { color: #fff; margin-bottom: 2rem; }
.auth-side .brand-mark { background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 100%); }
.auth-side .brand-text strong { color: #fff; }
.auth-side .brand-text small { color: var(--c-accent-soft); }

.auth-side h1 {
    color: #fff;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 1rem;
}

.auth-side p { color: rgba(255,255,255,.8); font-size: 1.05rem; margin-bottom: 2rem; line-height: 1.7; }

.auth-features { list-style: none; padding: 0; }
.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .65rem 0;
    color: rgba(255,255,255,.9);
    font-size: .95rem;
}
.auth-features li .ic {
    color: var(--c-accent-soft);
    width: 20px;
    height: 20px;
    margin-top: .15rem;
    flex-shrink: 0;
}

.auth-form-wrap {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-form-card h2 { font-size: 1.5rem; margin-bottom: .35rem; }
.auth-form-card .form-hint-text { color: var(--c-muted); margin-bottom: 1.5rem; font-size: .95rem; }

.auth-foot {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .88rem;
    color: var(--c-muted);
}
.auth-foot a { color: var(--c-brand); text-decoration: none; font-weight: 600; }

.demo-creds {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--c-surface-2);
    border-radius: var(--r-md);
    border: 1px dashed var(--c-border-2);
    font-size: .82rem;
}
.demo-creds strong { color: var(--c-brand); display: block; margin-bottom: .35rem; font-family: var(--f-display); }
.demo-creds code {
    background: var(--c-surface);
    padding: .15rem .4rem;
    border-radius: 4px;
    font-size: .78rem;
    color: var(--c-accent);
}

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-form-wrap { padding: 2rem 1.5rem; min-height: 100vh; }
}

/* ============================================================
   REVIEW PAGE (admin)
   ============================================================ */
.review-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.review-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: var(--c-surface-2);
    border-radius: var(--r-md);
    margin-bottom: 1.25rem;
}

.meta-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-muted);
    font-weight: 600;
    display: block;
    margin-bottom: .15rem;
}
.meta-value { font-weight: 600; color: var(--c-brand); font-size: .9rem; }

.review-img {
    border-radius: var(--r-md);
    overflow: hidden;
    margin: 1rem 0;
    border: 1px solid var(--c-border);
}
.review-img img { width: 100%; height: auto; }

.review-actions-card { position: sticky; top: calc(var(--appbar-h) + 1rem); }
.review-actions-card h2 { margin-bottom: 1rem; }

.review-actions-stack { display: flex; flex-direction: column; gap: .5rem; }

@media (max-width: 900px) {
    .review-grid { grid-template-columns: 1fr; }
    .review-actions-card { position: static; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal[hidden] { display: none; }
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
}

.modal-dialog {
    position: relative;
    background: var(--c-surface);
    border-radius: var(--r-xl);
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--sh-3);
    animation: modalIn .22s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-x {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--c-surface-2);
    border-radius: var(--r-full);
    color: var(--c-text-soft);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-x:hover { background: var(--c-danger-bg); color: var(--c-danger); }

.modal-body { padding: 2rem; }
.modal-body img {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    border-radius: var(--r-md);
    margin-bottom: 1.25rem;
}

.modal-body h2 { margin-bottom: .35rem; }
.modal-footer { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--c-border); display: flex; gap: .5rem; flex-wrap: wrap; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--c-brand);
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: var(--r-md);
    font-size: .9rem;
    box-shadow: var(--sh-3);
    z-index: 300;
    opacity: 0;
    transition: var(--t);
    max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: var(--c-danger); }
.toast.toast-success { background: var(--c-success); }

@media (max-width: 900px) {
    .toast { bottom: calc(var(--bottombar-h) + 1rem); }
}

/* ============================================================
   UTILITY
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.divider { height: 1px; background: var(--c-border); margin: 1.5rem 0; border: none; }

@media (max-width: 600px) {
    body { font-size: 14px; }
    .card { padding: 1.15rem; }
    .stat { padding: 1rem; }
    .stat-num { font-size: 1.5rem; }
    .term-grid { grid-template-columns: 1fr; }
    .hero { padding: 2rem 1rem; }
    .dict-shell { padding: 0 1rem 2rem; }
}
