/* ============================================================
   WARM HORIZON · v4.1
   Sidebar dọc + split-screen auth với illustration
   Palette ấm: terracotta + cream + navy
   Font: Inter (chuẩn giống bản gốc)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- LIGHT MODE — warm cream ---------- */
:root {
    --c-bg:         #f6f1e8;
    --c-bg2:        #efe7d6;
    --c-surface:    #fdfaf3;
    --c-surface2:   #f1ebdc;
    --c-surface3:   #e8e0cc;
    --c-input-bg:   #fdfaf3;

    --c-text:       #1f2937;
    --c-text2:      #374151;
    --c-text3:      #6b7280;
    --c-text4:      #9ca3af;

    /* Primary — terracotta ấm, không chói */
    --c-primary:          #b8532a;
    --c-primary-hover:    #9c4321;
    --c-primary-bg:       #fbe9df;
    --c-primary-border:   #f0c8b1;
    --c-primary-soft:     rgba(184, 83, 42, 0.07);
    --c-primary-ink:      #fdfaf3;

    /* Accent — navy đậm dùng cho text heading chính */
    --c-ink:        #1a2940;
    --c-ink-soft:   #334463;

    /* Status */
    --c-ok:         #4a7c59;
    --c-ok-bg:      #eaf2ec;
    --c-ok-border:  #bfd4c4;
    --c-err:        #a13c3c;
    --c-err-bg:     #f5e5e5;
    --c-err-border: #d9b5b5;
    --c-warn:       #a0661c;
    --c-warn-bg:    #f7ecd8;
    --c-warn-border:#e0c89d;

    --c-line:       #e0d6c0;
    --c-line2:      #c9bda0;
    --c-overlay:    rgba(26, 41, 64, 0.55);
    --c-shadow:     rgba(26, 41, 64, 0.06);
    --c-shadow2:    rgba(26, 41, 64, 0.12);
    --c-toggle-bg:  #d6c9ab;
    --c-toggle-dot: #fdfaf3;
}

/* ---------- DARK MODE — deep navy + warm accent ---------- */
[data-theme="dark"] {
    --c-bg:         #141a28;
    --c-bg2:        #0f1421;
    --c-surface:    #1c2434;
    --c-surface2:   #232c3f;
    --c-surface3:   #2d374d;
    --c-input-bg:   #151b28;

    --c-text:       #f1e9d8;
    --c-text2:      #d4cbb8;
    --c-text3:      #a69f8c;
    --c-text4:      #756f5f;

    --c-primary:          #e08862;
    --c-primary-hover:    #eba076;
    --c-primary-bg:       rgba(224, 136, 98, 0.12);
    --c-primary-border:   rgba(224, 136, 98, 0.35);
    --c-primary-soft:     rgba(224, 136, 98, 0.06);
    --c-primary-ink:      #141a28;

    --c-ink:        #f1e9d8;
    --c-ink-soft:   #d4cbb8;

    --c-ok:         #7ea88b;
    --c-ok-bg:      rgba(126, 168, 139, 0.12);
    --c-ok-border:  rgba(126, 168, 139, 0.3);
    --c-err:        #d47777;
    --c-err-bg:     rgba(212, 119, 119, 0.12);
    --c-err-border: rgba(212, 119, 119, 0.3);
    --c-warn:       #d4a05e;
    --c-warn-bg:    rgba(212, 160, 94, 0.12);
    --c-warn-border:rgba(212, 160, 94, 0.3);

    --c-line:       #2d374d;
    --c-line2:      #3f4a65;
    --c-overlay:    rgba(0, 0, 0, 0.7);
    --c-shadow:     rgba(0, 0, 0, 0.3);
    --c-shadow2:    rgba(0, 0, 0, 0.5);
    --c-toggle-bg:  #3f4a65;
    --c-toggle-dot: #e08862;
}

/* ---------- RESET ---------- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}

body{
    font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14.5px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background .3s, color .3s;
}

::selection { background: var(--c-primary); color: var(--c-primary-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb {
    background: var(--c-line2);
    border-radius: 99px;
    border: 2px solid var(--c-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--c-text4); }

a { color: var(--c-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-primary-hover); }
strong, b { font-weight: 600; color: var(--c-text); }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT — SIDEBAR DỌC bên trái (khác hẳn topbar ngang cũ)
   ============================================================ */

