:root {
    --deep: #170b28;
    --deep-2: #2b1246;
    --saffron: #e0862a;
    --saffron-light: #f5b942;
    --gold: #e0a940;
    --cream: #fdf6ec;
    --text-muted: #b9aecb;
    --success: #3fae6b;
    --danger: #d64545;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--cream);
    color: #241536;
    margin: 0;
}

a { text-decoration: none; }

/* ---------- Top nav ---------- */
.navbar-app {
    background: linear-gradient(120deg, var(--deep), var(--deep-2));
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.navbar-app .brand {
    color: var(--cream);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: .3px;
}
.navbar-app .brand span { color: var(--saffron-light); }
.navbar-app nav a {
    color: var(--text-muted);
    margin-left: 22px;
    font-weight: 500;
    font-size: .95rem;
    transition: color .15s;
}
.navbar-app nav a:hover, .navbar-app nav a.active { color: var(--saffron-light); }

/* ---------- Auth pages ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, #2b1246, #170b28 70%);
    padding: 24px;
}
.auth-card {
    background: var(--cream);
    border-radius: 18px;
    width: 100%;
    max-width: 420px;
    padding: 38px 34px;
    box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.auth-card h1 {
    font-size: 1.5rem;
    margin: 0 0 6px;
    text-align: center;
}
.auth-card p.sub {
    text-align: center;
    color: #7a6c8e;
    margin: 0 0 26px;
    font-size: .9rem;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: #40315a; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e3d9f2;
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
}
.form-control:focus { outline: none; border-color: var(--saffron); }
.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: transform .1s, box-shadow .15s;
}
.btn-primary { background: linear-gradient(120deg, var(--saffron), var(--gold)); color: #241536; width: 100%; }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(224,134,42,.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--saffron); color: var(--saffron); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.auth-footer { text-align: center; margin-top: 18px; font-size: .88rem; color: #7a6c8e; }
.auth-footer a { color: var(--saffron); font-weight: 600; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: .87rem; margin-bottom: 16px; }
.alert-danger { background: #fbe4e4; color: #a02c2c; }
.alert-success { background: #e2f5ea; color: #227a49; }

/* ---------- App shell ---------- */
.app-container { max-width: 1120px; margin: 0 auto; padding: 32px 24px 60px; }
.page-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: #7a6c8e; margin-bottom: 28px; font-size: .95rem; }

.hero-card {
    background: linear-gradient(120deg, var(--deep), var(--deep-2));
    border-radius: 20px;
    padding: 40px;
    color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}
.hero-card h2 { margin: 0 0 8px; font-size: 1.4rem; }
.hero-card p { margin: 0; color: var(--text-muted); max-width: 460px; font-size: .92rem; }
.hero-card .btn-primary { width: auto; padding: 14px 30px; font-size: 1rem; }

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 4px 18px rgba(43,18,70,.06);
    border: 1px solid #f0e8dd;
}

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.post-thumb { width: 100%; border-radius: 12px; display: block; margin-bottom: 10px; }
.post-meta { font-size: .82rem; color: #7a6c8e; }

table.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data-table th { text-align: left; color: #7a6c8e; font-weight: 600; padding: 10px 12px; border-bottom: 2px solid #f0e8dd; }
table.data-table td { padding: 12px; border-bottom: 1px solid #f4eee5; vertical-align: middle; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #e2f5ea; color: #227a49; }
.badge-muted { background: #f0eaf7; color: #6b5a87; }

/* ---------- Admin layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 235px;
    background: linear-gradient(180deg, var(--deep), var(--deep-2));
    color: var(--cream);
    padding: 24px 0;
    flex-shrink: 0;
}
.admin-sidebar .brand { padding: 0 22px 22px; font-weight: 700; font-size: 1.15rem; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 12px; }
.admin-sidebar .brand span { color: var(--saffron-light); }
.admin-sidebar a {
    display: block;
    padding: 12px 22px;
    color: var(--text-muted);
    font-size: .92rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    color: #fff;
    background: rgba(255,255,255,.06);
    border-left-color: var(--saffron);
}
.admin-main { flex: 1; padding: 28px 34px; max-width: 1100px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid #f0e8dd; }
.stat-card .num { font-size: 1.9rem; font-weight: 700; color: var(--deep-2); }
.stat-card .label { color: #7a6c8e; font-size: .85rem; }

.color-swatch { width: 22px; height: 22px; border-radius: 6px; display: inline-block; vertical-align: middle; border: 1px solid #ddd; }

@media (max-width: 720px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; }
}
