/* BIC Mekteb – boje iz logotipa: zelena #00763A, zlatna #B09872 */
:root {
  --green: #00763a;
  --green-dark: #0a4d2b;
  --green-deep: #073b21;
  --green-soft: #e3f1e8;
  --gold: #b09872;
  --gold-dark: #8a7550;
  --gold-soft: #f4efe5;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1d2a22;
  --ink-2: #4b5a50;
  --muted: #7d887f;
  --line: #e4e0d6;
  --ok: #1f8a4c;   --ok-bg: #dcf0e3;
  --warn: #a8701a; --warn-bg: #f8ebcf;
  --bad: #b93a32;  --bad-bg: #f7dcd9;
  --info: #2f6497; --info-bg: #dde8f3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 40, 28, .06), 0 4px 16px rgba(20, 40, 28, .05);
  --font: "Source Sans 3", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* ---------- Raspored ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--green-dark), var(--green-deep));
  color: #e9f2ec; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { width: 42px; height: 42px; background: #fff; border-radius: 50%; padding: 4px; }
.brand b { display: block; font-size: 1.05rem; letter-spacing: .02em; }
.brand span { font-size: .78rem; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: #d5e5da; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(176, 152, 114, .22); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(255,255,255,.45); margin: 16px 12px 4px; }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: .85rem; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-foot a { color: #d5e5da; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; border-bottom: 1px solid var(--line); background: rgba(247,245,240,.9); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5; }
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: .92rem; }
.content { padding: 24px 28px 60px; max-width: 1280px; }
.menu-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 2px 0 0; color: var(--ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Kartice ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .85rem; color: var(--ink-2); margin-top: 2px; }
.stat::after { content: ""; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--gold-soft); }
.stat.accent { background: var(--green); color: #fff; border-color: var(--green); }
.stat.accent .label, .stat.accent .sub { color: rgba(255,255,255,.8); }
.stat.accent::after { background: rgba(255,255,255,.08); }

/* ---------- Dugmad ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #cfc9bb; background: #fbfaf7; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: .84rem; }
.btn-link { background: none; border: 0; color: var(--green); padding: 0; cursor: pointer; font: inherit; }
.inline { display: inline; }

/* ---------- Oznake ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eeebe3; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: var(--gold-dark); }
.badge.muted { background: #f0eee8; color: var(--muted); }
.pill-sms { background: var(--warn-bg); color: var(--warn); }
.pill-sms.live { background: var(--ok-bg); color: var(--ok); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; background: #fbfaf6; }
tbody tr:hover { background: #fbfaf6; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 600; }
.person small { color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: var(--green); flex: none; }
.avatar.f { background: var(--gold); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }

/* ---------- Forme ---------- */
.input, select.input, textarea.input { width: 100%; padding: 9px 11px; border: 1px solid #d8d3c7; border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,118,58,.15); }
input[type="color"].input { height: 40px; padding: 3px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.field .help { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.field .error, .errorlist { color: var(--bad); font-size: .84rem; margin: 3px 0 0; padding: 0; list-style: none; }
.field.check-field label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check-list, .radio-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.check-list label, .radio-list label { display: flex; gap: 6px; align-items: center; font-weight: 500; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: #fff; }
.radio-list input:checked + span, .check-list label:has(input:checked), .radio-list label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 160px; }
.filters .grow { flex: 1; min-width: 220px; }
fieldset { border: 1px dashed #d8d3c7; border-radius: var(--radius); padding: 14px 16px 2px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; color: var(--gold-dark); }

/* ---------- Poruke (flash) ---------- */
.flash { list-style: none; padding: 0; margin: 0 0 18px; }
.flash li { padding: 11px 14px; border-radius: 10px; margin-bottom: 8px; background: var(--ok-bg); color: #145c34; border: 1px solid #bfe2cc; }
.flash li.error { background: var(--bad-bg); color: #8a2620; border-color: #ecc3be; }
.flash li.warning { background: var(--warn-bg); color: #7d5410; border-color: #ecd8ac; }

/* ---------- Prisustvo ---------- */
.att-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) auto minmax(140px, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
/* Prekidač primarnog jezika učenika (BS / EN) */
.lang-toggle { display: inline-flex; border: 1px solid #d8d3c7; border-radius: 999px; overflow: hidden; background: #fff; margin: 0; }
.lang-toggle button { border: 0; background: transparent; padding: 3px 10px; font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); cursor: pointer; min-width: 38px; }
.lang-toggle.full button { padding: 5px 12px; font-size: .85rem; letter-spacing: 0; }
.lang-toggle button + button { border-left: 1px solid #e6e1d6; }
.lang-toggle button.on { background: var(--green); color: #fff; }
.lang-toggle button:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.lang-toggle.busy { opacity: .6; }
.lang-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid #d8d3c7; border-radius: 10px; overflow: hidden; background: #fff; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 8px 12px; font-weight: 600; font-size: .86rem; cursor: pointer; border-left: 1px solid #e6e1d6; color: var(--ink-2); user-select: none; min-width: 44px; text-align: center; }
.seg label:first-of-type { border-left: 0; }
.seg input:checked + label.present { background: var(--ok); color: #fff; }
.seg input:checked + label.late { background: #d29a2c; color: #fff; }
.seg input:checked + label.excused { background: var(--info); color: #fff; }
.seg input:checked + label.absent { background: var(--bad); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--green); outline-offset: -2px; }
.att-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.sticky-save { position: sticky; bottom: 0; background: rgba(247,245,240,.95); backdrop-filter: blur(6px); padding: 12px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; z-index: 4; }

/* ---------- Učenici kao kartice (ClassDojo stil) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 12px; text-align: center; cursor: pointer; position: relative; transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .avatar { margin: 0 auto 8px; width: 52px; height: 52px; font-size: 1.1rem; }
.tile b { display: block; font-size: .95rem; }
.tile small { color: var(--muted); }
.tile .score { position: absolute; top: 8px; right: 8px; min-width: 28px; padding: 1px 7px; border-radius: 999px; background: var(--gold); color: #fff; font-weight: 700; font-size: .8rem; }
.tile .score.neg { background: var(--bad); }
.tile .meta { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.tile.pop { animation: pop .5s; }
@keyframes pop { 30% { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(176,152,114,.4); } }

.modal-back { position: fixed; inset: 0; background: rgba(10, 30, 20, .45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 520px; width: 100%; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.cat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; background: #fff; cursor: pointer; font: inherit; }
.cat:hover { border-color: var(--green); background: var(--green-soft); }
.cat.neg:hover { border-color: var(--bad); background: var(--bad-bg); }
.cat .ico { font-size: 1.6rem; display: block; }
.cat .pts { font-weight: 700; color: var(--ok); }
.cat.neg .pts { color: var(--bad); }

/* ---------- Napredak ---------- */
.bar { height: 8px; background: #ece8de; border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #2aa564); border-radius: 99px; }
.bar.gold > span { background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }
.matrix { border-collapse: separate; border-spacing: 0; }
.matrix th.rot { height: 210px; vertical-align: bottom; padding: 4px; min-width: 38px; }
.matrix th.rot > div { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 205px; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--ink-2); }
.matrix td.cell { text-align: center; padding: 4px; }
.chip { display: inline-grid; place-items: center; width: 30px; height: 28px; border-radius: 7px; font-weight: 700; font-size: .82rem; background: #f1eee7; color: #b2ab9c; border: 0; cursor: default; font-family: inherit; }
button.chip { cursor: pointer; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.matrix td.sticky, .matrix th.sticky { position: sticky; left: 0; background: #fff; z-index: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-2); align-items: center; }
.legend .chip { width: 24px; height: 22px; font-size: .75rem; margin-right: 4px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; }
.alert-box { background: var(--bad-bg); border: 1px solid #ecc3be; border-radius: 10px; padding: 10px 12px; color: #8a2620; font-size: .9rem; }
.note-box { background: var(--gold-soft); border: 1px solid #e6dcc6; border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.sms-preview { background: #e9f5ee; border-radius: 16px 16px 16px 4px; padding: 12px 14px; max-width: 360px; white-space: pre-wrap; border: 1px solid #cbe5d5; }
.class-color { width: 6px; align-self: stretch; border-radius: 4px; }
.class-card { display: flex; gap: 14px; }
.class-card .body { flex: 1; min-width: 0; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; align-items: center; }
.chart-box { position: relative; height: 260px; }

/* ---------- Prijava ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: radial-gradient(circle at 30% 20%, #0d8a48, var(--green-deep) 70%); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; text-align: center; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(176,152,114,.25) 1px, transparent 1px); background-size: 22px 22px; opacity: .5; }
.login-art > * { position: relative; }
.login-art .logo-ring { width: 150px; height: 150px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(176,152,114,.35); margin-bottom: 24px; }
.login-art .logo-ring img { width: 112px; }
.login-art h1 { font-size: 2.3rem; margin: 0; }
.login-art p { color: rgba(255,255,255,.8); max-width: 340px; }
.login-art .gold { color: var(--gold); letter-spacing: .04em; font-size: 1rem; font-weight: 600; }
.parent-portal-link { display: inline-flex; align-items: center; gap: 12px; margin-top: 22px; padding: 12px 18px; border-radius: 12px;
  background: #fff; color: var(--green-dark); text-align: left; box-shadow: 0 6px 18px rgba(0,0,0,.18); max-width: 100%; }
.parent-portal-link:hover { text-decoration: none; background: var(--gold-soft); }
.parent-portal-link:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.parent-portal-link svg { width: 26px; height: 26px; flex: none; color: var(--gold-dark); }
.parent-portal-link b { display: block; font-size: 1.02rem; }
.parent-portal-link small { display: block; color: var(--gold-dark); font-weight: 600; font-size: .9rem; }
.parent-portal-link .arrow { font-size: 1.2rem; margin-left: 4px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form .box { width: 100%; max-width: 360px; }

/* ---------- Responsivno ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 60px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .att-row { grid-template-columns: 1fr; gap: 8px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 32px 20px; }
  .login-art .logo-ring { width: 100px; height: 100px; } .login-art .logo-ring img { width: 74px; }
  .login-art h1 { font-size: 1.7rem; }
  .kv { grid-template-columns: 1fr; }
  .topbar .who .name { display: none; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .stat .value { font-size: 1.6rem; } }

/* ---------- Štampa ---------- */
@media print {
  .sidebar, .topbar, .no-print, .actions, .filters, .flash { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  .print-head { display: flex !important; }
}
.print-head { display: none; align-items: center; gap: 12px; border-bottom: 2px solid var(--green); padding-bottom: 8px; margin-bottom: 14px; }
.print-head img { width: 48px; }

/* Django RadioSelect / CheckboxSelectMultiple (div prikaz) */
.field > div:has(> div > label > input[type=radio]),
.field > div:has(> div > label > input[type=checkbox]) { display: flex; flex-wrap: wrap; gap: 8px; }
.field > div > div > label:has(input[type=radio]),
.field > div > div > label:has(input[type=checkbox]) { display: flex; gap: 6px; align-items: center; font-weight: 500; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: #fff; margin: 0; }
.field > div > div > label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.field input[type=radio], .field input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; }
details > summary { list-style: none; cursor: pointer; display: inline-flex; }
details > summary::-webkit-details-marker { display: none; }
.grid > .card + .card, .grid > .card { margin-top: 0; }
.filters label { display: block; margin-bottom: 2px; }
@media (min-width: 861px) { .app { background: linear-gradient(90deg, var(--green-deep) 248px, transparent 248px); } }
@media (max-width: 860px) { .topbar .date { display: none; } }

/* Plan nastave */
details.card > summary { display: flex; cursor: pointer; }
details.card > summary h2::before { content: ""; }
details.card[open] > summary { margin-bottom: 4px; }
.inline-details { position: relative; display: inline-block; }
.inline-details .popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.15); padding: 14px; white-space: normal; }
.check-table td:first-child, .check-table th:first-child { width: 36px; }
.dropdown { position: relative; display: inline-block; }
.dropdown .menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.15); min-width: 240px; z-index: 20; padding: 6px; }
.dropdown .menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); }
.dropdown .menu a:hover { background: var(--green-soft); text-decoration: none; }
.dropdown .menu small { display: block; color: var(--muted); }
@media (max-width: 860px) { .inline-details .popover { position: fixed; left: 16px; right: 16px; top: 20%; width: auto; } }

/* ---------- Nastavni planovi ---------- */
.input-sm { padding: 4px 8px; font-size: .85rem; width: auto; min-height: 0; }
.plan-week { border-top: 1px solid var(--line); padding: 12px 0 6px; scroll-margin-top: 16px; }
.plan-week:first-of-type { border-top: 0; padding-top: 0; }
.plan-week.past { opacity: .65; }
.plan-week:target { background: var(--gold-soft); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.plan-week-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plan-items { list-style: none; margin: 8px 0 0; padding: 0; }
.plan-items li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; background: #fff; }
.plan-items li.muted { border-style: dashed; background: transparent; }
.prog-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--green-soft); color: var(--green); margin-right: 4px; white-space: nowrap; }
.lp-scroll { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.lp-group { padding: 4px 0; }
.lp-group + .lp-group { border-top: 1px solid var(--line); }
.lp-group .check-list { flex-direction: column; align-items: stretch; gap: 4px; margin: 6px 0; }
.lp-group .check-list label { padding: 4px 10px; font-weight: 400; }
.lesson-picker .input-sm { width: 100%; margin-bottom: 6px; }
.radio-list.inline { flex-direction: row; }
@media (min-width: 861px) { .plan-grid > .stack { position: sticky; top: 12px; align-self: start; max-height: calc(100vh - 24px); overflow: auto; } }
@media (max-width: 860px) { .plan-week-head, .plan-items li { flex-wrap: wrap; } }
.lang-switch { display: flex; gap: 4px; margin-top: 8px; }
.lang-switch button { font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: inherit; cursor: pointer; opacity: .7; }
.lang-switch button.on { background: var(--gold); border-color: var(--gold); color: #fff; opacity: 1; }
.login-lang { justify-content: flex-end; margin: 0 0 18px; }
.login-lang button { color: var(--muted); border-color: var(--line); font-weight: 600; letter-spacing: 0; font-size: .8rem; }
.plan-items form.actions { flex-wrap: nowrap; gap: 4px; flex: none; }
select.input.input-sm { width: auto; padding: 4px 6px; }
.plan-items li > span { min-width: 0; }
.lp-group summary .muted { margin-left: 6px; }
.lesson-picker .lp-group > ul { max-height: 280px; overflow: auto; }
.lesson-picker { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.lp-group .check-list { flex-wrap: nowrap; }
.lp-group > summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lp-group > summary .badge { white-space: nowrap; }
.nav-count { margin-left: auto; background: var(--gold); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.nav-count + .nav-count { margin-left: 4px; }
.nav-count.pending { background: #fff; color: var(--gold-dark); }

/* Poruke na čekanju */
.pl-refresh { margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.pending-list { margin-bottom: 14px; padding: 14px 16px; }
.pending-list.kind-absent { border-left: 4px solid var(--bad); }
.pending-list.kind-positive { border-left: 4px solid var(--ok); }
.pending-list.kind-negative { border-left: 4px solid #d29a2c; }
.pending-list.kind-present { border-left: 4px solid var(--info); }
.pl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pl-title { flex: 1; min-width: 200px; cursor: pointer; }
.pl-body { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.pl-text { margin-bottom: 12px; }
.pl-text textarea { width: 100%; }
.pl-add { margin: 10px 0 0; }
.pl-body .table-wrap { position: relative; }
.pl-toggle { font-size: 1.3rem; line-height: 1; width: 22px; text-align: center; font-family: system-ui, sans-serif; }
.lang-tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .03em; padding: 1px 5px; border-radius: 5px; background: var(--gold-soft); color: var(--gold-dark); vertical-align: 1px; }
.lang-tag.en { background: var(--info-bg); color: var(--info); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Javna prijava za upis ---------- */
.pub { min-height: 100vh; background: var(--bg, #f6f4ee); }
.pub-head { background: radial-gradient(circle at 20% 10%, #0d8a48, #073b21 80%); color: #fff; padding: 22px 16px 26px; }
.pub-head .in { max-width: 760px; margin: 0 auto; display: flex; gap: 14px; align-items: center; }
.pub-head img { width: 54px; height: 54px; background: #fff; border-radius: 50%; padding: 4px; flex: none; }
.pub-head .org { color: var(--gold); font-weight: 600; font-size: .9rem; }
.pub-head h1 { margin: 2px 0 0; font-size: 1.5rem; color: #fff; }
.pub-head .lang-switch { margin-left: auto; align-self: flex-start; }
.pub-main { max-width: 760px; margin: -12px auto 40px; padding: 0 16px; }
.pub-main .card + .card { margin-top: 14px; }
.pub-main h2 { display: flex; align-items: center; gap: 10px; }
.pub-main h2 .n { background: var(--green); color: #fff; border-radius: 99px; width: 26px; height: 26px; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.child-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; background: #fff; }
.child-card .child-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pub-submit { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pub-main .check-field label { align-items: flex-start; }
.app-kids { margin: 0; padding-left: 16px; }
.enroll-card.is-open { border-left: 4px solid var(--green, #00763A); }
.sms-terms { margin: -4px 0 12px 28px; }
.pub-foot { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; font-size: .85rem; color: var(--muted, #6b7280); text-align: center; }
.pub-foot a { color: inherit; text-decoration: underline; }
.legal h2 { font-size: 1.15rem; margin: 22px 0 6px; }
.legal h1.legal-section { font-size: 1.35rem; margin: 26px 0 4px; padding-top: 14px; border-top: 1px solid var(--border, #e5e7eb); }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 20px; }
.legal .updated { color: var(--muted, #6b7280); font-size: .9rem; }
/* Dodatni programi */
.cand-list { flex-direction: column; flex-wrap: nowrap; max-height: 360px; overflow-y: auto; gap: 4px; }
.cand-list label { justify-content: flex-start; padding: 5px 10px; }
.result-grid th { vertical-align: bottom; min-width: 150px; }
.result-grid th.sticky, .result-grid td.sticky { min-width: 160px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.result-grid .item-head { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.result-grid .item-tools { display: flex; gap: 10px; margin-top: 4px; }
.result-grid .item-tools .danger { color: var(--bad); }
.result-grid td.rcell { vertical-align: top; }
.result-grid td.rcell select { width: 100%; margin-bottom: 4px; }
.result-grid td.rcell .score { width: 100%; }
.result-grid td.rcell.ok select { border-color: var(--ok); background: var(--ok-bg); }
.result-grid td.rcell.warn select { border-color: var(--warn); background: var(--warn-bg); }
.result-grid td.rcell.bad select { border-color: var(--bad); background: var(--bad-bg); }
/* Portal za roditelje */
.portal-auth { max-width: 460px; margin: 0 auto; }
.portal-auth .code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.pub-wide { width: 100%; justify-content: center; padding: 12px; }
.portal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 10px; }
.portal-bar form { margin: 0; }
.portal-h { margin: 6px 0 10px; font-size: 1.2rem; }
.portal-h3 { font-size: .95rem; margin: 14px 0 4px; color: var(--ink-2); }
.child-tile { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.child-tile + .child-tile { margin-top: 12px; }
.child-tile .grow { flex: 1; min-width: 0; }
.child-tile .chev { font-size: 1.8rem; color: var(--muted); }
.mini-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--ink-2); margin-top: 6px; }
.kid-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 12px; }
.kid-tabs a { padding: 8px 16px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.kid-tabs a.on { background: var(--green); border-color: var(--green); color: #fff; }
.kid-head { display: flex; gap: 14px; align-items: center; }
.kid-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.kid-stats .stat { padding: 12px; }
.kid-stats .stat .value { font-size: 1.6rem; }
.kid-stats .stat .value small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.kid-stats .stat .label { font-size: .7rem; }
.next-class { padding: 8px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.class-entry { padding: 10px 0; border-bottom: 1px solid var(--line); }
.class-entry:last-child { border-bottom: 0; }
.homework { margin-top: 6px; background: var(--gold-soft); border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.att-list { max-height: 320px; overflow-y: auto; }
.bar.big { height: 12px; margin: 4px 0 6px; }
.teacher-note { background: #f6f4ee; border-left: 3px solid var(--gold); border-radius: 6px; padding: 8px 10px; margin-top: 8px; }
.pub-main .card + .card { margin-top: 12px; }
@media (max-width: 520px) { .kid-stats { gap: 6px; } .kid-stats .stat { padding: 10px 8px; } .kid-stats .stat .value { font-size: 1.3rem; } .kid-stats .stat::after { display: none; } }
.child-tile:hover, .child-tile:hover * { text-decoration: none; }
.child-tile:hover { border-color: var(--green); }
.last-lessons { border-left: 4px solid var(--green); }
.child-tile .last-line { margin-top: 6px; color: var(--ink-2); }
.last-line .ll { white-space: nowrap; }
.last-line .st { font-weight: 700; }
.last-line .st.ok { color: var(--ok); } .last-line .st.warn { color: var(--warn); } .last-line .st.bad { color: var(--bad); }
/* Odgovori roditelja */
table.replies td { vertical-align: top; }
table.replies tr.unread { background: #fbf8ef; }
table.replies tr.unread .reply-body { font-weight: 600; }
.reply-cell { min-width: 260px; }
.reply-orig { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.reply-orig a { color: inherit; text-decoration: underline; }
.reply-answered { color: var(--ok); font-size: .85rem; margin-top: 4px; }
.reply-box { margin-top: 8px; }
.reply-box summary { list-style: none; display: inline-flex; }
.reply-box summary::-webkit-details-marker { display: none; }
.reply-box[open] summary { margin-bottom: 6px; }
/* Razgovor s roditeljem */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 65vh; overflow-y: auto; }
.chat-day { align-self: center; font-size: .78rem; color: var(--muted); background: #f0eee8; border-radius: 99px; padding: 2px 10px; margin: 6px 0 2px; }
.bubble { max-width: min(78%, 560px); border-radius: 14px; padding: 8px 12px; line-height: 1.45; }
.bubble.in { align-self: flex-start; background: #f0eee8; border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--ok-bg); border: 1px solid #bfe2cc; border-bottom-right-radius: 4px; }
.bubble .b-meta { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.bubble .b-meta a { color: inherit; text-decoration: underline; }
.bubble .b-err { color: var(--bad); font-weight: 600; }
.chat-reply { margin-top: 12px; }
.chat-reply textarea { min-height: 54px; }
/* Poslane poruke: razgovor ispod poruke */
.thread-toggle { width: 28px; }
.thread-toggle .btn-link { font-size: 1.1rem; line-height: 1; }
tr.thread-row td { background: #faf8f3; border-top: 0; }
.thread-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px; }
.t-item { display: grid; grid-template-columns: 185px 170px 1fr; gap: 10px; font-size: .9rem; padding: 6px 10px; border-radius: 8px; }
.t-item.in { background: #f0eee8; }
.t-item.out { background: var(--ok-bg); }
.t-when { color: var(--muted); white-space: nowrap; }
.t-who { font-weight: 600; }
.thread-list { gap: 10px; }
.t-group { display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; }
.t-group.waiting { border-left-color: var(--warn); }
.t-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 2px 2px; }
.t-meta { display: flex; align-items: center; gap: 8px; }
@media (max-width: 720px) { .t-item { grid-template-columns: 1fr; gap: 2px; } }

/* Izvještaji: Top 10 po kategorijama pohvala */
.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.top-cat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.top-cat.total { border-color: var(--green); box-shadow: inset 0 3px 0 var(--green); }
.top-cat h3 { margin: 0 0 8px; font-size: .98rem; display: flex; align-items: center; gap: 6px; }
.top-cat .ico { font-size: 1.15rem; }
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.top-list li:first-child { border-top: 0; }
.top-list .rank { width: 1.8em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.top-list .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-list .who small { font-size: .78rem; }
.top-list .pts { font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }
.top-list li.podium .rank { color: var(--gold); font-weight: 700; }
/* Kolone mreže smiju biti uže od tabele u njima (tabela tada klizi unutar .table-wrap) */
.grid > * { min-width: 0; }

/* Dodatni programi: lekcije po učeniku, status, historija */
.chip-s { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600; margin: 2px 4px 2px 0; white-space: nowrap; text-decoration: none; }
.chip-s.assigned { background: #eef0f3; color: #55606a; }
.chip-s.in_progress { background: var(--warn-bg); color: var(--warn); }
.chip-s.needs_review { background: var(--bad-bg); color: var(--bad); }
.chip-s.completed { background: var(--ok-bg); color: var(--ok); }
.chip-s.removed { background: #f2f0ec; color: var(--muted); text-decoration: line-through; }
.chip-s .d { font-weight: 400; opacity: .85; }
.st4 { display: inline-flex; border: 1px solid #d8d3c7; border-radius: 9px; overflow: hidden; background: #fff; }
.st4 button { border: 0; border-left: 1px solid #e6e1d6; background: #fff; padding: 6px 10px; font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.st4 button:first-child { border-left: 0; }
.st4 button:hover { background: #f6f3ec; }
.st4 button:disabled { cursor: default; }
.st4 button.on.assigned { background: #7d8790; color: #fff; }
.st4 button.on.in_progress { background: #d29a2c; color: #fff; }
.st4 button.on.needs_review { background: var(--bad); color: #fff; }
.st4 button.on.completed { background: var(--ok); color: #fff; }
.lib-list { list-style: none; margin: 8px 0; padding: 0; max-height: 360px; overflow: auto; }
.lib-list li { display: flex; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid #f0ece3; font-size: .92rem; }
.lib-list li.done { color: var(--muted); }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 8px 0 8px 22px; border-left: 2px solid #ebe6da; margin-left: 6px; font-size: .9rem; }
.tl li::before { content: ""; position: absolute; left: -7px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: #d8d3c7; }
.tl li.completed::before { background: var(--ok); } .tl li.in_progress::before { background: #d29a2c; }
.tl li.needs_review::before { background: var(--bad); } .tl li.assigned::before { background: #7d8790; }
.tl .when { display: block; font-size: .78rem; color: var(--muted); }
.mini-bar { height: 8px; border-radius: 99px; background: #efeae0; overflow: hidden; width: 110px; }
.mini-bar span { display: block; height: 100%; background: var(--green); }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.res-list { display: flex; flex-direction: column; }
.res-row { padding: 12px 6px; border-bottom: 1px solid var(--line); }
.res-row.completed { background: #fbfdfb; }
.res-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.res-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.res-meta .note { flex: 1 1 100px; min-width: 80px; }
.res-meta .score { width: 58px; }
.res-meta input[type=date] { width: 124px; display: inline-block; }
.res-actions { margin-left: auto; }
@media (max-width: 640px) {
  .res-top .st4 { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .res-top .st4 button { border-left: 0; border-top: 1px solid #e6e1d6; }
  .res-top .st4 button:nth-child(-n+2) { border-top: 0; }
  .res-top .st4 button:nth-child(even) { border-left: 1px solid #e6e1d6; }
}
/* Početna: kasni prozivka */
.late-banner { margin: 0 0 16px; font-size: .95rem; }
.late-banner a { color: #8a2620; font-weight: 700; text-decoration: underline; }
.repeat-box { margin-bottom: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
/* Izvještaji: SMS i troškovi */
.cost-total { font-size: 1.15rem; white-space: nowrap; }
.cost-table th, .cost-table td { padding: 7px 6px; font-size: .84rem; }
.cost-table thead th { font-size: .66rem; letter-spacing: .02em; hyphens: auto; vertical-align: bottom; }
.cost-table td:first-child, .cost-table th:first-child { padding-left: 10px; }
.cost-table tfoot th { border-top: 2px solid var(--line); }
.reply-excuse { margin-top: 6px; }
.reply-tip { cursor: help; }

/* Uvoz nastavnih programa */
.steps-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.steps-row span { padding: 5px 12px; border-radius: 999px; background: #f0eee8; color: var(--muted); font-size: .85rem; font-weight: 600; }
.steps-row span.on { background: var(--green); color: #fff; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; text-align: center; }
.drop:hover { border-color: var(--green); background: var(--green-soft); }
.drop .drop-icon { font-size: 1.8rem; line-height: 1; }
.drop input[type=file] { max-width: 100%; font-size: .85rem; }
.optbox { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; cursor: pointer; }
.optbox input { margin-top: 4px; }
.optbox.on { border-color: var(--green); background: var(--green-soft); }
.diff { list-style: none; margin: 6px 0 0; padding: 0; font-size: .86rem; color: var(--ink-2); }
.diff li { padding: 1px 0; }
.diff li > span:first-child { display: inline-block; width: 1.2em; font-weight: 700; text-align: center; }
.d-add { color: var(--ok); } .d-ren { color: var(--info); } .d-upd { color: var(--gold-dark); }
.d-mov { color: var(--info); } .d-del { color: var(--bad); } .d-keep { color: var(--muted); }
.d-warn { color: var(--gold-dark); font-weight: 700; cursor: help; }
.tracker-warn { border-left: 4px solid var(--gold-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
table.cols td { font-size: .86rem; vertical-align: top; }

/* Tabele napretka: zaglavlje s lekcijama i kolona s imenima ostaju vidljivi pri skrolanju */
.grid-scroll { max-height: max(360px, calc(100vh - 130px)); overflow: auto; padding: 0; }
.grid-scroll table { border-collapse: separate; border-spacing: 0; }
.grid-scroll thead th { position: sticky; top: 0; z-index: 2; background: #fbfaf6; box-shadow: inset 0 -1px 0 var(--line); }
.grid-scroll thead th.sticky { left: 0; z-index: 3; }
.grid-scroll th.sticky, .grid-scroll td.sticky { padding-left: 20px; box-shadow: inset -1px 0 0 var(--line); }
.grid-scroll thead th.sticky { box-shadow: inset -1px -1px 0 var(--line); }
.grid-scroll td:last-child, .grid-scroll th:last-child { padding-right: 20px; }

/* Izvještaji: napredak */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; }
.section-head h2 { margin: 0; font-size: 1.3rem; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row .bar { flex: 1; }
.hard-list .chip { width: auto; min-width: 34px; padding: 0 6px; height: 24px; font-size: .78rem; }
.hard-list li { flex-wrap: wrap; row-gap: 4px; }
@media (max-width: 720px) { .card-head { flex-wrap: wrap; } }  /* npr. ukupni trošak SMS-a ne izlazi iz ekrana */
.progress-sum { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
@media (max-width: 720px) { .progress-sum { grid-template-columns: 1fr; } }

/* Prozivka: automatsko snimanje */
.autosave { color: var(--muted); }
.autosave[data-state="saved"] { color: var(--ok); font-weight: 600; }
.autosave[data-state="saved"]::before { content: "✓ "; }
.autosave[data-state="error"] { color: var(--bad); font-weight: 600; }

/* „čeka odgovor“ → klik: nije potreban odgovor */
button.clear-wait { border: 0; cursor: pointer; font-family: inherit; }
.clear-wait .cw-off { display: none; }
.clear-wait:hover, .clear-wait:focus-visible { background: var(--ok-bg); color: var(--ok); }
.clear-wait:hover .cw-on, .clear-wait:focus-visible .cw-on { display: none; }
.clear-wait:hover .cw-off, .clear-wait:focus-visible .cw-off { display: inline; }
.chat-wait { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin: 2px 0 6px; }

/* Učenici → Spol */
.seg-gender { position: relative; }
.seg-gender input:checked + label { background: var(--green); color: #fff; }
.gender-table tr.no-guess td { background: var(--warn-bg); }

/* Učenici → Roditelji: roditelji grupisani po učeniku */
table.parents tr.p-student td { background: #faf8f3; border-top: 2px solid var(--line); padding-top: 9px; padding-bottom: 9px; }
table.parents td.p-name { padding-left: 28px; }

/* „Opravdaj izostanak“ u Poslanim porukama i razgovoru */
.t-excuse { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 2px 0; }
.t-excuse .reply-excuse { margin-top: 0; }
.excuse-card { margin-top: 12px; }
.excuse-card .reply-excuse { display: inline-block; margin: 4px 6px 0 0; }

/* Postavke → Obavijesti o novim odgovorima */
.alert-h { font-size: .92rem; margin: 14px 0 6px; }
.alert-rows { display: grid; gap: 6px; }
.alert-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.alert-row .grow { flex: 1 1 140px; min-width: 0; }
.alert-log { margin: 8px 0 0; padding-left: 18px; }
.alert-log li { margin: 2px 0; }

/* Bilješke i datoteke uz lekciju */
.note-item { border: 1px solid #ebe6da; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fcfbf8; }
.note-item.hidden-parents { background: #f6f5f1; border-style: dashed; }
.note-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.note-text { font-size: .93rem; line-height: 1.5; overflow-wrap: anywhere; }
.note-text a { font-weight: 600; }
.file-chip { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; padding: 6px 10px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .88rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip small { color: var(--ink-2); font-weight: 400; }
.note-edit { margin-top: 8px; }
.note-edit summary { cursor: pointer; font-size: .85rem; color: var(--green); font-weight: 600; }
.note-edit form { margin-top: 8px; }
.note-form { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 6px; }
.note-form h3 { margin: 0 0 8px; font-size: .95rem; }
.note-form textarea, .note-edit textarea { width: 100%; }
.note-link { display: inline-flex; align-items: center; gap: 3px; font-size: .8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); white-space: nowrap; }
.note-link.has { color: var(--green); border-color: #bfe2cc; background: var(--ok-bg); font-weight: 600; }
.portal-notes { margin: 6px 0 0; padding: 0; list-style: none; }
.portal-notes li { border-left: 3px solid var(--gold, #b09872); padding: 4px 0 4px 10px; margin: 6px 0; font-size: .92rem; }
.list .portal-notes li { display: block; border-bottom: 0; }  /* bilješka u „Zadnje lekcije“: datoteka ispod teksta, ne u istom redu */
.portal-notes li.own { border-left-color: var(--green); }
.note-lesson { padding: 10px 0; border-top: 1px solid #f0ece3; }
.note-lesson:first-of-type { border-top: 0; }
.more-notes summary { cursor: pointer; color: var(--green); font-weight: 600; font-size: .9rem; padding: 8px 0; }
.nav-count + .nav-count { margin-left: 4px; }
.nav-count.pending { background: #fff; color: var(--gold-dark); }

/* Arhiva → Učenici kroz godine */
.yt { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .92rem; }
.yt th.y, .yt td.y { text-align: center; width: 46px; padding-left: 2px; padding-right: 2px; }
.yc { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 25px; border-radius: 7px; font-weight: 700; font-size: .8rem; }
.yc.in { background: #dcefe3; color: #0b5d33; }
.yc.cur { background: var(--green); color: #fff; }
.yc.gap { background: #fff; border: 1.5px dashed #d9b9a6; color: #c0703f; font-weight: 600; }
.yc.none { color: #d5d0c4; }
.leg { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); align-items: center; margin: 10px 0 0; }
.leg .yc { min-width: 26px; height: 22px; font-size: .75rem; }
.tl { position: relative; margin: 4px 0 0 8px; padding-left: 22px; border-left: 3px solid #e6e1d4; }
.tl .it { position: relative; padding: 0 0 16px; }
.tl .it::before { content: ""; position: absolute; left: -31px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--green); border: 3px solid #fff; box-shadow: 0 0 0 1px #cfd8d2; }
.tl .it.gap::before { background: #fff; border: 2px dashed #d9b9a6; box-shadow: none; }
.tl .it.proj::before { background: #fff; border: 2px dashed #9fc6ae; box-shadow: none; }
.tl .yr { font-weight: 700; }
.tl .meta { font-size: .9rem; color: var(--ink-2); }
.mini { width: 100%; border-collapse: collapse; font-size: .88rem; }
.mini td { padding: 5px 6px; border-bottom: 1px solid var(--line); }
.diffv { background: #fdeee5; color: #a14b1e; border-radius: 5px; padding: 0 4px; font-weight: 700; }
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pipe .col { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.pipe .col.next { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.pipe h3 { margin: 0 0 2px; font-size: 1rem; }
.pipe .big { font-size: 1.8rem; font-weight: 700; color: var(--green); }
.pipe ul { margin: 8px 0 0; padding: 0; list-style: none; font-size: .88rem; max-height: 420px; overflow: auto; }
.pipe li { padding: 3px 0; border-top: 1px solid #f0ede5; }
@media (max-width: 860px) { .pipe { grid-template-columns: minmax(0, 1fr); } }
.warn-text { color: var(--warn); }

/* Poruke na čekanju: poruke duže od jednog SMS-a */
.long-msg { margin-top: 4px; font-size: .84rem; color: var(--ink-2); max-width: 420px; }
.long-msg summary { cursor: pointer; list-style: none; }
.long-msg summary::-webkit-details-marker { display: none; }
.long-msg[open] { background: var(--warn-bg); border-radius: 8px; padding: 4px 8px 6px; }
.reason-edit { width: 100%; min-width: 160px; }
tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* Ovlasti muallima (Postavke → korisnik) */
.perm-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 16px 0; }
.perm-box legend { font-weight: 700; padding: 0 6px; }
.perm-box .check-list { flex-direction: column; align-items: stretch; }
.perm-box .check-list label { align-items: flex-start; }
.perm-box .check-list input { margin-top: 3px; }
/* Samo pregled (muallim bez ovlasti) */
.readonly-note { margin-bottom: 14px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled .seg label { cursor: default; }
fieldset.plain:disabled .seg, fieldset.plain:disabled .input, fieldset.plain:disabled .check-list { opacity: .75; }
a.tile { display: block; color: inherit; text-decoration: none; }

/* Dodatni programi: redoslijed (prevlačenje kartica) */
.order-bar { margin: 0 0 12px; align-items: center; }
.drag-handle { border: 1px solid transparent; background: none; cursor: grab; font-size: 1.15rem; line-height: 1; padding: 2px 4px;
  margin-left: 4px; color: var(--muted, #8a948c); border-radius: 6px; touch-action: none; vertical-align: middle; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--ink); border-color: var(--line, #e3ddd0); background: #fff; }
.is-dragging { cursor: grabbing; }
.is-dragging * { user-select: none; }
[data-sortable] > .drag-src { opacity: .45 !important; outline: 2px dashed var(--gold, #b09872); outline-offset: 2px; }
.drag-ghost { position: fixed; z-index: 90; pointer-events: none; box-shadow: 0 14px 34px rgba(0,0,0,.18); transform: rotate(1.5deg);
  opacity: .95; margin: 0; }

/* Arhiviranje godine i nova godina */
.start-box { background: var(--green-soft); border-radius: 10px; padding: 12px 14px 2px; margin-top: 4px; }
.carry-row { display: grid; grid-template-columns: 30px minmax(0, 1.1fr) minmax(0, 1.7fr) minmax(0, 1.1fr); gap: 14px; padding: 14px 0; border-top: 1px solid #efebe2; align-items: start; }
.carry-row:first-of-type { border-top: 0; }
.carry-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green); }
.carry-chips { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.chip-line { white-space: nowrap; }
.info-box { background: var(--info-bg); color: #23507a; border-radius: 10px; padding: 10px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; font-size: .92rem; }
.plan-start { background: var(--green-soft); color: #1f5c3a; border-radius: 8px; padding: 5px 9px; margin-top: 8px; }
.empty-group { border: 1px dashed #d8d3c7; border-radius: 8px; padding: 7px 9px; margin-top: 8px; text-align: center; color: var(--muted); }
.inline-date { margin: 0; display: inline-flex; gap: 6px; align-items: center; }
.inline-date .input { width: 150px; }
details.fold > summary { color: var(--ink-2); font-size: .92rem; padding: 4px 0; }
details.fold > summary::before { content: "▸"; margin-right: 6px; }
details.fold[open] > summary::before { content: "▾"; }
/* Upisnica: povratnik i sažetak prošle godine */
.last-year { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.last-year .ly-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ly-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ly-stat { background: #fff; border-radius: 8px; padding: 8px 10px; }
.ly-stat .l { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ly-stat .v { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.ly-stat .s { font-size: .78rem; color: var(--ink-2); }
.ly-lessons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; font-size: .9rem; }
.ly-lessons .pill { display: inline-block; border-radius: 999px; padding: 1px 9px; margin: 0 4px 4px 0; font-size: .84rem; }
.ly-lessons .pill.ok { background: var(--ok-bg); color: #1f6b3d; }
.ly-lessons .pill.open { background: var(--warn-bg); color: #6b4a12; }
.ly-note { background: #fff; border-radius: 8px; padding: 8px 10px; margin-top: 10px; font-size: .9rem; }
.archived-banner { background: var(--warn-bg); color: #6b4a12; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }
@media (max-width: 860px) {
  .carry-row { grid-template-columns: 30px minmax(0, 1fr); }
  .carry-row > :nth-child(n+3) { grid-column: 2; }
  .ly-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ly-lessons { grid-template-columns: minmax(0, 1fr); }
}

/* Poruka se šalje u pozadini */
.sending-box { background: var(--warn-bg); color: #6b4a12; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.sending-box progress { flex: 1 1 200px; height: 10px; accent-color: var(--green); }
