:root {
  --bg: #07111f;
  --bg-soft: #0d1a2d;
  --panel: rgba(13, 26, 45, .82);
  --panel-strong: rgba(15, 30, 52, .95);
  --text: #eef5ff;
  --muted: #9bb0cb;
  --line: rgba(255,255,255,.10);
  --primary: #4f8cff;
  --primary-2: #6e6bff;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 24px 70px rgba(0,0,0,.30);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(79,140,255,.16), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(110,107,255,.12), transparent 34%),
    linear-gradient(180deg, #07111f 0%, #091523 60%, #07101c 100%);
  overflow-x: hidden;
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.hidden { display: none !important; }

.ambient { position: fixed; border-radius: 999px; filter: blur(100px); opacity: .18; pointer-events: none; z-index: -1; }
.ambient-a { width: 360px; height: 360px; background: #3b82f6; left: -180px; top: 22vh; }
.ambient-b { width: 420px; height: 420px; background: #7c3aed; right: -220px; top: 45vh; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 0 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
  font-weight: 900; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 26px rgba(79,140,255,.28);
}
.brand span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }
.admin-link {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: #dbe8f8;
  background: rgba(255,255,255,.04); transition: .18s ease;
}
.admin-link:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }

.page-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 22px; padding: 36px 0 24px; }
.panel { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.hero-card, .stats-panel { border-radius: var(--radius); }
.hero-card { padding: clamp(24px, 4vw, 46px); }
.stats-panel { padding: 26px; align-self: start; position: sticky; top: 18px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .16em; color: #8eb7ff; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.02; letter-spacing: -.045em; margin: 12px 0 16px; max-width: 780px; }
h2 { font-size: 22px; letter-spacing: -.02em; margin: 8px 0 0; }
.lead { max-width: 760px; font-size: 16px; line-height: 1.7; color: var(--muted); margin-bottom: 24px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid rgba(79,140,255,.20); background: rgba(79,140,255,.08); border-radius: 16px; }
.notice p { margin: 0; color: #c9daf0; line-height: 1.55; font-size: 13px; }
.notice-icon { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; background: rgba(79,140,255,.24); color: #bcd5ff; font-weight: 800; font-size: 12px; }

.submission-form { margin-top: 26px; display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: .7fr 1.3fr; gap: 16px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 13px; font-weight: 700; color: #c7d6e9; }
.field input, .field select, .search-box input {
  width: 100%; border: 1px solid var(--line); outline: none; color: var(--text);
  background: rgba(3, 10, 20, .45); border-radius: 14px; padding: 14px 15px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input:focus, .field select:focus, .search-box input:focus { border-color: rgba(79,140,255,.68); box-shadow: 0 0 0 4px rgba(79,140,255,.10); background: rgba(3,10,20,.68); }
.field select option { background: #0b1728; }

.upload-box {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  border: 1px dashed rgba(143,173,214,.35); border-radius: 18px; padding: 18px; background: rgba(255,255,255,.025);
  transition: .18s ease;
}
.upload-box:hover, .upload-box.dragover { border-color: rgba(79,140,255,.75); background: rgba(79,140,255,.06); }
.upload-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(79,140,255,.12); color: #9dc0ff; font-size: 24px; }
.upload-box strong { display: block; margin-bottom: 5px; }
.upload-box p { margin: 0; color: var(--muted); font-size: 13px; }
.ghost-button, .icon-button, .secondary-button, .ghost-danger-button {
  border: 1px solid var(--line); color: #dbe8f8; background: rgba(255,255,255,.04); border-radius: 12px; transition: .18s ease;
}
.ghost-button { padding: 10px 13px; }
.ghost-button:hover, .icon-button:hover, .secondary-button:hover { background: rgba(255,255,255,.08); }
.preview-wrap { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); }
.preview-wrap img { width: 92px; height: 70px; object-fit: cover; border-radius: 11px; border: 1px solid var(--line); }
.preview-meta { min-width: 0; display: grid; gap: 4px; }
.preview-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta span { color: var(--muted); font-size: 13px; }

.primary-button { position: relative; border: 0; min-height: 52px; border-radius: 15px; color: white; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 14px 30px rgba(79,140,255,.22); transition: .18s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(79,140,255,.28); }
.primary-button:disabled { opacity: .62; cursor: not-allowed; transform: none; }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.36); border-top-color: white; border-radius: 50%; animation: spin .75s linear infinite; }
.primary-button.loading .button-label { display: none; }
.primary-button.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-message { min-height: 20px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.form-message.success { color: #7be4bd; }
.form-message.error { color: #ff9daf; }

.stats-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.icon-button { width: 38px; height: 38px; font-size: 18px; }
.total-card { margin-top: 22px; padding: 22px; border: 1px solid rgba(79,140,255,.18); border-radius: 18px; background: linear-gradient(145deg, rgba(79,140,255,.15), rgba(110,107,255,.06)); }
.total-card span, .total-card small { display: block; color: var(--muted); }
.total-card strong { display: block; font-size: 52px; letter-spacing: -.05em; margin: 6px 0 1px; }
.squad-stats { display: grid; gap: 10px; margin-top: 14px; }
.squad-stat { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.squad-stat:last-child { border-bottom: 0; }
.squad-dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #bcd2ed; font-weight: 800; }
.squad-stat div { display: grid; gap: 2px; }
.squad-stat div strong { font-size: 14px; }
.squad-stat small { color: var(--muted); }
.squad-stat b { font-size: 24px; }
.stats-note { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 14px 0 0; }
.site-footer { padding: 24px 0 34px; color: #7186a1; font-size: 12px; text-align: center; }

/* Admin */
.admin-main { padding: 32px 0 48px; }
.login-card { width: min(470px, 100%); margin: 40px auto 0; border-radius: var(--radius); padding: 34px; }
.login-card h1 { font-size: 36px; }
.login-card p { color: var(--muted); line-height: 1.6; }
.login-form { display: grid; gap: 16px; margin-top: 22px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.dashboard-heading h1 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 10px; }
.dashboard-heading p { color: var(--muted); margin: 0; }
.dashboard-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.secondary-button, .ghost-danger-button { padding: 11px 14px; }
.ghost-danger-button { color: #ffabb8; border-color: rgba(251,113,133,.22); }
.ghost-danger-button:hover { background: rgba(251,113,133,.08); }
.admin-stat-grid { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 14px; }
.metric-card { padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: rgba(13,26,45,.70); }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card strong { display: block; font-size: 38px; margin: 6px 0 1px; letter-spacing: -.04em; }
.metric-total { background: linear-gradient(145deg, rgba(79,140,255,.16), rgba(110,107,255,.07)); border-color: rgba(79,140,255,.20); }
.toolbar { margin: 18px 0; padding: 12px; border-radius: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-tab { border: 1px solid transparent; border-radius: 11px; padding: 9px 12px; background: transparent; color: #a9bdd6; }
.filter-tab:hover { background: rgba(255,255,255,.04); }
.filter-tab.active { background: rgba(79,140,255,.14); color: #dbe9ff; border-color: rgba(79,140,255,.18); }
.search-box { position: relative; min-width: min(310px, 100%); }
.search-box span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 34px; }
.squad-sections { display: grid; gap: 18px; }
.squad-section { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: rgba(13,26,45,.60); }
.squad-section-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.025); }
.squad-section-head h2 { margin: 0; font-size: 18px; }
.squad-section-head span { color: var(--muted); font-size: 13px; }
.submission-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; padding: 14px; }
.submission-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: rgba(4,11,22,.42); }
.evidence-button { display: block; width: 100%; border: 0; padding: 0; background: #07111f; aspect-ratio: 16/9; overflow: hidden; }
.evidence-button img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .22s ease; }
.evidence-button:hover img { transform: scale(1.025); }
.submission-card-body { padding: 14px; display: grid; gap: 10px; }
.submission-person { min-width: 0; }
.submission-person strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.submission-person small { display: block; color: var(--muted); margin-top: 4px; }
.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.badge { padding: 5px 8px; border-radius: 999px; background: rgba(52,211,153,.10); color: #7be4bd; font-size: 11px; font-weight: 700; }
.delete-button { border: 0; background: transparent; color: #ff9daf; padding: 6px 0; font-size: 12px; }
.empty-state { padding: 36px 20px; text-align: center; color: var(--muted); }
.image-dialog { width: min(1100px, calc(100% - 28px)); max-height: 92vh; border: 1px solid var(--line); border-radius: 20px; padding: 12px; background: #07111f; color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.60); }
.image-dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.image-dialog img { display: block; max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 12px; }
.dialog-close { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 999px; border: 1px solid rgba(255,255,255,.15); color: white; background: rgba(0,0,0,.56); font-size: 22px; }
.dialog-caption { padding: 10px 4px 2px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .page-grid { grid-template-columns: 1fr; padding-top: 22px; }
  .stats-panel { position: static; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .submission-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { min-width: 0; width: 100%; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 22px, 1180px); }
  .site-header { padding-top: 16px; }
  .brand small { display: none; }
  .admin-link { font-size: 12px; padding: 9px 11px; }
  .hero-card, .stats-panel, .login-card { border-radius: 20px; }
  .hero-card { padding: 22px 18px; }
  .stats-panel { padding: 20px 18px; }
  h1 { font-size: 37px; }
  .field-row { grid-template-columns: 1fr; }
  .upload-box { grid-template-columns: auto 1fr; }
  .upload-box .ghost-button { grid-column: 1 / -1; width: 100%; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 32px; }
  .submission-grid { grid-template-columns: 1fr; }
  .filter-tabs { display: grid; grid-template-columns: repeat(2, 1fr); }
  .filter-tab { text-align: center; }
}
