/* Boje preuzete iz logotipa BetterTennis: tamnoplava (#11304C) i zelena (#7FBF35). */
:root {
  --brand-navy: #11304c;
  --brand-green: #7fbf35;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --text: #13263a;
  --muted: #5b6878;
  --border: #dde3e8;
  --primary: #11304c;
  --primary-dark: #0a2036;
  --on-primary: #ffffff;
  --primary-soft: #eaf4de;
  --accent: #7fbf35;
  --brand-text: #11304c;
  --positive: #3f8a12;
  --clay: #c8643b;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --success-soft: #eaf4de;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1824;
    --surface: #152434;
    --text: #e6edf3;
    --muted: #9aabbb;
    --border: #263a4e;
    --primary: #8fd14f;
    --primary-dark: #a6dd6e;
    --on-primary: #0b1a2a;
    --primary-soft: #1d3326;
    --brand-text: #e6edf3;
    --positive: #8fd14f;
    --danger: #f2867d;
    --danger-soft: #3a2220;
    --success-soft: #1d3326;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
h2 { font-size: 1.25rem; }

.container { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.container.wide { max-width: 1280px; }
main.container { flex: 1; padding-top: 24px; padding-bottom: 48px; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; color: var(--brand-text); text-decoration: none; font-style: italic; }
.brand-name span { color: var(--brand-green); }
.brand-mark { width: 40px; height: 40px; display: block; }
/* Logo ima tamnoplave dijelove – u tamnom načinu stoji na svijetloj podlozi. */
.logo-full { display: block; height: auto; }
@media (prefers-color-scheme: dark) {
  .brand-mark { background: #fff; border-radius: 10px; padding: 3px; }
  .logo-full { background: #fff; border-radius: 16px; padding: 12px; }
}
.hero-logo { width: 96px; height: auto; margin: 0 0 16px; }
.login-logo { width: 88px; height: auto; margin: 0 auto 16px; }
.card.narrow > h1 { text-align: center; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.main-nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.main-nav a:hover { background: var(--primary-soft); color: var(--text); }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); }
.logout { display: flex; align-items: center; gap: 10px; margin: 0; }
.who { color: var(--muted); font-size: 0.9rem; }
.badge { display: inline-block; background: var(--brand-green); color: #11304c; font-weight: 600; font-size: 0.7rem; padding: 1px 6px; border-radius: 999px; vertical-align: middle; }

.site-footer { color: var(--muted); font-size: 0.85rem; padding: 20px 0; border-top: 1px solid var(--border); }

/* ---------- Buttons & forms ---------- */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 0.875rem; border-radius: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; margin-top: 4px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
label { display: block; font-weight: 500; font-size: 0.95rem; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.stack { display: grid; gap: 14px; }
form.inline { display: flex; gap: 6px; align-items: center; margin: 0; }
form.inline select { margin: 0; width: auto; min-width: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Cards, flash, misc ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.narrow { max-width: 460px; margin: 24px auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.pre { white-space: pre-wrap; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.flash ul { margin: 0; padding-left: 18px; }
.flash-success { background: var(--success-soft); border-color: var(--primary); }
.flash-error { background: var(--danger-soft); border-color: var(--danger); }
.list { list-style: none; padding: 0; margin: 0 0 8px; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.danger-zone { border-color: var(--danger-soft); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--muted); background: var(--surface); }
.filters a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- Summary tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.summary-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); text-decoration: none; color: var(--text); min-width: 220px; }
a.summary-tile:hover { border-color: var(--primary); }
.summary-tile .label { color: var(--muted); font-size: 0.85rem; }
.summary-tile .value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-tile .hint { color: var(--muted); font-size: 0.8rem; }
.summary-tile.big { margin-bottom: 20px; background: var(--primary-soft); border-color: transparent; }
.summary-tile.big .value { font-size: 2.2rem; color: var(--primary); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; }
td.actions > * { margin: 2px 0 2px 4px; vertical-align: middle; }
td.actions form { display: inline-block; }
td.empty { text-align: center; color: var(--muted); padding: 24px; }
tfoot td { font-weight: 500; }
tr.total td { font-weight: 700; font-size: 1.05rem; border-bottom: 0; }
tr.is-cancelled td, li.is-cancelled { color: var(--muted); text-decoration: line-through; }
tr.is-inactive td { color: var(--muted); }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Week view ---------- */
.week { margin-bottom: 24px; }
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.week-title { display: flex; flex-direction: column; align-items: center; text-align: center; }
.week-title span { color: var(--muted); font-size: 0.9rem; }
.today-link { font-size: 0.85rem; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 180px; overflow: hidden; }
.day.is-weekend { background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
.day.is-today { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.day-head { padding: 8px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.day-name { font-weight: 700; }
.day-date { color: var(--muted); font-size: 0.85rem; }
.day.is-today .day-head { background: var(--primary); color: var(--surface); }
.day.is-today .day-date { color: inherit; opacity: 0.85; }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.day-body .empty { color: var(--muted); font-size: 0.85rem; margin: 4px 2px; }
.lesson { border-left: 4px solid var(--brand-green); background: var(--bg); border-radius: 8px; padding: 8px 10px; font-size: 0.9rem; }
.lesson-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.lesson-name { font-weight: 500; }
.lesson-meta, .lesson-note { color: var(--muted); font-size: 0.8rem; }
.lesson-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { display: inline-block; font-size: 0.72rem; padding: 1px 6px; border-radius: 6px; background: var(--border); color: var(--text); white-space: nowrap; }
.tag-kind.is-group { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.tag-done { background: var(--success-soft); color: var(--primary); }
.tag-cancelled { background: var(--danger-soft); color: var(--danger); }
.positive, .summary-tile .value.positive { color: var(--positive); }
.negative, .summary-tile .value.negative { color: var(--danger); }
tr.auto-row td { background: color-mix(in srgb, var(--primary-soft) 60%, transparent); }
.finance-form { margin-top: 8px; }
.tag-pending { background: color-mix(in srgb, var(--accent) 40%, var(--surface)); color: var(--text); }
.summary-tile .value.pending { font-size: 1.25rem; color: var(--muted); }
.summary-tile.big .value.pending { font-size: 1.6rem; }
.summary-tile.big.pending-tile { background: var(--surface); border: 1px dashed var(--border); }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 0.8rem; }
.lesson-actions form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--primary-soft); margin-bottom: 16px; }
a.notice-link { display: block; color: var(--text); text-decoration: none; }
a.notice-link:hover { outline: 1px solid var(--primary); }
.count { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--brand-green); color: #11304c; font-weight: 700; font-size: 0.75rem; text-align: center; line-height: 1.5; }
.inline-form { display: inline-block; margin: 0; }
.payment-row { margin-bottom: 16px; }
tr.is-selected td { background: var(--primary-soft); }
.inbox { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.inbox li + li { border-top: 1px solid var(--border); }
.inbox a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 14px 18px; color: var(--text); text-decoration: none; }
.inbox a:hover { background: var(--primary-soft); }
.inbox-title { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.inbox li.is-unread .inbox-title { font-weight: 700; }
.inbox-date { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.inbox-preview { grid-column: 1 / -1; color: var(--muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-green); flex-shrink: 0; }
.news-article { margin-top: 14px; }
.news-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.news-row form { margin: 0; flex-shrink: 0; }
.recipients { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; display: grid; gap: 8px; }
.recipients legend { font-weight: 500; padding: 0 4px; }
.recipient-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; padding-left: 26px; }
.lesson.is-cancelled { border-left-color: var(--muted); opacity: 0.75; }
.lesson.is-cancelled .lesson-time { text-decoration: line-through; }
.lesson-edit { font-size: 0.8rem; }

@media (max-width: 900px) {
  .week-grid { grid-template-columns: 1fr; }
  .day { min-height: 0; flex-direction: row; }
  .day-head { width: 110px; flex-shrink: 0; border-bottom: 0; border-right: 1px solid var(--border); }
  .day-body .empty { margin: 2px; }
}

/* ---------- Landing ---------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding: 24px 0 36px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; font-weight: 700; color: var(--brand-green); margin: 0 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
.lead { font-size: 1.1rem; color: var(--muted); margin-bottom: 22px; }
.hero-text .btn { margin: 0 8px 8px 0; }
.hero-art { position: relative; margin: 0; }
.court { aspect-ratio: 3 / 4; background: var(--clay); border-radius: 16px; position: relative; box-shadow: var(--shadow); border: 6px solid #fff; overflow: hidden; }
.court::before { content: ""; position: absolute; inset: 14% 12%; border: 3px solid #fff; }
.court::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 4px dashed rgba(255,255,255,0.9); }
.court span { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); top: 28%; left: 58%; box-shadow: 0 6px 10px rgba(0,0,0,0.25); }
.hero-photo { position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: cover; border-radius: 16px; border: 6px solid #fff; box-shadow: var(--shadow); background: var(--clay); }
.hero-art.photo-failed .hero-photo { display: none; }
.form-hint { align-self: end; margin: 0 0 10px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 12px; }
.feature h3 { color: var(--primary); }
.feature p { margin: 0; color: var(--muted); }
.form-card { scroll-margin-top: 16px; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .court, .hero-photo { aspect-ratio: 16 / 10; }
  .header-inner { gap: 8px; }
  .main-nav { order: 3; flex-basis: 100%; }
}
