/* ─── deldown Static — Design System ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fragment+Mono&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg:         #09090d;
  --bg2:        #0f1017;
  --card:       #12141c;
  --border:     #1e2130;
  --border-hi:  #2e3248;
  --text:       #e4e6f0;
  --text-muted: #5a5e72;
  --text-dim:   #8890a8;
  --accent:     #c8f135;
  --accent-dim: #8fab24;
  --accent2:    #00c9a7;
  --danger:     #ff4d6d;
  --warning:    #f5a623;
  --mono:       'Fragment Mono', 'Courier New', monospace;
  --sans:       'DM Sans', system-ui, sans-serif;
  --radius:     6px;
  --radius-lg:  12px;
  --shadow:     0 4px 24px rgba(0,0,0,.45);
  --shadow-lg:  0 8px 48px rgba(0,0,0,.6);
  --transition: 0.18s ease;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ─── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

code, pre, .mono {
  font-family: var(--mono);
  font-size: 0.875em;
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container--sm { max-width: 520px; margin: 0 auto; padding: 0 24px; }

/* ─── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9,9,13,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 16px;
}
.nav__logo {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nav__logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #09090d;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
}
.nav__links {
  display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.nav__links a {
  color: var(--text-dim);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav__links a:hover { color: var(--text); background: var(--border); text-decoration: none; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--mono);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; pointer-events: none; }

.btn--primary {
  background: var(--accent);
  color: #09090d;
  font-weight: 600;
}
.btn--primary:hover {
  background: #d8ff40;
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(200,241,53,.25);
  text-decoration: none; color: #09090d;
}

.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-hi);
}
.btn--ghost:hover { color: var(--text); border-color: var(--text-dim); background: var(--card); text-decoration: none; }

.btn--danger {
  background: rgba(255,77,109,.12);
  color: var(--danger);
  border: 1px solid rgba(255,77,109,.3);
}
.btn--danger:hover { background: rgba(255,77,109,.2); }

.btn--sm { padding: 6px 12px; font-size: 0.8rem; }
.btn--lg { padding: 14px 28px; font-size: 1rem; }

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card--hover {
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card--hover:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.8rem; color: var(--text-dim); font-family: var(--mono); letter-spacing: .05em; }
.form-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,241,53,.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); }

/* ─── Progress / Usage bars ──────────────────────────────────────────────── */
.progress { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress__fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s cubic-bezier(.4,0,.2,1); }
.progress__fill--warn { background: var(--warning); }
.progress__fill--danger { background: var(--danger); }

/* ─── Badge ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-family: var(--mono);
}
.badge--green { background: rgba(200,241,53,.12); color: var(--accent); border: 1px solid rgba(200,241,53,.25); }
.badge--red   { background: rgba(255,77,109,.12);  color: var(--danger);  border: 1px solid rgba(255,77,109,.25); }
.badge--gray  { background: rgba(90,94,114,.2);    color: var(--text-dim); border: 1px solid var(--border); }
.badge--teal  { background: rgba(0,201,167,.12);   color: var(--accent2);  border: 1px solid rgba(0,201,167,.25); }

/* ─── Table ───────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th {
  padding: 10px 16px; text-align: left;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 400;
  color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); background: var(--bg2);
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-dim); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); color: var(--text); }

/* ─── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: 1px solid;
  display: none;
}
.alert.show { display: block; }
.alert--error { background: rgba(255,77,109,.08); border-color: rgba(255,77,109,.3); color: var(--danger); }
.alert--success { background: rgba(200,241,53,.08); border-color: rgba(200,241,53,.3); color: var(--accent); }
.alert--info { background: rgba(0,201,167,.08); border-color: rgba(0,201,167,.3); color: var(--accent2); }

/* ─── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(9,9,13,.85);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px; width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal__title { font-family: var(--mono); font-size: 1rem; margin-bottom: 20px; }
.modal__close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem;
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.mono { font-family: var(--mono); }
.w-full { width: 100%; }
.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: 16px; }

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

/* ─── Divider ─────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ─── Spin ────────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.fade-up { animation: fadeUp .5s ease both; }
.fade-up-1 { animation-delay: .1s; }
.fade-up-2 { animation-delay: .2s; }
.fade-up-3 { animation-delay: .3s; }
.fade-up-4 { animation-delay: .4s; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.footer__links { display: flex; gap: 16px; }
.footer__links a { color: var(--text-muted); }
.footer__links a:hover { color: var(--text-dim); }

/* ─── Dashboard Layout ────────────────────────────────────────────────────── */
.dash {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.dash__sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.dash__sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.9rem; color: var(--text);
}
.dash__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.dash__nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.dash__nav-item:hover { color: var(--text); background: var(--border); text-decoration: none; }
.dash__nav-item.active { color: var(--accent); background: rgba(200,241,53,.08); }
.dash__nav-icon { width: 16px; text-align: center; opacity: .7; }
.dash__main { padding: 32px; overflow-y: auto; }
.dash__title { font-family: var(--mono); font-size: 1.25rem; margin-bottom: 24px; }
.dash__section { display: none; }
.dash__section.active { display: block; }

@media (max-width: 768px) {
  .dash { grid-template-columns: 1fr; }
  .dash__sidebar { position: relative; height: auto; }
  .dash__main { padding: 20px; }
}

/* ─── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.stat-card__label { font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.stat-card__value { font-size: 2rem; font-family: var(--mono); margin: 4px 0; color: var(--text); }
.stat-card__sub { font-size: 0.78rem; color: var(--text-muted); }

/* ─── Upload zone ─────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-hi);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(255,255,255,.01);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(200,241,53,.04);
}
.upload-zone__icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-zone__text { color: var(--text-dim); font-size: 0.9rem; }
.upload-zone__hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
