/* ============================================
   KOBAK - NAV e-nyugta SPA
   Design System & Complete Styles
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Primary palette */
  --c-primary: #1a365d;
  --c-primary-light: #2a4a7f;
  --c-primary-dark: #0f2240;
  --c-primary-50: #e8edf4;
  --c-primary-100: #c5d1e5;
  --c-primary-200: #9fb3d1;

  /* Accent / Success */
  --c-success: #38a169;
  --c-success-light: #48bb78;
  --c-success-dark: #2f855a;
  --c-success-bg: #f0fff4;

  /* Warning */
  --c-warning: #d69e2e;
  --c-warning-light: #ecc94b;
  --c-warning-bg: #fffff0;

  /* Danger */
  --c-danger: #e53e3e;
  --c-danger-light: #fc8181;
  --c-danger-bg: #fff5f5;

  /* Neutrals */
  --c-bg: #f7f8fa;
  --c-bg-card: #ffffff;
  --c-bg-input: #f1f3f7;
  --c-border: #e2e6ee;
  --c-text: #1a202c;
  --c-text-secondary: #4a5568;
  --c-text-muted: #a0aec0;
  --c-text-inverse: #ffffff;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.16);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 200ms ease;
  --transition-slow: 350ms ease;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Font */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Tap target minimum */
  --tap-min: 48px;
  --tap-preferred: 56px;

  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Dark Mode --- */
@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0f1724;
    --c-bg-card: #1a2332;
    --c-bg-input: #232f40;
    --c-border: #2d3a4d;
    --c-text: #e8edf4;
    --c-text-secondary: #a0b0c8;
    --c-text-muted: #5a6a82;
    --c-primary-50: #1a2840;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.6);
  }
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: var(--c-primary-light);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* prevent iOS zoom */
  color: var(--c-text);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--wide {
  max-width: 720px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--c-text-muted); }
.text-success { color: var(--c-success); }
.text-danger { color: var(--c-danger); }
.text-warning { color: var(--c-warning); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* --- View Transitions --- */
.view-enter {
  animation: viewIn 300ms ease forwards;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: var(--tap-preferred);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
}

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

.btn--primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  color: var(--c-text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-primary));
}

.btn--success {
  background: linear-gradient(135deg, var(--c-success), var(--c-success-light));
  color: var(--c-text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn--success:hover {
  box-shadow: var(--shadow-md);
}

.btn--danger {
  background: linear-gradient(135deg, var(--c-danger), var(--c-danger-light));
  color: var(--c-text-inverse);
}

.btn--outline {
  border: 2px solid var(--c-border);
  color: var(--c-text);
  background: var(--c-bg-card);
}

.btn--outline:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.btn--ghost {
  color: var(--c-text-secondary);
}

.btn--ghost:hover {
  background: var(--c-primary-50);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--lg {
  min-height: 64px;
  font-size: 1.2rem;
  padding: 18px 32px;
  border-radius: var(--radius-lg);
}

.btn--xl {
  min-height: 72px;
  font-size: 1.35rem;
  padding: 20px 36px;
  border-radius: var(--radius-lg);
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Cards --- */
.card {
  background: var(--c-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  border: 1px solid var(--c-border);
  transition: box-shadow var(--transition);
}

.card--interactive:hover {
  box-shadow: var(--shadow-md);
}

.card--interactive:active {
  box-shadow: var(--shadow-sm);
}

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  font-size: 0.9rem;
  color: var(--c-text-secondary);
}

.form-input {
  width: 100%;
  min-height: var(--tap-min);
  padding: 12px 16px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg-input);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(26,54,93,0.15);
  background: var(--c-bg-card);
}

.form-input--error {
  border-color: var(--c-danger);
}

.form-error {
  color: var(--c-danger);
  font-size: 0.85rem;
  margin-top: var(--space-xs);
}

.form-input-wrap {
  position: relative;
}

.form-input-wrap .toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
}

/* --- App Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-primary);
  color: var(--c-text-inverse);
  padding: var(--space-sm) var(--space-md);
  padding-top: calc(var(--space-sm) + var(--safe-top));
  box-shadow: var(--shadow-md);
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 480px;
  margin: 0 auto;
  min-height: 48px;
}

.app-header__title {
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 var(--space-sm);
}

.app-header__btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--c-text-inverse);
  flex-shrink: 0;
  transition: background var(--transition);
}

.app-header__btn:hover {
  background: rgba(255,255,255,0.15);
}

/* --- Side Nav / Menu --- */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
}

.nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.side-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--c-bg-card);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.side-nav.open {
  transform: translateX(0);
}

