/* ═══════════════════════════════════════════════
   Home OS — hlavní styly
   ═══════════════════════════════════════════════ */

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #e0e7ff;
  --sidebar-bg:     #1e1b4b;
  --sidebar-hover:  rgba(255,255,255,0.08);
  --sidebar-active: rgba(255,255,255,0.15);

  --c-rodina:    #ec4899;
  --c-finance:   #10b981;
  --c-pronajem:  #f59e0b;
  --c-auto:      #3b82f6;
  --c-domacnost: #8b5cf6;

  --success: #10b981;
  --danger:  #ef4444;
  --warning: #f59e0b;
  --info:    #3b82f6;

  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --surface2:   #f8fafc;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --radius:  10px;
  --radius-lg: 16px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1);

  --sidebar-w: 240px;
  --header-h:  56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Login screen ─────────────────────────────── */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: .75rem;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.login-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
  margin-bottom: 1rem;
  display: none;
}

/* ── Forms ────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: .375rem;
}

.form-control {
  width: 100%;
  padding: .625rem .875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9375rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

select.form-control { cursor: pointer; }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .625rem 1.125rem;
  border: none;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  white-space: nowrap;
}

.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--success); color: #fff; }

.btn-sm { padding: .375rem .75rem; font-size: .8125rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: .5rem; border-radius: 8px; }

/* ── App layout ───────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform .25s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.sidebar-version {
  font-size: .7rem;
  color: rgba(255,255,255,.45);
}

.nav-section {
  padding: 1rem .75rem .25rem;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}

.nav-links { list-style: none; padding: 0 .5rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .6rem .75rem;
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active { background: var(--sidebar-active); color: #fff; }

.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-user {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: .875rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: .7rem; color: rgba(255,255,255,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-logout {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  padding: .25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.sidebar-logout:hover { color: var(--danger); }

/* ── Mobile header ────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--sidebar-bg);
  z-index: 150;
  align-items: center;
  padding: 0 1rem;
  gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: .25rem;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: .2s;
}

.mobile-logo {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  color: #fff;
  font-size: .95rem;
}

/* ── Nav overlay (mobile) ─────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 190;
}
.nav-overlay.visible { display: block; }

/* ── Main content ─────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 1.5rem;
}

/* ── Page ─────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: .125rem;
}

.page-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.card-title {
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-body { padding: 1.25rem; }

/* ── KPI / stat cards ─────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: .375rem;
}

.kpi-value {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.kpi-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* ── Grid layouts ─────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ── Section ──────────────────────────────────── */
.section { margin-bottom: 1.5rem; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .875rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* ── Badge ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}

.badge-green  { background: #dcfce7; color: #166534; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-pink   { background: #fce7f3; color: #9d174d; }
.badge-gray   { background: #f1f5f9; color: var(--text-muted); }

/* ── Countdown badge ──────────────────────────── */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  border-radius: 8px;
  font-size: .8125rem;
  font-weight: 600;
}
.countdown.ok    { background: #dcfce7; color: #166534; }
.countdown.warn  { background: #fef9c3; color: #854d0e; }
.countdown.alert { background: #fee2e2; color: #991b1b; }

/* ── Event list ───────────────────────────────── */
.event-list { display: flex; flex-direction: column; gap: .5rem; }

.event-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1rem;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: default;
  transition: background .15s;
}
.event-item:hover { background: var(--primary-light); }

.event-date-box {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  line-height: 1.1;
}
.event-date-box .day { font-size: 1.1rem; }
.event-date-box .mon { font-size: .65rem; text-transform: uppercase; }

.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-meta  { font-size: .78rem; color: var(--text-muted); margin-top: 1px; }

.event-actions { display: flex; gap: .25rem; opacity: 0; transition: opacity .15s; }
.event-item:hover .event-actions { opacity: 1; }

/* ── Finance ──────────────────────────────────── */
.finance-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.month-nav { display: flex; align-items: center; gap: .5rem; }
.month-label { font-weight: 600; font-size: .95rem; min-width: 120px; text-align: center; }

.tx-list { display: flex; flex-direction: column; gap: .375rem; }

.tx-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.tx-category-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tx-body { flex: 1; min-width: 0; }
.tx-desc  { font-weight: 500; font-size: .9rem; }
.tx-meta  { font-size: .78rem; color: var(--text-muted); }
.tx-amount { font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.tx-amount.income { color: var(--success); }
.tx-amount.expense { color: var(--danger); }

.tx-actions { display: flex; gap: .25rem; opacity: 0; transition: opacity .15s; }
.tx-item:hover .tx-actions { opacity: 1; }

/* ── Progress bar ─────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: .5rem;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s;
}

/* ── Goal card ────────────────────────────────── */
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.25rem;
}
.goal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.goal-name { font-weight: 600; font-size: .9375rem; }
.goal-amounts { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-muted); margin-top: .375rem; }

/* ── Rental ───────────────────────────────────── */
.property-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.property-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(245,158,11,.08), transparent);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.property-name { font-weight: 700; font-size: 1rem; }
.property-address { font-size: .8rem; color: var(--text-muted); }

.payment-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  padding: .875rem 1.25rem;
}

