/* LensCraft Production — admin panel
   Matches the Admin Desktop / Admin Mobile frames in Figma. */

:root {
    --bg: #0B0B0B;
    --surface: #141414;
    --surface-2: #1A1A1A;
    --border: #2A2A2A;
    --text: #F5F5F5;
    --muted: #9A9A9A;
    --accent: #C4A35A;
    --accent-soft: rgba(196, 163, 90, 0.14);
    --success: #5A9E6F;
    --danger: #C45A5A;
    --radius: 4px;
    --radius-lg: 8px;
    --sidebar-w: 248px;
    --topbar-h: 76px;
    --font-display: 'Syne', 'Segoe UI', sans-serif;
    --font-body: 'Outfit', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }

a { color: inherit; text-decoration: none; }

.mono { font-family: 'Consolas', 'SFMono-Regular', monospace; font-size: 13px; }
.right { text-align: right; }
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); font-size: 13px; padding: 22px 4px; }

/* ------------------------------------------------------------------ shell */
.admin { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-display);
    font-weight: 700;
}

.sidebar__brand small {
    display: block;
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.24em;
    color: var(--accent);
    font-weight: 400;
}

.sidebar__nav { display: flex; flex-direction: column; padding: 14px 12px; gap: 2px; overflow-y: auto; }

.sidebar__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 14px;
    border-left: 2px solid transparent;
}

.sidebar__nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar__nav a.is-active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }

.dot {
    font-style: normal;
    background: var(--accent);
    color: #0B0B0B;
    font-size: 11px;
    border-radius: 999px;
    padding: 1px 7px;
}

.sidebar__user {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 16px 18px;
    border-top: 1px solid var(--border);
}

.sidebar__user strong { display: block; font-size: 13px; }
.sidebar__user small { color: var(--muted); font-size: 12px; }
.sidebar__user a { color: var(--accent); }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 700;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    background: rgba(11, 11, 11, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__title h1 { font-size: 22px; }
.topbar__title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar__search { margin-left: auto; }

.topbar__search input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 9px 14px;
    width: 220px;
    font-family: var(--font-body);
}

.topbar__search input:focus { outline: none; border-color: var(--accent); }

.topbar__burger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    padding: 7px 11px;
    cursor: pointer;
}

.content { padding: 26px; display: flex; flex-direction: column; gap: 20px; }

/* ------------------------------------------------------------------ cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.card--flush { padding: 0; overflow: hidden; }

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.card__head--pad { padding: 20px 22px 0; }
.card__head h2 { font-size: 17px; }

.card__label {
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--muted);
    font-weight: 500;
    margin: 0 0 16px;
}

.cols { display: grid; gap: 20px; align-items: start; }
.cols--2-1 { grid-template-columns: 2fr 1fr; }
.cols--1-1 { grid-template-columns: 1fr 1fr; }
.cols--1-1-1 { grid-template-columns: repeat(3, 1fr); }
.stack { display: flex; flex-direction: column; gap: 20px; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat__label { font-size: 11px; letter-spacing: 0.16em; color: var(--muted); }
.stat__value { display: block; font-family: var(--font-display); font-size: 34px; margin: 6px 0 4px; }
.stat__meta { font-size: 12px; color: var(--muted); }
.card.mini .stat__value { font-size: 26px; }

/* ----------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.table td small { display: block; color: var(--muted); font-size: 12px; }
.table--wide td, .table--wide th { padding-inline: 22px; }

.cell-media { display: flex; align-items: center; gap: 12px; }

.thumb {
    width: 54px;
    height: 36px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #222, #131313) center/cover;
    border: 1px solid var(--border);
    flex: none;
}

.thumb--video { display: grid; place-items: center; color: var(--accent); font-size: 12px; }
.thumb--logo { background-size: contain; background-repeat: no-repeat; background-position: center; background-color: var(--surface-2); }

.actions { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }
.actions form { display: inline; }

.link { color: var(--accent); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link--muted { color: var(--muted); }
.link--danger { color: var(--danger); }

/* ----------------------------------------------------------------- badges */
.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 11px;
    letter-spacing: 0.06em;
    border: 1px solid var(--border);
    color: var(--muted);
}

