/* =========================================================
   Doll Vendors Admin — Modern stylesheet
   Big readable fonts, clean spacing, professional feel
   ========================================================= */

:root {
    /* Palette — deep indigo + warm accent */
    --bg:           #0f1220;
    --bg-2:         #151a2e;
    --panel:        #ffffff;
    --panel-soft:   #f7f8fc;
    --border:       #e4e7ef;
    --border-soft:  #eef0f6;
    --text:         #1a1d2e;
    --text-soft:    #5b6078;
    --muted:        #8b90a8;

    --accent:       #6366f1;
    --accent-2:     #8b5cf6;
    --accent-soft:  #eef0ff;
    --success:      #10b981;
    --warning:      #f59e0b;
    --danger:       #ef4444;

    /* Typography — big & readable */
    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fs-xs:   14px;
    --fs-sm:   15px;
    --fs-base: 17px;   /* default body — bigger than typical 14-16 */
    --fs-md:   18px;
    --fs-lg:   22px;
    --fs-xl:   28px;
    --fs-xxl:  36px;

    --radius:    14px;
    --radius-sm: 10px;
    --shadow:    0 4px 24px rgba(15, 18, 32, 0.06);
    --shadow-lg: 0 20px 60px rgba(15, 18, 32, 0.12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--text);
    background: var(--panel-soft);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    color: #fff;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 8px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 20px;
}
.brand-mark {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    font-weight: 800; font-size: 18px;
    letter-spacing: 0.5px;
}
.brand-title { font-size: var(--fs-md); font-weight: 700; }
.brand-sub   { font-size: var(--fs-xs); color: rgba(255,255,255,0.55); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 14px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-size: var(--fs-md);
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.25), rgba(139,92,246,0.10));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon { font-size: 20px; width: 24px; text-align: center; }

.sidebar-foot { padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-chip { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    font-weight: 700; color: #fff;
}
.user-name { font-size: var(--fs-sm); color: rgba(255,255,255,0.9); }
.logout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
}
.logout-btn:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }

/* ---------- Main ---------- */
.main { min-width: 0; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 26px 40px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.page-title { margin: 0; font-size: var(--fs-xxl); font-weight: 700; letter-spacing: -0.5px; }
.badge {
    display: inline-flex; align-items: center;
    font-size: var(--fs-xs);
    background: #e6fbf2; color: #047857;
    padding: 6px 12px; border-radius: 999px;
    font-weight: 600;
}
.badge::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--success); margin-right: 8px;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.15);
}

.content { padding: 32px 40px 64px; max-width: 1200px; }

/* ---------- Cards / panels ---------- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-bottom: 24px;
}
.card h2 {
    margin: 0 0 6px;
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.3px;
}
.card .card-sub { color: var(--text-soft); margin-bottom: 24px; font-size: var(--fs-md); }

/* ---------- Stats grid (Main page) ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
    box-shadow: var(--shadow);
}
.stat-label { font-size: var(--fs-sm); color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.stat-value { font-size: 40px; font-weight: 800; margin-top: 6px; letter-spacing: -1px; }
.stat-change { font-size: var(--fs-sm); color: var(--success); margin-top: 4px; font-weight: 600; }
.stat-change.down { color: var(--danger); }

/* ---------- Form ---------- */
.form-section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.form-section-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}
.form-section-desc {
    font-size: var(--fs-sm);
    color: var(--text-soft);
    margin-bottom: 20px;
}

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field-label {
    display: block;
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.field-hint {
    font-size: var(--fs-sm);
    color: var(--text-soft);
    margin-top: 6px;
}

input[type="text"], input[type="url"], input[type="number"],
input[type="password"], input[type="email"], textarea, select {
    width: 100%;
    font-family: var(--font-base);
    font-size: var(--fs-md);
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

/* Checkbox groups */
.check-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}
.check-group.single-col { grid-template-columns: 1fr; }

.check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: #fff;
    transition: all 0.15s;
    font-size: var(--fs-md);
    user-select: none;
}
.check:hover { border-color: #c8ccdc; background: #fafbff; }
.check input {
    margin: 3px 0 0;
    width: 20px; height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}
.check input:checked ~ .check-text { color: var(--text); font-weight: 600; }
.check:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.check-text { line-height: 1.45; }

/* Radio-style (visually similar) */
.radio-group { display: flex; flex-direction: column; gap: 10px; }

/* Nested sub-options */
.sub-options {
    margin-top: 14px;
    margin-left: 0;
    padding: 18px 20px;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: none;
}
.sub-options.active { display: block; }
.sub-options .field-label { font-size: var(--fs-sm); }

/* Toggle / collapsible sections for sources */
.source-block {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin-bottom: 14px;
    background: #fff;
    transition: border-color 0.15s;
}
.source-block:has(> .source-head input:checked) {
    border-color: var(--accent);
    background: #fafbff;
}
.source-head {
    display: flex; align-items: center; gap: 12px;
    font-size: var(--fs-md); font-weight: 600;
    cursor: pointer;
}
.source-head input {
    width: 22px; height: 22px;
    accent-color: var(--accent);
}
.source-body {
    display: none;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--border);
}
.source-block.open .source-body { display: block; }

/* Rating pills (for sub-options) */
.rating-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rating-pill {
    position: relative;
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    transition: all 0.15s;
}
.rating-pill input {
    position: absolute; opacity: 0; pointer-events: none;
}
.rating-pill:hover { border-color: #c8ccdc; }
.rating-pill:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-base);
    font-size: var(--fs-md);
    font-weight: 600;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.05s, box-shadow 0.15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--panel-soft); }

.form-actions {
    display: flex; gap: 12px; justify-content: flex-end;
    padding: 24px 0 0;
    margin-top: 8px;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: var(--fs-md);
    border-left: 4px solid;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: var(--success); }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: var(--danger); }
.alert-info    { background: var(--accent-soft); color: #3730a3; border-color: var(--accent); }

/* Tables */
table.data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
table.data th, table.data td {
    padding: 16px 20px;
    text-align: left;
    font-size: var(--fs-md);
    border-bottom: 1px solid var(--border-soft);
}
table.data th {
    background: var(--panel-soft);
    font-weight: 600;
    color: var(--text-soft);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbff; }

/* Empty state */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-soft);
    font-size: var(--fs-md);
}

/* ---------- Login page ---------- */
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 100%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px;
    box-shadow: var(--shadow-lg);
}
.login-logo {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 24px;
    margin: 0 auto 20px;
}
.login-card h1 {
    text-align: center;
    font-size: var(--fs-xl);
    margin: 0 0 6px;
}
.login-card p.sub {
    text-align: center;
    color: var(--text-soft);
    margin: 0 0 28px;
    font-size: var(--fs-md);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .nav { flex-direction: row; overflow-x: auto; gap: 8px; }
    .nav-item { white-space: nowrap; }
    .topbar, .content { padding-left: 20px; padding-right: 20px; }
    .page-title { font-size: var(--fs-xl); }
    .card, .form-section { padding: 20px; }
}
