:root {
  --color-bg: #f2f5f4;
  --color-surface: #ffffff;
  --color-text: #1c2b27;
  --color-muted: #72857f;
  --color-primary: #17a06a;
  --color-primary-dark: #128055;
  --color-header: #0e3b32;
  --color-danger: #dc2626;
  --color-border: #e6ebe9;
  --radius-lg: 26px;
  --radius-md: 16px;
  --shadow-card: 0 10px 24px rgba(14, 59, 50, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.container.admin {
  max-width: 900px;
}

h1, h2, h3 { line-height: 1.2; }

/* ---------- Sdílené základní prvky (admin i zaměstnanec) ---------- */

.topbar {
  background: var(--color-header);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar a { color: #fff; text-decoration: none; font-size: 15px; }
.topbar strong { font-size: 18px; }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  font-family: inherit;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:active { background: var(--color-primary-dark); }
.btn-secondary { background: #fff; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn-danger { background: #fff; color: var(--color-danger); border: 2px solid var(--color-danger); }
.btn-sm { padding: 8px 12px; font-size: 15px; width: auto; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=date], input[type=tel],
input[type=number], select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
}
textarea { resize: vertical; min-height: 70px; font-family: inherit; }

.pin-input {
  font-size: 32px;
  letter-spacing: 12px;
  text-align: center;
  font-weight: 700;
}

.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 15px; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.muted { color: var(--color-muted); font-size: 15px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--color-border); }
.table-wrap { overflow-x: auto; }

form.card > .btn:last-child,
form.card > button:last-child { margin-top: 6px; }

/* Admin - navigace mezi měsíci (samostatná od zaměstnaneckého summary-nav) */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-nav a { text-decoration: none; color: var(--color-primary); font-weight: 700; font-size: 15px; padding: 4px 12px; }
.month-nav span { font-weight: 700; font-size: 18px; }

.detail-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--color-border); }
.detail-row:last-of-type { border-bottom: none; }

/* Logo Boulec (vektor, currentColor - přizpůsobí se barvě podle pozadí) */
.boulec-logo { height: 34px; width: auto; display: block; flex-shrink: 0; }
.boulec-logo-header { height: 38px; }
.boulec-logo-login { height: 32px; }
.boulec-logo-topbar { height: 26px; }

/* ================================================================
   Zaměstnanecká mobilní aplikace - vlastní design
   ================================================================ */

.app-shell { max-width: 480px; margin: 0 auto; padding-bottom: 24px; }
.app-section { padding: 0 16px; margin-top: 16px; }

/* Horní záhlaví s logem (hlavní obrazovka) */
.brand-header { background: var(--color-header); color: #fff; }
.brand-header-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 16px;
}
.brand-mark { display: flex; align-items: center; }

.brand-user { display: flex; align-items: center; gap: 10px; }
.brand-user-info { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.brand-user-name { font-weight: 600; font-size: 15px; }
.brand-user-role { font-size: 11px; color: rgba(255,255,255,0.7); }
.brand-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-avatar svg { width: 18px; height: 18px; color: #fff; }
.brand-logout, .brand-settings {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; flex-shrink: 0;
}
.brand-logout svg, .brand-settings svg { width: 16px; height: 16px; }

/* Horní záhlaví podstránek (detail, formulář) */
.page-header { background: var(--color-header); }
.page-header-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  color: #fff;
}
.page-header-back {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; flex: 0 0 auto;
}
.page-header-back svg { width: 16px; height: 16px; }
.page-header-title { flex: 1 1 auto; text-align: center; font-weight: 700; font-size: 17px; }
.page-header-spacer { width: 34px; flex: 0 0 auto; }

/* Souhrnná karta měsíce */
.summary-card {
  background: var(--color-header);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-card);
}
.summary-nav { display: flex; align-items: center; justify-content: space-between; }
.summary-nav-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none; flex-shrink: 0;
}
.summary-nav-btn svg { width: 16px; height: 16px; }
.summary-nav-label { font-size: 19px; font-weight: 700; }

.totals-row { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 18px; }
.stat { display: flex; align-items: center; gap: 10px; }
.stat-icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon svg { width: 17px; height: 17px; }
.stat-value { font-size: 25px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 1px; }
.stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.18); }

