/* EasyLuckyDraw — admin UI.
   Warm banquet palette: ink, cream, brass gold, jade and vermilion. */

:root {
    --ink: #161512;
    --ink-2: #242119;
    --ink-3: #373228;
    --cream: #f6f3ec;
    --paper: #fffdf8;
    --gold: #c8952f;
    --gold-2: #e8c36a;
    --gold-soft: #f4e7c6;
    --red: #a63a2e;
    --jade: #2f7d6d;
    --muted: #746c5d;
    --line: #e5dfd1;
    --shadow: 0 12px 40px rgba(30, 24, 12, .08);
    --shadow-sm: 0 4px 16px rgba(30, 24, 12, .06);
    --radius: 16px;
    --radius-sm: 11px;
    --font-sans: "Noto Sans HK", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Noto Serif HK", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif { font-family: var(--font-serif); letter-spacing: -.01em; }
a { color: var(--ink); }
a:hover { color: var(--gold); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { border-radius: 10px; font-weight: 600; font-size: 14px; padding: .55rem .95rem; }
.btn-sm { padding: .35rem .7rem; font-size: 13px; border-radius: 8px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1a1407; }
.btn-gold:hover, .btn-gold:focus { background: #b98624; border-color: #b98624; color: #120d04; }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #000; border-color: #000; }
.btn-outline-dark { border-color: #cdc4b2; color: var(--ink); background: transparent; }
.btn-outline-dark:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-icon {
    width: 38px; height: 38px; display: inline-grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
}
.link-arrow { color: var(--muted); font-weight: 600; text-decoration: none; font-size: 13px; }
.link-arrow:hover { color: var(--gold); }

/* ── App shell ───────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 252px; flex: 0 0 252px; background: var(--ink); color: #f5efe2;
    display: flex; flex-direction: column; padding: 20px 16px;
    position: sticky; top: 0; height: 100vh; z-index: 1030;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; padding: 4px 8px 18px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: #241a05; font-size: 19px;
    box-shadow: 0 8px 22px rgba(200, 149, 47, .28);
}
.brand-mark-lg { width: 58px; height: 58px; font-size: 27px; border-radius: 17px; }
.brand-text strong { display: block; font-family: var(--font-serif); font-size: 18px; letter-spacing: .01em; }
.brand-text small { color: #b9b09b; font-size: 11px; letter-spacing: .06em; }

.workspace-chip {
    display: flex; align-items: center; gap: 8px; padding: 9px 11px; margin: 2px 2px 22px;
    border: 1px solid #383328; border-radius: 10px; color: #d8cfba; font-size: 12.5px;
    background: #1d1a14; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.workspace-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 3px rgba(232, 195, 106, .14); }

.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-label { color: #7f7664; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; padding: 0 10px 6px; }
.side-link {
    display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
    color: #cfc6b3; text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.side-link i { font-size: 16px; opacity: .9; }
.side-link:hover { background: #211d16; color: #fff; }
.side-link.is-active { background: #2b261b; color: #fff; box-shadow: inset 3px 0 0 var(--gold); }

.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 10px 8px 0; border-top: 1px solid #2c2820; }
.tiny-label { color: #7f7664; font-size: 10.5px; margin-right: 2px; }
.lang-btn {
    background: transparent; border: 1px solid #3a3428; color: #a79d89; border-radius: 7px;
    font-size: 11px; padding: 2px 7px; font-weight: 600;
}
.lang-btn.is-on { background: var(--gold); border-color: var(--gold); color: #1c1505; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.app-topbar {
    display: flex; align-items: center; gap: 14px; padding: 16px 30px;
    border-bottom: 1px solid var(--line); background: rgba(246, 243, 236, .86);
    backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 1020;
}
.topbar-title { min-width: 0; }
.topbar-title .eyebrow { display: block; }
.topbar-title h1 { font-size: 22px; margin: 0; line-height: 1.2; }
.topbar-user { margin-left: auto; }
.user-chip {
    display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line);
    border-radius: 12px; padding: 6px 12px 6px 7px; color: var(--ink); box-shadow: var(--shadow-sm);
}
.user-chip:hover { border-color: #d3c8b1; }
.avatar {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: var(--ink); color: var(--gold-2); font-weight: 700; font-size: 12.5px;
}
.user-meta { text-align: left; line-height: 1.2; }
.user-meta strong { display: block; font-size: 12.5px; }
.user-meta small { color: var(--muted); font-size: 10.5px; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.dropdown-item { border-radius: 8px; font-size: 13px; padding: 8px 10px; }
.dropdown-item i { width: 17px; display: inline-block; }

.app-content { padding: 28px 30px 48px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ── Page heading / panels ───────────────────────────────────────────────── */
.eyebrow { color: var(--gold); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { font-size: 30px; margin: 3px 0 0; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel-head h3 { font-size: 19px; margin: 2px 0 0; }
.panel-tight { padding: 0; overflow: hidden; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); }
.stat-card strong { display: block; font-family: var(--font-serif); font-size: 27px; line-height: 1.1; }
.stat-card span:not(.stat-icon) { color: var(--muted); font-size: 12px; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: 0 0 42px; }
.stat-icon.gold { background: var(--gold-soft); color: #8a6417; }
.stat-icon.jade { background: #dcefe9; color: var(--jade); }
.stat-icon.red { background: #f4dfdb; color: var(--red); }
.stat-icon.ink { background: #e7e2d7; color: var(--ink); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-clean { margin: 0; }
.table-clean thead th {
    border-bottom: 1px solid var(--line); border-top: 0; color: var(--muted);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
    padding: 9px 12px; white-space: nowrap;
}
.table-clean tbody td { border-bottom: 1px solid #efe9dd; padding: 12px; vertical-align: middle; }
.table-clean tbody tr:last-child td { border-bottom: 0; }
.table-clean tbody tr:hover { background: #fbf7ed; }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.muted { color: var(--muted); }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 0; flex-wrap: wrap; }

/* ── Pills / badges ──────────────────────────────────────────────────────── */
.pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
    background: #ece6d8; color: #6b6353; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pill-live { background: #d9efe8; color: #1f6a5b; }
.pill-done { background: #e6e2d8; color: #5b5547; }
.pill-soft { background: var(--gold-soft); color: #7b5b11; }
.pill-red { background: #f6e0dc; color: #8d2f24; }
.pill-jade { background: #d9efe8; color: #1f6a5b; }
.pill-ink { background: #e7e2d7; color: #3d372c; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-label { font-size: 12px; font-weight: 700; color: #4e483b; margin-bottom: 5px; }
.form-control, .form-select {
    border-radius: 10px; border-color: #dcd4c4; padding: .55rem .75rem; font-size: 14px;
    background-color: #fffdf9;
}
.form-control:focus, .form-select:focus {
    border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(200, 149, 47, .16); background-color: #fff;
}
.form-text { color: var(--muted); font-size: 11.5px; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #a09682; }
.input-icon .form-control { padding-left: 38px; }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }

/* ── Dropzone ────────────────────────────────────────────────────────────── */
.dropzone {
    border: 1.5px dashed #d3c8b1; border-radius: 14px; padding: 26px 18px; text-align: center;
    background: #fbf8f1; color: var(--muted); cursor: pointer; transition: all .16s ease;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--gold); background: #fdf6e4; color: #6d5318; }
.dropzone i { display: block; font-size: 26px; color: var(--gold); margin-bottom: 7px; }
.dropzone strong { display: block; color: var(--ink); font-size: 13.5px; }
.dropzone small { font-size: 11.5px; }
.dropzone.has-file { border-style: solid; border-color: #cdbf9d; background: #fdfaf2; }
.upload-preview { max-width: 100%; max-height: 150px; border-radius: 10px; border: 1px solid var(--line); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state.compact { padding: 26px 16px; }
.empty-state h2 { font-size: 24px; color: var(--ink); margin: 10px 0 6px; }
.empty-state p { margin: 0 0 16px; }
.empty-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto; background: var(--gold-soft); color: #8a6417; font-size: 23px; }

/* ── List toolbar / pickers ──────────────────────────────────────────────── */
.list-toolbar { display: flex; gap: 10px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-toolbar .input-icon { min-width: 220px; }
.table-link { color: var(--ink); text-decoration: none; }
.table-link:hover { color: var(--gold); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-card {
    position: relative; display: block; border: 1.5px solid var(--line); border-radius: 13px;
    padding: 14px 14px 13px 42px; background: #fffdf9; cursor: pointer; transition: all .15s ease;
}
.choice-card input { position: absolute; left: 14px; top: 17px; accent-color: var(--gold); }
.choice-card i { color: var(--gold); font-size: 17px; margin-right: 4px; }
.choice-card strong { display: block; font-size: 13.5px; }
.choice-card small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.choice-card.is-on { border-color: var(--gold); background: #fdf7e6; box-shadow: 0 0 0 3px rgba(200, 149, 47, .1); }
.form-note { background: #fbf6e9; border: 1px solid #efe3c6; border-radius: 14px; padding: 20px; height: 100%; }
.form-note i { color: var(--gold); font-size: 20px; }
.form-note h4 { font-size: 16px; margin: 8px 0 8px; }
.form-note p { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.form-foot { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.field-chip-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; background: #fbf7ed; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; }
.settings-switches { display: grid; gap: 7px; margin-top: 16px; padding: 12px 14px; background: #fbf7ed; border: 1px solid var(--line); border-radius: 11px; }
.settings-switches .form-check { margin: 0; }
.form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.prize-progress-list { display: flex; flex-direction: column; gap: 16px; }
.prize-progress { padding-bottom: 14px; border-bottom: 1px solid #f0eadf; }
.prize-progress:last-child { border-bottom: 0; padding-bottom: 0; }
.progress-line { height: 6px; background: #eee7d9; border-radius: 99px; margin-top: 9px; overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.quick-grid { display: flex; flex-direction: column; gap: 8px; }
.quick-card {
    display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line);
    border-radius: 12px; text-decoration: none; color: var(--ink); background: #fffdf9;
}
.quick-card:hover { border-color: #d8c9a8; background: #fdf8ea; color: var(--ink); }
.quick-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: #8a6417; font-size: 17px; }
.quick-card strong { display: block; font-size: 13px; }
.quick-card small { color: var(--muted); font-size: 11.5px; }
.copy-field { display: flex; gap: 7px; }
.copy-field .form-control { font-size: 12px; color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.mini-stats div { background: #f8f4ea; border-radius: 10px; padding: 10px; text-align: center; }
.mini-stats strong { display: block; font-family: var(--font-serif); font-size: 20px; }
.mini-stats span { font-size: 10.5px; color: var(--muted); }
.danger-zone { border-color: #efd6d0; }
.btn-outline-danger { border-color: #e3b7ae; color: #98382b; }
.btn-outline-danger:hover { background: #98382b; border-color: #98382b; color: #fff; }
.small { font-size: 12.5px; }

/* ── Style editor ───────────────────────────────────────────────────────── */
.style-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.style-tab {
    border: 1px solid var(--line); background: var(--paper); color: var(--muted);
    border-radius: 999px; padding: 7px 16px; font-size: 12.5px; font-weight: 700;
}
.style-tab:hover { border-color: #d6c8aa; color: var(--ink); }
.style-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.style-preview-panel { position: sticky; top: 92px; }
.style-preview {
    position: relative; border-radius: 18px; min-height: 300px; overflow: hidden;
    display: grid; place-items: center; text-align: center;
    background-color: var(--ld-bg-color, #0b1026);
    background-image: var(--ld-bg-image, none);
    background-size: cover; background-position: center;
    color: var(--ld-text, #fff); font-family: var(--ld-font, "Noto Sans HK", sans-serif);
}
.style-preview .preview-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, var(--ld-overlay, .55)); }
.preview-inner { position: relative; z-index: 2; padding: 32px 22px; }
.preview-prize {
    display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 800;
    letter-spacing: .12em; color: var(--ld-primary); border: 1px solid var(--ld-primary);
    background: rgba(0, 0, 0, .18);
}
.preview-name {
    display: block; margin: 16px 0 6px; font-size: clamp(30px, 4vw, 46px); font-weight: 900;
    color: var(--ld-primary); line-height: 1.1;
    text-shadow: 0 0 30px color-mix(in srgb, var(--ld-primary) 55%, transparent);
}
.preview-meta { color: var(--ld-text); opacity: .86; font-size: 14px; letter-spacing: .08em; }
.preview-confetti { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.preview-confetti i {
    position: absolute; width: 7px; height: 12px; border-radius: 2px; opacity: .85;
    background: var(--ld-accent); animation: previewFloat 3.6s ease-in-out infinite;
}
.preview-confetti i:nth-child(1) { left: 12%; top: 18%; background: var(--ld-primary); }
.preview-confetti i:nth-child(2) { left: 26%; top: 70%; animation-delay: .4s; }
.preview-confetti i:nth-child(3) { left: 52%; top: 12%; background: var(--ld-primary); animation-delay: .8s; }
.preview-confetti i:nth-child(4) { left: 72%; top: 62%; animation-delay: 1.2s; }
.preview-confetti i:nth-child(5) { left: 86%; top: 24%; background: var(--ld-primary); animation-delay: 1.6s; }
.preview-confetti i:nth-child(6) { left: 64%; top: 84%; animation-delay: 2s; }
@keyframes previewFloat {
    0%, 100% { transform: translateY(0) rotate(0); opacity: .7; }
    50% { transform: translateY(-14px) rotate(24deg); opacity: 1; }
}
.style-preview.is-minimal .preview-name { color: var(--ld-text); text-shadow: none; }
.style-preview.is-minimal .preview-prize { border-color: var(--ld-text); color: var(--ld-text); }
.style-preview.is-neon .preview-name { text-shadow: 0 0 8px var(--ld-primary), 0 0 32px var(--ld-accent); }
.style-preview.no-confetti .preview-confetti { display: none; }
@media (max-width: 991px) { .style-preview-panel { position: static; } }

/* ── Draw console ───────────────────────────────────────────────────────── */
.control-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.control-stage-wrap {
    position: relative; background: #050505; border-radius: 18px; overflow: hidden;
    aspect-ratio: 16 / 9; box-shadow: var(--shadow); border: 1px solid #201b12;
}
.control-stage-wrap iframe { width: 100%; height: 100%; border: 0; display: block; background: #050505; }
.control-side { display: flex; flex-direction: column; gap: 12px; }
.control-card { padding: 18px; margin-bottom: 0; }
.control-card h3 { font-size: 17px; }
.control-actions { display: grid; gap: 8px; margin-top: 16px; }
.btn-draw { font-size: 16px; padding: 14px; border-radius: 12px; }
.current-meta .mini-stats { margin-top: 14px; }
.control-winner { text-align: center; padding: 10px 0 4px; }
.control-winner-name { font-family: var(--font-serif); font-size: 26px; font-weight: 900; line-height: 1.2; }
.control-winner-sub { color: var(--muted); margin-top: 4px; }
.control-winner .winner-fields { justify-content: center; margin-top: 10px; }
.control-winner .winner-field { background: #f7f2e6; border-color: #eadfc8; color: #4f4738; }
.control-winner .winner-field em { color: #8b8170; }
.control-result-list { display: flex; flex-direction: column; gap: 9px; }
.control-result-row { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.control-result-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.control-note { display: flex; gap: 8px; color: var(--muted); font-size: 11.5px; padding: 2px 4px; }
.control-note i { color: var(--gold); }
.floating-actions { display: none; position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); gap: 8px; z-index: 20; background: rgba(15,12,8,.82); padding: 8px; border-radius: 14px; backdrop-filter: blur(8px); }
body.controls-hidden .control-main { grid-template-columns: minmax(0, 1fr); }
body.controls-hidden .control-side { display: none; }
body.controls-hidden .floating-actions { display: flex; }
body.controls-hidden .control-stage-wrap { aspect-ratio: auto; height: calc(100vh - 190px); }
body.controls-hidden .app-content { padding-bottom: 16px; }
.control-stage-wrap:fullscreen { border-radius: 0; }
.control-stage-wrap:fullscreen iframe { height: 100vh; }
.control-stage-wrap:fullscreen .floating-actions { display: flex; }
@media (max-width: 1100px) {
    .control-main { grid-template-columns: 1fr; }
    .control-side { order: 2; }
    .control-stage-wrap { aspect-ratio: 16 / 9; }
}
@media (max-width: 991px) {
    body.controls-hidden .control-stage-wrap { height: auto; aspect-ratio: 16 / 9; }
}



/* ── Flash ───────────────────────────────────────────────────────────────── */
.flash-area { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 11px 14px; font-size: 13.5px; border: 1px solid; }
.flash-success { background: #e7f4ef; border-color: #bfe3d6; color: #1f6555; }
.flash-error { background: #fbeae7; border-color: #efc9c2; color: #8d2f24; }
.flash .btn-close { font-size: 10px; }

/* ── Styled dialogs / toasts ─────────────────────────────────────────────── */
.app-dlg-backdrop {
    position: fixed; inset: 0; background: rgba(20, 17, 12, .55); backdrop-filter: blur(3px);
    display: grid; place-items: center; z-index: 2000; opacity: 0; transition: opacity .15s ease;
    padding: 18px;
}
.app-dlg-backdrop.show { opacity: 1; }
.app-dlg {
    width: min(430px, 100%); background: var(--paper); border-radius: 18px; padding: 24px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .3); transform: translateY(8px) scale(.98);
    transition: transform .18s ease;
}
.app-dlg-backdrop.show .app-dlg { transform: none; }
.app-dlg-body { display: flex; gap: 13px; align-items: flex-start; }
.app-dlg-icon {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 40px;
    font-weight: 800; font-size: 18px;
}
.app-dlg-icon-danger { background: #f6dfdb; color: var(--red); }
.app-dlg-icon-warning { background: var(--gold-soft); color: #8a6417; }
.app-dlg-icon-info { background: #dfeeea; color: var(--jade); }
.app-dlg-msg { margin: 4px 0 0; font-size: 14px; white-space: pre-line; }
.app-dlg-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.app-dlg-btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; font-size: 13px; }
.app-dlg-btn-ok { background: var(--ink); color: #fff; }
.app-dlg-btn-cancel { background: #eee8dc; color: #4f483a; }

.toast-stack { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 3000; }
.app-toast {
    display: flex; align-items: center; gap: 9px; background: var(--ink); color: #f6f1e6;
    border-radius: 11px; padding: 11px 15px; font-size: 13px; box-shadow: var(--shadow);
    max-width: 360px;
}
.app-toast.is-success i { color: #7bd3b8; }
.app-toast.is-error i { color: #ff9b8c; }
.app-toast i { font-size: 16px; }

/* ── Auth ────────────────────────────────────────────────────────────────── */
.auth-body { background: var(--ink); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr); min-height: 100vh; }
.auth-brand {
    position: relative; overflow: hidden; display: flex; align-items: center; padding: 60px;
    background: radial-gradient(1000px 700px at 20% 10%, #332a18 0%, #17140e 58%, #0d0b08 100%);
    color: #f7f1e3;
}
.auth-brand-inner { position: relative; z-index: 2; max-width: 470px; }
.auth-brand h1 { font-size: 46px; margin: 26px 0 8px; letter-spacing: -.02em; }
.auth-brand p { color: #c9bfaa; font-size: 15px; margin: 0 0 30px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; color: #ded4bf; font-size: 13.5px; }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points i { color: var(--gold-2); width: 20px; }
.auth-glow {
    position: absolute; width: 540px; height: 540px; border-radius: 50%; right: -180px; bottom: -220px;
    background: radial-gradient(circle, rgba(200, 149, 47, .28), transparent 65%);
}
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--cream); }
.auth-card { width: min(410px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: var(--shadow); }
.auth-head h2 { font-size: 25px; margin: 6px 0 5px; }
.auth-head p { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-form .form-label { margin-top: 12px; }
.auth-form .form-label:first-of-type { margin-top: 0; }
.auth-foot { color: #9d9484; font-size: 11px; margin-top: 18px; }

/* ── Utilities / responsive ─────────────────────────────────────────────── */
.sidebar-scrim { display: none; }
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
    .app-sidebar { position: fixed; left: -270px; transition: left .2s ease; }
    .app-sidebar.show { left: 0; }
    .sidebar-scrim { display: none; position: fixed; inset: 0; background: rgba(20, 17, 12, .45); z-index: 1025; }
    .app-sidebar.show + .sidebar-scrim { display: block; }
    .app-content { padding: 20px 18px 40px; }
    .app-topbar { padding: 12px 18px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr; }
    .page-head h2 { font-size: 24px; }
    .user-meta { display: none; }
    .panel { padding: 18px 16px; }
}
