:root {
    --scc-purple: #432774;
    --scc-purple-dark: #2f1a53;
    --scc-gold: #ffb606;
    --bs-primary: #432774;
    --bs-primary-rgb: 67, 39, 116;
    --bs-link-color: #432774;
    --bs-link-hover-color: #2f1a53;
    --sidebar-w: 250px;
}
body { background: #f4f3f8; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.btn-primary { --bs-btn-bg: var(--scc-purple); --bs-btn-border-color: var(--scc-purple); --bs-btn-hover-bg: var(--scc-purple-dark); --bs-btn-hover-border-color: var(--scc-purple-dark); --bs-btn-active-bg: var(--scc-purple-dark); --bs-btn-active-border-color: var(--scc-purple-dark); }
.btn-outline-primary { --bs-btn-color: var(--scc-purple); --bs-btn-border-color: var(--scc-purple); --bs-btn-hover-bg: var(--scc-purple); --bs-btn-hover-border-color: var(--scc-purple); --bs-btn-active-bg: var(--scc-purple); }
.form-control:focus, .form-select:focus { border-color: #8d74b8; box-shadow: 0 0 0 .25rem rgba(67, 39, 116, .2); }
.form-check-input:checked { background-color: var(--scc-purple); border-color: var(--scc-purple); }
.page-link { color: var(--scc-purple); }
.active > .page-link { background: var(--scc-purple); border-color: var(--scc-purple); }

/* Shell */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--scc-purple); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; color: #fff; text-decoration: none; font-size: 1.15rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-sidebar .brand img { border-radius: 8px; background: #fff; padding: 2px; }
.admin-nav { padding: .75rem 0; flex: 1; overflow-y: auto; }
.admin-nav a { display: flex; align-items: center; gap: .75rem; padding: .65rem 1.25rem; color: rgba(255,255,255,.82); text-decoration: none; border-left: 3px solid transparent; transition: background .15s; }
.admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav a.active { background: rgba(0,0,0,.22); color: #fff; border-left-color: var(--scc-gold); }
.admin-nav i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-footer a { color: rgba(255,255,255,.8); text-decoration: none; font-size: .9rem; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { display: flex; align-items: center; gap: .5rem; padding: .75rem 1.5rem; background: #fff; border-bottom: 1px solid #e5e2ee; position: sticky; top: 0; z-index: 1020; }
.admin-content { padding: 1.5rem; flex: 1; }
.admin-footer { padding: 1rem 1.5rem; color: #777; font-size: .85rem; }

@media (max-width: 991.98px) {
    .admin-sidebar { position: fixed; left: calc(-1 * var(--sidebar-w)); z-index: 1040; transition: left .2s; box-shadow: 0 0 30px rgba(0,0,0,.3); }
    .admin-sidebar.open { left: 0; }
    .admin-content { padding: 1rem; }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
}

/* Widgets */
.stat-card { --accent: var(--scc-purple); --accent-bg: rgba(67,39,116,.1); position: relative; display: flex; align-items: center; gap: .85rem; height: 100%; padding: .95rem 1rem .95rem 1.1rem; background: #fff; border-radius: .9rem; border: 1px solid #e9e6f1; text-decoration: none; color: inherit; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); border-radius: 4px 0 0 4px; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: 0 .6rem 1.2rem rgba(67,39,116,.12); border-color: var(--accent); color: inherit; }
.stat-card > .min-w-0 { min-width: 0; flex: 1 1 auto; }
.stat-card .icon { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--accent-bg); color: var(--accent); }
.stat-card .value { font-size: 1.7rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: #1f1b2e; }
.stat-card .label { font-size: .8rem; font-weight: 600; color: #4b4660; white-space: nowrap; margin-top: .2rem; }
.stat-card .go { position: absolute; right: .8rem; top: .8rem; color: var(--accent); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
a.stat-card:hover .go { opacity: 1; transform: none; }
.stat-card.c-purple { --accent: #432774; --accent-bg: rgba(67,39,116,.1); }
.stat-card.c-gold   { --accent: #b57a00; --accent-bg: rgba(255,182,6,.18); }
.stat-card.c-teal   { --accent: #0f8a8a; --accent-bg: rgba(15,138,138,.12); }
.stat-card.c-rose   { --accent: #c2395b; --accent-bg: rgba(194,57,91,.12); }
.stat-card.c-blue   { --accent: #2f6fd6; --accent-bg: rgba(47,111,214,.12); }
.stat-card.c-green  { --accent: #2e8b57; --accent-bg: rgba(46,139,87,.13); }
.stat-card.c-slate  { --accent: #6c6880; --accent-bg: rgba(108,104,128,.12); }
.card { border-color: #e9e6f1; border-radius: .75rem; }
.card-header { background: #fff; border-bottom-color: #e9e6f1; font-weight: 600; }
.table > :not(caption) > * > * { vertical-align: middle; }
.thumb { width: 96px; height: 54px; object-fit: cover; border-radius: .35rem; background: #eee; }
.thumb-sm { width: 44px; height: 44px; object-fit: cover; border-radius: .35rem; background: #eee; }
.thumb-mobile { width: 54px; height: 72px; object-fit: cover; border-radius: .35rem; background: #eee; }
.preview-img { max-width: 100%; max-height: 240px; border-radius: .5rem; border: 1px solid #e9e6f1; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery-grid .tile { background: #fff; border: 1px solid #e9e6f1; border-radius: .6rem; overflow: hidden; }
.gallery-grid .tile img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery-grid .tile.cover { outline: 3px solid var(--scc-gold); }
.ql-editor { min-height: 260px; font-size: 1rem; }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: #dee2e6; }
.ql-toolbar.ql-snow { border-radius: .375rem .375rem 0 0; }
.ql-container.ql-snow { border-radius: 0 0 .375rem .375rem; }
.msg-body { white-space: pre-wrap; word-break: break-word; }
.unread td { font-weight: 600; }
.badge-cat { background: rgba(67,39,116,.1); color: var(--scc-purple); }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--scc-purple) 0%, #6a4aa5 60%, var(--scc-gold) 160%); padding: 1rem; }
.login-card { width: 100%; max-width: 440px; border-radius: 1rem; }

/* Dashboard analytics */
.stat-card .sub { font-size: .72rem; color: #8b87a0; margin-top: .15rem; }

.trend-up { color: #198754; font-weight: 600; }
.trend-down { color: #dc3545; font-weight: 600; }
.chart-svg { width: 100%; height: auto; display: block; }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: .35rem; }
.legend-swatch.bar { background: #432774; }
.legend-swatch.line { background: transparent; border: 2.5px solid #ffb606; border-radius: 50%; width: 11px; height: 11px; }
.pct-bar { height: 8px; border-radius: 4px; background: #efedf5; overflow: hidden; }
.pct-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--scc-purple); }
.pct-bar.mini { height: 4px; width: 100%; max-width: 160px; }
.pct-bar.mini > span { background: #c9b8e8; }
@media (min-width: 1900px) { .stat-grid > .col-md-4 { width: 16.6667%; } }
@media (max-width: 575.98px) { .stat-card { padding: .8rem .75rem .8rem .9rem; gap: .6rem; } .stat-card .icon { width: 38px; height: 38px; font-size: 1.1rem; } .stat-card .value { font-size: 1.4rem; } .stat-card .label { white-space: normal; font-size: .74rem; line-height: 1.2; } }