.amount-compact { display: none; }

.rate-pill {
  margin-top: 16px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}

/* Tlačítko "Přidat záznam" */
.btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 10px 20px rgba(23, 160, 106, 0.30);
}
.btn-cta svg { width: 18px; height: 18px; }
.btn-cta:active { background: var(--color-primary-dark); }

/* Seznam záznamů */
.list-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 4px 14px;
  box-shadow: var(--shadow-card);
}

.record-item { border-bottom: 1px solid var(--color-border); }
.record-item:last-child { border-bottom: none; }

.record-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 2px;
  min-height: 62px;
  background: none;
  border: none;
  margin: 0;
  font: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.record-row-date {
  flex: 0 0 auto;
  width: 58px;
  text-align: center;
  padding-right: 12px;
  border-right: 1px solid var(--color-border);
}
.record-row-weekday { font-size: 11px; font-weight: 700; color: var(--color-muted); letter-spacing: 0.04em; }
.record-row-day { font-size: 24px; font-weight: 800; line-height: 1.05; color: var(--color-text); }
.record-row-monthyear { font-size: 10px; color: var(--color-muted); }

.record-row-mid { flex: 1 1 auto; display: flex; align-items: center; gap: 16px; min-width: 0; }
.record-row-hours, .record-row-money {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 15px; color: var(--color-text);
  white-space: nowrap;
}
.record-row-hours svg, .record-row-money svg { width: 15px; height: 15px; color: var(--color-muted); flex-shrink: 0; }

.record-row-arrow { flex: 0 0 auto; color: var(--color-muted); display: flex; }
.record-row-arrow svg { width: 16px; height: 16px; transition: transform .2s ease; }
.record-item.is-open .record-row-arrow svg { transform: rotate(180deg); }
.record-item.is-open .record-row { color: var(--color-primary-dark); }

/* Rozbalený detail záznamu v seznamu */
.record-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}
.record-detail-inner {
  padding: 2px 2px 16px;
}
.record-detail-note { margin-top: 10px; font-size: 14px; }
.record-detail-actions { display: flex; gap: 10px; margin-top: 14px; }
.record-action {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  background: rgba(23, 160, 106, 0.10);
  color: var(--color-primary-dark);
}
.record-action-danger { background: rgba(220, 38, 38, 0.08); color: var(--color-danger); }

/* Přihlašovací obrazovka zaměstnance - logo v levém horním rohu */
.login-topbar { display: flex; align-items: center; gap: 8px; padding-top: 4px; color: var(--color-header); }

/* ================================================================
   Mobilní zobrazení (šířka displeje do 480 px) - jen tato oblast
   upravuje rozložení pro telefon, výše uvedená pravidla (desktop)
   zůstávají beze změny.
   ================================================================ */
@media (max-width: 480px) {
  /* Hlavička - kompaktnější, ale stále v jednom řádku */
  .brand-header-inner { padding: 14px 12px; gap: 8px; }
  .boulec-logo-header { height: 30px; }
  .brand-user { gap: 6px; }
  .brand-user-info { line-height: 1.15; }
  .brand-user-name { font-size: 12.5px; }
  .brand-user-role { font-size: 9.5px; }
  .brand-avatar, .brand-logout, .brand-settings { width: 28px; height: 28px; }
  .brand-avatar svg, .brand-logout svg, .brand-settings svg { width: 13px; height: 13px; }

  /* Souhrnná karta - dvě rovnoměrně široké části vedle sebe */
  .summary-card { padding: 16px 14px 14px; }
  .summary-nav-label { font-size: 17px; }

  .totals-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
  }
  .stat {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }
  .stat-icon { width: 24px; height: 24px; }
  .stat-icon svg { width: 12px; height: 12px; }
  .stat-value {
    font-size: 21px;
    white-space: nowrap;
  }
  .stat-label { font-size: 10px; }
  .stat-divider { height: 38px; }

  /* Na mobilu bez desetinných míst, aby se částka nikdy nezalomila */
  .amount-full { display: none; }
  .amount-compact { display: inline; }
}
