/* =============================================================
   Е-НЕТ систем — стилови
   ============================================================= */
:root {
  --orange: #F28C1B;
  --orange-d: #D46F06;
  --orange-l: #FFF1E2;
  --blue: #1D63B8;
  --blue-l: #E7F0FB;
  --red: #E03A3A;
  --red-l: #FDECEC;
  --green: #1F9D5B;
  --green-l: #E5F6EC;
  --amber: #B7791F;
  --amber-l: #FDF4E0;

  --bg: #FAF7F3;
  --surface: #FFFFFF;
  --surface-2: #F6F2EC;
  --ink: #1E2430;
  --ink-2: #4A5261;
  --muted: #7A818E;
  --line: #ECE5DC;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(30, 36, 48, .05), 0 8px 24px rgba(30, 36, 48, .06);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke-width='5' stroke-linecap='round'%3E%3Cpath d='M20 20c0-9 7-14 14-11' stroke='%23F28C1B'/%3E%3Cpath d='M20 20c0-9 7-14 14-11' stroke='%231D63B8' transform='rotate(120 20 20)'/%3E%3Cpath d='M20 20c0-9 7-14 14-11' stroke='%23E03A3A' transform='rotate(240 20 20)'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 18px; }

/* ---------- Лого ---------- */
.logo { display: inline-block; width: 34px; height: 34px; background: var(--logo) center/contain no-repeat; flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; white-space: nowrap; font-size: 19px; font-weight: 800; letter-spacing: .02em; }
.brand small { display: block; font-size: 9.5px; letter-spacing: .14em; color: var(--muted); font-weight: 700; margin-top: -3px; }
.brand-lg .logo { width: 46px; height: 46px; }
.brand-lg b { font-size: 24px; }

/* ---------- Сплеш ---------- */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; }
.logo-spin { width: 54px; height: 54px; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Копчиња ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 15px; border-radius: 10px; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-d); border-color: var(--orange-d); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-l); border-color: #F6C9C9; }
.btn-ok { color: var(--green); }
.btn-ok:hover { background: var(--green-l); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Форми ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font-size: 15px; font-weight: 500; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242, 140, 27, .18); }
textarea { min-height: 70px; resize: vertical; }
input[type="checkbox"] { width: auto; display: inline; margin: 0 6px 0 0; accent-color: var(--orange); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--red); font-size: 13.5px; font-weight: 600; min-height: 1px; margin: 6px 0 0; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 2px; border: 0; background: none; cursor: pointer; font-size: 16px; padding: 6px; opacity: .6; }
.input-row { display: flex; gap: 8px; align-items: flex-end; }
.input-row > *:first-child { flex: 1; }
.check-list { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; margin-top: 5px; background: var(--surface); }
.check-list label { display: flex; align-items: center; padding: 6px 8px; border-radius: 7px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check-list label:hover { background: var(--surface-2); }

/* ---------- Најава ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, #F7A23A 0%, var(--orange) 45%, #E06A0A 100%);
  display: flex; align-items: flex-end; padding: 56px;
}
.login-swirl { position: absolute; width: 560px; right: -120px; top: -90px; opacity: .22; animation: spin 60s linear infinite; }
.login-swirl path { stroke: #fff; }
.login-art-text { position: relative; max-width: 440px; }
.login-art h2 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.login-art p { font-size: 17px; opacity: .92; margin: 14px 0 0; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.login-card h1 { font-size: 26px; margin-top: 18px; }
.login-card .muted { margin: -8px 0 4px; }
.demo-box { margin-top: 6px; padding: 14px; border: 1px dashed #F3C48F; background: var(--orange-l); border-radius: var(--radius-sm); font-size: 13.5px; }
.demo-box b { display: block; margin-bottom: 6px; }
.demo-accounts { display: grid; gap: 4px; }
.demo-accounts button { text-align: left; border: 0; background: rgba(255, 255, 255, .7); border-radius: 7px; padding: 6px 9px; cursor: pointer; font-size: 13px; }
.demo-accounts button:hover { background: #fff; }
.demo-accounts code { font-weight: 700; }

/* ---------- Распоред ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh;
}
.nav { display: grid; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 14.5px;
}
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--orange-l); color: var(--orange-d); }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); }
.mode-demo { display: inline-block; background: var(--amber-l); color: var(--amber); padding: 4px 8px; border-radius: 6px; font-weight: 700; }
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px; border-bottom: 1px solid var(--line); background: rgba(250, 247, 243, .9);
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 22px; font-weight: 800; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue-l); color: var(--blue); font-weight: 800; font-size: 13px; flex: none;
}
.user-chip .who { line-height: 1.2; text-align: right; }
.user-chip .who b { display: block; font-size: 14px; }
.user-chip .who small { color: var(--muted); font-size: 12px; font-weight: 600; }
.view { padding: 28px 32px 60px; max-width: 1240px; width: 100%; outline: none; }

/* ---------- Картички и секции ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.section { margin-top: 28px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; font-weight: 800; }
.section-head .sub { color: var(--muted); font-size: 13.5px; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; }
.stat .label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat .foot { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat.accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.stat.accent .label, .stat.accent .foot { color: rgba(255, 255, 255, .85); }
.stat.danger .value { color: var(--red); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { margin: 0; width: auto; min-width: 180px; padding: 8px 11px; font-size: 14px; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.seg button.on { background: var(--orange-l); color: var(--orange-d); }

/* ---------- Табели ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface);
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FFFCF8; }
td .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; }
td b { font-weight: 700; }
tfoot td { font-weight: 800; background: var(--surface-2); }
.td-actions { text-align: right; white-space: nowrap; }
.td-actions .btn { margin-left: 4px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { cursor: pointer; }

/* ---------- Беџови ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--green-l); color: var(--green); }
.badge.bad { background: var(--red-l); color: var(--red); }
.badge.warn { background: var(--amber-l); color: var(--amber); }
.badge.muted { background: var(--surface-2); color: var(--ink-2); }
.badge.blue { background: var(--blue-l); color: var(--blue); }
.badge.orange { background: var(--orange-l); color: var(--orange-d); }
.role-admin { background: #EFE9FB; color: #5B3BB5; }

/* ---------- Курс / дете картички ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.course-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.course-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--orange); }
.course-card.c1::before { background: var(--blue); }
.course-card.c2::before { background: var(--red); }
.course-card h3 { font-size: 17px; font-weight: 800; }
.course-card .meta { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.course-card .meta span { display: flex; gap: 7px; align-items: center; }
.course-card .meta svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.course-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }

.child-block { margin-top: 28px; }
.child-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.child-head .avatar { width: 44px; height: 44px; font-size: 15px; background: var(--orange-l); color: var(--orange-d); }
.child-head h2 { font-size: 20px; font-weight: 800; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.pay-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.next-due .badge { flex: none; }
.next-due { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.next-due.overdue { background: var(--red-l); }
.next-due.soon { background: var(--amber-l); }
details.inst summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--blue); list-style: none; }
details.inst summary::-webkit-details-marker { display: none; }
details.inst summary::before { content: "▸ "; }
details.inst[open] summary::before { content: "▾ "; }
details.inst table { margin-top: 8px; font-size: 13px; }
details.inst td, details.inst th { padding: 7px 8px; }

.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .logo { width: 44px; height: 44px; opacity: .5; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }

.course-hero { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.course-hero h2 { font-size: 24px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--surface-2); padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.back { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--ink-2); text-decoration: none; margin-bottom: 14px; font-size: 14px; }
.back:hover { color: var(--orange-d); }

/* ---------- Модал ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(30, 36, 48, .42); z-index: 40;
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
  animation: fade .15s ease;
}
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .2); animation: pop .18s ease; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-head .sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.modal-close { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.modal-close:hover { background: var(--surface-2); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.cred-box { background: var(--surface-2); border-radius: 12px; padding: 16px; font-size: 15px; display: grid; gap: 6px; }
.cred-box code { font-size: 16px; font-weight: 800; background: #fff; padding: 2px 8px; border-radius: 6px; }
.inst-table input { margin: 0; padding: 6px 8px; font-size: 14px; min-width: 120px; }
.inst-table td { padding: 7px 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* ---------- Тостови ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: pop .2s ease; max-width: 360px; }
.toast.err { background: var(--red); }

/* ---------- Мобилно ---------- */
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; padding: 28px 20px; }
  .login-art h2 { font-size: 28px; }
  .login-swirl { width: 360px; right: -100px; top: -80px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar .brand small, .sidebar-foot { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav a { padding: 8px 10px; font-size: 13.5px; white-space: nowrap; }
  .nav a svg { display: none; }
  .topbar { padding: 14px 16px; position: static; }
  .topbar h1 { font-size: 19px; }
  .user-chip .who { display: none; }
  .view { padding: 18px 16px 50px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { min-width: 0; flex: 1 1 140px; }
  .grid-cards { grid-template-columns: 1fr; }
}

/* ---------- Тонови (бои) — се користат за картички, избори и секции ---------- */
.uf { --tone: var(--orange); --tone-l: var(--orange-l); --tone-ring: rgba(242, 140, 27, .22); }
.tone-green  { --tone: #1F9D5B; --tone-l: #E5F6EC; --tone-ring: rgba(31, 157, 91, .22); }
.tone-orange { --tone: #E07B0B; --tone-l: #FFF1E2; --tone-ring: rgba(224, 123, 11, .22); }
.tone-blue   { --tone: #1D63B8; --tone-l: #E7F0FB; --tone-ring: rgba(29, 99, 184, .2); }
.tone-violet { --tone: #5B3BB5; --tone-l: #EFE9FB; --tone-ring: rgba(91, 59, 181, .2); }
.tone-teal   { --tone: #0E7C86; --tone-l: #E0F3F4; --tone-ring: rgba(14, 124, 134, .22); }
.tone-pink   { --tone: #C2366F; --tone-l: #FCE8F0; --tone-ring: rgba(194, 54, 111, .2); }
.badge.teal { background: #E0F3F4; color: #0E7C86; }
.tone-slate  { --tone: #5F6B7A; --tone-l: #EEF0F3; --tone-ring: rgba(95, 107, 122, .2); }
.badge.slate { background: #EEF0F3; color: #5F6B7A; }
.btn-slate { color: #5F6B7A; }
.btn-slate:hover { background: #EEF0F3; border-color: #D8DCE2; }
.row-off td:not(.td-actions) { opacity: .62; }
.row-off td:first-child { opacity: 1; }
.row-off td:first-child > b, .row-off td:first-child > .sub:not(.off-line) { opacity: .62; }
.off-line { color: #5F6B7A !important; font-weight: 700 !important; }
.seg-status button.on.st-active { background: var(--green-l); color: var(--green); }
.seg-status button.on.st-inactive { background: #EEF0F3; color: #5F6B7A; }
.note-box.note-slate { background: #EEF0F3; color: #48525F; }
.check-line { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 600; color: var(--ink); cursor: pointer; }
.check-line input { margin: 0; }
.uf-active { margin-top: 16px; }
.badge.pink { background: #FCE8F0; color: #C2366F; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.modal.md { max-width: 720px; }

/* Форма за корисник */
.uf-block + .uf-block { margin-top: 18px; }
.uf-label { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.uf-label .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }
.uf-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--tone-l); }
.uf-wait {
  margin-top: 16px; padding: 18px; border: 2px dashed var(--line); border-radius: 14px;
  text-align: center; color: var(--muted); font-size: 14px; font-weight: 600;
}
.uf-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.uf-note .btn { margin-left: auto; }
.uf .uf-note.role-only { margin-top: 16px; }
.uf-fields { animation: ufIn .22s ease; }
@keyframes ufIn { from { opacity: 0; transform: translateY(6px); } }

/* Секции со боја */
.fsec { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--tone); border-radius: 12px; background: var(--surface); }
.fsec h4 {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--tone);
}
.fsec h4::after { content: ""; flex: 1; height: 1px; background: var(--tone-l); }
.uf input:focus, .uf select:focus, .uf textarea:focus { border-color: var(--tone); box-shadow: 0 0 0 3px var(--tone-ring); }
.uf input[type="checkbox"] { accent-color: var(--tone); }

/* Картички за избор */
.choice-grid { display: grid; gap: 10px; }
.choice-grid.four { grid-template-columns: repeat(4, 1fr); }
.choice-grid.two { grid-template-columns: 1fr 1fr; }
.choice {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer;
  color: var(--ink); font-weight: 500; transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}
.choice:hover { border-color: var(--tone); transform: translateY(-1px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tone-l); color: var(--tone); transition: background .15s, color .15s; }
.choice-ic svg { width: 21px; height: 21px; }
.choice-tx b { display: block; font-size: 14.5px; font-weight: 800; }
.choice-tx small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 1px; line-height: 1.3; }
.choice.on { border-color: var(--tone); background: var(--tone-l); box-shadow: 0 8px 20px var(--tone-ring); }
.choice.on .choice-ic { background: var(--tone); color: #fff; }
.choice.on .choice-tx b { color: var(--tone); }
.choice::after {
  content: "✓"; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--tone); color: #fff; font-size: 12px; font-weight: 800;
  opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s;
}
.choice.on::after { opacity: 1; transform: none; }
.choice input:focus-visible ~ .choice-ic { outline: 2px solid var(--tone); outline-offset: 3px; }
.choice.big { flex-direction: row; align-items: center; gap: 14px; padding: 18px; }
.choice.big .choice-ic { width: 56px; height: 56px; border-radius: 16px; }
.choice.big .choice-ic svg { width: 30px; height: 30px; }
.choice.big .choice-tx b { font-size: 18px; }
.choice.big .choice-tx small { font-size: 12.5px; }

/* Избор на одделение / година */
.grade-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--tone-l); }
.grade-row + .grade-row { margin-top: 8px; }
.grade-lvl { font-weight: 800; color: var(--tone); font-size: 14px; line-height: 1.15; }
.grade-lvl small { display: block; font-size: 11.5px; font-weight: 700; opacity: .75; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { position: relative; cursor: pointer; display: inline-block; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span {
  display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px;
  border: 1.5px solid transparent; background: var(--surface); color: var(--ink-2); font-weight: 800; font-size: 15px;
  box-shadow: 0 1px 2px rgba(30, 36, 48, .06); transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.pick:hover span { border-color: var(--tone); color: var(--tone); }
.pick.on span { background: var(--tone); color: #fff; border-color: var(--tone); box-shadow: 0 6px 14px var(--tone-ring); }
.pick input:focus-visible + span { outline: 2px solid var(--tone); outline-offset: 2px; }
.level-out { margin-top: 12px; min-height: 30px; }
.level-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: var(--tone); color: #fff; font-weight: 800; font-size: 13.5px; box-shadow: 0 6px 14px var(--tone-ring); }

/* Листа деца кај родител */
.kid-filter { margin: 0 0 8px; padding: 8px 11px; font-size: 14px; }
.check-list.tall { max-height: 260px; }
.check-list label { gap: 8px; }
.ck-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 1px 8px; }
.check-list label .badge { flex: none; }
.check-list label:has(input:checked) { background: var(--tone-l); }
.ck-name { font-weight: 500; }
.ck-name b { font-weight: 800; }
.ck-meta { font-size: 12px; color: var(--muted); font-weight: 600; }
.check-list label .badge { margin-left: auto; }

/* Следен чекор по креирање дете */
.next-step { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--tone-l); border: 1px solid var(--tone-ring); display: grid; gap: 10px; }
.next-step b { display: block; color: var(--tone); font-size: 15px; }
.next-step span { font-size: 13.5px; color: var(--ink-2); }

@media (max-width: 700px) {
  .choice-grid.four { grid-template-columns: 1fr 1fr; }
  .choice-grid.two { grid-template-columns: 1fr; }
  .grade-row { grid-template-columns: 1fr; }
  .fsec { padding: 14px; }
}

/* ---------- Месечни плаќања ---------- */
.badge.violet { background: #EFE9FB; color: #5B3BB5; }
.txt-bad { color: var(--red); }
.txt-warn { color: var(--amber); }
.txt-ok { color: var(--green); }
.month-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.month-nav b { min-width: 150px; text-align: center; font-size: 15px; }
.month-nav .btn { border: 0; font-size: 18px; line-height: 1; padding: 5px 11px; }
.pay-select {
  display: inline-block; width: auto; min-width: 178px; margin: 0;
  padding: 6px 10px; font-size: 13.5px; font-weight: 700; border-radius: 8px; cursor: pointer;
}
.pay-select.ps-unpaid { color: var(--ink-2); }
.pay-select.ps-paid { background-color: var(--green-l); border-color: #BFE5CE; color: var(--green); }
.pay-select.ps-nm { background-color: var(--amber-l); border-color: #F1D9A6; color: var(--amber); }
.pay-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pay-cell .sub { flex-basis: 100%; }
.btn-ok-solid { background: var(--green); border-color: var(--green); color: #fff; }
.btn-ok-solid:hover { background: #17824A; border-color: #17824A; }
.next-due.paid { background: var(--green-l); }
.price-line { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.price-line b { font-size: 19px; color: var(--ink); font-weight: 800; }
.method-lines { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; font-size: 13.5px; margin-top: 8px; font-weight: 600; color: var(--ink-2); }
.method-lines b { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.note-box { margin-top: 18px; padding: 12px 16px; background: var(--blue-l); color: #1A4F91; border-radius: 10px; font-size: 14px; font-weight: 500; }
.stat.clickable { cursor: pointer; transition: border-color .15s, transform .1s; }
.stat.clickable:hover { border-color: var(--orange); }
.stat.warn { background: var(--amber-l); border-color: #F1D9A6; }
.stat.warn .value { color: var(--amber); }
.print-only { display: none; }
.inst-table input[type="date"] { min-width: 140px; }

.stats-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .stats-3 { grid-template-columns: repeat(2, 1fr); } }

/* Табели → картички на мобилен */
@media (max-width: 700px) {
  .stack-table, .stack-table tbody, .stack-table tfoot { display: block; }
  .stack-table thead { display: none; }
  .stack-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .stack-table tr:last-child { border-bottom: 0; }
  .stack-table td { display: block; padding: 2px 0; border: 0; min-width: 0; text-align: left; }
  .stack-table td:not([data-label]):not(.td-actions), .stack-table td.wide { grid-column: 1 / -1; }
  .stack-table td.hide-sm { display: none; }
  .stack-table td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-top: 4px;
  }
  .stack-table .td-actions { text-align: left; align-self: end; }
  .stack-table .td-actions .btn { margin: 0 4px 0 0; }
  .stack-table tbody tr:hover td { background: none; }
  .stack-table tfoot td { background: none; }
  .stack-table .pay-select { width: 100%; min-width: 0; }
  .toolbar input[type="search"] { flex-basis: 100%; }
  .stats-3 { grid-template-columns: 1fr 1fr; }
  .month-nav b { min-width: 120px; }
}

/* ---------- Печатење (листи на ученици) ---------- */
@media print {
  .sidebar, .topbar .user-chip, .toolbar, .td-actions, .btn, .back, .no-print, .toasts { display: none !important; }
  .app { display: block; }
  .topbar { position: static; border: 0; padding: 0 0 10px; background: none; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  body { background: #fff; }
}

@media print {
  .print-only { display: inline; }
  .pay-select { border: 0; background: none !important; padding: 0; appearance: none; -webkit-appearance: none; color: var(--ink) !important; }
  .note-box { display: none; }
}

/* ---------- Области, професори на курс, групи ---------- */
.adot { display: inline-flex; align-items: center; gap: 7px; }
.adot i { width: 10px; height: 10px; border-radius: 50%; background: var(--tone); flex: none; box-shadow: 0 0 0 3px var(--tone-l); }
.adots { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.course-card[class*="tone-"]::before { background: var(--tone); }

.swatches { display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 2px; }
.swatch { position: relative; cursor: pointer; display: inline-block; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--tone);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); transition: transform .12s, box-shadow .12s;
  color: #fff; font-weight: 800; font-size: 15px;
}
.swatch:hover span { transform: scale(1.08); }
.swatch.on span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--tone), 0 8px 16px var(--tone-ring); }
.swatch.on span::after { content: "✓"; }
.swatch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 5px; }

.choice-grid.areas { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice-grid.profs { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.choice.compact { flex-direction: row; align-items: center; gap: 11px; padding: 12px 14px; }
.choice.compact .choice-ic { width: 38px; height: 38px; flex: none; }
.choice.compact .choice-tx { min-width: 0; padding-right: 24px; }
.choice.compact .choice-tx b { font-size: 14px; }
.choice.compact::after { top: 8px; right: 8px; width: 20px; height: 20px; font-size: 11px; }
.avatar-ic { border-radius: 50% !important; font-weight: 800; font-size: 13px; }
.uf .uf-wait[data-prof-empty] { margin-top: 4px; }
.h4-count { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--ink-2); }

.gbadge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; background: var(--tone-l); color: var(--tone); font-size: 12px; font-weight: 800; white-space: nowrap; }
.gbadge i { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }

.course-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.ctab {
  text-align: left; border: 2px solid var(--line); border-left: 6px solid var(--tone); background: var(--surface);
  border-radius: 14px; padding: 10px 16px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.ctab b { display: block; font-size: 14.5px; font-weight: 800; }
.ctab small { color: var(--muted); font-weight: 600; font-size: 12px; }
.ctab:hover { border-color: var(--tone); }
.ctab.on { background: var(--tone-l); border-color: var(--tone); box-shadow: 0 8px 18px var(--tone-ring); }
.ctab.on b { color: var(--tone); }

.gstats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.gstats b { font-size: 16px; font-weight: 800; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.gcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.gcard-head { background: var(--tone); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.gcard-head h3 { font-size: 17px; font-weight: 800; }
.gcard-head span { font-size: 12.5px; opacity: .92; font-weight: 600; display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.gcount { background: rgba(255, 255, 255, .24); border-radius: 999px; min-width: 34px; height: 34px; padding: 0 8px; display: grid !important; place-items: center; font-weight: 800; font-size: 15px !important; margin: 0 !important; opacity: 1 !important; }
.gcard-prof { padding: 9px 16px; font-size: 13px; font-weight: 700; color: var(--tone); background: var(--tone-l); display: flex; gap: 6px; align-items: center; }
.gmembers { list-style: none; margin: 0; padding: 4px 16px 8px; }
.gmembers li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.gmembers li:last-child { border-bottom: 0; }
.gmembers small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.gempty { padding: 16px; color: var(--muted); font-size: 13.5px; }
.gcard-foot { display: flex; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.gfree { border: 2px dashed #DDD5CA; box-shadow: none; background: rgba(255, 255, 255, .5); }
.gfree .gcard-head { background: var(--surface-2); color: var(--ink-2); }
.gfree .gcount { background: var(--surface); }
.check-list label.taken { opacity: .55; cursor: not-allowed; }
.course-card .meta .gbadge { margin-left: 2px; }
@media print { .gcard { break-inside: avoid; box-shadow: none; } .gcard-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.course-card .meta .gline { flex-wrap: wrap; }
.course-card .meta .gline .muted { display: inline; }

/* ---------- Профил на корисник ---------- */
.ulink { color: inherit; text-decoration: none; }
.ulink:hover b { color: var(--orange-d); text-decoration: underline; text-underline-offset: 3px; }
.note-box.note-warn { background: var(--red-l); color: #9B2C2C; }
.note-box.note-warn a { color: #9B2C2C; font-weight: 800; }
.cchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.cchip { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--tone-l); color: var(--tone); white-space: nowrap; }

.phero { position: relative; overflow: hidden; padding: 0; }
.phero-band { height: 78px; background: linear-gradient(115deg, var(--tone) 0%, var(--tone) 45%, var(--tone-l) 160%); }
.phero-main { display: flex; gap: 20px; align-items: flex-end; padding: 0 24px 20px; margin-top: -40px; flex-wrap: wrap; }
.pavatar {
  width: 88px; height: 88px; border-radius: 26px; background: var(--surface); color: var(--tone);
  display: grid; place-items: center; font-weight: 800; font-size: 30px; flex: none;
  box-shadow: 0 0 0 4px var(--surface), 0 12px 26px var(--tone-ring); border: 2px solid var(--tone-l);
}
.phero-tx { flex: 1; min-width: 240px; padding-top: 48px; }
.phero-tx h2 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.pmeta > span { display: inline-flex; align-items: center; gap: 6px; }
.pmeta svg { width: 15px; height: 15px; color: var(--tone); flex: none; }
.phero-actions { padding-bottom: 4px; }
.phero.off .phero-band { filter: grayscale(1); opacity: .45; }
.phero-off { padding: 10px 24px; background: #EEF0F3; color: #48525F; font-weight: 700; font-size: 13.5px; }
.phero-note { padding: 10px 24px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }

.pcourse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.pcourse { overflow: hidden; display: flex; flex-direction: column; border-top: 5px solid var(--tone); }
.pcourse-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 16px 18px 8px; }
.pcourse-head h3 { font-size: 17px; font-weight: 800; }
.pc-rows { padding: 4px 18px 12px; display: grid; gap: 8px; }
.pc-row { display: grid; grid-template-columns: 20px 86px 1fr; align-items: center; gap: 4px; font-size: 13.5px; }
.pc-row svg { width: 15px; height: 15px; color: var(--tone); }
.pc-row .k { color: var(--muted); font-weight: 600; }
.pc-row .v { font-weight: 600; color: var(--ink); min-width: 0; }
.pc-price { margin: 0 18px; padding: 12px 14px; background: var(--tone-l); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price-input { display: inline-flex; align-items: center; gap: 6px; }
.price-input input { width: 112px; margin: 0; font-weight: 800; font-size: 16px; padding: 7px 10px; text-align: right; }
.price-input.sm input { width: 92px; font-size: 14px; padding: 5px 8px; }
.price-input span { font-weight: 700; color: var(--ink-2); font-size: 13px; }
.pc-month { margin: 12px 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.pc-debt { margin: 10px 18px 0; padding: 8px 12px; background: var(--red-l); color: var(--red); border-radius: 10px; font-size: 13px; font-weight: 700; }
.pc-foot { margin-top: 14px; padding: 12px 18px; display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); background: var(--surface-2); }

.pparents { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.pmini { display: flex; gap: 12px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; border-left: 4px solid var(--tone); transition: transform .1s, box-shadow .15s; }
.pmini:hover, .pkid:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(30, 36, 48, .1); }
.pmini .avatar, .pkid .avatar { background: var(--tone-l); color: var(--tone); }
.pmini b { display: block; }
.pmini small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.warn-box { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: 14px; background: var(--red-l); border: 1px solid #F6C9C9; }
.warn-box b { color: var(--red); display: block; font-size: 15px; }
.warn-box span { color: var(--ink-2); font-size: 13.5px; }
.pkid { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; text-decoration: none; color: inherit; border-top: 5px solid var(--tone); transition: transform .1s, box-shadow .15s; }
.pkid-head { display: flex; gap: 12px; align-items: center; }
.pkid-head > div { flex: 1; min-width: 0; }
.pkid-head b { display: block; font-size: 16px; }
.pkid-head small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pkid-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding-top: 10px; border-top: 1px dashed var(--line); }
@media (max-width: 700px) {
  .phero-main { padding: 0 16px 16px; }
  .phero-tx { padding-top: 6px; min-width: 0; flex-basis: 100%; }
  .phero-tx h2 { font-size: 22px; }
  .pcourse-grid { grid-template-columns: 1fr; }
}
