:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --bg-elevated: #242836;
  --text: #e8eaed;
  --text-muted: #9aa0b0;
  --accent: #4ecdc4;
  --accent-dim: #3a9d96;
  --danger: #e85d4c;
  --border: #2d3348;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.screen.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

/* PIN */
.pin-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 360px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  margin: 0 0 0.25rem;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.pin-display {
  display: flex;
  gap: 16px;
  margin-bottom: 1rem;
  min-height: 24px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
}

.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

.pin-display.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .pin-display.shake { animation: none; }
}

.auth-message {
  min-height: 1.5rem;
  color: var(--danger);
  font-size: 0.9rem;
  text-align: center;
  margin: 0 0 1rem;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.numpad button {
  min-height: 56px;
  font-size: 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.numpad button:active {
  transform: scale(0.96);
  background: var(--bg-elevated);
}

.numpad-fn {
  font-size: 1.1rem !important;
  color: var(--text-muted);
}

/* Profiles */
.screen-title {
  text-align: center;
  font-size: 1.5rem;
  margin: 3rem 0 2rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
}

.profile-card:hover,
.profile-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.profile-card:active {
  transform: scale(0.98);
}

.profile-silhouette {
  width: 64px;
  height: 80px;
  fill: var(--text-muted);
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.header-profile {
  font-weight: 600;
  font-size: 1.1rem;
}

.header-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px;
}

.btn-text:hover {
  color: var(--text);
}

/* Tabs */
.tab-panel {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

.tab-panel.hidden {
  display: none;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  font-size: 0.75rem;
}

.nav-btn.active {
  color: var(--accent);
}

/* Date bar */
.date-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.date-label {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  min-width: 140px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

.btn-close-x {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.date-input-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entry-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
}

.entry-card[data-category="cigarety"] { border-left-color: #e85d4c; }
.entry-card[data-category="zuvak"] { border-left-color: #4ecdc4; }
.entry-card[data-category="sisa"] { border-left-color: #a78bfa; }
.entry-card[data-category="vape"] { border-left-color: #60a5fa; }

.entry-info h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.entry-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.entry-actions {
  display: flex;
  gap: 8px;
}

.btn-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

.fab {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  right: 20px;
  padding: 14px 24px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 50;
}

.fab:hover {
  background: var(--accent-dim);
}

/* Wizard */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: flex-end;
}

.overlay.hidden {
  display: none !important;
}

.overlay-fullscreen {
  align-items: stretch;
  background: var(--bg);
}

.wizard {
  width: 100%;
  max-height: 92dvh;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.wizard-header > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#wizard-step-label {
  font-weight: 600;
}

.wizard-progress {
  height: 3px;
  background: var(--border);
}

.wizard-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 33%;
  transition: width 0.3s;
}

.wizard-step {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Kanban categories */
.kanban-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .kanban-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kanban-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s, border-color 0.2s;
  min-height: 100px;
}

.kanban-card:active {
  transform: scale(0.97);
}

.kanban-card.selected {
  border-color: var(--card-color, var(--accent));
  box-shadow: 0 0 0 1px var(--card-color, var(--accent));
}

.kanban-icon {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.nav-btn span {
  font-size: 0.8rem;
}

.kanban-name {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Brand grid (step 2) */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 480px) {
  .brand-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.brand-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s;
  min-height: 72px;
}

.brand-card:hover,
.brand-card:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.brand-card-name {
  font-weight: 600;
  font-size: 1rem;
}

.brand-card-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.flavour-other-panel,
.flavour-add-panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.flavour-other-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.flavour-other-btn {
  width: 100%;
  margin-top: 8px;
}

.flavour-action-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  padding: 12px;
}

.flavour-chip-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.flavour-chip-wrap .brand-chip {
  flex: 1;
}

.flavour-edit-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

#flavors-overlay .wizard {
  max-height: none;
  height: 100dvh;
  height: 100vh;
  border-radius: 0;
}

#flavors-overlay .wizard-header {
  padding-top: calc(12px + env(safe-area-inset-top));
}

#flavors-overlay .wizard-step {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#flavors-overlay .fm-kanban-board,
#flavors-overlay .fm-flavour-kanban {
  flex: 1;
  min-height: 0;
  align-items: flex-start;
}

#flavors-overlay .fm-kanban-col {
  max-height: 100%;
  overflow-y: auto;
}

.fm-context-label {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fm-kanban-board,
.fm-flavour-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.fm-kanban-col {
  flex: 0 0 min(220px, 78vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scroll-snap-align: start;
  min-height: 140px;
}

.fm-col-new {
  flex: 0 0 min(140px, 42vw);
  justify-content: center;
  align-items: stretch;
  border-style: dashed;
  background: transparent;
}

.fm-col-header {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.fm-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fm-col-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fm-col-open {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.fm-col-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-danger-text {
  color: var(--danger, #e85d4c);
}

.fm-kanban-add {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.fm-kanban-add:hover,
.fm-kanban-add:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.fm-flavour-col {
  min-height: 120px;
}

.fm-brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fm-brand-hit {
  display: none;
}

.fm-brand-chevron {
  display: none;
}

.fm-brand-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 599px) {
  #flavors-overlay {
    padding: 0;
  }

  #flavors-overlay .wizard {
    width: 100%;
  }

  #flavors-overlay .fm-kanban-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
    overflow-x: visible;
    overflow-y: auto;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
  }

  #flavors-overlay .fm-kanban-board .fm-col-new {
    flex: none;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
    order: -1;
  }

  #flavors-overlay .fm-kanban-board .fm-col-new .fm-kanban-add {
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
  }

  #flavors-overlay .fm-brand-card {
    position: relative;
    flex: none;
    width: 100%;
    max-width: none;
    min-height: 0;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 4px 10px;
    padding: 10px 12px;
    flex-direction: unset;
  }

  #flavors-overlay .fm-brand-info {
    grid-column: 1;
  }

  #flavors-overlay .fm-brand-chevron {
    display: block;
    grid-column: 2;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-muted);
  }

  #flavors-overlay .fm-brand-hit {
    display: block;
    position: absolute;
    inset: 0;
    right: 72px;
    z-index: 1;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
  }

  #flavors-overlay .fm-brand-open-wide {
    display: none;
  }

  #flavors-overlay .fm-brand-card .fm-col-actions {
    position: relative;
    z-index: 2;
    grid-column: 3;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    margin-top: 0;
  }

  #flavors-overlay .fm-brand-card .fm-col-actions .btn-text {
    padding: 6px 0;
    font-size: 0.8rem;
    min-height: 28px;
  }

  #flavors-overlay .fm-flavour-kanban {
    flex: 1;
    min-height: 0;
    align-items: flex-start;
  }

  #flavors-overlay .fm-flavour-kanban .fm-kanban-col {
    flex: 0 0 min(260px, 88vw);
    min-height: 0;
    max-height: none;
  }
}