.side-nav__header {
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + var(--safe-top));
  background: var(--c-primary);
  color: var(--c-text-inverse);
}

.side-nav__biz-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.side-nav__email {
  font-size: 0.85rem;
  opacity: 0.8;
}

.side-nav__links {
  flex: 1;
  padding: var(--space-md) 0;
  overflow-y: auto;
}

.side-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px var(--space-lg);
  color: var(--c-text);
  font-weight: 500;
  transition: background var(--transition);
  min-height: var(--tap-min);
}

.side-nav__link:hover,
.side-nav__link.active {
  background: var(--c-primary-50);
  color: var(--c-primary);
}

.side-nav__link svg {
  flex-shrink: 0;
}

.side-nav__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--c-border);
}

.side-nav__logout {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: 14px 0;
  color: var(--c-danger);
  font-weight: 500;
  min-height: var(--tap-min);
}

/* --- Landing Page --- */
.landing {
  overflow-x: hidden;
}

.hero {
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 50%, var(--c-primary-light) 100%);
  color: var(--c-text-inverse);
  padding: 60px var(--space-md) 48px;
  text-align: center;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--c-bg);
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 40%);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 0.85rem;
  margin-bottom: var(--space-lg);
  backdrop-filter: blur(4px);
}

.hero__title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.hero__subtitle {
  font-size: clamp(1rem, 3vw, 1.2rem);
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto var(--space-xl);
  line-height: 1.5;
}

.hero__cta {
  margin-bottom: var(--space-md);
}

.hero__note {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Steps section */
.steps {
  padding: var(--space-2xl) var(--space-md);
}

.section-title {
  text-align: center;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  margin-bottom: var(--space-xl);
  color: var(--c-text);
}

.steps__grid {
  display: grid;
  gap: var(--space-lg);
  max-width: 480px;
  margin: 0 auto;
}

.step-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.step-card__icon {
  display: none;
}

.step-card__number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0 auto var(--space-md);
}

.step-card__title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.step-card__desc {
  color: var(--c-text-secondary);
  font-size: 0.95rem;
}

.steps__arrow {
  display: flex;
  justify-content: center;
  color: var(--c-primary-200);
  padding: var(--space-xs) 0;
}

/* Pricing */
.pricing {
  padding: var(--space-2xl) var(--space-md) 60px;
  background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-primary-50) 100%);
}

.section-subtitle {
  text-align: center;
  color: var(--c-text-secondary);
  font-size: 1rem;
  margin-top: calc(-1 * var(--space-md));
  margin-bottom: var(--space-xl);
}

.pricing-cards {
  max-width: 420px;
  margin: 0 auto;
}

.pricing-card {
  text-align: center;
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.pricing-card--featured {
  border: 2px solid var(--c-primary);
}

.pricing-card__ribbon {
  background: linear-gradient(135deg, var(--c-success), var(--c-success-light));
  color: white;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.pricing-card__header {
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
}

.pricing-card__plan {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--c-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-md);
}

.pricing-card__price-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.pricing-card__price {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--c-primary);
  line-height: 1;
}

.pricing-card__currency {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-text-secondary);
}

.pricing-card__period {
  color: var(--c-text-muted);
  font-size: 0.85rem;
  margin-top: var(--space-sm);
}

.pricing-card__divider {
  height: 1px;
  background: var(--c-border);
  margin: 0 var(--space-xl);
}

.pricing-card__features {
  list-style: none;
  text-align: left;
  padding: var(--space-lg) var(--space-xl);
}

.pricing-card__features li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 0;
  color: var(--c-text);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--c-border);
}

.pricing-card__features li:last-child {
  border-bottom: none;
}

