/* Evidence telefonátů – styly */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --border: #e2e6ee;
  --text: #1e2532;
  --muted: #6b7280;
  --primary: #1f5eff;
  --primary-hover: #1548cc;
  --primary-soft: #e8efff;
  --success: #157347; --success-bg: #d9f3e4;
  --warning: #9a5b00; --warning-bg: #fff1cc;
  --danger: #b42318;  --danger-bg: #fde3e1;
  --info: #0b6e8f;    --info-bg: #d7f0fa;
  --muted-bg: #e9ecf1;
  --topbar: #111827;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 18px; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
code { background: var(--muted-bg); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 140px); }

/* --- Horní lišta --- */
.topbar { background: var(--topbar); color: #fff; }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-icon { opacity: .8; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a { color: #cbd5e1; padding: 6px 11px; border-radius: 6px; font-size: .95rem; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255, 255, 255, .12); text-decoration: none; }
.nav .nav-user { color: #94a3b8; padding: 6px 10px; font-size: .9rem; }
.nav .nav-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .15); margin: 0 6px; }
.nav .pill { display: inline-block; background: #f59e0b; color: #111; border-radius: 999px; padding: 0 7px; font-size: .72rem; margin-left: 6px; font-weight: 700; line-height: 1.5; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255, 255, 255, .25); color: #fff; font-size: 1.2rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; }
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; margin-left: auto; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  .nav.open { display: flex; }
  .nav .nav-sep { display: none; }
}

/* --- Karty --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-header h1, .card-header h2 { margin: 0; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-header h1 { margin: 0; }

/* --- Dlaždice --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .83rem; }
.stat .value { font-size: 1.65rem; font-weight: 650; margin-top: 2px; line-height: 1.2; }
.stat .sub { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.stat.accent { border-left: 4px solid var(--primary); }
.stat.warn { border-left: 4px solid #f59e0b; }
.stat.good { border-left: 4px solid var(--success); }

/* --- Tabulky --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #f8fafc; white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.nowrap, th.nowrap { white-space: nowrap; }
tr.overdue td { background: #fff4e5; }
tr.total td { font-weight: 650; background: #f8fafc; border-top: 2px solid var(--border); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.small { font-size: .85rem; }
.muted-row { color: var(--muted); }

/* --- Odznaky --- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: #4b5563; }

/* --- Formuláře --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
label .req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel],
input[type=datetime-local], input[type=month], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c9d1dc; border-radius: 8px; font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31, 94, 255, .18); border-color: var(--primary); }
textarea { min-height: 100px; resize: vertical; }
.help { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters > div { min-width: 140px; flex: 1; }
.filters > div.grow { flex: 2; min-width: 200px; }
.filters > div.auto { flex: 0; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.inline-form { display: inline; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px 16px; margin: 0 0 16px; }
legend { font-weight: 600; padding: 0 6px; font-size: .9rem; }

/* --- Tlačítka --- */
.btn {
  display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.3; text-align: center;
}
.btn:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.btn-secondary { background: #fff; color: var(--text); border-color: #c9d1dc; }
.btn-secondary:hover { background: #f3f4f6; color: var(--text); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #0f5c38; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1c13; }
.btn-sm { padding: 5px 10px; font-size: .84rem; border-radius: 6px; }
.btn-block { display: block; width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); padding: 0; font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* --- Hlášky --- */
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #b7e4c7; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f5c2bd; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #b3e1f1; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #f5dd9b; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }

/* --- Různé --- */
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.amount-pos { color: var(--success); font-weight: 600; white-space: nowrap; }
.amount-neg { color: var(--danger); font-weight: 600; white-space: nowrap; }
.balance-big { font-size: 2.1rem; font-weight: 700; line-height: 1.1; }
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: .9rem; }
.pagination a:hover { background: var(--primary-soft); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .dots { border: none; background: none; }
.login-page { max-width: 420px; margin: 50px auto; }
.login-page .brand-big { text-align: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; }
.footer { color: var(--muted); font-size: .83rem; padding: 18px 16px; text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.details dt { color: var(--muted); font-size: .9rem; }
dl.details dd { margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.leader-rank { font-weight: 700; color: var(--muted); width: 2.5em; }
tr.rank-1 .leader-rank { color: #d97706; }
tr.rank-2 .leader-rank { color: #6b7280; }
tr.rank-3 .leader-rank { color: #b45309; }
tr.me td { background: var(--primary-soft); }
.note-box { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }
.phone-link { white-space: nowrap; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 12px; }
.setup-steps li { margin-bottom: 6px; }

/* --- Projekty --- */
.badge-project { background: var(--primary-soft); color: var(--primary); }
.project-switch { display: flex; align-items: center; gap: 8px; margin: 0; }
.project-switch label { color: #94a3b8; font-weight: 500; font-size: .85rem; margin: 0; }
.project-switch select {
  width: auto; max-width: 240px; padding: 6px 10px; background: #1f2937; color: #fff;
  border: 1px solid #374151; border-radius: 6px; font-size: .92rem;
}
.project-card { border-left: 4px solid var(--primary); }
.checklist {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; max-height: 300px; overflow: auto; background: #fff;
}
.checklist .check { font-size: .92rem; margin: 0; }
.checklist-tools { display: flex; gap: 14px; margin: 4px 0 6px; font-size: .85rem; }
@media (max-width: 820px) {
  .project-switch { order: 3; width: 100%; padding-bottom: 8px; }
  .project-switch select { flex: 1; max-width: none; }
}
