/* RAFC Admin v1 - Stylesheet */

:root {
  --navy: #1E2A5C;
  --navy-deep: #0F1A3E;
  --navy-mid: #3D4E8E;
  --black: #0A0A0A;
  --gold: #FFFFFF;
  --gold-bright: #E8EBF0;
  --paper: #F4F5F8;
  --paper-warm: #E8EBF0;
  --line: rgba(30, 42, 92, 0.12);
  --line-dark: rgba(244, 245, 248, 0.12);
  --red: #C8323C;
  --green: #4A7C59;
  --bg: #F4F5F8;
  --text: #1E2A5C;
  --muted: rgba(30, 42, 92, 0.55);

  --shadow-sm: 0 1px 3px rgba(30,42,92,0.08);
  --shadow-md: 0 4px 16px rgba(30,42,92,0.10);
  --shadow-lg: 0 12px 40px rgba(30,42,92,0.18);
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-mid); }

/* ============ APP LAYOUT ============ */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--navy-deep);
  color: var(--paper);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { padding: 24px 24px 20px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line-dark); }
.brand-logo {
  width: 64px; height: 64px;
  background: url('img/logo.png') no-repeat center / contain;
  text-indent: -9999px;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-logo span { display: none; }
.brand-logo.big { width: 96px; height: 96px; }
.brand strong { font-size: 14px; font-weight: 700; display: block; }
.brand small { font-size: 11px; color: rgba(244,239,227,0.55); letter-spacing: 0.05em; text-transform: uppercase; }

.nav { padding: 12px 0; flex: 1; }
.nav-section {
  padding: 16px 24px 6px;
  font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244,239,227,0.4);
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  color: rgba(244,239,227,0.75);
  font-weight: 500; font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav a:hover { background: rgba(244,239,227,0.04); color: var(--paper); }
.nav a.active {
  background: rgba(200,166,86,0.08);
  color: var(--gold);
  border-left-color: var(--gold);
}
.nav .ico {
  width: 18px; text-align: center;
  font-size: 14px; opacity: 0.7;
}

.sidebar-footer {
  padding: 16px 24px; border-top: 1px solid var(--line-dark);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.user-info strong { display: block; font-size: 13px; }
.user-info small { color: rgba(244,239,227,0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.logout {
  font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(244,239,227,0.5);
  padding: 6px 10px; border: 1px solid var(--line-dark);
}
.logout:hover { color: var(--red); border-color: var(--red); }

.main {
  padding: 32px 40px;
  max-width: 1400px;
  width: 100%;
}

/* ============ HEADERS ============ */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 32px; flex-wrap: wrap;
  padding-bottom: 24px; border-bottom: 1px solid var(--line);
}
.page-header h1 {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 36px; line-height: 1;
  letter-spacing: -0.01em; text-transform: uppercase;
}
.eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.eyebrow a { color: var(--navy); }
.header-actions { display: flex; gap: 12px; }

/* ============ FLASH / ALERTS ============ */
.flash, .alert {
  padding: 14px 20px; margin-bottom: 24px;
  border-left: 3px solid;
  font-size: 14px; font-weight: 500;
}
.flash-success, .alert-success { background: #ECF6EE; color: #1F5C2E; border-color: var(--green); }
.flash-error, .alert-error     { background: #FBECEC; color: #6E1A1F; border-color: var(--red); }
.flash-info, .alert-info       { background: #ECF1F8; color: var(--navy); border-color: var(--navy-mid); }

/* ============ STATS GRID (DASHBOARD) ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 32px;
}
.stat-card {
  background: white; padding: 24px 28px;
  display: block; transition: all 0.2s;
}
.stat-card:hover { background: var(--paper); transform: translateY(-2px); }
.stat-num {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 56px; line-height: 1;
  color: var(--navy); letter-spacing: -0.02em; margin-bottom: 8px;
}
.stat-label {
  font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  padding: 28px;
}
.card-wide { grid-column: 1 / -1; }
.card-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.card-header h2 {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 22px;
  text-transform: uppercase; letter-spacing: -0.01em;
}
.card-link { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy); }

/* ============ NEXT MATCH ============ */
.next-match { padding: 8px 0; }
.nm-comp { font-size: 12px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 12px; }
.nm-teams {
  display: flex; align-items: center; justify-content: space-around; gap: 24px;
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 700; font-size: 22px; text-transform: uppercase;
  margin: 16px 0;
}
.nm-teams .vs { color: var(--navy-mid); font-size: 32px; }
.nm-info { color: var(--muted); margin-bottom: 20px; }

.recent-list, .audit-list { list-style: none; }
.recent-list li { border-bottom: 1px solid var(--line); }
.recent-list li:last-child { border-bottom: none; }
.recent-list a { display: block; padding: 12px 0; }
.rl-title { display: block; font-weight: 600; }
.rl-meta { font-size: 12px; color: var(--muted); }

.audit-list li {
  display: grid; grid-template-columns: 100px 120px auto auto 1fr;
  gap: 12px; padding: 8px 0; font-size: 13px;
  border-bottom: 1px dashed var(--line);
  align-items: center;
}
.audit-time { font-family: "SF Mono", Menlo, monospace; font-size: 12px; color: var(--muted); }
.audit-user { font-weight: 600; }
.audit-action { font-family: "SF Mono", monospace; color: var(--navy-mid); }
.audit-entity { font-size: 11px; color: var(--muted); }
.audit-details { color: var(--muted); font-style: italic; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 1px solid transparent;
  font-family: inherit; font-size: 13px;
  font-weight: 600; letter-spacing: 0.05em;
  cursor: pointer; transition: all 0.15s;
  text-decoration: none;
  background: transparent;
}
.btn-primary { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); color: #FFFFFF; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 14px 24px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--line);
  color: var(--navy); cursor: pointer; font-size: 14px;
  transition: all 0.15s;
}
.btn-icon:hover { border-color: var(--navy); background: var(--paper); }
.btn-icon-danger:hover { border-color: var(--red); background: var(--red); color: white; }

/* ============ TABLES ============ */
.data-table {
  width: 100%; border-collapse: collapse;
  background: white; border: 1px solid var(--line);
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  background: var(--paper);
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.data-table tr.is-featured { background: rgba(200,166,86,0.05); }
.data-table tr:hover { background: rgba(10,31,61,0.02); }
.data-table .actions { display: flex; gap: 4px; }
.data-table .muted { color: var(--muted); }

.thumb {
  width: 56px; height: 36px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.thumb-round { width: 40px; height: 40px; border-radius: 50%; }
.thumb-empty {
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
}

.badge {
  display: inline-block; padding: 2px 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--paper); color: var(--muted);
}
.badge-gold { background: var(--navy); color: #FFFFFF; }
.tag {
  display: inline-block; padding: 3px 8px;
  font-size: 11px; font-weight: 700;
  background: var(--navy-deep); color: var(--paper);
  letter-spacing: 0.05em;
}
.tag-platine { background: #B9C0C9; color: var(--navy-deep); }
.tag-gold { background: var(--navy); color: #FFFFFF; }
.tag-silver { background: #C0C0C0; color: var(--navy-deep); }
.status {
  display: inline-block; padding: 3px 10px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.status-published { background: #ECF6EE; color: var(--green); }
.status-draft { background: var(--paper); color: var(--muted); }
.status-archived { background: #F0F0F0; color: var(--muted); }
.status-scheduled { background: #ECF1F8; color: var(--navy-mid); }
.status-live { background: var(--red); color: white; animation: pulse 2s infinite; }
.status-finished { background: #E8E8E8; color: var(--muted); }
.status-postponed { background: #FFF4E0; color: #8B5E00; }
.status-cancelled { background: #F0F0F0; color: var(--muted); text-decoration: line-through; }

@keyframes pulse { 50% { opacity: 0.6; } }

/* ============ FILTERS ============ */
.filters { display: flex; gap: 4px; margin-bottom: 24px; }
.filters a {
  padding: 8px 16px; font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted);
  font-weight: 600;
}
.filters a:hover { color: var(--navy); border-color: var(--navy); }
.filters a.active { background: var(--navy-deep); color: var(--paper); border-color: var(--navy-deep); }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center; padding: 80px 32px;
  background: white; border: 1px solid var(--line);
  border-style: dashed;
}
.empty-state h3 {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 28px; margin-bottom: 8px;
  text-transform: uppercase;
}
.empty-state p { color: var(--muted); margin-bottom: 24px; }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; }

/* ============ FORMS ============ */
.form-stack { max-width: 1000px; }
.form-section {
  background: white;
  padding: 28px 32px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.form-section h2 {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 18px;
  text-transform: uppercase; letter-spacing: 0.02em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.form-section fieldset {
  border: 1px dashed var(--line); padding: 16px 20px; margin-top: 16px;
}
.form-section fieldset legend {
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--navy); padding: 0 8px; font-weight: 700;
}
.form-hint { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.form-section label, .form-grid label {
  display: block; margin-bottom: 16px;
}
.form-section label > span, .form-grid label > span {
  display: block; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  font-weight: 700; margin-bottom: 6px;
}
.form-section label > span em, .form-grid label > span em {
  color: var(--red); font-style: normal;
}
.form-section label.full { grid-column: 1 / -1; }
.form-section input[type=text], .form-section input[type=email],
.form-section input[type=password], .form-section input[type=tel],
.form-section input[type=number], .form-section input[type=date],
.form-section input[type=time], .form-section input[type=datetime-local],
.form-section input[type=url], .form-section input:not([type]),
.form-section select, .form-section textarea,
.form-grid input, .form-grid select, .form-grid textarea, .login-form input {
  width: 100%; padding: 10px 12px;
  font-family: inherit; font-size: 14px;
  border: 1px solid var(--line); background: white;
  color: var(--text); transition: all 0.15s;
}
.form-section input[type=file] { padding: 8px 0; font-size: 13px; }
.form-section input:focus, .form-section select:focus, .form-section textarea:focus,
.login-form input:focus, .form-grid input:focus {
  outline: none; border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(200,166,86,0.15);
}
.form-section textarea { font-family: inherit; line-height: 1.6; resize: vertical; }
.form-section small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }

.form-row { display: grid; gap: 16px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}

.checkbox-line {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--paper); border: 1px solid var(--line);
  cursor: pointer; user-select: none;
}
.checkbox-line input { width: auto; }
.checkbox-line span { font-weight: 600; }

.current-image {
  margin-top: 8px; padding: 8px;
  background: var(--paper); border: 1px solid var(--line);
  display: inline-block;
}
.current-image img { max-height: 80px; max-width: 200px; display: block; }

.form-actions {
  display: flex; justify-content: flex-end; gap: 12px;
  padding: 24px 0; margin-top: 16px;
  border-top: 2px solid var(--navy-deep);
}

/* ============ SPONSOR GRID (admin) ============ */
.sponsor-admin-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.sponsor-card {
  background: white; border: 1px solid var(--line);
  display: grid; grid-template-columns: 100px 1fr auto;
  gap: 16px; align-items: center; padding: 16px;
}
.sponsor-card.inactive { opacity: 0.5; }
.sponsor-logo {
  width: 100px; height: 70px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); padding: 8px;
}
.sponsor-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-empty { font-weight: 800; font-size: 24px; color: var(--muted); }
.sponsor-info strong { display: block; font-size: 14px; margin-bottom: 4px; }
.sponsor-actions { display: flex; gap: 4px; }

/* ============ ALBUM GRID ============ */
.album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.album-card {
  background: white; border: 1px solid var(--line);
  display: block; transition: all 0.2s;
}
.album-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.album-cover {
  position: relative; aspect-ratio: 4/3;
  background: var(--paper);
  overflow: hidden;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 56px;
}
.album-count {
  position: absolute; bottom: 8px; right: 8px;
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  background: var(--navy-deep); color: var(--paper);
  letter-spacing: 0.05em;
}
.album-info { padding: 14px 16px; }
.album-info strong { display: block; margin-bottom: 4px; }
.album-info small { color: var(--muted); font-size: 12px; }

.upload-zone {
  border: 2px dashed var(--navy);
  background: rgba(200,166,86,0.05);
  padding: 24px; text-align: center;
  margin-bottom: 24px;
}
.upload-zone input[type=file] { margin-bottom: 12px; }

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.photo-tile {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--paper);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-delete {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px;
  background: rgba(10,10,10,0.7); color: white;
  border: none; cursor: pointer; font-size: 12px;
  opacity: 0; transition: opacity 0.2s;
}
.photo-tile:hover .photo-delete { opacity: 1; }

/* ============ LOGIN ============ */
.login-body {
  background: var(--navy-deep);
  background-image:
    radial-gradient(ellipse at top right, rgba(200,166,86,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(27,58,107,0.4) 0%, transparent 60%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 20px;
}
.login-wrap {
  background: var(--paper);
  width: 100%; max-width: 420px;
  padding: 48px 40px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  border-top: 4px solid var(--navy);
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand .brand-logo { margin: 0 auto 20px; }
.login-brand h1 {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 36px;
  text-transform: uppercase; letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.login-brand p { color: var(--muted); font-size: 13px; }
.login-form label { display: block; margin-bottom: 16px; }
.login-form label span { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.login-foot { text-align: center; color: var(--muted); font-size: 11px; letter-spacing: 0.05em; margin-top: 24px; }

/* ============ INSTALL ============ */
.install-body {
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 20px;
}
.install-wrap { width: 100%; max-width: 640px; }
.install-header {
  display: flex; gap: 20px; align-items: center; margin-bottom: 32px;
}
.install-logo {
  width: 80px; height: 80px;
  background: url('img/logo.png') no-repeat center / contain;
  text-indent: -9999px;
  overflow: hidden;
}
.install-logo span { display: none; }
.install-header h1 {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 32px; text-transform: uppercase;
}
.install-steps {
  display: flex; gap: 8px; list-style: none; margin-bottom: 24px;
  background: white; border: 1px solid var(--line); padding: 12px;
}
.install-steps li {
  flex: 1; padding: 12px;
  font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 700; color: var(--muted);
  border-bottom: 3px solid var(--line);
}
.install-steps li.current { color: var(--navy); border-color: var(--navy); }
.install-steps li.done { color: var(--green); border-color: var(--green); }
.install-card {
  background: white; padding: 32px; border: 1px solid var(--line);
}
.install-card h2 {
  font-family: "Big Shoulders Display", system-ui, sans-serif;
  font-weight: 900; font-size: 22px;
  text-transform: uppercase; margin-bottom: 12px;
}
.install-card.success { border-top: 4px solid var(--green); }
.install-card pre {
  background: var(--bg); padding: 12px;
  font-family: "SF Mono", Menlo, monospace; font-size: 12px;
  margin: 12px 0; border-left: 3px solid var(--navy);
}
.install-card code { font-family: "SF Mono", Menlo, monospace; background: var(--bg); padding: 2px 6px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto;
    flex-direction: column;
  }
  .nav { display: flex; flex-wrap: wrap; padding: 0; }
  .nav a { flex: 1 1 auto; padding: 10px 12px; font-size: 12px; border-left: none; border-bottom: 3px solid transparent; }
  .nav a.active { border-bottom-color: var(--gold); border-left-color: transparent; }
  .nav-section { display: none; }
  .main { padding: 24px 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row.two, .form-row.three, .form-grid { grid-template-columns: 1fr; }
  .data-table { display: block; overflow-x: auto; }
}