.pricing-card__check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-success-bg);
  color: var(--c-success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pricing-card .btn {
  margin: 0 var(--space-lg);
  width: calc(100% - var(--space-lg) * 2);
}

.pricing-card__guarantee {
  padding: var(--space-md) var(--space-lg) var(--space-xl);
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

/* Trust badges */
.trust {
  padding: var(--space-xl) var(--space-md);
}

.trust__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: 480px;
  margin: 0 auto;
}

.trust__item {
  text-align: center;
  padding: var(--space-md) var(--space-sm);
}

.trust__item svg {
  margin: 0 auto var(--space-sm);
  color: var(--c-primary);
}

.trust__item-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text-secondary);
}

/* FAQ */
.faq {
  padding: var(--space-2xl) var(--space-md);
}

.faq__list {
  max-width: 480px;
  margin: 0 auto;
}

.faq__item {
  border-bottom: 1px solid var(--c-border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) 0;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  color: var(--c-text);
  min-height: var(--tap-min);
}

.faq__question svg {
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq__question.open svg {
  transform: rotate(180deg);
}

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
  color: var(--c-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq__answer.open {
  max-height: 300px;
}

.faq__answer-inner {
  padding-bottom: var(--space-md);
}

/* Landing footer */
.landing-footer {
  background: var(--c-primary-dark);
  color: var(--c-text-inverse);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

.landing-footer__logo {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.landing-footer__text {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* Landing nav */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition);
}

.landing-nav.scrolled {
  background: rgba(26, 54, 93, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}

.landing-nav__logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
}

.landing-nav__btn {
  color: white;
  padding: 10px 20px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 44px;
  transition: all var(--transition);
}

.landing-nav__btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
}

/* --- Auth Page --- */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-xl);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo__text {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--c-primary);
}

.auth-logo__sub {
  color: var(--c-text-muted);
  font-size: 0.9rem;
}

.auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--c-bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: var(--space-lg);
}

.auth-toggle__btn {
  padding: 12px;
  border-radius: 6px;
  font-weight: 600;
  transition: all var(--transition);
  min-height: 44px;
  color: var(--c-text-muted);
}

.auth-toggle__btn.active {
  background: var(--c-bg-card);
  color: var(--c-primary);
  box-shadow: var(--shadow-sm);
}

.auth-forgot {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  color: var(--c-primary-light);
  margin-top: calc(-1 * var(--space-sm));
  margin-bottom: var(--space-md);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.auth-back {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  color: white;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Dashboard --- */
.dashboard {
  flex: 1;
  padding-bottom: calc(var(--space-xl) + var(--safe-bottom));
}

.new-receipt-btn-wrap {
  padding: var(--space-lg) var(--space-md);
}

.new-receipt-btn {
  width: 100%;
  min-height: 80px;
  background: linear-gradient(135deg, var(--c-success), var(--c-success-light));
  color: white;
  border-radius: var(--radius-lg);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  box-shadow: 0 4px 20px rgba(56, 161, 105, 0.4);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.new-receipt-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
}

.new-receipt-btn:hover {
  box-shadow: 0 6px 28px rgba(56, 161, 105, 0.5);
  transform: translateY(-1px);
}

.new-receipt-btn:active {
  transform: translateY(0) scale(0.98);
}

.new-receipt-btn svg {
  width: 32px;
  height: 32px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
}

.stat-card {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.stat-card--wide {
  grid-column: 1 / -1;
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-text);
}

.stat-card__sub {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* KATA Progress */
.kata-progress {
  margin: 0 var(--space-md) var(--space-md);
  padding: var(--space-lg);
  background: var(--c-bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.kata-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.kata-progress__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.kata-progress__pct {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-primary);
}

.progress-bar {
  height: 12px;
  background: var(--c-bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--c-success), var(--c-success-light));
  transition: width 600ms ease;
  min-width: 4px;
}

.progress-bar__fill--warning {
  background: linear-gradient(90deg, var(--c-warning), var(--c-warning-light));
}

.progress-bar__fill--danger {
  background: linear-gradient(90deg, var(--c-danger), var(--c-danger-light));
}

.kata-progress__info {
  font-size: 0.85rem;
  color: var(--c-text-secondary);
}

/* NAV Status */
.nav-status {
  margin: 0 var(--space-md) var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border: 1px solid;
}

.nav-status--green {
  background: var(--c-success-bg);
  border-color: var(--c-success);
  color: var(--c-success-dark);
}

.nav-status--yellow {
  background: var(--c-warning-bg);
  border-color: var(--c-warning);
  color: #744210;
}

.nav-status--red {
  background: var(--c-danger-bg);
  border-color: var(--c-danger);
  color: var(--c-danger);
}

.nav-status__text {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
}

.section-header__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--c-text-secondary);
}

.section-header__link {
  font-size: 0.9rem;
  color: var(--c-primary-light);
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Receipt List Items */
.receipt-list {
  padding: 0 var(--space-md);
}

.receipt-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--c-bg-card);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: all var(--transition);
  min-height: var(--tap-preferred);
}

