/* =====================================================================
   HitFitness – Fitness Booking
   Smjer dizajna: antracitni zidovi studija + limeta zeleni akcenti,
   naslovi u kurzivu (Saira 800 italic) nalik logotipu.
   ===================================================================== */

@font-face { font-family: "Saira"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("../vendor/fonts/saira-latin-ext-800-italic.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Saira"; font-style: italic; font-weight: 800; font-display: swap;
  src: url("../vendor/fonts/saira-latin-800-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Saira"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/saira-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Saira"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/saira-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --brand: #b4dc19;            /* zamjenjuje se postavkom "Glavna boja" */
  --brand-ink: #16170f;        /* tekst na limeta podlozi */
  --font-display: "Saira", "Arial Narrow", system-ui, sans-serif;

  --st-free: #2fb344;          /* ZELENA – slobodna mjesta */
  --st-full: #e5484d;          /* CRVENA – popunjeno */
  --st-mine: #3b82f6;          /* PLAVA – moja rezervacija */
  --st-off:  #8b8f98;          /* SIVA – zatvoreno / prošlo */
  --radius: 14px;
}

/* --- Tamna tema (zadana) ------------------------------------------- */
[data-bs-theme="dark"] {
  --bg: #1c1d20;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #34363b 0%, #1c1d20 60%);
  --surface: #26272b;
  --surface-2: #2f3035;
  --line: #3b3d43;
  --text: #ecedef;
  --muted: #a3a6ae;
  --st-free: #b4dc19;          /* u tamnoj temi "zeleno" = limeta iz loga */
  --st-free-ink: #16170f;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
}

/* --- Svijetla tema --------------------------------------------------- */
[data-bs-theme="light"] {
  --bg: #f2f3ef;
  --bg-grad: linear-gradient(#f2f3ef, #f2f3ef);
  --surface: #ffffff;
  --surface-2: #f6f7f3;
  --line: #dfe1da;
  --text: #1f2023;
  --muted: #61656d;
  --st-free: #2f9e44;
  --st-free-ink: #ffffff;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
}

html, body { min-height: 100%; }
body {
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, .display-font {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
}
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.text-muted, .form-text { color: var(--muted) !important; }
a { color: var(--brand); }
[data-bs-theme="light"] a { color: #4d6b00; }

/* --- Brand / wordmark ---------------------------------------------- */
.wordmark { font-family: var(--font-display); font-style: italic; font-weight: 800; text-transform: uppercase;
  line-height: 1; letter-spacing: -.01em; text-decoration: none; display: inline-flex; flex-direction: column; }
.wordmark .wm-main { font-size: 1.45rem; color: var(--text); }
.wordmark .wm-accent { color: var(--brand); }
.wordmark .wm-tag { font-family: system-ui, sans-serif; font-style: normal; font-weight: 500; font-size: .52rem;
  letter-spacing: .32em; color: var(--muted); border-top: 2px solid var(--brand); padding-top: 3px; margin-top: 3px; }
.wordmark.wm-lg .wm-main { font-size: clamp(2.2rem, 9vw, 3.2rem); }
.wordmark.wm-lg .wm-tag { font-size: .72rem; }
.brand-logo { max-height: 44px; max-width: 200px; }

/* --- Navigacija ------------------------------------------------------ */
.app-header { background: rgba(20, 21, 23, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1030; }
[data-bs-theme="light"] .app-header { background: rgba(255, 255, 255, .9); }
.app-header .nav-link { color: var(--muted); font-weight: 600; border-radius: 10px; padding: .45rem .8rem; }
.app-header .nav-link:hover { color: var(--text); }
.app-header .nav-link.active { color: var(--brand-ink); background: var(--brand); }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 10px;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }

/* Donja navigacija na mobitelu (član) */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex;
  background: rgba(20, 21, 23, .95); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
[data-bs-theme="light"] .bottom-nav { background: rgba(255, 255, 255, .97); }
.bottom-nav a { flex: 1; text-align: center; padding: .55rem 0 .5rem; color: var(--muted); text-decoration: none;
  font-size: .72rem; font-weight: 600; }
.bottom-nav a svg { display: block; margin: 0 auto 2px; width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--brand); }
.has-bottom-nav { padding-bottom: 76px; }
@media (min-width: 768px) { .bottom-nav { display: none; } .has-bottom-nav { padding-bottom: 0; } }

/* --- Kartice ------------------------------------------------------------ */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel { padding: 1.1rem; }
.card-header { background: transparent; border-bottom: 1px solid var(--line); }
.hero-card { position: relative; overflow: hidden; background: linear-gradient(135deg, #2b2c31 0%, #202125 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; color: #ecedef; }
[data-bs-theme="light"] .hero-card { background: linear-gradient(135deg, #2b2c31 0%, #36383e 100%); }
.hero-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px;
  border: 14px solid var(--brand); border-radius: 50%; opacity: .12; }
.hero-card .label { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: #a3a6ae; }
.hero-card .next-title { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.35rem; text-transform: uppercase; }
.stat-pill { display: inline-flex; align-items: baseline; gap: .35rem; background: rgba(180, 220, 25, .12);
  color: var(--brand); border-radius: 999px; padding: .25rem .75rem; font-weight: 700; }

/* --- Gumbi ---------------------------------------------------------------- */
.btn { border-radius: 12px; font-weight: 700; }
.btn-lg { padding: .8rem 1.2rem; }
.btn-brand { background: var(--brand); color: var(--brand-ink); border: 0; text-transform: uppercase; letter-spacing: .04em; }
.btn-brand:hover, .btn-brand:focus { background: color-mix(in srgb, var(--brand) 88%, #fff); color: var(--brand-ink); }
.btn-brand:disabled { background: var(--brand); color: var(--brand-ink); opacity: .55; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--muted); color: var(--text); }
.btn-mine { background: var(--st-mine); color: #fff; border: 0; text-transform: uppercase; }
.btn-mine:hover { background: #2563eb; color: #fff; }

/* --- Odabir dana (PON ... NED) --------------------------------------------- */
.week-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.week-bar .week-label { font-weight: 700; }
.day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.day-tab { background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 12px;
  padding: .5rem 0 .45rem; text-align: center; line-height: 1.1; min-height: 58px; }
.day-tab .d-name { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: .95rem; display: block; }
.day-tab .d-date { font-size: .72rem; color: var(--muted); }
.day-tab .d-dot { display: block; width: 6px; height: 6px; border-radius: 50%; margin: 4px auto 0; background: transparent; }
.day-tab .d-dot.has-mine { background: var(--st-mine); }
.day-tab.today { border-color: var(--muted); }
.day-tab.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.day-tab.active .d-date { color: var(--brand-ink); opacity: .75; }
.day-tab.active .d-dot.has-mine { background: var(--brand-ink); }

/* --- Termini ------------------------------------------------------------- */
.slot { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: .75rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--st-off);
  border-radius: var(--radius); padding: .8rem .9rem; margin-bottom: .6rem; transition: transform .12s; }
.slot .s-time { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.45rem; line-height: 1; }
.slot .s-time small { display: block; font-family: system-ui, sans-serif; font-style: normal; font-weight: 500; font-size: .7rem; color: var(--muted); margin-top: 4px; }
.slot .s-info { min-width: 0; }
.slot .s-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .s-meta { font-size: .85rem; color: var(--muted); }
.slot .s-meta strong { color: var(--text); }
.slot .s-bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: .4rem; overflow: hidden; }
.slot .s-bar span { display: block; height: 100%; background: var(--st-off); border-radius: 3px; }
.slot .btn { min-width: 128px; padding: .7rem .9rem; }

.slot.st-available { border-left-color: var(--st-free); }
.slot.st-available .s-bar span { background: var(--st-free); }
.slot.st-available .s-free { color: var(--st-free); font-weight: 700; }
.slot.st-full { border-left-color: var(--st-full); }
.slot.st-full .s-bar span { background: var(--st-full); }
.slot.st-mine { border-left-color: var(--st-mine); background: color-mix(in srgb, var(--st-mine) 10%, var(--surface)); }
.slot.st-mine .s-bar span { background: var(--st-mine); }
.slot.st-past, .slot.st-closed, .slot.st-cancelled, .slot.st-not_yet { opacity: .62; }
.badge-state { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  border-radius: 10px; padding: .6rem .8rem; min-width: 128px; text-align: center; }
.badge-full { background: color-mix(in srgb, var(--st-full) 18%, transparent); color: var(--st-full); }
.badge-off { background: var(--surface-2); color: var(--muted); }
.badge-mine { background: var(--st-mine); color: #fff; }

@media (max-width: 420px) {
  .slot { grid-template-columns: 62px 1fr; }
  .slot .s-action { grid-column: 1 / -1; }
  .slot .btn, .slot .badge-state { width: 100%; }
}

.legend { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius); }

/* --- Obavijesti (toast) ---------------------------------------------------- */
.toast-zone { position: fixed; left: 50%; transform: translateX(-50%); bottom: 88px; z-index: 1080;
  width: min(92vw, 440px); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
@media (min-width: 768px) { .toast-zone { bottom: 24px; } }
.toast-msg { pointer-events: auto; border-radius: 12px; padding: .85rem 1rem; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  animation: toastIn .2s ease-out; }
.toast-msg.ok { background: var(--brand); color: var(--brand-ink); }
.toast-msg.err { background: var(--st-full); color: #fff; }
.toast-msg.info { background: var(--st-mine); color: #fff; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.alert { border-radius: 12px; }

/* --- Forme ------------------------------------------------------------------ */
.form-control, .form-select { border-radius: 11px; padding: .7rem .85rem; background-color: var(--surface-2); border-color: var(--line); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 25%, transparent); background-color: var(--surface-2); color: var(--text); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-control-sm, .form-select-sm { padding: .35rem .6rem; border-radius: 9px; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-bg { background:
  linear-gradient(180deg, rgba(28,29,32,.0) 0%, rgba(28,29,32,1) 85%),
  radial-gradient(900px 500px at 50% 0%, #3a3c42 0%, #1c1d20 70%); }
.stripe { height: 3px; background: var(--brand); width: 64px; border-radius: 2px; margin: .6rem 0 1rem; }

/* --- Administracija --------------------------------------------------------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 240px; flex-shrink: 0; background: #17181b; border-right: 1px solid var(--line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
[data-bs-theme="light"] .admin-side { background: #ffffff; }
.admin-side .nav-link { color: var(--muted); font-weight: 600; border-radius: 10px; padding: .55rem .75rem; display: flex; align-items: center; gap: .6rem; }
.admin-side .nav-link:hover { color: var(--text); background: var(--surface-2); }
.admin-side .nav-link.active { background: var(--brand); color: var(--brand-ink); }
.admin-side .nav-link .badge { margin-left: auto; }
.admin-main { flex: 1; min-width: 0; padding: 1.25rem; }
@media (max-width: 991.98px) {
  .admin-side { position: fixed; left: -260px; z-index: 1045; transition: left .2s; }
  .admin-side.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .admin-main { padding: 1rem .75rem; }
}
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; height: 100%; }
.kpi .kpi-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi .kpi-value { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 2rem; line-height: 1.1; }
.kpi.kpi-accent .kpi-value { color: var(--brand); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--line); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .6rem .65rem; }
.table thead th { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.table a.text-reset, .session-block a.text-reset { text-decoration: none; }
.table a.text-reset:hover, .session-block a.text-reset:hover { color: var(--brand) !important; }
.occ { display: inline-flex; align-items: center; gap: .5rem; }
.occ-bar { width: 80px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.occ-bar span { display: block; height: 100%; background: var(--st-free); }
.occ-bar.full span { background: var(--st-full); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.badge.bg-pending { background: #f59f00 !important; color: #1f1300; }
.badge.bg-active { background: var(--st-free) !important; color: var(--st-free-ink, #fff); }
.badge.bg-rejected { background: var(--st-full) !important; }
.badge.bg-deactivated, .badge.bg-closed, .badge.bg-cancelled { background: #6b6f78 !important; }
.badge.bg-open { background: var(--st-free) !important; color: var(--st-free-ink, #fff); }
.att-group .btn { padding: .25rem .55rem; font-size: .78rem; }
.att-group .btn.on-present { background: var(--st-free); color: var(--st-free-ink, #fff); border-color: var(--st-free); }
.att-group .btn.on-no_show { background: var(--st-full); color: #fff; border-color: var(--st-full); }
.att-group .btn.on-unknown { background: var(--surface-2); color: var(--text); }
.session-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1rem; }
.session-block > header { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.session-block .time { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 1.4rem; }
.hbar { display: flex; align-items: center; gap: .6rem; margin-bottom: .45rem; font-size: .85rem; }
.hbar .hb-label { width: 52px; color: var(--muted); }
.hbar .hb-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar .hb-track span { display: block; height: 100%; background: var(--brand); }
.hbar .hb-val { width: 44px; text-align: right; font-weight: 700; }

/* --- Ispis dnevnog rasporeda --------------------------------------------- */
@media print {
  :root, [data-bs-theme] { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --line: #bbb; }
  body { background: #fff !important; color: #000 !important; }
  .admin-side, .app-header, .bottom-nav, .no-print, .toast-zone { display: none !important; }
  .admin-main { padding: 0 !important; }
  .session-block { break-inside: avoid; border-color: #999; }
  a { color: #000; text-decoration: none; }
}