.site-shell {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--c-surface);
    border-right: 1px solid var(--c-line);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 200;
    flex-shrink: 0;
    padding: 28px 0 20px;
}

/* Decorative dotted pattern phía sau logo */
.sidebar::before {
    content: '';
    position: absolute;
    top: 20px; right: 20px;
    width: 60px; height: 60px;
    background-image: radial-gradient(circle, var(--c-line2) 1px, transparent 1px);
    background-size: 10px 10px;
    opacity: 0.4;
    pointer-events: none;
}

.sb-head {
    padding: 0 24px 28px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid var(--c-line);
    margin-bottom: 20px;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--c-text);
}
.sb-brand:hover { color: var(--c-text); }

.sb-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--c-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--c-bg);
    flex-shrink: 0;
    letter-spacing: -0.02em;
    position: relative;
    border: 2px solid var(--c-surface);
    outline: 2px solid var(--c-line2);
}
.sb-icon::after {
    content: '';
    position: absolute;
    right: -4px; bottom: -2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--c-primary);
    border: 2px solid var(--c-surface);
}

.sb-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--c-ink);
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.sb-tagline {
    font-size: 10.5px;
    color: var(--c-text3);
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sb-menu {
    flex: 1;
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sb-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--c-text2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all .18s;
    white-space: nowrap;
    position: relative;
}
.sb-link:hover {
    background: var(--c-surface2);
    color: var(--c-text);
}
.sb-link.active {
    background: var(--c-ink);
    color: var(--c-bg);
}
.sb-link.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--c-primary);
    border-radius: 0 3px 3px 0;
}
[data-theme="dark"] .sb-link.active {
    background: var(--c-primary);
    color: var(--c-primary-ink);
}
[data-theme="dark"] .sb-link.active::before {
    background: var(--c-ink);
}

.sb-link svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity .15s;
}
.sb-link:hover svg { opacity: 1; }
.sb-link.active svg { opacity: 1; }

.sb-sep {
    height: 1px;
    width: calc(100% - 20px);
    background: var(--c-line);
    margin: 10px auto;
    flex-shrink: 0;
}

.sb-foot {
    padding: 18px 20px 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-top: 1px solid var(--c-line);
    margin-top: 12px;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--c-text3);
    user-select: none;
    font-weight: 500;
    padding: 6px 4px;
    border-radius: 6px;
    transition: .2s;
    width: 100%;
}
.theme-switch:hover { color: var(--c-text); }
.theme-switch-track {
    width: 32px; height: 18px;
    border-radius: 99px;
    background: var(--c-toggle-bg);
    position: relative;
    transition: .25s;
}
.theme-switch-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--c-toggle-dot);
    position: absolute;
    top: 3px; left: 3px;
    transition: .25s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
[data-theme="dark"] .theme-switch-dot { left: 17px; }

/* ============================================================
   MAIN CONTENT — offset bên phải sidebar
   ============================================================ */
.main-area {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-zone {
    flex: 1;
    padding: 48px 56px 64px;
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    animation: fadeUp .5s cubic-bezier(.22,.61,.36,1);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- MOBILE TOP BAR -- */
.topbar-mobile {
    display: none;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 150;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.topbar-hamburger {
    background: transparent;
    border: 1px solid var(--c-line2);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--c-text2);
    line-height: 0;
    transition: .18s;
}
.topbar-hamburger:hover {
    background: var(--c-ink);
    border-color: var(--c-ink);
    color: var(--c-bg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--c-overlay);
    z-index: 190;
}
.sidebar-overlay.show { display: block; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   AUTH LAYOUT — SPLIT SCREEN (hero trái + form phải)
   ============================================================ */

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    padding: 0;
    position: relative;
    background: var(--c-bg);
}

/* Hero panel bên trái — chứa illustration + quote */
.auth-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, var(--c-primary-bg) 0%, transparent 55%),
        radial-gradient(circle at 80% 85%, var(--c-surface3) 0%, transparent 50%),
        linear-gradient(135deg, var(--c-surface) 0%, var(--c-bg2) 100%);
    min-height: 100vh;
}