.receipt-item:hover {
  box-shadow: var(--shadow-sm);
}

.receipt-item:active {
  background: var(--c-primary-50);
}

.receipt-item--void {
  opacity: 0.5;
  text-decoration: line-through;
}

.receipt-item__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.receipt-item__icon--cash {
  background: #f0fff4;
  color: var(--c-success);
}

.receipt-item__icon--card {
  background: #ebf8ff;
  color: #3182ce;
}

.receipt-item__icon--transfer {
  background: #faf5ff;
  color: #805ad5;
}

.receipt-item__body {
  flex: 1;
  min-width: 0;
}

.receipt-item__number {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-item__time {
  font-size: 0.8rem;
  color: var(--c-text-muted);
}

.receipt-item__amount {
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

/* --- New Receipt Flow --- */
.receipt-flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.receipt-flow__header {
  background: var(--c-primary);
  color: white;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  min-height: 56px;
}

.receipt-flow__back {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border-radius: var(--radius-sm);
}

.receipt-flow__title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  padding-right: 44px; /* balance back button */
}

/* Step indicator */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-border);
  transition: all var(--transition);
}

.step-dot.active {
  background: var(--c-primary);
  width: 28px;
  border-radius: var(--radius-full);
}

.step-dot.done {
  background: var(--c-success);
}

/* Amount Display */
.amount-display {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
}

.amount-display__value {
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 800;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.amount-display__currency {
  font-size: 0.4em;
  color: var(--c-text-muted);
  font-weight: 600;
  margin-left: 4px;
}

/* Quick amounts */
.quick-amounts {
  display: flex;
  gap: var(--space-sm);
  padding: 0 var(--space-md) var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-amounts::-webkit-scrollbar {
  display: none;
}

.quick-amount-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--c-primary-50);
  color: var(--c-primary);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 40px;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.quick-amount-btn:hover {
  border-color: var(--c-primary);
}

.quick-amount-btn:active {
  background: var(--c-primary);
  color: white;
}

/* Number Pad */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: var(--space-md);
  max-width: 360px;
  margin: 0 auto;
  flex: 1;
  align-content: end;
}

.numpad__key {
  aspect-ratio: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  transition: all var(--transition);
  min-height: var(--tap-preferred);
  user-select: none;
  -webkit-user-select: none;
}

.numpad__key:hover {
  background: var(--c-primary-50);
}

.numpad__key:active {
  background: var(--c-primary);
  color: white;
  transform: scale(0.95);
}

.numpad__key--accent {
  background: var(--c-primary-50);
  color: var(--c-primary);
  border-color: var(--c-primary-200);
}

.numpad__key--delete {
  color: var(--c-danger);
}

.numpad__next {
  grid-column: 1 / -1;
  min-height: var(--tap-preferred);
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.numpad__next:hover {
  box-shadow: var(--shadow-md);
}

.numpad__next:active {
  transform: scale(0.98);
}

.numpad__next:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Payment Method Select */
.payment-methods {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
  max-width: 400px;
  margin: 0 auto;
  flex: 1;
  align-content: center;
}

.payment-method-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--c-bg-card);
  border: 2px solid var(--c-border);
  transition: all var(--transition);
  min-height: 100px;
}

.payment-method-btn:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-md);
}

.payment-method-btn:active {
  transform: scale(0.97);
  border-color: var(--c-primary);
  background: var(--c-primary-50);
}

.payment-method-btn svg {
  width: 40px;
  height: 40px;
  color: var(--c-primary);
}

.payment-method-btn__label {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Receipt Finalize */
.receipt-finalize {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.receipt-summary-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--c-border);
  margin-bottom: var(--space-lg);
}

.receipt-summary__row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: 0.95rem;
}

