:root {
  --navy: #081a3e;
  --blue: #174a88;
  --cyan: #28b6e6;
  --ruby: #9f0a2b;
  --deep-ruby: #5e061d;
  --gold: #f5c64d;
  --champagne: #ffe9a7;
  --paper: #f7fbff;
  --ink: #102553;
  --muted: #64748b;
  --danger: #b42318;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
  background:
    linear-gradient(135deg, rgba(255,255,255,.045) 25%, transparent 25%) 0 0/42px 42px,
    radial-gradient(circle at 80% 10%, rgba(40,182,230,.46), transparent 32rem),
    linear-gradient(125deg, #102b67, #0b699d 58%, #071a43);
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: .7rem clamp(1rem, 5vw, 4.5rem);
  color: white;
  background: rgba(6, 22, 55, .9);
  border-bottom: 2px solid var(--gold);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(1, 8, 25, .35);
}
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; }
.brand img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--champagne);
  box-shadow: 0 5px 16px rgba(0,0,0,.38), 0 0 18px rgba(245,198,77,.2);
}
.brand strong { display: block; font-size: 1.35rem; line-height: 1; }
.brand small { color: var(--champagne); font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: 1rem; }
.site-nav a { color: white; font-weight: 750; text-decoration: none; }
.site-nav a:hover { color: var(--champagne); }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .72rem 1.15rem;
  color: white;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid var(--champagne);
  border-radius: 14px;
  background: linear-gradient(#326eb2, #142f68);
  box-shadow: 0 7px 18px rgba(1, 11, 34, .32), inset 0 1px rgba(255,255,255,.18);
}
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button.ruby { background: linear-gradient(#c31a42, var(--deep-ruby)); }
.button.ghost { background: rgba(255,255,255,.08); }
.button.small { min-height: 36px; padding: .45rem .75rem; font-size: .9rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  width: min(1180px, calc(100% - 2rem));
  margin: auto;
  padding: clamp(3rem, 8vw, 7rem) 0;
  color: white;
}
.eyebrow { color: var(--champagne); font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { margin: .5rem 0 1rem; font-size: clamp(3rem, 8vw, 6.5rem); line-height: .88; letter-spacing: -.06em; }
.hero h1 span { display: block; color: var(--champagne); font-size: .38em; letter-spacing: -.02em; }
.hero p { max-width: 680px; font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.65; color: #e7f7ff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-logo { position: relative; display: grid; place-items: center; }
.hero-logo::before {
  content: "";
  position: absolute;
  width: 105%; height: 105%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,229,146,.45), transparent 65%);
  filter: blur(8px);
}
.hero-logo img {
  position: relative;
  width: min(100%, 420px);
  border-radius: 28%;
  filter: drop-shadow(0 28px 35px rgba(0,0,0,.48));
}

.public-section { padding: 4rem max(1rem, calc((100% - 1180px)/2)); background: var(--paper); }
.public-section h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 1.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature {
  padding: 1.5rem;
  border: 1px solid #dbe7f3;
  border-top: 4px solid var(--gold);
  border-radius: 18px;
  background: white;
  box-shadow: 0 12px 30px rgba(16,37,83,.09);
}
.feature b { display: block; margin-bottom: .5rem; font-size: 1.15rem; }
.feature p { color: #516078; line-height: 1.55; }

.site-footer { margin-top: auto; padding: 1.5rem max(1rem, calc((100% - 1180px)/2)); color: #d8edff; background: #06152f; border-top: 1px solid #29466e; }
.site-footer .row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--champagne); }

.auth-wrap { width: min(460px, calc(100% - 2rem)); margin: auto; padding: 4rem 0; }
.auth-card, .panel {
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(255,255,255,.75);
  border-top: 4px solid var(--gold);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(0,0,0,.28);
}
.auth-card { padding: 2rem; }
.auth-card .auth-logo { display: block; width: 108px; height: 108px; border-radius: 50%; margin: -5.5rem auto 1rem; border: 3px solid var(--champagne); box-shadow: 0 12px 28px rgba(0,0,0,.3); }
.auth-card h1 { text-align: center; margin: .2rem 0 1.5rem; }

label { display: grid; gap: .4rem; color: #263a5f; font-weight: 750; }
input, select, textarea {
  width: 100%;
  padding: .75rem .85rem;
  color: var(--ink);
  border: 1px solid #bfccdc;
  border-radius: 11px;
  background: white;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,198,77,.24); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 1rem; }
.hint { color: var(--muted); font-size: .9rem; }

.admin-body { background: #eef4fa; }
.admin-layout { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.2rem; color: white; background: linear-gradient(170deg, #0c285c, #07152f); border-right: 2px solid var(--gold); }
.sidebar .brand { margin-bottom: 1.5rem; }
.admin-nav { display: grid; gap: .35rem; }
.admin-nav a { padding: .72rem .85rem; border-radius: 10px; color: #ddebfa; font-weight: 750; text-decoration: none; }
.admin-nav a:hover, .admin-nav a.active { color: white; background: linear-gradient(90deg, rgba(245,198,77,.22), rgba(255,255,255,.06)); box-shadow: inset 3px 0 var(--gold); }
.sidebar-bottom { position: absolute; left: 1.2rem; right: 1.2rem; bottom: 1.2rem; color: #a8bad2; font-size: .84rem; }
.admin-main { min-width: 0; padding: clamp(1rem, 3vw, 2.2rem); }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.admin-top h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); }
.admin-user { color: var(--muted); text-align: right; }

.flash { margin-bottom: 1rem; padding: .85rem 1rem; border-radius: 12px; color: #075f39; background: #dff8eb; border: 1px solid #93deb8; }
.flash.error { color: #7f1d1d; background: #fee2e2; border-color: #fecaca; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.metric { padding: 1.2rem; color: white; background: linear-gradient(135deg, #245f9f, #112c63); border: 1px solid var(--gold); border-radius: 16px; box-shadow: 0 10px 24px rgba(16,37,83,.16); }
.metric span { display: block; color: #cdeeff; font-size: .86rem; font-weight: 750; }
.metric strong { display: block; margin-top: .35rem; font-size: 2rem; }
.metric.ruby { background: linear-gradient(135deg, #b51238, #5c071d); }

.panel { padding: 1.2rem; margin-bottom: 1.2rem; overflow: hidden; box-shadow: 0 10px 28px rgba(16,37,83,.08); }
.panel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.panel h2, .panel h3 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: .72rem .65rem; text-align: left; border-bottom: 1px solid #e1e9f1; vertical-align: top; }
th { color: #4a5f7c; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; padding: .25rem .55rem; border-radius: 999px; color: #38506e; background: #e8eef5; font-size: .78rem; font-weight: 800; }
.badge.active { color: #065f46; background: #d1fae5; }
.badge.draft { color: #92400e; background: #fef3c7; }
.badge.closed { color: #6b21a8; background: #f3e8ff; }
.ad-thumb { width: 54px; height: 64px; object-fit: cover; border: 2px solid white; border-radius: 8px; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.empty { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed #bdcad9; border-radius: 14px; }
.legal { width: min(850px, calc(100% - 2rem)); margin: 2rem auto; padding: 2rem; background: white; border-top: 4px solid var(--gold); border-radius: 18px; box-shadow: 0 15px 40px rgba(0,0,0,.2); }
.legal h1 { margin-top: 0; }
.legal p, .legal li { line-height: 1.65; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-logo { order: -1; }
  .hero-logo img { width: 240px; }
  .feature-grid, .metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .admin-nav { grid-template-columns: repeat(3, 1fr); }
  .sidebar-bottom { position: static; margin-top: 1rem; }
}

@media (max-width: 600px) {
  .site-nav a:not(.button) { display: none; }
  .feature-grid, .metrics, .form-grid { grid-template-columns: 1fr; }
  .admin-nav { grid-template-columns: repeat(2, 1fr); }
  .admin-top { align-items: flex-start; }
  .admin-user { display: none; }
  .panel { padding: .9rem; }
}