/* Decorative dotted pattern trang trí */
.auth-hero::before {
    content: '';
    position: absolute;
    top: 20%;
    right: -60px;
    width: 180px; height: 180px;
    background-image: radial-gradient(circle, var(--c-line2) 1.2px, transparent 1.2px);
    background-size: 16px 16px;
    opacity: 0.55;
    pointer-events: none;
}
.auth-hero::after {
    content: '';
    position: absolute;
    top: 42%;
    left: 48%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    border: 1.5px dashed var(--c-line2);
    border-radius: 50%;
    opacity: 0.45;
    pointer-events: none;
    animation: spinSlow 80s linear infinite;
}
@keyframes spinSlow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Top logo bar trong hero */
.auth-hero-top {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}
.auth-hero-top .sb-icon {
    width: 40px; height: 40px;
    font-size: 17px;
}
.auth-hero-top-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--c-ink);
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.auth-hero-top-sub {
    font-size: 10.5px;
    color: var(--c-text3);
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Illustration container */
.auth-hero-illust {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 20px 0;
}
.auth-hero-illust svg {
    width: 100%;
    max-width: 420px;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(26, 41, 64, 0.12));
}

/* Quote block dưới cùng */
.auth-hero-quote {
    position: relative;
    z-index: 2;
    padding: 24px 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 16px;
    max-width: 440px;
    box-shadow: 0 8px 24px -10px var(--c-shadow);
}
.auth-hero-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--c-primary);
    line-height: 1;
    background: var(--c-surface);
    padding: 0 6px;
    height: 28px;
    display: flex;
    align-items: center;
}
.auth-hero-quote-text {
    font-size: 14.5px;
    color: var(--c-text);
    line-height: 1.65;
    font-weight: 500;
    letter-spacing: -0.005em;
    margin-bottom: 12px;
}
.auth-hero-quote-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.auth-hero-quote-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--c-ink);
    color: var(--c-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.auth-hero-quote-meta {
    font-size: 12px;
    color: var(--c-text3);
    line-height: 1.3;
}
.auth-hero-quote-name {
    color: var(--c-ink);
    font-weight: 600;
    font-size: 13px;
}

/* Form container — phải */
.auth-card {
    width: 100%;
    max-width: none;
    background: var(--c-bg);
    border: none;
    border-left: 1px solid var(--c-line);
    border-radius: 0;
    padding: 60px 64px 60px;
    position: relative;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    z-index: 2;
}

/* Inner wrapper để giới hạn độ rộng form */
.auth-card > * {
    max-width: 380px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 48px !important;
    padding: 0;
    border: none;
}

.auth-brand-icon {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--c-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--c-bg);
    flex-shrink: 0;
    letter-spacing: -0.02em;
    position: relative;
}
.auth-brand-icon::after {
    content: '';
    position: absolute;
    right: -3px; bottom: -2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--c-primary);
    border: 2px solid var(--c-bg);
}

.auth-brand-name {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--c-ink);
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.auth-brand-sub {
    font-size: 10.5px;
    color: var(--c-text3);
    margin-top: 3px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-title {
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--c-ink);
    margin-bottom: 12px !important;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* Overline mảnh */
.auth-form-title {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--c-primary);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 14px !important;
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-form-title::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--c-primary);
}

/* Headline sans-serif lớn */
.auth-form-desc {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--c-ink);
    margin-bottom: 36px !important;
    line-height: 1.15;
    letter-spacing: -0.025em;
}
.auth-form-desc em {
    font-style: normal;
    color: var(--c-primary);
    font-weight: 700;
    position: relative;
}
.auth-form-desc em::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 2px;
    height: 6px;
    background: var(--c-primary-bg);
    z-index: -1;
    border-radius: 2px;
}

.auth-theme-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--c-line2);
    background: var(--c-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text2);
    transition: .2s;
    z-index: 10;
    font-size: 14px;
    margin: 0 !important;
    max-width: none !important;
}
.auth-theme-btn:hover {
    background: var(--c-ink);
    border-color: var(--c-ink);
    color: var(--c-bg);
    transform: rotate(15deg);
}

/* ============================================================
   FORMS — filled style với floating label feel
   ============================================================ */

.form-group { margin-bottom: 18px; }

