/* =====================================================================
   Angelé Beauty Studio — vizuelni sistem
   „Tihi luksuz": krem pozadina, jedan zlatan detalj, nikad #000/#FFF.
   Tipografija: Cormorant Garamond (naslovi) + Montserrat (telo).
   ===================================================================== */

:root {
  /* Brend tokeni (izvor istine: ANGELE-brend-vodic.md) */
  --cream:     #F4EDE3;   /* osnovna pozadina — toplo, ne belo */
  --champagne: #C4A062;   /* JEDINI akcenat — redak */
  --espresso:  #2A2422;   /* tekst i tamne površine — nikad čisto crno */
  --nude:      #E3D2C0;
  --page-muted: #5A514C;
  --page-faint: #8C817A;
  --page-line:  #D8CBB8;

  /* Semantičke uloge (svetla tema) */
  --bg:        var(--cream);
  --surface:   #FBF7F0;
  --text:      var(--espresso);
  --muted:     var(--page-muted);
  --faint:     var(--page-faint);
  --line:      var(--page-line);
  --accent:    var(--champagne);

  /* Suzdržani statusni tonovi (topli, ne sirovo crveno/zeleno) */
  --ok:    #6E7B54;
  --warn:  #B08328;
  --danger:#9C5B4E;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(42, 36, 34, .05), 0 8px 24px rgba(42, 36, 34, .06);
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --bg:      #201C1A;
  --surface: #2A2422;
  --text:    #F1E7D9;
  --muted:   #C3B4A4;
  --faint:   #8C817A;
  --line:    #3A322E;
  --accent:  #C4A062;
  --shadow:  0 1px 2px rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      #201C1A;
    --surface: #2A2422;
    --text:    #F1E7D9;
    --muted:   #C3B4A4;
    --faint:   #8C817A;
    --line:    #3A322E;
    --accent:  #C4A062;
    --shadow:  0 1px 2px rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 500; letter-spacing: .01em; margin: 0 0 .4em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
a { color: inherit; }

/* Nadnaslov / eyebrow */
.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 .5rem;
}

/* --- Luk (potpis brenda) — koristi se preko .luk klase na SVG-u -------- */
.luk { display: inline-block; vertical-align: middle; }
.luk path {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

/* --- Brend / logo u nav-u ---------------------------------------------- */
.brand {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.brand .e-wrap { position: relative; display: inline-block; }
.brand .e-wrap .luk { position: absolute; left: 50%; top: -.35em; width: 22px; transform: translateX(-50%); }

/* --- Layout ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .9rem 1.6rem;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; gap: .35rem; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none; color: var(--muted);
  padding: .4rem .8rem; border-radius: 8px;
  font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 500;
  transition: color .2s, background .2s;
}
.topbar nav a:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.topbar nav a.active { color: var(--text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.topbar .spacer { flex: 1; }
.topbar .whoami { font-size: .8rem; color: var(--faint); }

.container { max-width: 1120px; margin: 0 auto; padding: 2rem 1.6rem 4rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }

/* --- Dugmad ------------------------------------------------------------ */
.btn {
  font-family: var(--font-body); font-size: .85rem; font-weight: 600; letter-spacing: .02em;
  padding: .58rem 1.1rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: all .2s; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
:root[data-theme="dark"] .btn-primary { background: var(--accent); color: var(--espresso); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; }

/* --- Kartice ----------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem; margin-bottom: 1.4rem;
}
.card h2, .card h3 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- Forme ------------------------------------------------------------- */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: .6rem .75rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: .92rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field textarea { min-height: 90px; resize: vertical; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 180px; }
.form-actions { display: flex; gap: .7rem; margin-top: 1.2rem; }

/* --- GradixTable ------------------------------------------------------- */
.gxt-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.gxt-toolbar { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.gxt-search { flex: 1; max-width: 340px; padding: .5rem .75rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: .88rem; }
.gxt-count { font-size: .78rem; color: var(--faint); }
.gxt-scroll { overflow-x: auto; }
table.gxt { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.gxt th, table.gxt td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.gxt th { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; }
table.gxt th .arrow { color: var(--accent); font-size: .7em; }
table.gxt tbody tr { transition: background .15s; }
table.gxt tbody tr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
table.gxt td.num { text-align: right; font-variant-numeric: tabular-nums; }
.gxt-empty { padding: 2.5rem 1rem; text-align: center; color: var(--faint); }
.gxt-clickable { cursor: pointer; }

/* --- Značke (status) --------------------------------------------------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .03em; padding: .18rem .55rem; border-radius: 999px; border: 1px solid var(--line); }
.badge-zakazan { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.badge-gotov   { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.badge-otkazan { color: var(--faint); }
.badge-no_show { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.badge-korekcija { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

/* --- Toast / poruke ---------------------------------------------------- */
.flash-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }
.flash { padding: .8rem 1rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .88rem; animation: slidein .3s ease; }
.flash.ok { border-left: 3px solid var(--ok); }
.flash.err { border-left: 3px solid var(--danger); }
.flash.info { border-left: 3px solid var(--accent); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* --- Modal ------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; background: color-mix(in srgb, var(--espresso) 55%, transparent); display: none; align-items: center; justify-content: center; z-index: 150; padding: 1rem; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 1.6rem; }
.modal h2 { margin-top: 0; }

/* --- Tema prekidač ----------------------------------------------------- */
.theme-toggle { background: transparent; border: 1px solid var(--line); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }

/* --- Login ------------------------------------------------------------- */
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .brand-big { font-family: var(--font-head); font-size: 2.6rem; font-weight: 500; position: relative; display: inline-block; margin-bottom: .3rem; }
.login-card .brand-big .luk { position: absolute; right: .1em; top: -.15em; width: 30px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.mono-num { font-variant-numeric: tabular-nums; }
.tag-korekcija { font-size: .7rem; color: var(--accent); letter-spacing: .04em; }

/* --- Kalendar (nedeljni) ---------------------------------------------- */
.cal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cal-grid { display: grid; grid-template-columns: 70px repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 46px; position: relative; }
.cal-dayhead { padding: .5rem; text-align: center; font-size: .78rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.cal-dayhead .d { font-family: var(--font-head); font-size: 1.2rem; }
.cal-dayhead.today .d { color: var(--accent); }
.cal-hour { font-size: .7rem; color: var(--faint); padding: .3rem .4rem; text-align: right; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-event { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: .2rem .35rem; font-size: .72rem; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--text); z-index: 2; }
.cal-event.st-otkazan { opacity: .45; text-decoration: line-through; }
.cal-event.st-no_show { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.cal-event.st-gotov { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.cal-event.is-korekcija { border-style: dashed; }
