/* ============================================================
   LU5WSA — Main Stylesheet
   Fonts: Syne (display), DM Sans (body), DM Mono (code)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius-sm:  6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 180ms ease;

  /* Light theme */
  --bg:          #F9F8F6;
  --bg-card:     #FFFFFF;
  --bg-subtle:   #F1EFE9;
  --bg-hover:    #ECEAE3;

  --text-primary:   #1A1917;
  --text-secondary: #5C5A55;
  --text-muted:     #9A9891;

  --border:         rgba(26,25,23,0.10);
  --border-strong:  rgba(26,25,23,0.18);

  --accent:         #1A6B4A;   /* radio green */
  --accent-light:   #E6F4EE;
  --accent-text:    #0F4A33;

  --amber:          #B5670A;
  --amber-light:    #FEF3E2;

  --blue:           #1A4F8A;
  --blue-light:     #EBF2FB;

  --danger:         #C0392B;
  --danger-light:   #FEF0EE;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);

  --navbar-h: 60px;
}

[data-theme="dark"] {
  --bg:         #111210;
  --bg-card:    #1C1C1A;
  --bg-subtle:  #242422;
  --bg-hover:   #2A2A28;

  --text-primary:   #F2F0EB;
  --text-secondary: #A8A69F;
  --text-muted:     #6A6860;

  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);

  --accent:        #3EC87A;
  --accent-light:  #0D2A1C;
  --accent-text:   #6EE0A0;

  --amber:         #F0A030;
  --amber-light:   #2A1E09;

  --blue:          #5B9FE0;
  --blue-light:    #0D1E30;

  --danger:        #E05555;
  --danger-light:  #2A0D0D;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.50);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--navbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 12px;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  margin-right: auto;
}
.brand-icon { font-size: 20px; line-height: 1; }
.nav-links {
  display: flex; align-items: center; gap: 4px;
}
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-subtle); }
.nav-link.active { color: var(--accent); background: var(--accent-light); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.theme-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg-subtle); color: var(--text-primary); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.nav-burger {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
}
.nav-burger span {
  display: block; width: 16px; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transition: all 200ms;
}

/* ── Layout ─────────────────────────────────────────────────── */
.main-content { min-height: calc(100vh - var(--navbar-h) - 180px); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.page-header .container { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-header-text { flex: 1; }
.page-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 8px;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.page-subtitle {
  margin-top: 10px; font-size: 15px;
  color: var(--text-secondary); max-width: 520px;
}

/* ── Hero (home) ────────────────────────────────────────────── */
.hero {
  padding: 80px 0 64px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 60% -10%, var(--accent-light) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  position: relative; z-index: 1;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-light); color: var(--accent-text);
  font-size: 12px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 14px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700; line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 20px;
}
.hero-title .highlight { color: var(--accent); }
.hero-desc {
  font-size: 17px; color: var(--text-secondary);
  max-width: 540px; line-height: 1.7; margin-bottom: 36px;
}
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 32px; margin-bottom: 40px;
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.03em;
}
.hero-stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap; cursor: pointer; text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary {
  background: var(--bg-card); color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-subtle); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-danger { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }

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

/* ── Brand Grid ─────────────────────────────────────────────── */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.brand-card {
  display: flex; flex-direction: column;
  padding: 20px;
}
.brand-card-name {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.brand-card-count {
  font-size: 12px; color: var(--text-muted);
  font-family: var(--font-mono);
}
.brand-card-icon {
  width: 40px; height: 40px;
  background: var(--bg-subtle); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
}
.brand-card .badge-type {
  margin-top: auto; padding-top: 12px;
}

/* ── File Table ─────────────────────────────────────────────── */
.file-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 32px;
}
.file-table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.file-table-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  color: var(--text-primary);
}
.file-count-badge {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--bg-subtle); color: var(--text-muted);
  padding: 3px 10px; border-radius: 99px;
}
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg-subtle); }
th {
  text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 10px 16px;
}
td { padding: 11px 16px; border-top: 1px solid var(--border); }
tr:hover td { background: var(--bg-subtle); }
.td-filename {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-primary);
}
.td-size { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.td-dl { text-align: right; }

/* ── Search ─────────────────────────────────────────────────── */
.search-wrap {
  position: relative; max-width: 520px;
}
.search-input {
  width: 100%; padding: 12px 16px 12px 44px;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 99px;
}
.badge-green { background: var(--accent-light); color: var(--accent-text); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-blue  { background: var(--blue-light);  color: var(--blue); }

/* ── Download Button ────────────────────────────────────────── */
.dl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  background: var(--accent-light); color: var(--accent-text);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  transition: all var(--transition);
  cursor: pointer; text-decoration: none;
}
.dl-btn:hover {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.dl-btn svg { flex-shrink: 0; }

/* ── Section title ──────────────────────────────────────────── */
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-primary); margin-bottom: 12px;
}

/* ── Home feature cards ─────────────────────────────────────── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.feature-card { padding: 28px; }
.feature-icon {
  width: 44px; height: 44px;
  background: var(--accent-light); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.feature-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; margin-bottom: 8px;
}
.feature-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  margin-bottom: 8px;
}
.footer-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 20px; }
.footer-links a { font-size: 13px; color: var(--text-secondary); transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* ── Admin ──────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px; background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 12px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar-brand {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  padding: 8px 12px; margin-bottom: 16px;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition); cursor: pointer;
  text-decoration: none;
}
.admin-nav-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.admin-nav-item.active { background: var(--accent-light); color: var(--accent-text); }
.admin-main { flex: 1; padding: 32px; overflow: auto; }
.admin-page-title {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  margin-bottom: 24px; letter-spacing: -0.02em;
}

/* ── Upload Zone ────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 24px; text-align: center;
  cursor: pointer; transition: all var(--transition);
  background: var(--bg-subtle);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}
.upload-zone-icon { font-size: 40px; margin-bottom: 12px; }
.upload-zone-text { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.upload-zone-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ── Form elements ──────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="email"], select, textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A9891' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 16px; }
.alert-success { background: var(--accent-light); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.alert-error   { background: var(--danger-light);  color: var(--danger);       border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info    { background: var(--blue-light);    color: var(--blue);         border: 1px solid color-mix(in srgb, var(--blue) 25%, transparent); }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 24px; }
.page-item {
  display: flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-secondary);
  cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.page-item:hover { background: var(--bg-subtle); color: var(--text-primary); }
.page-item.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Utility ────────────────────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-40 { margin-bottom: 40px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-mono { font-family: var(--font-mono); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--navbar-h); left: 0; right: 0;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 12px; gap: 4px; z-index: 99;
  }
  .nav-burger { display: flex; }
  .nav-brand { margin-right: 0; }
  .brand-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .admin-sidebar { display: none; }
  .admin-main { padding: 16px; }
  .hero { padding: 48px 0 40px; }
  th:nth-child(3), td:nth-child(3) { display: none; }
}