.field-label, .fld-label, .il-label {
    display: block;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--c-text3);
    margin-bottom: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fld:has(.fld-label), .fld:has(.fld-box) {
    width: auto;
    padding: 0;
    background: transparent;
    border: none;
    margin-bottom: 20px;
    display: block;
}
.fld:has(.fld-label):focus, .fld:has(.fld-box):focus {
    box-shadow: none;
}

/* Filled input style */
.fld:not(:has(.fld-label)):not(:has(.fld-box)),
.input-shell input, .input-shell textarea,
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="tel"], select {
    width: 100%;
    padding: 14px 16px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    outline: none;
    transition: all .2s;
    font-weight: 500;
}
.fld:not(:has(.fld-label)):not(:has(.fld-box)):focus,
.input-shell input:focus, .input-shell textarea:focus,
input:focus, select:focus {
    border-color: var(--c-ink);
    background: var(--c-surface);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}
input::placeholder, textarea::placeholder {
    color: var(--c-text4);
    font-weight: 400;
}

.fld-box {
    position: relative;
}
.fld-box input, .fld-box textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    outline: none;
    transition: all .2s;
    font-weight: 500;
}
.fld-box input:focus, .fld-box textarea:focus {
    border-color: var(--c-ink);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

textarea, textarea.fld, .config-textarea {
    resize: vertical;
    min-height: 90px;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 13px;
    padding: 12px 14px;
    border: 1px solid var(--c-line);
    border-radius: 12px;
    background: var(--c-surface);
}
textarea:focus, textarea.fld:focus, .config-textarea:focus {
    border-color: var(--c-ink);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

/* ============================================================
   BUTTONS — pill shape, ink dark với terracotta hover
   ============================================================ */

.btn-primary-wide, .btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px 28px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--c-bg);
    background: var(--c-ink);
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: all .25s;
    position: relative;
    overflow: hidden;
}
.btn-primary-wide::after, .btn-main::after {
    content: '→';
    transition: transform .25s;
    font-weight: 300;
    font-size: 18px;
}
.btn-primary-wide:hover, .btn-main:hover {
    background: var(--c-primary);
    color: var(--c-primary-ink);
}
.btn-primary-wide:hover::after, .btn-main:hover::after {
    transform: translateX(5px);
}
.btn-primary-wide:active, .btn-main:active {
    transform: translateY(1px);
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 99px;
    border: 1px solid var(--c-line2);
    background: var(--c-surface);
    color: var(--c-text2);
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
}
.btn-sm:hover {
    border-color: var(--c-ink);
    background: var(--c-ink);
    color: var(--c-bg);
}

.btn-outline, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 22px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 99px;
    border: 1px solid var(--c-line2);
    background: transparent;
    color: var(--c-text2);
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
    text-decoration: none;
}
.btn-outline:hover, .btn-ghost:hover {
    border-color: var(--c-ink);
    color: var(--c-ink);
    background: var(--c-surface);
    text-decoration: none;
}

/* Colored buttons — nhẹ, harmonious với palette ấm */
.btn-red, .btn-green, .btn-blue, .btn-orange, .btn-gray {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 99px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    text-decoration: none;
    letter-spacing: 0;
}
.btn-red {
    background: var(--c-err-bg);
    color: var(--c-err);
    border-color: var(--c-err-border);
}
.btn-red:hover { background: var(--c-err); color: var(--c-bg); border-color: var(--c-err); }

.btn-green {
    background: var(--c-ok-bg);
    color: var(--c-ok);
    border-color: var(--c-ok-border);
}
.btn-green:hover { background: var(--c-ok); color: var(--c-bg); border-color: var(--c-ok); }

.btn-blue {
    background: var(--c-primary-bg);
    color: var(--c-primary);
    border-color: var(--c-primary-border);
}
.btn-blue:hover { background: var(--c-primary); color: var(--c-primary-ink); border-color: var(--c-primary); }

.btn-orange {
    background: var(--c-warn-bg);
    color: var(--c-warn);
    border-color: var(--c-warn-border);
}
.btn-orange:hover { background: var(--c-warn); color: var(--c-bg); border-color: var(--c-warn); }

.btn-gray {
    background: var(--c-surface2);
    color: var(--c-text2);
    border-color: var(--c-line2);
}
.btn-gray:hover { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }

