:root {
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --ink: #111B2E;
  --muted: #52617A;
  --sapphire: #1A4FA0;
  --sapphire-dark: #133B7A;
  --sapphire-soft: #EAF1FC;
  --emerald: #177856;
  --emerald-soft: #E8F6F0;
  --crimson: #B42336;
  --crimson-soft: #FCECEF;
  --amber: #9A5B00;
  --amber-soft: #FEF5E6;
  --line: #DFE6F0;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sapphire);
  text-decoration: none;
}

/* --- Top bar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(246, 248, 251, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
}

.topbar-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary {
  background: var(--sapphire);
  color: #FFFFFF;
}

.btn-primary:active {
  background: var(--sapphire-dark);
}

.btn-approve {
  background: var(--emerald);
  color: #FFFFFF;
}

.btn-reject {
  background: var(--surface);
  color: var(--crimson);
  border-color: var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  min-height: 38px;
  padding: 0 10px;
  font-size: 14px;
}

.btn-sm {
  min-height: 38px;
  padding: 0 13px;
  font-size: 14px;
}

/* --- Main container --- */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px calc(92px + env(safe-area-inset-bottom));
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 16px;
  scroll-margin-top: 76px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}

.count-pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--sapphire);
  background: var(--sapphire-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

/* --- Briefing typography --- */
.brief-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
}

.brief-sec {
  font-size: 15px;
  font-weight: 700;
  color: var(--sapphire-dark);
  margin: 16px 0 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.brief-list {
  margin: 0;
  padding-left: 18px;
}

.brief-list li {
  margin-bottom: 6px;
}

.brief-note {
  background: var(--amber-soft);
  color: var(--amber);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

/* --- Tasks --- */
.task-add {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 16px;
  background: var(--surface);
  color: var(--ink);
}

.input:focus {
  outline: 2px solid var(--sapphire);
  outline-offset: -1px;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.task-row:first-child {
  border-top: none;
  padding-top: 4px;
}

.task-check {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--emerald);
  cursor: pointer;
  flex-shrink: 0;
}

.task-done .task-text {
  text-decoration: line-through;
  color: var(--muted);
}

.task-text {
  font-weight: 600;
}

.item-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge-high, .badge-SURGOS_TEENDO {
  background: var(--crimson-soft);
  color: var(--crimson);
}

.badge-NAPTAR_ESEMENY, .badge-approved, .badge-auto_created {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.badge-INFO, .badge-normal {
  background: var(--sapphire-soft);
  color: var(--sapphire);
}

.badge-SZEMET, .badge-low {
  background: #EEF1F6;
  color: var(--muted);
}

.badge-draft {
  background: var(--amber-soft);
  color: var(--amber);
}

/* --- Proposals --- */
.proposal-card {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.proposal-card:first-child {
  border-top: none;
  padding-top: 2px;
}

.proposal-title {
  font-weight: 700;
  font-size: 16px;
}

.proposal-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* --- Filter pills --- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
}

.filter-pill.active {
  background: var(--sapphire);
  color: #FFFFFF;
  border-color: var(--sapphire);
}

.email-row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.email-row:first-child {
  border-top: none;
  padding-top: 2px;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}

/* --- Bottom tab bar --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 8px max(10px, env(safe-area-inset-bottom));
}

.bottom-nav-inner {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 10px;
}

.nav-link:active, .nav-link:hover {
  color: var(--sapphire);
  background: var(--sapphire-soft);
}

/* --- Login --- */
.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.error-box {
  background: var(--crimson-soft);
  color: var(--crimson);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 14px;
}

/* --- Toast --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 50;
  max-width: calc(100vw - 32px);
  display: none;
}

.toast.show {
  display: block;
}