.payment-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s;
  border: 1.5px solid transparent;
}
.payment-cell:hover { transform: scale(1.15); }
.payment-cell.paid { background: #dcfce7; color: #166534; border-color: #86efac; }
.payment-cell.unpaid { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.payment-cell.future { background: var(--surface2); color: var(--text-light); border-color: var(--border); }

/* ── Car card ─────────────────────────────────── */
.car-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.car-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.car-name { font-weight: 700; font-size: 1rem; }
.car-plate {
  display: inline-block;
  background: #fef9c3;
  border: 1.5px solid #fde68a;
  border-radius: 6px;
  padding: .125rem .5rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #78350f;
  margin-top: .25rem;
}

.car-dates { display: flex; flex-direction: column; gap: .5rem; }
.car-date-row { display: flex; align-items: center; justify-content: space-between; font-size: .875rem; }
.car-date-label { color: var(--text-muted); }

/* ── Shopping list ────────────────────────────── */
.shop-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .875rem;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: background .15s;
}
.shop-item.done { opacity: .5; }
.shop-item.done .shop-name { text-decoration: line-through; }

.shop-check {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.shop-check.checked { background: var(--success); border-color: var(--success); }
.shop-check.checked::after { content: '✓'; color: #fff; font-size: .75rem; font-weight: 700; }

.shop-name { flex: 1; font-size: .9rem; }
.shop-qty { font-size: .8rem; color: var(--text-muted); }

/* ── Warranty ─────────────────────────────────── */
.warranty-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 1rem;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.warranty-body { flex: 1; min-width: 0; }
.warranty-name { font-weight: 600; font-size: .9rem; }
.warranty-meta { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ── Empty state ──────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .375rem; }
.empty-text { font-size: .875rem; }

/* ── Loading ──────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
  gap: .5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Toast ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: .75rem 1.125rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Modal ────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 640px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  line-height: 1;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
}

/* ── Dashboard tiles ──────────────────────────── */
.dash-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.module-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  text-decoration: none;
  color: inherit;
}
.module-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.module-tile-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: .875rem;
}

.module-tile-name { font-weight: 700; font-size: .9375rem; }
.module-tile-desc { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }
.module-tile-stat { font-size: .8rem; font-weight: 600; margin-top: .75rem; }

/* ── Tabs ─────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }

.tab-btn {
  padding: .5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Table ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  padding: .625rem .875rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: .75rem .875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

/* ── Quick add bar ────────────────────────────── */
.quick-add {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.quick-add .form-control { flex: 1; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .mobile-header { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: calc(var(--header-h) + 1rem);
  }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .dash-modules { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }

  .page-title { font-size: 1.25rem; }

  .payment-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .dash-modules { grid-template-columns: 1fr; }
  .payment-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Category colors ──────────────────────────── */
.cat-potraviny   { background: #fef3c7; color: #92400e; }
.cat-bydleni     { background: #dbeafe; color: #1e40af; }
.cat-auto        { background: #e0e7ff; color: #3730a3; }
.cat-zdravi      { background: #dcfce7; color: #166534; }
.cat-volny-cas   { background: #fce7f3; color: #9d174d; }
.cat-deti        { background: #fef9c3; color: #854d0e; }
.cat-stavba      { background: #ffedd5; color: #9a3412; }
.cat-pronajem    { background: #f3f4f6; color: #374151; }
.cat-ostatni     { background: #f1f5f9; color: var(--text-muted); }
.cat-prijem      { background: #dcfce7; color: #166534; }

/* ── Type color accents ───────────────────────── */
[data-module="rodina"]   .module-tile-icon { background: #fce7f3; }
[data-module="finance"]  .module-tile-icon { background: #dcfce7; }
[data-module="pronajem"] .module-tile-icon { background: #fef9c3; }
[data-module="auto"]     .module-tile-icon { background: #dbeafe; }
[data-module="domacnost"].module-tile-icon { background: #ede9fe; }
