:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #e6ebf2;
  --text: #161f2d;
  --muted: #61708a;
  --primary: #2563eb;
  --primary-2: #4f8cff;
  --primary-d: #1d4ed8;
  --primary-soft: #edf3ff;
  --green: #12b76a;
  --green-soft: #e6f8ef;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --red: #e5484d;
  --red-soft: #fdecec;
  --purple: #8b5cf6;
  --purple-soft: #f2edff;
  --blue: #0ea5e9;
  --blue-soft: #e6f6fd;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
  --shadow-md: 0 6px 16px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.05);
  --shadow-lg: 0 16px 40px rgba(16,24,40,.14), 0 3px 10px rgba(16,24,40,.07);
  --ease: cubic-bezier(.22,.8,.3,1);
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: var(--font);
  background: linear-gradient(180deg, #f6f8fd 0%, var(--bg) 40%);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(37,99,235,.16); }

/* ---------- ikone (male, tanke, uglađene) ---------- */
.ic { width: 17px; height: 17px; flex-shrink: 0; vertical-align: middle; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff; font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(37,99,235,.3), inset 0 1px 0 rgba(255,255,255,.3);
}
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.tabs { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 8px 13px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; position: relative;
  transition: color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease);
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab:active { transform: scale(.97); }
.tab.active { color: var(--primary); background: var(--primary-soft); }
.tab.active::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--primary); animation: grow .22s var(--ease);
}
@keyframes grow { from { transform: scaleX(.3); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px; padding: 5px 12px 5px 5px; font-size: 13px; font-weight: 600;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.user-chip:hover { border-color: #d6deeb; box-shadow: var(--shadow-sm); }
.user-avatar {
  width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, var(--primary-soft), #dce8ff); color: var(--primary);
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
}

/* ---------- izgled ---------- */
.view { max-width: 1240px; margin: 0 auto; padding: 26px 24px 70px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view > * { animation: fadeUp .3s var(--ease) both; }

/* ---------- kartice ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 18px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: #d9e0ec; box-shadow: var(--shadow-md); }
.card-title { font-size: 14.5px; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 9px; color: var(--text); }
.card-title .ic { color: var(--muted); width: 16px; height: 16px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
/* deca grid/flex-a se mogu skupljati (ne prelivaju širinu) */
.grid > *, .card > *, .toolbar > * { min-width: 0; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- stat kartice ---------- */
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.stat::before {
  content: ''; position: absolute; top: 0; left: 12px; right: 12px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d9e0ec; }
.stat-ic {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary-soft), #dfe9ff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 6px rgba(37,99,235,.12);
  color: var(--primary); transition: transform .2s var(--ease);
}
.stat:hover .stat-ic { transform: scale(1.06); }
.stat-ic svg { width: 18px; height: 18px; }
.stat-val { font-size: 23px; font-weight: 800; letter-spacing: -.4px; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
a.stat { text-decoration: none; color: inherit; }
.stat.green .stat-ic { background: linear-gradient(180deg, var(--green-soft), #d5f3e3); color: var(--green); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 6px rgba(18,183,106,.12); }
.stat.amber .stat-ic { background: linear-gradient(180deg, var(--amber-soft), #fae9cd); color: var(--amber); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 6px rgba(217,119,6,.12); }
.stat.purple .stat-ic { background: linear-gradient(180deg, var(--purple-soft), #e6dcff); color: var(--purple); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 6px rgba(124,58,237,.12); }

/* ---------- dugmad (gradijent + glow + prelaz) ---------- */
.btn3d {
  position: relative; border: 0; cursor: pointer; font-family: var(--font);
  font-weight: 600; font-size: 13.5px; padding: 9px 16px; border-radius: var(--radius-sm); color: #fff;
  background: linear-gradient(180deg, var(--primary-2) 0%, var(--primary) 55%, var(--primary-d) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(37,99,235,.25);
  transition: background .18s var(--ease), box-shadow .18s var(--ease), transform .12s var(--ease), filter .18s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}
.btn3d:hover { filter: brightness(1.04); background: linear-gradient(180deg, #5a94ff 0%, var(--primary) 55%, var(--primary-d) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px rgba(37,99,235,.38); transform: translateY(-1px); }
.btn3d:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 4px rgba(37,99,235,.2); }
.btn3d.green { background: linear-gradient(180deg, #2fd088 0%, var(--green) 55%, #0ea05e 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(18,183,106,.25); }
.btn3d.green:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px rgba(18,183,106,.38); }
.btn3d.red { background: linear-gradient(180deg, #ef5b5f 0%, var(--red) 55%, #d13b40 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(229,72,77,.25); }
.btn3d.red:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px rgba(229,72,77,.36); }
.btn3d.ghost {
  background: #fff; color: var(--text); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), var(--shadow-sm);
}
.btn3d.ghost:hover { background: var(--surface-2); border-color: #d6deeb; box-shadow: inset 0 1px 0 rgba(255,255,255,.7), var(--shadow-md); filter: none; }
.btn3d.ghost:active { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), var(--shadow-sm); }
.btn3d.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
button:disabled, .btn3d:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.7); pointer-events: none; }

/* ---------- tabele ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 600; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: #f8fafc; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions .btn3d { opacity: .82; }
tbody tr:hover .row-actions .btn3d { opacity: 1; }

/* ---------- tagovi / bedzevi ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--primary-soft); color: var(--primary); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.purple { background: var(--purple-soft); color: var(--purple); }
.tag.gray { background: var(--surface-2); color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge.parna { background: var(--primary-soft); color: var(--primary); }
.badge.neparna { background: var(--purple-soft); color: var(--purple); }

/* ---------- forme ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; font-size: 14px;
  font-family: var(--font); background: #fff; color: var(--text);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #cdd6e4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.13), 0 2px 8px rgba(37,99,235,.08); }
input[type=number] { width: 100px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.cloud-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cloud-box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.cloud-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cloud-box code { background: var(--surface-2); border-radius: 5px; padding: 1px 5px; font-size: 11.5px; word-break: break-all; }
.cloud-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; font: inherit; transition: transform .14s var(--ease), box-shadow .14s var(--ease), border-color .14s; }
.cloud-tile:hover { transform: translateY(-2px); border-color: #cfd8e6; box-shadow: var(--shadow-md); }
.cloud-tile:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }
.cloud-tile b { font-size: 13.5px; }
.cloud-tile .tag { font-size: 11px; }
.cloud-ic { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .cloud-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cloud-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-start; justify-content: center; padding: 34px 18px; overflow: auto; background: rgba(15,23,42,.42); backdrop-filter: blur(4px); }
.modal-bg.open { display: flex; animation: fadeUp .18s var(--ease) both; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 820px; padding: 24px 26px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: modalIn .22s var(--ease) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 16px; font-size: 16px; font-weight: 700; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal .close-x { float: right; border: 0; background: var(--surface-2); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; transition: background .14s, color .14s, transform .1s; }
.modal .close-x:hover { background: var(--red-soft); color: var(--red); transform: rotate(90deg); }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; border-radius: 11px; padding: 11px 15px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary); animation: slideIn .28s var(--ease) both; display: flex; align-items: center; gap: 9px; }
.toast .ic { width: 15px; height: 15px; }
.toast.ok { border-left-color: var(--green); color: #15803d; }
.toast.err { border-left-color: var(--red); color: #b91c1c; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.toast.bye { transition: opacity .28s, transform .28s; opacity: 0; transform: translateX(24px); }

/* ---------- raspored ---------- */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
@media (max-width: 900px) { .week-grid { grid-template-columns: repeat(2,1fr); } }
/* kalendar časova po danima — uvek 7 kolona (i na telefonu) */
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.wd-name { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.wd-name.we { color: var(--red); }
.weekday { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 90px; }
.weekday .wd-name { font-weight: 600; font-size: 12px; margin-bottom: 6px; color: var(--muted); }
.slot-chip { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; border-radius: 7px; padding: 5px 8px; font-size: 12px; font-weight: 600; margin-bottom: 5px; box-shadow: 0 1px 3px rgba(37,99,235,.25); }
.slot-chip.conflict { background: linear-gradient(180deg, #ef5b5f, var(--red)); }

/* ---------- razno ---------- */
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 30px; height: 30px; opacity: .4; margin-bottom: 8px; }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; height: 80px; margin-bottom: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.login-wrap { max-width: 400px; margin: 80px auto; }
.login-card { background: #fff; border-radius: 18px; padding: 32px 34px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login-logo { width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 14px; background: linear-gradient(135deg, var(--primary-2), var(--primary)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; box-shadow: 0 6px 16px rgba(37,99,235,.32), inset 0 1px 0 rgba(255,255,255,.3); }
.login-card h1 { text-align: center; font-size: 18px; margin: 0 0 4px; font-weight: 700; }
.login-card p { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.attendance-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.attendance-row:last-child { border-bottom: 0; }
.attendance-row .name { flex: 1; min-width: 140px; font-weight: 600; font-size: 13.5px; }
.att-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.att-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); transition: all .14s var(--ease); display: inline-flex; align-items: center; gap: 5px; }
.att-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.att-btn.on.green { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(18,183,106,.3); }
.att-btn.on.purple { background: var(--purple); border-color: var(--purple); color: #fff; box-shadow: 0 2px 8px rgba(139,92,246,.3); }
.att-btn.on.red { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(229,72,77,.3); }
.att-btn.on.blue { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(14,165,233,.3); }
.att-note { border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px; min-width: 160px; flex: 1; max-width: 340px; background: var(--surface); color: var(--text); }
.att-note::placeholder { color: var(--muted); }
.calendar-box { max-width: 340px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 12px; box-shadow: var(--shadow-sm); }
.cal-cell { text-align: center; padding: 7px 3px; border-radius: 9px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); transition: background .13s, box-shadow .13s, transform .13s, border-color .13s; cursor: pointer; user-select: none; min-height: 36px; }
.cal-cell:hover { background: var(--primary-soft); border-color: #c8d5f0; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.cal-cell.we { background: var(--surface-2); color: var(--muted); }
.cal-cell.off { background: linear-gradient(180deg, #fdecec, #fbe4e4); color: var(--red); border-color: var(--red); font-weight: 700; cursor: help; }
.cal-cell.off:hover { box-shadow: 0 2px 8px rgba(229,72,77,.28); }
.cal-cell.today { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.pstatus { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.year-switch { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 10px; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.year-switch:hover { border-color: var(--primary); }
.lic-widget { display: flex; align-items: center; }
.lic-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: border-color .16s, box-shadow .16s; }
.lic-pill .ic { width: 14px; height: 14px; }
.lic-pill:hover { border-color: #d6deeb; box-shadow: var(--shadow-sm); }
.lic-pill-activated { color: var(--green); background: var(--green-soft); border-color: transparent; }
.lic-pill-trial { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.lic-pill-expired { color: var(--red); background: var(--red-soft); border-color: transparent; }
.lic-machine { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.lic-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.lic-code { font-family: Consolas, monospace; font-size: 14px; font-weight: 700; letter-spacing: .5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.scanner-box { position: relative; border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.scanner-box video { display: block; width: 100%; height: 260px; object-fit: cover; }
.contact-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 6px; }
.contact-row { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: 12.5px; color: #fff; text-decoration: none; border: 0; cursor: pointer; font-family: var(--font); transition: transform .12s, box-shadow .12s; white-space: nowrap; }
.contact-row .ic { width: 15px; height: 15px; }
.contact-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.contact-row.green { background: var(--green); }
.contact-row.blue { background: var(--blue); }
.contact-row.wa { background: #25D366; }
.contact-row.vb { background: #7360F2; }
.cal-lesson { display: block; font-size: 10px; font-weight: 600; background: linear-gradient(180deg, #eaf1ff, #e0ecff); color: #1d4ed8; border: 1px solid #d4e2fb; border-radius: 5px; padding: 1px 4px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-lesson.cancel { background: linear-gradient(180deg, #fdecec, #fadfdf); color: #b91c1c; border-color: #f6cdcd; text-decoration: line-through; }
.cal-count { font-size: 9px; font-weight: 700; color: #1d4ed8; background: #e0ecff; border-radius: 8px; padding: 0 5px; margin-left: 4px; }
.dp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dp-head b { flex: 1; text-align: center; font-size: 13px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.dp-day { text-align: center; padding: 4px 0; border-radius: 6px; font-size: 12px; cursor: pointer; border: 1px solid transparent; }
.dp-day:hover { background: var(--primary-soft); }
.dp-day.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.pstatus .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pstatus.green { background: var(--green-soft); color: #15803d; } .pstatus.green .dot { background: var(--green); }
.pstatus.yellow { background: var(--amber-soft); color: #b45309; } .pstatus.yellow .dot { background: #f5a623; }
.pstatus.red { background: var(--red-soft); color: #b91c1c; } .pstatus.red .dot { background: var(--red); }
.pstatus.gray { background: var(--surface-2); color: var(--muted); } .pstatus.gray .dot { background: #94a3b8; }
.c-red { color: var(--red) !important; }
.c-green { color: var(--green) !important; }

/* ---------- MOBILNI PRIKAZ (telefon) — sve staje na ekran, bez skrola udesno ---------- */
@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .view { padding: 12px 10px 70px; }
  .topbar-inner { padding: 8px 10px; gap: 8px; flex-wrap: wrap; height: auto; }
  .brand-sub { display: none; }
  .brand-logo { width: 30px; height: 30px; font-size: 12px; }
  .brand-title { font-size: 14px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 6px 9px; font-size: 12px; white-space: nowrap; }
  .tab.active::after { left: 9px; right: 9px; }
  .topbar-right .user-chip span { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card { padding: 12px; }
  .card-title { font-size: 13.5px; gap: 7px; }
  .toolbar { gap: 8px; }
  .stat { padding: 12px 12px; gap: 11px; }
  .stat-ic { width: 34px; height: 34px; }
  .stat-val { font-size: 20px; }
  .grid-2, .grid-3, .grid-4 { gap: 10px; }
  /* kartice ispunjavaju širinu s leva na desno */
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .row-actions { gap: 4px; }
  .btn3d.sm { padding: 5px 8px; }

  /* redovi sa fiksnim širinama — omotaju se i inputi se sliju */
  [style*="display:flex"] { flex-wrap: wrap; }
  input[type="text"], input[type="number"], input[type="search"], input[type="date"], input[type="time"], select, textarea { max-width: 100%; }
  input[style*="width"], select[style*="width"] { width: auto !important; max-width: 100% !important; flex: 1 1 auto !important; min-width: 0 !important; }

  /* tabele — kompaktne da stanu (bez skrola udesno) */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  th, td { padding: 6px 5px; font-size: 11px; white-space: normal; word-break: break-word; }
  th { font-size: 9.5px; letter-spacing: .2px; padding: 7px 5px; }
  td .tag { font-size: 10px; padding: 1px 5px; }

  /* modal — uvek staje na ekran (i široki) */
  .modal-bg { padding: 6px; }
  .modal { max-width: 100% !important; padding: 14px; border-radius: 14px; }
  .modal-foot { flex-wrap: wrap; }
  .form-grid { gap: 0 8px; }

  .calendar-box { max-width: 100%; }
  .att-btns { gap: 4px; }
  .att-btn { padding: 4px 7px; font-size: 11px; }
  .login-wrap { margin: 40px auto; padding: 0 10px; }
  .contact-menu { grid-template-columns: repeat(2, 1fr); }
  .lic-pill { padding: 5px 8px; font-size: 11px; }
  .lic-code { font-size: 12px; }
}

/* ---------- padajući meniji ---------- */
.menu-btn { display: none; border: 0; background: var(--surface-2); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; color: var(--text); font-size: 19px; line-height: 1; transition: background .15s; }
.menu-btn:hover { background: var(--primary-soft); }
.user-menu { position: relative; }
.user-chip { cursor: pointer; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 170px; display: none; z-index: 60; }
.user-dropdown.open { display: block; animation: fadeUp .15s ease both; }
.dd-item { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); font-family: var(--font); text-align: left; }
.dd-item:hover { background: var(--surface-2); }
.dd-item .ic { color: var(--muted); }
.dd-hint { padding: 8px 12px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.dd-sep { height: 1px; background: var(--line); margin: 6px 8px; }
.lang-list { max-height: 250px; overflow-y: auto; }
.lang-item { gap: 8px; }
.lang-item.active { background: var(--primary-soft); color: var(--primary); }
.flag { width: 18px; height: 13px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex-shrink: 0; }
.av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; vertical-align: middle; flex-shrink: 0; display: inline-block; }
.av-lg { width: 64px; height: 64px; }
.av-ini { display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-soft), #dce8ff); color: var(--primary); font-size: 12px; font-weight: 700; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.av-opt { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px; cursor: pointer; transition: border-color .15s, transform .12s; }
.av-opt img { width: 100%; border-radius: 8px; display: block; }
.av-opt:hover { border-color: var(--primary); transform: translateY(-1px); }
.mobile-menu { display: none; }
@media (max-width: 640px) {
  .menu-btn { display: block; }
  .tabs { display: none; }
  .mobile-menu { position: fixed; top: 62px; left: 8px; right: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 55; flex-direction: column; }
  .mobile-menu.open { display: flex; animation: fadeUp .15s ease both; }
  .mobile-menu .dd-item { padding: 12px 14px; }
}

/* ---------- analitika / grafikoni ---------- */
.name-link { color: inherit; text-decoration: none; }
.name-link:hover { color: var(--primary); text-decoration: underline; }
.chart-box { position: relative; height: 220px; }
.tag.blue { background: var(--blue-soft); color: var(--blue); }

/* ---------- kviz: odgovori + obeležavanje tačnog ---------- */
.quiz-opt { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-1); cursor: pointer; text-align: left; transition: .15s; font-size: 14px; }
.quiz-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.quiz-opt.correct { border-color: var(--green, #12b76a); background: rgba(18, 183, 106, .12); color: var(--green, #12b76a); font-weight: 700; }
.quiz-opt.wrong { border-color: var(--red, #e5484d); background: rgba(229, 72, 77, .12); color: var(--red, #e5484d); font-weight: 700; }
.quiz-fill { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.quiz-fill.correct { border-color: var(--green, #12b76a); box-shadow: 0 0 0 2px rgba(18,183,106,.18); }
.quiz-fill.wrong { border-color: var(--red, #e5484d); box-shadow: 0 0 0 2px rgba(229,72,77,.18); }
.quiz-fb { font-size: 12px; font-weight: 600; margin-top: 4px; min-height: 16px; }
.quiz-correct { display: inline-flex; align-items: center; gap: 2px; color: var(--green, #12b76a); cursor: pointer; font-weight: 700; }
.quiz-correct input { cursor: pointer; }
.quiz-correct:hover { color: var(--primary); }
