:root {
  --blue: #5BB8B0;
  --blue-dark: #479C94;
  --blue-darker: #2E6F69;
  --blue-light: #DFF1EE;
  --blue-mid: #C3E6E2;

  --teal: #3D8F88;
  --teal-light: #E7F5F2;
  --mint: #5BB8B0;
  --mint-dark: #479C94;
  --charcoal: #2b2b2b;
  --charcoal-light: #3a3a3a;

  --text-primary: #1a1a1a;
  --text-secondary: #6b6b66;
  --text-muted: #9b9b95;

  --surface-0: #F5F4EF;
  --surface-1: #EEF3F0;
  --surface-2: #FFFFFF;
  --border: #E0E6E2;

  --danger: #A32D2D;
  --danger-bg: #FCEBEB;

  --radius: 10px;
  --radius-lg: 16px;
  --gutter: clamp(18px, 5vw, 32px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--surface-0);
  color: var(--text-primary);
  overflow-x: hidden;
}

img, svg { max-width: 100%; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter);
}
.table-scroll table.data { min-width: 480px; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem var(--gutter) calc(3rem + env(safe-area-inset-bottom));
}

a { color: var(--blue-dark); }

/* Hlavička a navigácia */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.app-brand { display: flex; align-items: center; gap: 10px; }
.app-logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.app-brand-name { font-weight: 600; font-size: 16px; margin: 0; }
.app-brand-sub { font-size: 12px; color: var(--text-muted); margin: 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
}

.lang-switch { display: flex; gap: 2px; }
.lang-switch a {
  font-size: 18px; line-height: 1; text-decoration: none;
  padding: 4px 6px; border-radius: 6px;
  opacity: 0.5;
  filter: grayscale(60%);
}
.lang-switch a.active { opacity: 1; filter: none; background: var(--blue-light); }
.container > .lang-switch { justify-content: flex-end; margin-bottom: 8px; }

.tabs {
  display: flex; gap: 6px;
  background: var(--surface-1);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tabs a {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  white-space: nowrap;
}
.tabs a.active {
  background: var(--surface-2);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Karty */
.card {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.card-title { font-weight: 600; font-size: 15px; margin: 0 0 14px; }

.hero-card {
  background: var(--blue-dark);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  color: #fff;
}
.hero-label { font-size: 13px; margin: 0 0 6px; color: var(--blue-mid); }
.hero-value { font-size: 32px; font-weight: 600; margin: 0 0 12px; color: #fff; }
.hero-row { display: flex; gap: 20px; flex-wrap: wrap; }
.hero-item p { margin: 0; }
.hero-item .l { font-size: 11px; color: var(--blue-mid); }
.hero-item .v { font-size: 14px; font-weight: 600; color: #fff; }

.goal-card {
  background: var(--blue-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.goal-title { font-weight: 600; font-size: 15px; margin: 0 0 4px; color: var(--blue-darker); }
.goal-rate { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0; }
.goal-rate .l { font-size: 13px; color: var(--blue-dark); margin-right: 10px;}
.goal-rate .v { font-size: 20px; font-weight: 600; color: var(--blue-darker); }
.progress-track { height: 8px; background: var(--blue-mid); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue-dark); }

/* Formuláre */
label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 4px; }
input[type=text], input[type=date], input[type=number], input[type=email], input[type=password] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--surface-2);
  color: var(--text-primary);
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }

input[type=date] {
  width: 100% !important;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none;
  background: var(--blue);
  color: #fff;
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--blue-dark); }
.btn.btn-block { width: 100%; }
.btn.btn-secondary { background: var(--surface-1); color: var(--text-primary); }
.btn.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn.btn-ghost { background: none; color: var(--text-secondary); border: 1px solid var(--border); }

/* Stat karty */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
.stat-card { background: var(--surface-1); border-radius: var(--radius); padding: 1rem; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin: 0 0 4px; }
.stat-value { font-size: 22px; font-weight: 600; margin: 0; display: flex; justify-content: center; }
.stat-hourly { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.stat-card.success .stat-hourly { color: var(--teal); font-size: 22px; }
.stat-card.success { background: var(--teal-light); }
.stat-card.success .stat-label, .stat-card.success .stat-value { color: var(--teal); }

/* Zoznam jázd */
.ride-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.ride-left { display: flex; align-items: center; gap: 10px; }
.ride-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--teal-light);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
}
.ride-day { font-size: 13px; font-weight: 600; margin: 0; }
.ride-sub { font-size: 12px; color: var(--text-secondary); margin: 0; }
.ride-amount { font-size: 14px; font-weight: 600; color: var(--teal); margin: 0; }
.ride-hourly { font-size: 12px; color: var(--text-secondary); margin: 0; }
.ride-row:nth-of-type(even) { background: var(--surface-1); }
.ride-actions a { color: var(--text-secondary); text-decoration: none; margin-left: 8px; font-size: 13px; }
.ride-actions a.delete { color: var(--danger); }

/* Tabuľky */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; color: var(--text-secondary); font-weight: 400; padding: 6px 4px; border-bottom: 0.5px solid var(--border); }
table.data td { padding: 6px 4px; border-bottom: 0.5px solid var(--border); }
table.data td.num, table.data th.num { text-align: right; }
table.data tr:nth-child(even) { background: var(--surface-1); }