.il-save {
    background: var(--c-ink);
    color: var(--c-bg);
    border: none;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 99px;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
}
.il-save:hover { background: var(--c-primary); color: var(--c-primary-ink); }
.il-cancel {
    background: transparent;
    color: var(--c-text3);
    border: 1px solid var(--c-line2);
    padding: 6px 15px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 99px;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
}
.il-cancel:hover { color: var(--c-err); border-color: var(--c-err); }
.il-hint { font-size: 11.5px; color: var(--c-text3); margin-top: 6px; font-style: italic; }
.il-actions { display: flex; gap: 8px; margin-top: 10px; }

.quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.tag-edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: var(--c-surface2);
    color: var(--c-text2);
    border: 1px solid var(--c-line);
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: .15s;
    text-decoration: none;
    font-family: inherit;
}
.tag-edit:hover { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }

/* ============================================================
   CARDS — rounded corner 16px, ấm áp
   ============================================================ */

.s-card, .panel-card {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 16px;
    padding: 28px 30px;
    margin-bottom: 22px;
    position: relative;
    transition: .2s;
}
.s-card:hover, .panel-card:hover {
    border-color: var(--c-line2);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -8px var(--c-shadow);
}

.section-title {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--c-ink);
    margin-bottom: 22px;
    padding-bottom: 0;
    border: none;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.2;
}
.section-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-primary);
    flex-shrink: 0;
}

.panel-desc {
    font-size: 14px;
    color: var(--c-text3);
    line-height: 1.65;
    margin-bottom: 18px;
}

/* ============================================================
   PAGE HEADER — editorial với số chương
   ============================================================ */

.pg-header {
    margin-bottom: 40px;
    padding: 0 0 28px;
    position: relative;
    border-bottom: 1px solid var(--c-line);
}

.pg-title {
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--c-ink);
    margin-bottom: 10px;
    letter-spacing: -0.025em;
    line-height: 1.15;
    position: relative;
}

.pg-desc {
    font-size: 15px;
    color: var(--c-text3);
    font-weight: 400;
    max-width: 580px;
    line-height: 1.6;
}

/* ============================================================
   GRID
   ============================================================ */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.full-width { grid-column: 1 / -1; }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.info-tile {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 18px 20px 20px;
    position: relative;
    transition: .2s;
}
.info-tile:hover {
    border-color: var(--c-primary-border);
    background: var(--c-surface);
    box-shadow: 0 4px 16px -6px var(--c-shadow);
}
.info-tile-label {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--c-text3);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.info-tile-value {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--c-ink);
    letter-spacing: -0.015em;
    word-break: break-word;
    line-height: 1.25;
}
.info-tile-value.highlight {
    color: var(--c-primary);
}

/* ============================================================
   NOTICES
   ============================================================ */

.notice, .notice-ok, .notice-err {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 18px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}
.notice-ok {
    background: var(--c-ok-bg);
    border-color: var(--c-ok-border);
    color: var(--c-ok);
}
.notice-err {
    background: var(--c-err-bg);
    border-color: var(--c-err-border);
    color: var(--c-err);
}
.notice:not(.notice-ok):not(.notice-err) {
    background: var(--c-primary-bg);
    border-color: var(--c-primary-border);
    color: var(--c-primary);
}

.hint {
    font-size: 12.5px;
    color: var(--c-text3);
    margin-top: 6px;
    line-height: 1.5;
}

/* ============================================================
   TABLES
   ============================================================ */

.table-modern, .dtable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    background: var(--c-surface);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--c-line);
}
.table-modern th, .dtable th {
    background: var(--c-surface2);
    padding: 14px 18px;
    text-align: left;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--c-text3);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--c-line);
}
.table-modern td, .dtable td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-text);
    font-weight: 400;
}
.table-modern tr:last-child td, .dtable tr:last-child td {
    border-bottom: none;
}
.table-modern tbody tr:hover, .dtable tbody tr:hover {
    background: var(--c-surface2);
}

/* ============================================================
   DOWNLOAD LIST
   ============================================================ */

.dl-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    margin-bottom: 10px;
    transition: .2s;
    position: relative;
}
.dl-row:hover {
    border-color: var(--c-primary-border);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -8px var(--c-shadow);
}

.dl-row-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--c-ink);
    letter-spacing: -0.005em;
}
.dl-row-desc {
    font-size: 12.5px;
    color: var(--c-text3);
    margin-top: 2px;
}

