@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');

:root {
  --ink: #111716;
  --muted: #6f7773;
  --paper: #f2f0e9;
  --panel: #fffdf8;
  --line: #d8d5ca;
  --gold: #f2b544;
  --red: #d8462f;
  --green: #30745c;
  --nav: #111716;
  --shadow: 0 18px 50px rgba(32, 35, 31, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.dashboard-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  color: #f8f5ec;
  background: var(--nav);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar::after {
  content: '';
  position: absolute;
  inset: auto -65px -90px auto;
  width: 210px;
  height: 210px;
  border: 35px solid rgba(242, 181, 68, .12);
  border-radius: 50%;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; position: relative; z-index: 1; }
.brand-mark {
  width: 39px; height: 39px; border: 2px solid var(--gold); border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 6px var(--nav), inset 0 0 0 8px var(--gold);
}
.brand-copy strong { display: block; font-family: 'Fraunces', serif; font-size: 17px; letter-spacing: -.2px; }
.brand-copy span { color: #939b96; font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px; }
.side-label { color: #727a76; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin: 42px 12px 10px; }
.side-nav { display: grid; gap: 5px; position: relative; z-index: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 13px; color: #aeb5b1;
  border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 600; transition: .2s ease;
}
.side-nav a:hover { color: white; background: rgba(255,255,255,.06); transform: translateX(2px); }
.side-nav a.active { color: var(--ink); background: var(--gold); }
.nav-icon { width: 21px; font-size: 16px; text-align: center; }
.sidebar-foot { margin-top: auto; position: relative; z-index: 1; }
.site-link { display: block; border-top: 1px solid #303633; padding: 20px 10px 0; color: #aeb5b1; text-decoration: none; font-size: 12px; }

.main-panel { min-width: 0; }
.topline {
  height: 76px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: rgba(242,240,233,.88); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.mobile-menu { display: none; border: 0; background: none; font-size: 24px; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb strong { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(48,116,92,.12); }
.avatar { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font: 700 12px 'Fraunces', serif; cursor: pointer; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); }
.auth-art { padding: 7vw; color: white; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 20% 80%, rgba(242,181,68,.2), transparent 34%), var(--ink); }
.auth-art h1 { font: 700 clamp(48px,7vw,92px)/.88 'Fraunces',serif; letter-spacing: -4px; max-width: 680px; margin: 70px 0; }
.auth-art h1 em { color: var(--gold); font-weight: inherit; }
.auth-art p { color: #9da5a1; max-width: 490px; line-height: 1.7; }
.auth-panel { background: var(--paper); padding: 7vw; display: grid; place-items: center; }
.auth-card { width: min(430px,100%); }
.auth-card h2 { font: 700 42px 'Fraunces',serif; margin: 0 0 10px; }
.auth-card > p { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .button { width: 100%; margin-top: 8px; }
.auth-switch { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }
.auth-switch button { border: 0; background: none; color: var(--red); font-weight: 700; cursor: pointer; }

.content { padding: 42px 4vw 70px; max-width: 1500px; margin: auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.eyebrow { color: var(--red); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 8px; }
.page-head h1 { font: 700 clamp(34px, 4vw, 56px)/.98 'Fraunces', serif; letter-spacing: -2px; margin: 0; }
.page-head .lede { color: var(--muted); margin: 13px 0 0; max-width: 620px; }
.button {
  border: 1px solid var(--ink); background: var(--ink); color: white; border-radius: 6px; padding: 12px 17px;
  text-decoration: none; font-weight: 700; font-size: 13px; cursor: pointer; transition: .18s ease; display: inline-flex; gap: 8px; align-items: center; justify-content: center;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(17,23,22,.16); }
.button.gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.button.ghost { color: var(--ink); background: transparent; border-color: var(--line); }
.button.danger { color: var(--red); background: transparent; border-color: #e3bdb6; }
.button.small { padding: 8px 11px; font-size: 11px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.metric { min-height: 154px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; position: relative; overflow: hidden; }
.metric::after { content: ''; position: absolute; right: -24px; bottom: -28px; width: 90px; height: 90px; border: 18px solid rgba(17,23,22,.035); border-radius: 50%; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { display: block; font: 700 38px 'Fraunces', serif; margin-top: 14px; }
.metric-note { color: var(--green); font-size: 11px; margin-top: 6px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { padding: 21px 23px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-head h2 { font: 700 21px 'Fraunces', serif; margin: 0; }
.panel-head a { color: var(--red); font-size: 12px; font-weight: 700; text-decoration: none; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; text-align: left; padding: 13px 20px; background: #f8f6f0; }
td { border-top: 1px solid #e9e6dc; padding: 15px 20px; font-size: 13px; }
.video-cell { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.mini-thumb { width: 54px; aspect-ratio: 16/10; background: var(--ink); border-radius: 4px; display: grid; place-items: center; color: var(--gold); flex: 0 0 auto; }
.video-cell strong { display: block; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-cell span { color: var(--muted); font-size: 11px; }
.badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.badge.published { color: var(--green); }
.badge.draft { color: #9b6920; }
.quick-list { padding: 12px 22px 22px; }
.quick-item { display: grid; grid-template-columns: 37px 1fr; gap: 13px; padding: 15px 0; border-bottom: 1px solid #e9e6dc; text-decoration: none; }
.quick-item:last-child { border: 0; }
.quick-number { width: 34px; height: 34px; background: var(--gold); display: grid; place-items: center; font: 700 15px 'Fraunces', serif; border-radius: 50%; }
.quick-item strong { font-size: 13px; display: block; }
.quick-item span { color: var(--muted); font-size: 11px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 22px; }
.search { flex: 1; position: relative; }
.search input, .toolbar select, .field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 12px 14px; border-radius: 6px; outline: none;
}
.search input { padding-left: 39px; }
.search::before { content: '⌕'; position: absolute; left: 14px; top: 8px; color: var(--muted); font-size: 20px; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17,23,22,.08); }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.video-card { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; transition: .2s ease; }
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.video-preview { aspect-ratio: 16/9; background: #171d1b; position: relative; overflow: hidden; }
.video-preview video { width: 100%; height: 100%; object-fit: cover; }
.video-placeholder { height: 100%; display: grid; place-items: center; color: var(--gold); font-size: 34px; background: radial-gradient(circle at 80% 10%, #313b36, #111716 60%); }
.video-meta { padding: 17px; }
.video-meta h3 { font: 700 18px/1.2 'Fraunces', serif; margin: 9px 0 7px; }
.video-meta p { color: var(--muted); font-size: 12px; margin: 0; min-height: 36px; }
.card-kicker { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
.card-actions { display: flex; gap: 7px; margin-top: 15px; padding-top: 14px; border-top: 1px solid #ebe8de; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .65fr); gap: 22px; }
.upload-form { padding: 25px; }
.drop-zone {
  border: 1.5px dashed #aaa89e; background: #f8f6ef; border-radius: 9px; min-height: 280px; display: grid; place-items: center;
  text-align: center; padding: 35px; cursor: pointer; transition: .2s ease; position: relative; overflow: hidden;
}
.drop-zone.dragging { border-color: var(--red); background: #fff6f3; transform: scale(.995); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { width: 74px; height: 74px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: 30px; margin: 0 auto 18px; }
.drop-zone h2 { font: 700 24px 'Fraunces', serif; margin: 0 0 8px; }
.drop-zone p { color: var(--muted); font-size: 12px; margin: 0; }
.selected-file { display: none; width: 100%; text-align: left; align-items: center; gap: 15px; }
.selected-file.show { display: flex; }
.selected-file .file-art { width: 88px; aspect-ratio: 16/10; background: var(--ink); color: var(--gold); display: grid; place-items: center; border-radius: 6px; font-size: 24px; }
.selected-file strong { display: block; }
.selected-file span { color: var(--muted); font-size: 12px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin-top: 23px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 7px; }
.field textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.upload-guide { padding: 24px; }
.upload-guide h2 { font: 700 20px 'Fraunces', serif; margin-top: 0; }
.guide-step { display: grid; grid-template-columns: 27px 1fr; gap: 12px; margin: 20px 0; }
.guide-step b { width: 25px; height: 25px; border-radius: 50%; background: var(--ink); color: white; display: grid; place-items: center; font-size: 10px; }
.guide-step strong { display: block; font-size: 12px; }
.guide-step span { color: var(--muted); font-size: 11px; }
.progress { display: none; margin-top: 18px; }
.progress.show { display: block; }
.progress-track { height: 7px; background: #e2dfd4; border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--red); transition: width .15s linear; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 6px; }

.chart-panel { padding: 25px; }
.chart-bars { height: 230px; display: flex; align-items: end; gap: 3%; padding-top: 25px; border-bottom: 1px solid var(--line); }
.bar-wrap { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 9px; }
.bar { width: min(46px, 70%); min-height: 3px; background: var(--ink); border-radius: 4px 4px 0 0; transition: height .7s cubic-bezier(.2,.8,.2,1); position: relative; }
.bar:hover { background: var(--red); }
.bar-wrap span { color: var(--muted); font-size: 10px; }
.category-list { padding: 12px 24px 24px; }
.category-row { margin-top: 18px; }
.category-copy { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 7px; }
.category-track { height: 6px; background: #e7e4da; overflow: hidden; }
.category-fill { height: 100%; background: var(--gold); }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 70px 20px; border: 1px dashed #bdbab0; background: rgba(255,253,248,.5); border-radius: 9px; }
.empty-state strong { display: block; font: 700 24px 'Fraunces', serif; margin-bottom: 7px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }
.skeleton { background: linear-gradient(90deg, #e9e6dd, #f6f4ee, #e9e6dd); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; height: 280px; }
.notice { padding: 12px 14px; border-radius: 6px; font-size: 12px; margin-top: 15px; display: none; }
.notice.show { display: block; }
.notice.error { background: #fae8e4; color: #982e1e; }
.notice.success { background: #e3f1ea; color: #225c47; }

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.content > * { animation: rise .45s both; }
.content > *:nth-child(2) { animation-delay: .06s; }
.content > *:nth-child(3) { animation-delay: .12s; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .upload-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dashboard-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; width: 244px; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 30px 0 70px rgba(0,0,0,.24); }
  .mobile-menu { display: block; cursor: pointer; }
  .topline { height: 64px; padding: 0 20px; }
  .crumb, .top-actions > span { display: none; }
  .content { padding: 30px 20px 55px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head h1 { font-size: 38px; }
  .metrics, .video-grid, .fields { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .toolbar { flex-direction: column; }
  .metric { min-height: 125px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { min-height: 100vh; padding: 30px 22px; }
}
