/* Clessia – base styles. Brand: navy #0F2340, gold #C9A66B (accent only), white, Outfit. */
:root {
  --navy: #0F2340;
  --navy-2: #1A3358;
  --navy-3: #2B4A78;
  --gold: #C9A66B;
  --gold-soft: #F4ECDD;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #0F2340;
  --muted: #5B6B82;
  --line: #E1E6EE;
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --ok: #1E7B4F;
  --ok-soft: #E5F4EC;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 35, 64, .06), 0 4px 16px rgba(15, 35, 64, .06);
  --sidebar: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 500; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
a { color: var(--navy-3); }
button, input, select, textarea { font: inherit; color: inherit; }

.splash { min-height: 100vh; display: grid; place-items: center; }
.splash img { opacity: .8; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500;
}
.btn:hover { border-color: var(--navy-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-danger { color: var(--danger); }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--navy-3); cursor: pointer; text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.input, select.input {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  background: var(--surface); width: 100%;
}
.input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.input:disabled { background: var(--bg); color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: var(--navy);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: 14px; padding: 28px; box-shadow: var(--shadow);
}
.login-card .logo { display: block; width: 190px; margin: 0 auto 6px; }
.login-card .slogan { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.login-card .lang { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; display: flex; flex-direction: column; }
.sidebar .brand { padding: 14px 18px 6px; }
.sidebar .brand img { width: 150px; display: block; }
.nav { display: flex; flex-direction: column; padding: 10px 10px; gap: 2px; }
.nav a {
  color: rgba(255, 255, 255, .82); text-decoration: none; padding: 9px 12px;
  border-radius: 8px; display: flex; justify-content: space-between; align-items: center;
}
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav a.soon { opacity: .5; pointer-events: none; }
.nav .tag { font-size: 11px; color: var(--gold); }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 8px 12px; }
.sidebar .foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: rgba(255, 255, 255, .5); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
}
.topbar .studio { font-weight: 500; }
.topbar .role { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 20px; padding: 2px 10px; }
.topbar .spacer { flex: 1; }
.topbar select.input { width: auto; padding: 5px 8px; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1100px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
tr.inactive td { color: var(--muted); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 6px; }

.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; background: var(--bg); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.gold { background: var(--gold-soft); color: #7A5A22; }

/* ---------- settings ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; }
.tabs a {
  padding: 10px 14px; text-decoration: none; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--gold); font-weight: 500; }
.add-row { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.add-row .grow { flex: 1; min-width: 180px; }
.add-row select.input { width: auto; }
.order { display: inline-flex; gap: 4px; }
td .input { min-width: 120px; }
td select.input { width: auto; }
.model-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.model-head .grow { flex: 1; min-width: 180px; }
.model-head select.input { width: auto; }
.model.inactive .model-head .input { color: var(--muted); }
.steps { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; vertical-align: middle; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 22px; transition: background .15s; }
.switch span::after {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- clients ---------- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tr.clickable:focus td { background: var(--bg); }
tr.clickable:focus { outline: none; }
tr.bad td { background: var(--danger-soft); }
td .badge + .badge { margin-left: 4px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }
.checks { display: flex; flex-direction: column; gap: 6px; }
.input.num { max-width: 120px; }
.input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
textarea.input { resize: vertical; }
/* contract totals */
.totals { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.totals b { color: var(--text); font-weight: 600; }
ul.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- work lists ---------- */
.content.wide { max-width: none; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.toolbar select.input { width: auto; }
.period { display: inline-flex; gap: 8px; align-items: center; }
.period strong { min-width: 150px; text-align: center; font-weight: 500; font-size: 17px; }
.list-summary { margin: 4px 0 8px; }
.wl-card { padding: 0; }
.wl-wrap { max-height: calc(100vh - 230px); overflow: auto; }
table.wl th, table.wl td { padding: 6px 8px; }
table.wl thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; vertical-align: bottom; }
table.wl th.step { text-align: center; text-transform: none; letter-spacing: 0; font-size: 12px; min-width: 70px; }
table.wl th.step.off { opacity: .55; }
table.wl th .count { font-size: 11px; color: var(--muted); font-weight: 400; }
table.wl .client { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 190px; white-space: nowrap; }
table.wl thead .client { z-index: 3; }
table.wl tr.row-done td.client { box-shadow: inset 3px 0 0 var(--ok); }
table.wl tr.row-done td.client a { color: var(--ok); }
table.wl td.client a { text-decoration: none; color: var(--text); font-weight: 500; }
.row-x { margin-left: 6px; text-decoration: none; color: var(--muted); font-size: 16px; visibility: hidden; }
table.wl tr:hover .row-x { visibility: visible; }
td.cell { text-align: center; }
td.cell.done { background: var(--ok-soft); }
td.cell.na { color: var(--muted); background: var(--bg); }
td.cell.info { background: #F6F4EF; }
table.wl th.step.info { font-style: italic; color: var(--muted); }
td.cell .tick { width: 18px; height: 18px; accent-color: var(--ok); cursor: pointer; }
td.cell .tick:disabled { cursor: default; }
td.cell .cell-in { min-width: 0; width: 96px; padding: 4px 6px; font-size: 13px; }
.who { display: block; margin: 3px auto 0; font-size: 10px; line-height: 1.5; border: 0; border-radius: 10px; padding: 0 6px;
  background: var(--bg); color: var(--muted); width: max-content; }
button.who { cursor: pointer; }
button.who:hover { background: var(--line); color: var(--text); }
.who.me { background: var(--gold-soft); color: #7A5A22; }
td.note { min-width: 160px; max-width: 260px; font-size: 13px; }
td.note .note-txt { display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
td.note .btn-link { margin-left: 6px; text-decoration: none; }
.wiz-clients { max-height: 340px; overflow: auto; padding: 4px; }

/* work lists: forms, payments, chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.chip { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 20px; padding: 3px 11px; }
.chip b { color: var(--text); font-weight: 600; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--navy-3); }
.chip.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.chip.active b { color: #fff; }
.chip.ok { background: var(--ok-soft); border-color: transparent; }
.chip.gold { background: var(--gold-soft); border-color: transparent; }
.chip.gold.active { background: var(--navy); }
.chip.warn, .badge.warn { background: #FFF4D6; color: #7A5A00; border-color: transparent; }
td.client .badge { margin-left: 6px; font-size: 11px; }
table.wl tr.row-novat td { background: #FFFBEA; }
table.wl tr.row-novat td.cell.done { background: var(--ok-soft); }
td.cell.nap { background: #E6EEF9; }
td.cell.nema { background: var(--bg); }
td.cell.nema select { color: var(--muted); }
td.cell.t-obrazac, td.cell.t-placanje { min-width: 150px; }
td.cell.t-obrazac .cell-in, td.cell.t-placanje .cell-in { width: 140px; }
.minis { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.mini { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.mini input { width: 14px; height: 14px; margin: 0; accent-color: var(--navy); }
.mini input:disabled + span { opacity: .55; }
.step-details { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.step-details .input { min-width: 120px; }

/* ---------- studio picker ---------- */
.picker { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.picker .card { width: 100%; max-width: 460px; }
.picker-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.picker-list button {
  text-align: left; border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 12px 14px; cursor: pointer; display: flex; justify-content: space-between;
}
.picker-list button:hover { border-color: var(--gold); }

/* ---------- modal & toast ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(15, 35, 64, .45);
  display: grid; place-items: center; padding: 16px; z-index: 50;
}
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 440px; padding: 22px; box-shadow: var(--shadow); }
.modal h2 { margin-bottom: 16px; }
.modal .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; }
.toast.error { background: var(--danger); }

/* ---------- phone ---------- */
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .topbar .role { display: none; }
  .content { padding: 16px; }
}