.badge--accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.badge--success { background: rgba(90, 158, 111, 0.14); border-color: var(--success); color: var(--success); }
.badge--danger { background: rgba(196, 90, 90, 0.14); border-color: var(--danger); color: var(--danger); }

.tag {
    display: inline-block;
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px 8px;
    margin: 0 4px 4px 0;
}

.tags { max-width: 210px; }

/* --------------------------------------------------------------- toolbars */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--pad { padding: 12px 16px; border-bottom: 1px solid var(--border); }

.chip {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--muted);
}

.chip:hover { color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ----------------------------------------------------------------- forms */
.field { display: block; margin-bottom: 16px; }
.field > span, .field__label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 7px;
}

.field__label { margin-top: 6px; }

.field input, .field select, .field textarea,
.repeater input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 11px 13px;
}

.field input:focus, .field select:focus, .field textarea:focus, .repeater input:focus {
    outline: none;
    border-color: var(--accent);
}

.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn--primary { background: var(--accent); color: #0B0B0B; }
.btn--primary:hover { background: #D4B571; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: rgba(196, 90, 90, 0.12); }
.btn--sm { padding: 9px 16px; font-size: 13px; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.delete-form { margin-top: 4px; }

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.switch-row:last-of-type { border-bottom: 0; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch i {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    position: relative;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.switch i::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--muted);
    transition: transform 0.18s ease, background 0.18s ease;
}

.switch input:checked + i { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); background: var(--accent); }

.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv--row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; margin-top: 16px; }
.kv--row li { flex-direction: column; gap: 2px; border-bottom: 0; }

/* ------------------------------------------------------------- repeaters */
.repeater { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.repeater__row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: center; }
.repeater__row--2 { grid-template-columns: 2fr 1fr auto; }
.repeater__row--stack { grid-template-columns: 1fr 2fr auto; }

.quote-total { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.quote-total strong { color: var(--accent); font-size: 16px; }

/* ---------------------------------------------------------------- pickers */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 18px; }

.picker__item {
    position: relative;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2) center/cover;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.picker__item input { position: absolute; opacity: 0; }
.picker__item.is-selected, .picker__item:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.picker__none { margin: auto; color: var(--muted); font-size: 12px; }

.picker__name {
    font-size: 10px;
    color: var(--text);
    background: rgba(11, 11, 11, 0.82);
    padding: 3px 6px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------------------- listings */
.list { list-style: none; margin: 0; padding: 0; }

.list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.list li:last-child { border-bottom: 0; }
.list strong { display: block; font-size: 14px; }
.list span { color: var(--muted); font-size: 12px; }
.list time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.section-list { list-style: none; margin: 0; padding: 0; }

.section-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.section-list li:last-child { border-bottom: 0; }
.section-list strong { display: block; font-size: 14px; }
.section-list small { color: var(--muted); font-size: 12px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; }
.timeline strong { font-size: 13px; }
.timeline em { color: var(--muted); font-style: normal; font-size: 13px; }
.timeline time { display: block; color: var(--muted); font-size: 12px; }

.dot-mark {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent);
    margin-top: 7px;
    flex: none;
}

.dot-mark--open { background: transparent; border: 1px solid var(--muted); }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rank li:last-child { border-bottom: 0; }
.rank__no { color: var(--accent); font-family: var(--font-display); width: 20px; }
.rank strong { display: block; font-size: 13px; }
.rank small { color: var(--muted); font-size: 12px; }

.meter { list-style: none; margin: 0; padding: 0; }
.meter li { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 12px; padding: 9px 0; font-size: 13px; }
.meter i { display: block; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter b { display: block; height: 100%; background: var(--accent); }
.meter strong { text-align: right; color: var(--muted); font-weight: 400; }

/* ------------------------------------------------------------------ chart */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 12px; }
.chart__bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 8px; }
.chart__bar span { width: 100%; background: linear-gradient(180deg, var(--accent), rgba(196, 163, 90, 0.35)); border-radius: 3px 3px 0 0; }
.chart__bar small { color: var(--muted); font-size: 11px; }