/* ============================================================
   MILESTONES
   ============================================================ */

.ms-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ms-box {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: 14px;
    padding: 20px 22px;
    transition: .2s;
}
.ms-box:hover {
    border-color: var(--c-line2);
}

.ms-lbl {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-ink);
    letter-spacing: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.ms-pct {
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-primary);
}

.ms-progress-wrap, .ms-bar {
    width: 100%;
    height: 6px;
    background: var(--c-surface3);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    margin-top: 4px;
}

.ms-fill {
    height: 100%;
    background: var(--c-primary);
    border-radius: 99px;
    position: relative;
    transition: width .6s cubic-bezier(.22,.61,.36,1);
}

.ms-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--c-warn-bg);
    color: var(--c-warn);
    border: 1px solid var(--c-warn-border);
}
.ms-badge-ok {
    background: var(--c-ok-bg);
    color: var(--c-ok);
    border-color: var(--c-ok-border);
}

.ms-warn {
    font-size: 12.5px;
    color: var(--c-warn);
    padding: 10px 14px;
    background: var(--c-warn-bg);
    border: 1px solid var(--c-warn-border);
    border-radius: 10px;
    margin-top: 12px;
}

/* ============================================================
   ADMIN TABS — pill navigation
   ============================================================ */

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--c-surface2);
    border: 1px solid var(--c-line);
    border-radius: 99px;
}

.admin-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-text3);
    letter-spacing: 0;
    background: transparent;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: .18s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.admin-tab:hover {
    color: var(--c-text);
    background: var(--c-surface);
}
.admin-tab.active {
    background: var(--c-ink);
    color: var(--c-bg);
}
[data-theme="dark"] .admin-tab.active {
    background: var(--c-primary);
    color: var(--c-primary-ink);
}

.tab-panel {
    animation: fadeUp .3s ease-out;
}

/* ============================================================
   API RESULT
   ============================================================ */

.api-result {
    background: var(--c-surface2);
    border: 1px solid var(--c-line);
    border-radius: 12px;
    padding: 16px 18px;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 12.5px;
    color: var(--c-text);
    margin-top: 14px;
    overflow-x: auto;
    max-height: 300px;
    line-height: 1.65;
    position: relative;
}

/* ============================================================
   MISC
   ============================================================ */

.form-footer {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--c-line);
    text-align: center;
    font-size: 13px;
    color: var(--c-text3);
}
.form-footer a {
    color: var(--c-primary);
    font-weight: 500;
    text-decoration: none;
}
.form-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

.inline-form { display: inline-block; }
.no-caret { caret-color: transparent; }
.mb { margin-bottom: 12px; }
.mc { text-align: center; }
.mo { opacity: 0.7; }

.site-footer {
    padding: 24px 56px;
    text-align: left;
    font-size: 12px;
    color: var(--c-text4);
    font-weight: 400;
    border-top: 1px solid var(--c-line);
    margin-top: 40px;
    background: transparent;
}

.wide { width: 100%; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-hero {
        display: none;
    }
    .auth-card {
        border-left: none;
        padding: 48px 32px;
    }
}

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .ms-2col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .site-shell {
        flex-direction: column;
    }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.22,.61,.36,1);
    }
    .sidebar.open { transform: translateX(0); }
    .topbar-mobile { display: flex; }
    .main-area { min-height: auto; }
    .content-zone { padding: 32px 22px 48px; }
    .pg-header { padding: 0 0 20px; }
    .pg-title { font-size: 32px; }
    .s-card, .panel-card { padding: 22px 22px; border-radius: 14px; }
    .auth-card { padding: 40px 24px; }
    .auth-brand-name { font-size: 19px; }
    .auth-title { font-size: 28px; }
    .auth-form-desc { font-size: 30px; }
    .site-footer { padding: 20px 22px; }
}

@media (max-width: 480px) {
    .info-grid { grid-template-columns: 1fr; }
    .admin-tab { padding: 8px 14px; font-size: 12px; }
    .quick-btns { gap: 6px; }
}

@media print {
    .sidebar, .topbar-mobile { display: none !important; }
    .content-zone { padding: 0; max-width: 100%; }
    .s-card, .panel-card { box-shadow: none; border: 1px solid #ddd; }
}
