/*
 * Portalens design. Lægges oven på styles.css (grundlayout) på alle sider.
 * Samme sider og funktioner – kun udseende: blødere kort, tydeligere hierarki, klubfarver
 * (blå/lilla + rød fra logoet), gradient-topbar og mere luft. Ingen eksterne skrifttyper.
 */
:root {
  --bg: #f3f4fa;
  --card: #ffffff;
  --text: #171a2c;
  --muted: #646a85;
  --line: #e4e6f0;
  --brand: #2e1a6b;
  --brand-2: #4b33b5;
  --brand-soft: #efecfb;
  --accent: #c8102e;            /* den røde fra klublogoet */
  --link: #3d27a0;
  --pick: #f1eefc;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 44, .05), 0 1px 3px rgba(23, 26, 44, .08);
  --shadow-md: 0 4px 10px rgba(23, 26, 44, .06), 0 12px 32px rgba(46, 26, 107, .10);
  --ring: 0 0 0 4px rgba(75, 51, 181, .18);
  --topbar-grad: linear-gradient(120deg, #1d0f4a 0%, #2e1a6b 45%, #4b2fa8 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1120;
    --card: #181b2e;
    --text: #e9eaf4;
    --muted: #9aa0bd;
    --line: #2a2e47;
    --brand: #8c7af0;
    --brand-2: #a596ff;
    --brand-soft: #241f45;
    --accent: #ff5a6e;
    --link: #b9adff;
    --pick: #221d40;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, .45);
    --ring: 0 0 0 4px rgba(140, 122, 240, .25);
    --topbar-grad: linear-gradient(120deg, #120a33 0%, #21134f 50%, #34208a 100%);
  }
}

/* ---------- Grundlag ---------- */
body {
  font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  background:
    radial-gradient(1200px 400px at 100% -10%, rgba(75, 51, 181, .08), transparent 60%),
    radial-gradient(900px 300px at -10% 0%, rgba(200, 16, 46, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 1180px; padding: 28px 20px 120px; }
h1 { font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-weight: 700; letter-spacing: -.01em; }
a { text-underline-offset: 2px; }
::selection { background: rgba(75, 51, 181, .2); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--topbar-grad);
  padding: 10px 20px;
  gap: 8px 24px;
  box-shadow: 0 2px 16px rgba(29, 15, 74, .25);
}
.topbar::after { /* tynd rød klubstribe */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: .9;
}
.brand { gap: 12px; }
.brand-logo { height: 40px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.brand-text { display: grid; line-height: 1.1; font-weight: 750; font-size: 1.05rem; white-space: nowrap; letter-spacing: -.01em; }
.brand-text small { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.topbar nav { gap: 2px; }
.topbar nav a { padding: 6px 10px; border-radius: 99px; opacity: .82; font-weight: 500; font-size: .88rem; white-space: nowrap; transition: background .15s, opacity .15s; }
.topbar nav a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.topbar nav a.active { background: #fff; color: var(--brand) !important; opacity: 1; font-weight: 650; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
@media (prefers-color-scheme: dark) { .topbar nav a.active { color: #2e1a6b !important; } }
.who { display: inline-flex; align-items: center; gap: 8px; opacity: 1; }
.who .avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35);
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.who-name { font-weight: 500; opacity: .9; }
button.link { text-decoration: none; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .3); font-size: .85rem; }
button.link:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Undermenu i modulerne ---------- */
.subnav {
  position: relative; z-index: 30;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.subnav-inner { max-width: 1180px; padding: 8px 20px; gap: 4px 4px; }
.subnav-title { font-weight: 750; margin-right: 14px; color: var(--brand); }
.subnav a { padding: 6px 14px; font-weight: 500; color: var(--muted); }
.subnav a:hover { background: var(--brand-soft); color: var(--brand); }
.subnav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent); }
.subnav a.admin-link.active { color: var(--brand); }
.subnav a.admin-first { border-left: 1px solid var(--line); border-radius: 0 99px 99px 0; padding-left: 16px; }
@media (max-width: 760px) { .topbar { position: relative; } }

/* ---------- Kort, flader og tabeller ---------- */
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow-sm); padding: 22px; }
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
thead th { background: color-mix(in srgb, var(--bg) 70%, var(--card)); font-weight: 650; font-size: .74em; letter-spacing: .06em; padding-top: 10px; padding-bottom: 10px; }
th, td { border-bottom-color: var(--line); padding: 10px 12px; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: color-mix(in srgb, var(--brand) 3.5%, transparent); }
.stats div, .totals { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stats div { padding: 14px 16px; position: relative; overflow: hidden; }
.stats div::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--brand-2), var(--brand)); }
.stats strong { font-size: 1.35rem; letter-spacing: -.01em; }
.flash { border-radius: var(--radius-sm); padding: 12px 16px; border: 1px solid transparent; }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.error { border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.tag { padding: 2px 10px; font-weight: 600; }

/* ---------- Formularer og knapper ---------- */
input, select, textarea { border-radius: var(--radius-sm); padding: 9px 12px; border-color: var(--line); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--ring); }
button, .button { border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 550; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
button:hover, .button:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-sm); }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary-link {
  background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; font-weight: 650;
  box-shadow: 0 4px 14px rgba(46, 26, 107, .28);
}
button.primary:hover, .button.primary-link:hover { background: linear-gradient(135deg, #5a40c9, #34207a); box-shadow: 0 6px 18px rgba(46, 26, 107, .35); }
button.small, .button.small { padding: 5px 11px; border-radius: 8px; }
button.danger { background: color-mix(in srgb, var(--err) 6%, var(--card)); }
.filters a { padding: 6px 14px; font-weight: 550; box-shadow: var(--shadow-sm); }
.filters a.active { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; }

/* ---------- Forside ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: 0 0 22px; padding: 28px 30px;
  border-radius: 22px; color: #fff;
  background: var(--topbar-grad);
  box-shadow: var(--shadow-md);
}
.hero::after { /* klublogoet som stort vandmærke */
  content: ""; position: absolute; right: -30px; top: -40px; width: 260px; height: 260px;
  background: url(/logo.png) center / contain no-repeat; opacity: .12; transform: rotate(-8deg);
}
.hero h1 { color: #fff; margin: 2px 0 6px; font-size: 2.1rem; }
.hero .muted { color: rgba(255, 255, 255, .78); margin: 0; max-width: 560px; }
.hero-date { display: block; margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.hero-date::first-letter { text-transform: uppercase; }

.module-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 4px; }
.module-tile {
  position: relative; padding: 22px; border-radius: 18px; border-color: var(--line);
  box-shadow: var(--shadow-sm); gap: 16px; align-items: center; height: 100%;
}
.module-tile:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.module-tile::after { /* pil der glider frem ved hover */
  content: "→"; position: absolute; right: 18px; bottom: 16px; color: var(--brand); font-weight: 700;
  opacity: 0; transform: translateX(-6px); transition: opacity .15s, transform .15s;
}
.module-tile:hover::after { opacity: 1; transform: none; }
.module-icon {
  flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(145deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, var(--card)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent);
  font-size: 1.9rem;
}
.module-icon img { width: 44px; height: 44px; }
.module-tile h2 { font-size: 1.08rem; margin-bottom: 4px; }
.module-tile p { line-height: 1.45; }
.module-tile.has-news { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent), var(--shadow-sm); }
.icon-badge { background: var(--accent); box-shadow: 0 0 0 3px var(--card); top: -8px; right: -8px; }
.tile-news { color: var(--accent) !important; }

/* ---------- Login ---------- */
body.logged-out main { max-width: 1000px; }
.login-split {
  display: grid; grid-template-columns: 1.05fr 1fr; margin: 4vh auto 0; max-width: 940px;
  border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-md); background: var(--card); border: 1px solid var(--line);
}
.login-brand {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 44px 40px; color: #fff; background: var(--topbar-grad); position: relative; overflow: hidden;
}
.login-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--accent), transparent); }
.login-brand img { width: 92px; height: auto; margin-bottom: 14px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .35)); }
.login-brand h2 { color: #fff; font-size: 1.9rem; margin: 0; letter-spacing: -.02em; }
.login-brand p { margin: 4px 0 18px; color: rgba(255, 255, 255, .8); max-width: 320px; }
.login-brand ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.login-brand li { padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); font-weight: 500; }
.login-card.card.narrow { margin: 0; max-width: none; border: 0; border-radius: 0; box-shadow: none; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-card .login-logo { display: none; }
.login-card h1 { text-align: left; }
.login-card button.primary { padding: 12px; font-size: 1rem; }
@media (max-width: 760px) {
  .login-split { grid-template-columns: 1fr; margin-top: 0; }
  .login-brand { padding: 28px 24px; }
  .login-brand ul { display: none; }
  .login-card.card.narrow { padding: 28px 24px; }
}

/* ---------- Kalendere ---------- */
.month-cal td { transition: background .12s; }
.month-cal td.today { background: var(--brand-soft); }
.month-cal td.today .daynum { background: linear-gradient(135deg, var(--brand-2), var(--brand)); box-shadow: 0 2px 6px rgba(46, 26, 107, .3); }
.chip { border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Mange menupunkter: skjul navnet ved siden af avataren før menuen bryder */
@media (max-width: 1320px) { .who-name { display: none; } .topbar { gap: 8px 16px; } }

/* ---------- Farvevælger (fx VEO-kameraer) ---------- */
/* Den generelle input-padding må ikke klemme farvefeltet til en streg */
input[type="color"] {
  width: 48px; height: 36px; padding: 3px; cursor: pointer;
  border-radius: var(--radius-sm); background: var(--card);
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 7px; }
input[type="color"]:disabled { opacity: .5; cursor: not-allowed; }