.fm-flavour-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 48px;
}

.fm-flavour-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
}

.fm-flavour-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-word;
}

.fm-flavour-card-mg {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fm-col-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

#fm-flavour-tier {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
}

.flavor-edit-actions {
  flex-wrap: wrap;
  justify-content: stretch;
}

.flavor-edit-actions .btn-primary {
  flex: 1;
  min-width: 100px;
}

/* Catalog browser */
.catalog-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.catalog-hint code {
  font-size: 0.8rem;
  color: var(--accent);
}

.catalog-browser {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 24px;
}

.catalog-category {
  border-left: 4px solid var(--cat-color, var(--accent));
  padding-left: 12px;
}

.catalog-cat-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.catalog-brands {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-brand-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.catalog-brand-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.catalog-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.catalog-tier h4 {
  margin: 10px 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

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

.catalog-flavour-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.catalog-flavour-item:last-child {
  border-bottom: none;
}

.catalog-flavour-name {
  flex: 1;
  font-weight: 500;
}

.catalog-flavour-mg {
  font-size: 0.8rem;
  color: var(--accent);
}

.btn-catalog-edit {
  flex-shrink: 0;
}

.bottom-nav .nav-btn {
  font-size: 0.7rem;
}

/* Brands / flavours */
.brand-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-tier h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}

.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s;
}

.brand-chip:hover,
.brand-chip.selected {
  border-color: var(--accent);
}

.brand-chip-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.brand-chip-mg {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 2px;
}

/* Dose vessel */
.selected-product {
  text-align: center;
  font-weight: 600;
  margin: 0 0 16px;
}

.dose-vessel {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.vessel-glass {
  position: relative;
  width: 100px;
  height: 160px;
  border: 3px solid var(--border);
  border-radius: 8px 8px 20px 20px;
  overflow: hidden;
  background: var(--bg-card);
}

.vessel-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(to top, var(--accent-dim), var(--accent));
  transition: height 0.2s ease;
}

.vessel-amount {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.amount-chip {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}

.amount-chip.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.amount-slider {
  width: 100%;
  margin: 12px 0;
  accent-color: var(--accent);
}

.amount-unit-label {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.note-label {
  display: block;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.note-label input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

.btn-danger {
  padding: 10px 20px;
  background: var(--danger);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
}

.wizard-message {
  text-align: center;
  color: var(--danger);
  min-height: 1.25rem;
  margin-top: 8px;
}

/* Dashboard */
.dash-controls {
  margin-bottom: 16px;
}

.dash-controls select {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (min-width: 600px) {
  .kpi-row {
    grid-template-columns: repeat(5, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-section {
  margin-bottom: 24px;
}

.chart-section h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.chart-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 600px) {
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.chart-section canvas {
  max-height: 220px;
}

/* Heatmap */
.heatmap {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 100%;
  overflow-x: auto;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-day {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--bg-elevated);
  cursor: default;
}

.heatmap-day[data-level="1"] { background: #1e3a35; }
.heatmap-day[data-level="2"] { background: #2d6a5f; }
.heatmap-day[data-level="3"] { background: #4ecdc4; }
.heatmap-day[data-level="4"] { background: #7ee8e0; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 320px;
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}