.receipt-summary__row--total {
  border-top: 2px solid var(--c-border);
  margin-top: var(--space-sm);
  padding-top: var(--space-md);
  font-weight: 700;
  font-size: 1.2rem;
}

/* Success Screen */
.receipt-success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  text-align: center;
}

.receipt-success__check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--c-success-bg);
  color: var(--c-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  animation: successPop 400ms ease;
}

@keyframes successPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.receipt-success__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: var(--c-success);
}

.receipt-success__amount {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.receipt-success__number {
  color: var(--c-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}

.receipt-success__actions {
  width: 100%;
  max-width: 320px;
  display: grid;
  gap: var(--space-md);
}

/* --- Receipt History --- */
.date-picker-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--c-bg-card);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 56px;
  z-index: 10;
}

.date-picker-bar button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.date-picker-bar button:hover {
  background: var(--c-primary-50);
}

.date-picker-bar__date {
  font-weight: 700;
  font-size: 1rem;
  min-width: 140px;
  text-align: center;
}

.receipt-list-page {
  flex: 1;
  padding: var(--space-md);
  padding-bottom: calc(80px + var(--safe-bottom));
}

.daily-total {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-bg-card);
  border-top: 1px solid var(--c-border);
  padding: var(--space-md);
  padding-bottom: calc(var(--space-md) + var(--safe-bottom));
  text-align: center;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

.daily-total__label {
  font-size: 0.8rem;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.daily-total__value {
  font-size: 1.5rem;
  font-weight: 800;
}

/* Receipt Detail Expand */
.receipt-detail {
  padding: var(--space-md);
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
  animation: slideDown 200ms ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 200px;
  }
}

.receipt-detail__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--c-text-secondary);
}

.receipt-detail__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* --- Reports --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: var(--space-md);
}

.calendar-day-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-muted);
  padding: var(--space-sm);
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
  gap: 2px;
}

.calendar-day:hover {
  border-color: var(--c-primary);
}

.calendar-day--empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.calendar-day--today {
  border-color: var(--c-primary);
  border-width: 2px;
}

.calendar-day--has-data {
  background: var(--c-success-bg);
}

.calendar-day__num {
  font-weight: 600;
}

.calendar-day__amount {
  font-size: 0.6rem;
  color: var(--c-success);
  font-weight: 600;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-md);
}

.month-nav__title {
  font-weight: 700;
  font-size: 1.1rem;
  min-width: 160px;
  text-align: center;
}

.month-nav button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
}

.report-actions {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
}

/* --- Settings --- */
.settings-page {
  padding: var(--space-md);
  padding-bottom: calc(var(--space-xl) + var(--safe-bottom));
}

.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--c-text-secondary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--c-border);
}

.settings-version {
  text-align: center;
  color: var(--c-text-muted);
  font-size: 0.8rem;
  padding: var(--space-lg);
}

/* --- Toast Notifications --- */
#toast-container {
  position: fixed;
  top: calc(var(--space-md) + var(--safe-top));
  left: var(--space-md);
  right: var(--space-md);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  background: var(--c-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  animation: toastIn 300ms ease forwards;
  pointer-events: auto;
  border-left: 4px solid;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.toast--success {
  border-color: var(--c-success);
}

.toast--error {
  border-color: var(--c-danger);
}

.toast--info {
  border-color: var(--c-primary);
}

.toast--out {
  animation: toastOut 300ms ease forwards;
}

.toast__icon {
  flex-shrink: 0;
}

.toast__message {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
}

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

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--c-text-muted);
}

.empty-state__icon {
  margin: 0 auto var(--space-md);
  color: var(--c-text-muted);
  opacity: 0.5;
}

.empty-state__title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--space-sm);
  color: var(--c-text-secondary);
}

.empty-state__text {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* --- Loading --- */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.loading-spinner::after {
  content: '';
  width: 36px;
  height: 36px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--c-bg-input) 25%, var(--c-border) 50%, var(--c-bg-input) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* --- Confirm Dialog --- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: dialogIn 300ms ease;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dialog__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.dialog__message {
  color: var(--c-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.dialog__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--c-text-muted);
  border-radius: 4px;
}

/* --- Print --- */
@media print {
  .app-header, .side-nav, .nav-overlay, #toast-container {
    display: none !important;
  }
}
