/* BeSafe — vzhľad pod brand */
:root {
  --navy:        #262478;   /* hlavná značková farba (z loga) */
  --navy-dark:   #1A1958;
  --navy-light:  #3B388F;
  --accent:      #F59E0B;
  --bg:          #F4F5FB;
  --bg-card:     #FFFFFF;
  --border:      #E2E5F0;
  --text:        #1A1F36;
  --text-muted:  #64748B;
  --green:       #16A34A;
  --green-bg:    #DCFCE7;
  --red:         #DC2626;
  --red-bg:      #FEE2E2;
  --yellow:      #F59E0B;
  --yellow-bg:   #FEF3C7;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Topbar — biely s logom */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.5rem; background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(38, 36, 120, .04);
}
.topbar .brand a {
  display: flex; align-items: center; gap: .6rem;
  color: var(--navy); font-weight: 700; text-decoration: none;
}
.topbar .brand-logo { height: 36px; width: auto; display: block; }
.topbar .brand-sub  {
  font-size: .82rem; color: var(--text-muted); font-weight: 500;
  border-left: 1px solid var(--border); padding-left: .6rem;
  letter-spacing: .03em;
}
.topbar nav { display: flex; gap: .25rem; flex: 1; margin-left: 1.5rem; flex-wrap: wrap; }
.topbar nav a {
  color: var(--text); padding: .45rem .75rem; border-radius: 6px;
  font-weight: 500; font-size: .92rem;
}
.topbar nav a:hover { background: var(--bg); color: var(--navy); text-decoration: none; }
.topbar nav a.nav-external { margin-left: auto; background: var(--navy); color: #fff; }
.topbar nav a.nav-external:hover { background: var(--navy-dark); color: #fff; }

/* Embed iframe for sub-projects (Skoly SWAN) */
.embed-frame { width: 100%; height: calc(100vh - 230px); min-height: 600px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(38,36,120,.04); }
.topbar .user { display: flex; align-items: center; gap: .75rem; }
.topbar .user span { color: var(--text-muted); font-size: .88rem; }

.container { max-width: 1240px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.bottombar { text-align: center; padding: 1.5rem 1rem; color: var(--text-muted); font-size: .85rem; border-top: 1px solid var(--border); background: #fff; margin-top: 2rem; }
.bottombar a { color: var(--navy); font-weight: 500; }
.footer-info { display: flex; justify-content: center; gap: 2rem; margin-bottom: .35rem; flex-wrap: wrap; align-items: center; }
.footer-brand strong { color: var(--navy-dark); font-size: 1rem; letter-spacing: .04em; }
.footer-contact { color: var(--text); }
.footer-contact a { color: var(--navy); }

/* Headings */
h1 { margin-top: 0; color: var(--navy-dark); font-weight: 700; font-size: 1.65rem; }
h2 { color: var(--navy-dark); font-weight: 600; }
h3 { color: var(--navy-dark); }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.4rem 1.5rem; margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(38, 36, 120, .04), 0 1px 2px rgba(38, 36, 120, .04);
}
.card h2 { margin-top: 0; }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Forms */
form.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem 1rem; align-items: end; }
form.grid .span2 { grid-column: 1/-1; }
form label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; color: var(--text-muted); font-weight: 500; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  font: inherit; padding: .55rem .7rem; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(38, 36, 120, .12);
}
textarea { resize: vertical; min-height: 80px; }
small { color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font: inherit; color: var(--text);
  font-weight: 500; transition: all .15s;
}
.btn:hover { background: var(--bg); border-color: #cbd5e1; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn.small { padding: .3rem .65rem; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.alert.ok    { background: var(--green-bg); border: 1px solid #86efac; color: #166534; }
.alert.error { background: var(--red-bg);   border: 1px solid #fca5a5; color: #991b1b; }
.alert.info  { background: #E5E7FB;         border: 1px solid #C7C9F0; color: var(--navy-dark); }
.pool-preview { border-left: 4px solid var(--navy); }
.pool-detail { margin-top: .5rem; padding: .5rem .75rem; background: #F8FAFC; border-radius: 6px; border-left: 3px solid var(--border); }
.empty { color: var(--text-muted); font-style: italic; padding: .5rem 0; }
.muted { color: var(--text-muted); }

/* Auth — login page */
.auth { max-width: 420px; margin: 4rem auto; padding: 2rem; }
.auth-logo { display: block; max-width: 220px; margin: 0 auto 1.5rem; }
.auth h1 { text-align: center; font-size: 1.3rem; margin-bottom: 1.25rem; }
.auth form { display: flex; flex-direction: column; gap: .85rem; }
.auth .btn { justify-content: center; }
.hint { font-size: .82rem; color: var(--text-muted); margin-top: 1rem; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data thead th { background: #F0F1F8; font-size: .82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.data tbody tr:hover { background: var(--bg); }
table.data .sum { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.b-zadana       { background: #E0E7FF; color: #3730A3; }
.b-rozpracovana { background: var(--yellow-bg); color: #92400E; }
.b-hotova       { background: var(--green-bg);  color: #166534; }
.b-payable      { background: #ECFCCB; color: #3F6212; border: 1px dashed #65A30D; }
.b-pay-pending  { background: #FEF9C3; color: #854D0E; }
.b-paid         { background: #CFFAFE; color: #155E75; }
.b-pending      { background: #FEF9C3; color: #854D0E; }
.b-cancelled    { background: #F1F5F9; color: var(--text-muted); }

/* Navbar badge */
.navbadge {
  display: inline-block; min-width: 18px; padding: 0 .4rem; height: 18px; line-height: 18px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: .72rem; font-weight: 700; text-align: center; margin-left: .25rem;
}
.navbadge.nb-blue  { background: var(--navy); }
.navbadge.nb-amber { background: var(--accent); color: #1F1D63; }

/* tasks_new — checkbox label */
.checkbox-label {
  display: flex !important; flex-direction: row !important; align-items: center;
  gap: .6rem; padding: .65rem .9rem; background: #FFF7ED;
  border: 1px dashed var(--accent); border-radius: 8px; color: #92400E;
}
.checkbox-label input { width: auto; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .35rem; margin-top: .5rem; }
.event-grid .checkbox-label { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: .35rem .55rem; font-size: .85rem; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .8rem 1rem; }
fieldset legend { padding: 0 .4rem; color: var(--navy-dark); font-weight: 600; }
select:disabled { opacity: .5; background: #F1F5F9; }

/* pool actions */
.pool-actions form.inline { margin-bottom: .25rem; }

/* Payouts */
.payout-block {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 1.15rem 1.25rem; margin-bottom: 1rem; background: #FAFBFD;
}
.payout-block h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.payout-block h3 small { font-weight: 400; font-size: .82rem; color: var(--text-muted); }
.payout-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.payout-total { font-size: 1.15rem; color: var(--navy-dark); }
.payout-note {
  background: #FFFBEB; border-left: 3px solid var(--accent);
  padding: .45rem .75rem; margin: .5rem 0; border-radius: 4px; font-size: .9rem;
}
tr.total-row { background: var(--bg); font-weight: 600; }
tr.row-unassigned td { background: #FFFBEB; border-top: 2px solid var(--accent); }
.mt1 { margin-top: 1rem; display: block; }

.row-stav-hotova { opacity: .8; }

/* Inline forms */
form.inline { display: inline-flex; gap: .35rem; align-items: center; margin-top: .35rem; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--navy); font-weight: 500; }
details[open] summary { margin-bottom: .5rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stats > div {
  background: linear-gradient(135deg, #F8F9FE, #FFFFFF);
  border: 1px solid var(--border); border-radius: 10px; padding: 1.1rem .9rem; text-align: center;
}
.stats .num { display: block; font-size: 1.6rem; font-weight: 700; color: var(--navy-dark); }
.stats .lbl { display: block; color: var(--text-muted); font-size: .82rem; margin-top: .3rem; }

/* Weekly view */
table.week { table-layout: fixed; }
table.week td { vertical-align: top; min-height: 80px; }
.taskcell {
  background: #EEF0FA; border-left: 3px solid var(--navy-light);
  padding: .4rem .55rem; margin-bottom: .35rem; border-radius: 4px; font-size: .82rem;
}
.taskcell .d-popis { display: block; }
.taskcell .d-suma  { display: block; font-weight: 600; color: var(--text-muted); margin-top: .2rem; font-size: .78rem; }
.taskcell.stav-hotova       { background: var(--green-bg); border-color: var(--green); }
.taskcell.stav-rozpracovana { background: var(--yellow-bg); border-color: #D97706; }
.daysum { margin-top: .4rem; font-size: .76rem; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: .3rem; }
.weeksum { background: var(--bg); font-weight: 600; }

.weeknav { display: flex; gap: .35rem; }
.filter { display: flex; gap: 1rem; align-items: end; }

/* Progress bar */
.progressbar { width: 100%; height: 10px; background: #E2E5F0; border-radius: 999px; overflow: hidden; }
.progressbar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--green));
  transition: width .3s ease;
}
.progressbar.mini { height: 5px; margin: .15rem 0; }
.progresscell small { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.inline-quick { display: inline-flex; gap: .25rem; margin-top: .25rem; }
.quick-select { padding: .15rem .35rem; font-size: .8rem; min-width: 60px; }
.note-form { display: flex; gap: .25rem; align-items: center; width: 100%; }
.note-input { flex: 1; min-width: 100px; padding: .35rem .5rem; font-size: .85rem; }

/* Compact week strip on technik dashboard */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; margin-top: .5rem; }
.ws-day { padding: .55rem .35rem; text-align: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.ws-day .ws-name { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.ws-day .ws-date { font-size: .9rem; color: var(--navy-dark); font-weight: 600; margin: .15rem 0; }
.ws-day .ws-count { font-size: .85rem; color: var(--text); }
.ws-day .ws-count.muted { color: var(--text-muted); }
.ws-day.day-done    { background: var(--green-bg); border-color: #86efac; }
.ws-day.day-pending { background: var(--red-bg);   border-color: #fca5a5; }
.ws-day.today       { outline: 2px solid var(--navy); outline-offset: -2px; }
@media (max-width: 600px) {
  .week-strip { grid-template-columns: repeat(7, 1fr); gap: .25rem; }
  .ws-day { padding: .35rem .15rem; }
  .ws-day .ws-date { font-size: .8rem; }
}
.progressform { display: flex; align-items: center; gap: .35rem; }
.inline-label { display: flex; align-items: center; gap: .35rem; color: var(--text-muted); font-size: .85rem; }
.inline-label select { padding: .25rem .4rem; }

/* Mesačný kalendár */
table.month { table-layout: fixed; }
table.month th { text-align: center; }
table.month td { vertical-align: top; min-height: 100px; padding: .4rem; height: 110px; }
table.month td.today        { outline: 2px solid var(--navy); outline-offset: -2px; }
table.month td.muted-cell   { background: #F8FAFC; }
table.month td.day-done     { background: var(--green-bg); }
table.month td.day-pending  { background: var(--red-bg); }
table.month td.day-done.today    { background: #BBF7D0; }
table.month td.day-pending.today { background: #FECACA; }

.legend { display: flex; gap: .8rem; align-items: center; font-size: .82rem; color: var(--text-muted); flex-wrap: wrap; }
.legend .lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); vertical-align: middle; margin-right: .25rem; }
.legend .lg-done    { background: var(--green-bg); }
.legend .lg-pending { background: var(--red-bg); }
.legend .lg-today   { background: #fff; outline: 2px solid var(--navy); outline-offset: -2px; }

/* Mini kalendár na dashboarde */
table.month.mini td { height: 64px; min-height: 64px; padding: .25rem; }
table.month.mini .daylink { display: block; height: 100%; color: inherit; text-decoration: none; padding: .15rem; border-radius: 4px; }
table.month.mini .daylink:hover { background: rgba(38, 36, 120, .06); }
table.month.mini .daynum { font-size: .85rem; font-weight: 600; }
table.month.mini .daydots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: .25rem; }
table.month.mini .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
table.month.mini .dot.done    { background: var(--green); }
table.month.mini .dot.pending { background: var(--red); }
.daynum { font-size: .8rem; color: var(--text-muted); font-weight: 600; margin-bottom: .25rem; }

/* Expenses block (in task details) */
.exp-block { margin-top: .8rem; padding: .7rem .85rem; background: #FFFCF2; border: 1px solid #F0E5C0; border-radius: 8px; }
.exp-title { font-weight: 600; font-size: .85rem; color: #92400E; margin-bottom: .5rem; }
.exp-list { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .3rem; }
.exp-item { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: 4px; background: #fff; border: 1px solid var(--border); font-size: .88rem; }
.exp-item .exp-sum { font-weight: 600; min-width: 70px; }
.exp-item .exp-popis { flex: 1; color: var(--text-muted); }
.exp-item.exp-approved { background: #F0FDF4; border-color: #BBF7D0; }
.exp-item.exp-rejected { background: #FEF2F2; border-color: #FECACA; opacity: .7; }
.b-approved { background: var(--green-bg); color: #166534; }
.b-rejected { background: var(--red-bg); color: #991B1B; }
.exp-form { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.exp-form .exp-suma { width: 80px; }
.exp-form .exp-popis-inp { flex: 1; min-width: 200px; }

/* Task title + description */
.task-title { color: var(--navy-dark); font-weight: 600; }
.task-desc  { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; line-height: 1.35; }
.task-meta  { font-size: .8rem; color: var(--navy); margin-top: .25rem; font-weight: 500; }

/* Collaborators */
.collab-block { margin-top: .8rem; padding: .7rem .85rem; background: #F0F4FF; border: 1px solid #C7D2FE; border-radius: 8px; }
.collab-title { font-weight: 600; font-size: .85rem; color: var(--navy-dark); margin-bottom: .5rem; }
.collab-title small { font-weight: 400; color: var(--text-muted); }
.collab-list { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.collab-item { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: .25rem .65rem; font-size: .85rem; display: flex; align-items: center; gap: .35rem; }
.collab-add { display: flex; gap: .35rem; flex-wrap: wrap; }
.collab-chip { display: inline-flex; align-items: center; gap: .15rem; margin-right: .5rem; }
.collab-shares { flex-direction: column; gap: .35rem; }
.collab-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding: .4rem .6rem; }
.collab-row .collab-who { min-width: 160px; display: flex; align-items: center; gap: .35rem; }
.collab-row .collab-share { min-width: 130px; }
.collab-row.is-locked { background: #ECFCCB; border-color: #65A30D; }
.inline-details { display: inline-block; }
.inline-details summary { display: inline-block; }
.inline-details[open] { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; }

/* Attachments */
.att-block { margin-top: .8rem; padding: .7rem .85rem; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 8px; }
.att-title { font-weight: 600; font-size: .85rem; color: #166534; margin-bottom: .5rem; }
.att-list  { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-direction: column; gap: .35rem; }
.att-item  { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: .35rem .55rem; font-size: .88rem; }
.att-icon  { font-size: 1.2rem; }
.att-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.att-name  { flex: 1; color: var(--navy); }
.att-form  { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.att-source { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; font-weight: 600; }
.att-source-admin { background: #FEF3C7; color: #92400E; }
.att-source-tech  { background: #DBEAFE; color: #1E40AF; }
.att-locked       { color: var(--text-muted); margin-left: .35rem; }
.att-by-admin     { background: #FFFBEB; }   /* veľmi jemné odlíšenie pozadia */
.att-by-technik   { background: #fff; }

/* Realizácia (poznámka pri dokončení) */
.realizacia-block { background: #FFFBEB; border-left: 3px solid var(--accent); padding: .55rem .75rem; border-radius: 4px; font-size: .9rem; margin: .5rem 0; }

/* Archive of done tasks */
.archive-task { border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.15rem; margin-bottom: .85rem; background: #FAFBFD; }
.archive-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.archive-sum { text-align: right; display: flex; flex-direction: column; gap: .15rem; align-items: flex-end; font-size: 1rem; }
.archive-sum small { font-size: .78rem; }

/* Done form (povinná realizácia) */
.done-form summary { list-style: none; cursor: pointer; }
.done-form summary::-webkit-details-marker { display: none; }
.done-content { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; padding: .6rem .8rem; background: #FEF9C3; border: 1px solid #FCD34D; border-radius: 8px; }
.done-content textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 6px; }

/* Sub-sums in tasks table */
.sub-sum { font-size: .76rem; line-height: 1.2; margin-top: .15rem; font-weight: 500; }
.sub-sum.approved { color: var(--green); }
.sub-sum.pending  { color: var(--yellow); }
.sub-sum.total    { color: var(--navy-dark); font-weight: 700; border-top: 1px solid var(--border); padding-top: .15rem; }

/* Chart card */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
.chart-box  { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.chart-box h3 { margin: 0 0 .75rem; font-size: 1rem; color: var(--navy-dark); }
.chart-canvas-wrap { position: relative; height: 260px; }
.chart-legend { display: grid; gap: .35rem; margin-top: .75rem; font-size: .85rem; }
.chart-legend .row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.chart-legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: .4rem; }
.chart-empty { color: var(--text-muted); font-style: italic; padding: 1rem; text-align: center; }

/* Mapa */
.taskmap { height: 500px; border-radius: 10px; border: 1px solid var(--border); margin-top: .5rem; }
.leaflet-popup-content { font-size: .9rem; }
.taskmap-pin { background: transparent; border: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.map-legend { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .6rem; padding: .55rem .75rem; background: var(--bg); border-radius: 8px; font-size: .85rem; }
.map-legend strong { color: var(--navy-dark); margin-right: .25rem; }
.map-leg-item { display: inline-flex; align-items: center; gap: .15rem; }

/* Approval row in tasks_approvals.php */
.approve-row { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed var(--border); }
.task-info { margin-top: .3rem; }
.task-info .task-meta { margin-left: .6rem; }

.big-sum { color: var(--navy-dark); font-size: 1.05rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .5rem; }

/* User color chip */
.user-chip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: .35rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.user-chip-lg { width: 18px; height: 18px; }
.technik-name { white-space: nowrap; }

/* Activity strip */
.activity-strip { border-left: 4px solid var(--accent); }
table.activity td { padding: .45rem .6rem; border-bottom: 1px dashed var(--border); }
table.activity .act-time { width: 100px; color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
table.activity .act-who  { width: 160px; color: var(--navy-dark); }
table.activity .act-what { color: var(--text); }

@media (max-width: 980px) {
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .container { max-width: 100%; padding: 1rem .75rem 2rem; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .container { padding: .75rem .5rem 2rem; }

  /* Topbar — kompaktné, nav posuvné horizontálne pri pretečení */
  .topbar { flex-wrap: wrap; padding: .55rem .75rem; gap: .5rem; }
  .topbar .brand-logo { height: 28px; }
  .topbar .brand-sub  { display: none; }
  .topbar nav {
    order: 3; flex-basis: 100%; margin-left: 0;
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: .15rem 0 .25rem;
  }
  .topbar nav a { flex-shrink: 0; font-size: .85rem; padding: .35rem .55rem; }
  .topbar nav a.nav-external { margin-left: 0; }   /* na mobile nech sa nepretláča vpravo */
  .topbar .user span { display: none; }            /* meno + rolu skryjeme */
  .topbar .user .btn { padding: .35rem .65rem; }

  /* Karty: menšie odsadenie + horizontálny scroll pri pretekajúcom obsahu (tabuľky) */
  .card { padding: .85rem; overflow-x: auto; }
  .card > h1, .card > h2, .card > h3, .card > p, .card > div { overflow-x: visible; }
  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.05rem; }

  /* Formuláre */
  form.grid { grid-template-columns: 1fr; gap: .55rem; }
  form.inline { flex-wrap: wrap; }
  form.inline > * { min-width: 0; }
  input[type=text], input[type=password], input[type=date], input[type=email],
  input[type=number], select, textarea { max-width: 100%; }

  /* Tabuľky — všeobecne necháme cez overflow-x:auto v karte; špecifické typy ako block */
  table.data { font-size: .88rem; }
  table.data th, table.data td { padding: .5rem .55rem; }

  /* Týždenná tabuľka — block (každá bunka pod sebou) */
  table.week, table.week thead, table.week tbody, table.week tr, table.week td, table.week th { display: block; }
  table.week td { border-bottom: 1px solid var(--border); }

  /* Mesačný kalendár — block */
  table.month, table.month thead, table.month tbody, table.month tr, table.month td, table.month th { display: block; }
  table.month td { border-bottom: 1px solid var(--border); height: auto; }

  /* Stats cards — kompaktnejšie */
  .stats > div { padding: .85rem .5rem; }
  .stats .num { font-size: 1.35rem; }
  .stats .lbl { font-size: .78rem; }

  /* Týždenný strip na technikovom dashboarde */
  .week-strip { gap: .2rem; }
  .ws-day { padding: .3rem .15rem; }
  .ws-day .ws-name { font-size: .65rem; }
  .ws-day .ws-date { font-size: .8rem; }
  .ws-day .ws-count { font-size: .78rem; }

  /* Mapa o niečo nižšia, ale stále použiteľná */
  .taskmap { height: 380px; }

  /* SWAN iframe */
  .embed-frame { height: calc(100vh - 200px); min-height: 420px; }

  /* Spolupracovníci a podiely — riadky sa zalamujú */
  .collab-row { padding: .5rem .55rem; }
  .collab-row .collab-who { min-width: 0; flex: 1 1 100%; }
  .collab-row .collab-share { min-width: 0; flex: 1 1 50%; }

  /* Prílohy — zalamovanie a menšie miniatúry */
  .att-item { flex-wrap: wrap; gap: .35rem; }
  .att-thumb { width: 32px; height: 32px; }
  .att-name { word-break: break-all; }

  /* Activity strip — kompaktné */
  table.activity .act-time { width: 80px; }
  table.activity .act-who  { width: auto; max-width: 110px; word-break: break-word; }
  table.activity .act-what { font-size: .85rem; }

  /* Payout block */
  .payout-block { padding: .85rem; }
  .payout-actions { align-items: stretch; }

  /* Auth — login na mobile */
  .auth { margin: 1.5rem auto; padding: 1.5rem; }
  .auth-logo { max-width: 180px; margin-bottom: 1rem; }

  /* Footer */
  .footer-info { gap: 1rem; flex-direction: column; }
}

/* Veľmi úzke obrazovky (telefóny do 420 px) */
@media (max-width: 420px) {
  .topbar nav a { font-size: .8rem; padding: .3rem .45rem; }
  .topbar .brand a { font-size: .95rem; }
  .topbar .brand-logo { height: 24px; }
  .ws-day .ws-name { font-size: .6rem; }
  .ws-day .ws-date { font-size: .75rem; }
  .stats { gap: .5rem; }
  .stats > div { padding: .65rem .35rem; }
  .stats .num { font-size: 1.15rem; }
  table.data { font-size: .82rem; }
  .map-legend { font-size: .78rem; }
}