/* ------------------------------------------------------------------ inbox */
.inbox { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.inbox__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.inbox__list ul { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.inbox__list li { border-bottom: 1px solid var(--border); }
.inbox__list li a { display: block; padding: 14px 18px; }
.inbox__list li:hover { background: var(--surface-2); }
.inbox__list li.is-active { background: var(--accent-soft); border-left: 2px solid var(--accent); }
.inbox__list li.is-unread strong::before { content: '●'; color: var(--accent); font-size: 10px; margin-right: 6px; }
.inbox__row { display: flex; justify-content: space-between; gap: 10px; }
.inbox__row time { color: var(--muted); font-size: 11px; }
.inbox__subject { display: block; font-size: 13px; margin-top: 2px; }
.inbox__preview { display: block; color: var(--muted); font-size: 12px; }

.inbox__readhead { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.inbox__readhead h2 { font-size: 19px; }
.inbox__readhead p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.inbox__readhead a { color: var(--accent); }

.message-body { padding: 20px 0; line-height: 1.8; }

.reply-list { list-style: none; margin: 0 0 18px; padding: 0; }
.reply-list li { border-left: 2px solid var(--accent); padding: 8px 0 8px 14px; margin-bottom: 12px; }
.reply-list time { color: var(--muted); font-size: 12px; margin-left: 8px; }
.reply-list p { margin: 6px 0 0; color: var(--muted); }

.reply-form { border-top: 1px solid var(--border); padding-top: 18px; }

/* ------------------------------------------------------------- dropzone */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }

.tab {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
}

.tab.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.dropzone {
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 46px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { font-family: var(--font-display); font-size: 17px; }
.dropzone span { color: var(--muted); font-size: 13px; }

.upload-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

.upload-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: var(--bg);
}

.upload-item__head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.upload-item__head span { color: var(--muted); font-size: 12px; }
.upload-item__bar { height: 6px; background: var(--surface-2); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.upload-item__bar b { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.upload-item.is-done .upload-item__bar b { background: var(--success); }
.upload-item.is-failed .upload-item__bar b { background: var(--danger); }

.media-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.media-upload input[type="file"] { color: var(--muted); font-size: 13px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.media-card {
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.media-card__thumb { aspect-ratio: 4 / 3; background: var(--surface-2) center/cover; display: grid; place-items: center; }
.media-card__doc { color: var(--accent); font-family: var(--font-display); }
.media-card figcaption { padding: 12px 14px; }
.media-card figcaption strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card figcaption small { color: var(--muted); font-size: 12px; }
.media-card__actions { display: flex; justify-content: space-between; padding: 0 14px 12px; }

.preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; background: var(--bg); }
.preview__eyebrow { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.preview h3 { font-size: 22px; margin-bottom: 8px; }
.preview p { color: var(--muted); font-size: 13px; margin: 0; }

.player__empty { display: grid; place-items: center; height: 100%; color: var(--muted); }

/* ------------------------------------------------------------------ flash */
.flash {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
}

.flash--success { border-left-color: var(--success); }
.flash--error { border-left-color: var(--danger); }

/* ------------------------------------------------------------------- auth */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(70% 60% at 50% 0%, rgba(196, 163, 90, 0.1), transparent 70%), var(--bg); }
.auth__wrap { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 38px 32px;
    text-align: center;
}

.auth-card img { margin: 0 auto 18px; }
.auth-card h1 { font-size: 26px; }
.auth-card__sub { color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.auth-card .field { text-align: left; }
.auth-card__row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; margin-bottom: 20px; }
.auth-card__row a { color: var(--accent); }
.auth-card__foot { color: var(--muted); font-size: 12px; margin: 18px 0 0; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
    .cols--2-1, .cols--1-1, .cols--1-1-1 { grid-template-columns: 1fr; }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .inbox { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .sidebar.is-open { transform: translateX(0); }
    .topbar__burger { display: inline-flex; }
    .topbar__search { display: none; }
    .content { padding: 16px; }
    .field-row, .kv--row, .repeater__row, .repeater__row--2, .repeater__row--stack { grid-template-columns: 1fr; }
    .table { display: block; overflow-x: auto; white-space: nowrap; }
}