/* Mesačné akordeóny (Zárobok, Tankovanie) */
.month-card { border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 10px; }
.month-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--surface-2);
  text-decoration: none; color: inherit;
}
.month-header.current { background: var(--teal-light); }
.month-header.current .month-name { color: var(--teal); }
.month-header.current .month-sub { color: var(--teal); }
.month-name { font-weight: 600; font-size: 14px; margin: 0; }
.month-sub { font-size: 12px; color: var(--text-secondary); margin: 0; }
.month-detail { padding: 0 16px 14px; }
.month-totals { display: flex; gap: 20px; margin-bottom: 10px; flex-wrap: wrap; }
.month-totals div p { margin: 0; }
.month-totals .l { font-size: 11px; color: var(--text-secondary); }
.month-totals .v { font-size: 16px; font-weight: 600; }

/* Auth stránky */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-card {
  background: var(--charcoal);
  border: none;
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 360px;
  color: #fff;
}
.auth-card label { color: #B7C4C0; }
.auth-card input {
  background: var(--charcoal-light);
  border: 1px solid #3E4747;
  color: #fff;
}
.auth-card input::placeholder { color: #7C8A86; }
.auth-card .btn { background: var(--mint); color: #10281F; }
.auth-card .btn:hover { background: var(--mint-dark); color: #fff; }
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; }
.auth-logo .app-logo { background: var(--mint); }
.auth-title { font-weight: 600; font-size: 16px; margin: 8px 0 0; color: #fff; }
.auth-sub { text-align: center; font-size: 13px; color: #A9B7B3; margin-top: 8px; }
.auth-sub a { color: var(--mint); }
.error-box { background: var(--danger-bg); color: var(--danger); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }
.info-box { background: rgba(62,207,142,0.15); color: var(--mint); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }

.toggle-row { display: grid; grid-template-columns: 1fr 40px; margin-bottom: 14px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin-left: 10px;}
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--border); border-radius: 11px; cursor: pointer; transition: 0.15s; }
.slider:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.15s; }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider:before { left: 21px; }

.section-title { font-weight: 600; font-size: 14px; margin: 1.5rem 0 10px; }
.muted { color: var(--text-muted); }

body.teal-auth { background: var(--blue); }
.teal-auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 24px) var(--gutter) env(safe-area-inset-bottom, 24px);
  box-sizing: border-box;
}
.teal-auth-lang { display: flex; justify-content: flex-end; gap: 2px; margin-bottom: 8px; }
.teal-auth-lang a { font-size: 18px; text-decoration: none; padding: 4px 6px; border-radius: 6px; opacity: 0.55; filter: grayscale(50%); }
.teal-auth-lang a.active { opacity: 1; filter: none; background: rgba(255,255,255,0.18); }
.teal-auth-icon {
  width: 96px; height: 96px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 44px; color: #fff;
}
.teal-auth-title { text-align: center; color: #fff; font-size: 20px; font-weight: 600; margin: 0 0 32px; }
.teal-auth-card { max-width: 340px; width: 100%; margin: 0 auto; }
.teal-auth-card label { color: rgba(255,255,255,0.85); font-size: 12px; }
.teal-auth-card input {
  background: rgba(255,255,255,0.22);
  border: none;
  color: #fff;
}
.teal-auth-card input::placeholder { color: rgba(255,255,255,0.75); }
.teal-auth-card input:focus { box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }
.teal-auth-btn {
  width: 100%;
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
  padding: 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.teal-auth-btn:hover { background: rgba(255,255,255,0.12); }
.teal-auth-sub { text-align: center; font-size: 13px; color: rgba(255,255,255,0.85); margin-top: 14px; }
.teal-auth-sub a { color: #fff; font-weight: 600; }
.teal-auth-error { background: rgba(0,0,0,0.2); color: #fff; padding: 10px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 14px; }

body.app-teal { background: var(--blue-mid); }
body.app-teal .app-brand-sub { color: var(--blue-darker); opacity: 0.75; }
body.app-teal .tabs { background: rgba(255,255,255,0.35); }
body.app-teal .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,0.6); }
