/*
  Caretaker Portal — Sweet Pastel Edition
  Light, airy, soft pastel colors with a cute rounded font.
  Warm, inviting, and gentle on the eyes.
*/

:root {
  /* Pastel Cream Theme (default) */
  --bg-gradient: linear-gradient(145deg, #eccfc5 0%, #e6c4d0 25%, #cdbfe0 50%, #b8cbe0 75%, #bcd8c8 100%);
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.04);
  --card-shadow: 0 8px 32px rgba(130, 80, 120, 0.22);
  --card-blur: blur(8px);
  --text: #000000;
  --text-muted: #666666;
  --line: #d4a0b4;
  --primary: #f472b6;
  --primary-gradient: linear-gradient(135deg, #f472b6 0%, #fb923c 100%);
  --primary-dark: #ec4899;
  --primary-light: rgba(244, 114, 182, 0.12);
  --primary-glow: 0 0 20px rgba(244, 114, 182, 0.15);
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.10);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.10);
  --danger: #fb7185;
  --danger-light: rgba(251, 113, 133, 0.10);
  --radius: 18px;
  --radius-sm: 10px;
  --touch-target: 56px;
  --font-base: 16px;
  --font-large: 20px;
  --font-xl: 28px;
}

/* ─── Lavender Dream Theme ─── */
body.dark-mode {
  --bg-gradient: linear-gradient(145deg, #d8cae8 0%, #ccc0e0 25%, #c8c2dc 50%, #ccc4e0 75%, #ddd0ea 100%);
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.04);
  --card-shadow: 0 8px 32px rgba(100, 60, 150, 0.22);
  --text: #000000;
  --text-muted: #666666;
  --line: #bfa0d8;
  --primary: #a78bfa;
  --primary-gradient: linear-gradient(135deg, #a78bfa 0%, #818cf8 100%);
  --primary-dark: #8b5cf6;
  --primary-light: rgba(167, 139, 250, 0.12);
  --primary-glow: 0 0 20px rgba(167, 139, 250, 0.15);
  --success: #6ee7b7;
  --success-light: rgba(110, 231, 183, 0.10);
  --warning: #fcd34d;
  --warning-light: rgba(252, 211, 77, 0.10);
  --danger: #fca5a5;
  --danger-light: rgba(252, 165, 165, 0.10);
}

/* ─── Mint Serenity Theme ─── */
body.light-mode {
  --bg-gradient: linear-gradient(145deg, #c2dccc 0%, #b8d8c4 25%, #c4d0dc 50%, #b8d8d0 75%, #c0e0cc 100%);
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.04);
  --card-shadow: 0 8px 32px rgba(50, 130, 90, 0.22);
  --text: #000000;
  --text-muted: #666666;
  --line: #a0c8b0;
  --primary: #34d399;
  --primary-gradient: linear-gradient(135deg, #34d399 0%, #38bdf8 100%);
  --primary-dark: #10b981;
  --primary-light: rgba(52, 211, 153, 0.12);
  --primary-glow: 0 0 20px rgba(52, 211, 153, 0.15);
  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.10);
  --warning: #fbbf24;
  --warning-light: rgba(251, 191, 36, 0.10);
  --danger: #fb7185;
  --danger-light: rgba(251, 113, 133, 0.10);
}

/* ─── Red & White (kept for compatibility) ─── */
body.red-white {
  --bg-gradient: linear-gradient(145deg, #fff5f5 0%, #ffe8e8 50%, #fff5f5 100%);
  --card-bg: #ffffff;
  --card-border: #fecaca;
  --card-shadow: 0 2px 16px rgba(220, 38, 38, 0.08);
  --text: #7f1d1d;
  --text-muted: #b91c1c;
  --line: #fecaca;
  --primary: #dc2626;
  --primary-gradient: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
  --primary-dark: #b91c1c;
  --primary-light: #fee2e2;
  --primary-glow: 0 0 16px rgba(220, 38, 38, 0.08);
  --success: #dc2626;
  --success-light: #fee2e2;
  --warning: #b45309;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
}

body.red-white .top-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

body.red-white .bottom-tab-bar {
  background: #ffffff;
  border-top: 1px solid var(--line);
}

body.red-white button,
body.red-white .option-btn {
  background: #ffffff;
  border: 2px solid var(--primary);
  color: var(--primary);
}

body.red-white button:hover,
body.red-white .option-btn:hover {
  background: var(--primary-light);
}

body.red-white button.active,
body.red-white button.primary,
body.red-white .option-btn.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
}

body.red-white .bottom-tab-btn {
  border: none !important;
  background: transparent !important;
  color: var(--text-muted) !important;
}

body.red-white .bottom-tab-btn.active {
  color: var(--primary) !important;
}

body.red-white input,
body.red-white select,
body.red-white textarea {
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
}

body.red-white input:focus,
body.red-white select:focus,
body.red-white textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* ─── High Contrast (kept for accessibility) ─── */
body.high-contrast {
  --bg-gradient: #000000;
  --card-bg: #121212;
  --card-border: #ffff00;
  --card-shadow: none;
  --text: #ffff00;
  --text-muted: #ffff00;
  --line: #ffff00;
  --primary: #ffff00;
  --primary-gradient: #ffff00;
  --primary-dark: #ffff00;
  --primary-light: #1a1a00;
  --success: #ffff00;
  --success-light: #1a1a00;
  --warning: #ffff00;
  --warning-light: #1a1a00;
  --danger: #ff0000;
  --danger-light: #1a0000;
}

body.high-contrast button {
  border: 3px solid #ffff00;
  background: #000000;
  color: #ffff00;
}

body.high-contrast button:hover {
  background: #ffff00;
  color: #000000;
}

body.high-contrast button.active,
body.high-contrast button.primary,
body.high-contrast .option-btn.active {
  background: #ffff00;
  color: #000000;
  border-color: #ffff00;
}

body.high-contrast .bottom-tab-btn {
  border: none !important;
  background: transparent !important;
  color: #ffff00 !important;
}

body.high-contrast .bottom-tab-btn.active {
  text-decoration: underline;
  background: transparent !important;
}

body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea {
  background: #000000;
  border: 3px solid #ffff00;
  color: #ffff00;
}

body.high-contrast .top-nav {
  background: #000000;
  border-bottom: 3px solid #ffff00;
}

body.high-contrast .bottom-tab-bar {
  background: #000000;
  border-top: 3px solid #ffff00;
}

/* ─── Base Resets ─── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-size: var(--font-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 90px;
  transition: background 0.4s ease, color 0.3s ease;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 0% 20%, rgba(244, 114, 182, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 80%, rgba(251, 146, 60, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(167, 139, 250, 0.06) 0%, transparent 60%);
}

body.dark-mode::before {
  background:
    radial-gradient(ellipse 80% 60% at 0% 20%, rgba(167, 139, 250, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 80%, rgba(129, 140, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(196, 181, 253, 0.06) 0%, transparent 60%);
}

body.light-mode::before {
  background:
    radial-gradient(ellipse 80% 60% at 0% 20%, rgba(52, 211, 153, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 80%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 60%);
}

body.red-white::before,
body.high-contrast::before {
  display: none;
}

h1, h2, h3, h4, h5, h6, strong, th, .card-title, .logo-area, b {
  font-weight: 700;
}

/* ─── Font Scaling ─── */
body.scale-large {
  --font-base: 20px;
  --font-large: 24px;
  --font-xl: 34px;
}

body.scale-extra-large {
  --font-base: 24px;
  --font-large: 30px;
  --font-xl: 42px;
}

/* ─── Accessibility Bar ─── */
.accessibility-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

.option-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.option-btn {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.option-btn.active {
  background: var(--primary-gradient) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: var(--primary-glow);
}

/* ─── Top Navigation ─── */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-nav .logo-area {
  font-size: var(--font-large);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  letter-spacing: -0.2px;
}

.top-nav .nav-actions {
  display: flex;
  gap: 6px;
}

/* ─── Bottom Tab Bar ─── */
.bottom-tab-bar {
  display: none;
}

@media (max-width: 600px) {
  .top-nav .nav-actions {
    display: none;
  }
  .top-nav {
    justify-content: center;
  }
  .bottom-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.03);
  }
  .bottom-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 6px;
    min-height: 56px;
    flex: 1;
    cursor: pointer;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    transition: color 0.2s ease;
  }
  .bottom-tab-btn .tab-icon {
    font-size: 24px;
    margin-bottom: 2px;
  }
  .bottom-tab-btn.active {
    color: var(--primary) !important;
  }
}

/* ─── Buttons ─── */
button, .option-btn {
  min-height: var(--touch-target);
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  font-size: var(--font-base);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  user-select: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

button.active,
button.primary,
.option-btn.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--primary-glow);
}

button.active:hover,
button.primary:hover {
  box-shadow: 0 4px 20px var(--primary-light);
  transform: translateY(-2px);
}

button.secondary {
  border-color: var(--line);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.5);
}

button.secondary:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--text-muted);
}

button.danger {
  border-color: rgba(251, 113, 133, 0.3);
  color: var(--danger);
  background: rgba(251, 113, 133, 0.04);
}

button.danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

button.success {
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--success);
  background: rgba(52, 211, 153, 0.04);
}

button.success:hover {
  background: var(--success-light);
  border-color: var(--success);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Bottom-tab overrides */
.bottom-tab-btn,
.bottom-tab-btn.active {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 6px !important;
  min-height: 56px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1;
  cursor: pointer;
  transform: none !important;
}

.bottom-tab-btn:hover {
  background: transparent !important;
  opacity: 0.8;
}

/* ─── Container ─── */
.container {
  max-width: 960px;
  margin: 20px auto;
  padding: 0 16px;
}

/* ─── Subpage Header ─── */
.subpage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.subpage-header h2 {
  font-size: var(--font-large);
  font-weight: 800;
}

@media (max-width: 600px) {
  .subpage-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .subpage-header button {
    width: 100%;
  }
}

.dashboard-top-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .dashboard-top-cards {
    grid-template-columns: 1fr;
  }
}

/* ─── Dashboard ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 800px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ─── Action Cards ─── */
.action-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(200, 140, 180, 0.18);
  border-color: var(--primary);
}

.action-card .card-icon {
  font-size: 28px;
  margin-bottom: 10px;
  color: var(--primary);
}

.action-card .card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.action-card .card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ─── Next Job Card ─── */
.next-job-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--card-shadow);
}

.next-job-card .badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  border: 1px solid var(--primary-light);
}

.next-job-card h2 {
  font-size: var(--font-large);
  font-weight: 800;
  margin-bottom: 4px;
}

.next-job-card p {
  font-size: 15px;
  margin-bottom: 14px;
}

@media (max-width: 600px) {
  .next-job-card div {
    flex-direction: column;
  }
  .next-job-card button {
    width: 100%;
  }
}

/* ─── Voice Card ─── */
.voice-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.voice-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(200, 140, 180, 0.18);
  border-color: var(--primary);
}

.voice-card-mic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voice-card-text h3 {
  font-size: var(--font-large);
  font-weight: 800;
  margin-bottom: 4px;
}

.voice-card-text p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 600px) {
  .voice-card {
    flex-direction: column;
    text-align: center;
  }
}

/* ─── Wizard ─── */
.wizard-header {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 22px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: var(--card-shadow);
}

.step-indicator {
  display: flex;
  gap: 8px;
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.step-dot.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--primary-glow);
}

.step-dot.completed {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-muted);
  border-color: rgba(0, 0, 0, 0.06);
}

/* ─── Selection Cards ─── */
.selection-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0;
}

.selection-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--font-base);
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: var(--card-shadow);
}

.selection-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.selection-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary);
}

.selection-card.selected strong,
.selection-card.selected span {
  color: var(--text);
}

.selection-card input[type="radio"],
.selection-card input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Avatar ─── */
.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

/* ─── Alphabet Filter ─── */
.alphabet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  justify-content: center;
}

.alphabet-letter {
  width: calc(10% - 6px);
  min-width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  font-size: 15px;
}

.alphabet-letter:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.alphabet-letter.active {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--primary-glow);
}

@media (max-width: 600px) {
  .alphabet-letter {
    width: calc(20% - 6px);
  }
}

/* ─── Preset Grid ─── */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

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

/* ─── Dialog ─── */
.dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.dialog-box {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  width: 100%;
  max-width: 550px;
  box-shadow: var(--card-shadow);
}

.dialog-box h2 {
  font-size: var(--font-large);
  font-weight: 800;
  margin-bottom: 10px;
}

.dialog-box p {
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.dialog-actions button {
  flex: 1;
}

@media (max-width: 600px) {
  .dialog-actions {
    flex-direction: column;
  }
}

/* ─── Undo Banner ─── */
.undo-banner {
  position: fixed;
  bottom: 84px;
  left: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  padding: 14px 18px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  font-weight: 700;
  border: 1px solid var(--line);
}

.undo-banner button {
  min-height: 44px;
  padding: 8px 16px;
  background: var(--primary-gradient);
  color: #ffffff;
  border-radius: 12px;
  border: none;
  box-shadow: var(--primary-glow);
}

/* ─── Calendar ─── */
.calendar-wrap {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--card-shadow);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

@media (max-width: 600px) {
  .calendar-header {
    flex-direction: column;
    text-align: center;
  }
  .calendar-header button {
    width: 100%;
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-day-label {
  text-align: center;
  font-weight: 700;
  padding: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.calendar-cell {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
  padding: 5px;
  position: relative;
  transition: all 0.15s ease;
}

@media (max-width: 600px) {
  .calendar-cell {
    min-height: 70px;
  }
}

.calendar-cell.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 2px var(--primary-light);
}

.calendar-cell-date {
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
  font-size: 14px;
  color: var(--text-muted);
}

.calendar-event {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-light);
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 2px;
  cursor: grab;
  user-select: none;
  transition: all 0.1s ease;
}

.calendar-event:hover {
  background: var(--primary);
  color: #ffffff;
}

.calendar-event:active {
  cursor: grabbing;
}

/* ─── Voice Card ─── */
.voice-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  color: var(--text);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: all 0.25s ease;
  border: 2px solid var(--line);
}

.voice-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.voice-card-mic {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  color: var(--primary);
  border: 2px solid var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.voice-card:hover .voice-card-mic {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
}

.voice-card-text h3 {
  font-size: var(--font-large);
  font-weight: 800;
  margin-bottom: 2px;
}

.voice-card-text p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ─── Floating Mic ─── */
.floating-mic {
  position: fixed;
  right: 16px;
  bottom: 96px;
  width: 80px;
  height: 80px;
  background: transparent;
  color: var(--danger);
  border: none;
  box-shadow: none;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 24px;
}

.floating-mic:hover {
  transform: scale(1.1);
}

/* ─── Floating Bell ─── */
.floating-bell {
  position: fixed;
  right: 16px;
  bottom: 190px;
  width: 80px;
  height: 80px;
  background: transparent;
  color: var(--warning);
  border: none;
  font-size: 24px;
  box-shadow: none;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.floating-bell:hover {
  transform: scale(1.1);
}

.floating-bell.has-alerts::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(251, 113, 133, 0.4);
}

/* ─── Alarm Overlay ─── */
.alarm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: flash-alarm 1s infinite alternate;
  padding: 20px;
  box-sizing: border-box;
}

@keyframes flash-alarm {
  0% { background: rgba(255, 255, 255, 0.95); }
  100% { background: rgba(254, 226, 226, 0.95); }
}

.alarm-box {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--danger);
  border-radius: 24px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.alarm-icon {
  font-size: 72px;
  margin-bottom: 16px;
  animation: wobble 0.5s infinite;
  display: inline-block;
  color: var(--danger);
}

@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}

/* ─── Alerts Sidebar ─── */
.alerts-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1999;
  display: flex;
  justify-content: flex-end;
}

.alerts-sidebar {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  width: 360px;
  max-width: 90vw;
  height: 100%;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.04);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-left: 1px solid var(--card-border);
}

.alerts-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.alerts-sidebar-header .wizard-cancel-btn {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text) !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 0 !important;
  min-height: auto !important;
}

.alerts-sidebar-header .wizard-cancel-btn:hover {
  opacity: 0.7;
}

.alerts-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.alert-item-card {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 14px;
}

/* ─── Client Info Card ─── */
.client-info-card {
  background: var(--card-bg);
  border: 2px solid var(--line);
  padding: 18px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
}

/* ─── Checklist ─── */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  font-weight: 700;
  border: 2px solid var(--line);
  box-shadow: var(--card-shadow);
  transition: all 0.15s ease;
}

.checklist-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.checklist-item input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  pointer-events: none;
}

/* ─── Tables ─── */
.table-responsive {
  overflow-x: auto;
  margin-top: 14px;
}

.accessible-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.accessible-table th,
.accessible-table td {
  padding: 14px 18px;
  border-bottom: 2px solid var(--line);
  text-align: left;
  font-weight: 700;
}

.accessible-table th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.accessible-table tr:hover td {
  background: var(--primary-light);
}

.accessible-table tr:last-child td {
  border-bottom: none;
}

/* ─── Badges ─── */
.badge-status {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-status.paid {
  background: var(--success-light);
  color: var(--success);
}

.badge-status.pending {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-status.draft {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
}

.badge-status.sent {
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── Invoice Cards ─── */
.invoice-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 700px) {
  .invoice-list {
    grid-template-columns: 1fr;
  }
}

.invoice-card {
  background: var(--card-bg);
  backdrop-filter: var(--card-blur);
  -webkit-backdrop-filter: var(--card-blur);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.invoice-card:hover {
  box-shadow: 0 8px 40px rgba(180, 140, 200, 0.14);
  border-color: var(--primary);
}

.invoice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.invoice-num {
  font-size: var(--font-large);
  font-weight: 800;
  color: var(--text);
}

.invoice-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
}

.invoice-card-body p {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.invoice-amount {
  font-size: var(--font-large);
  color: var(--primary);
  font-weight: 800;
}

.invoice-card-actions {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
}

.invoice-card-actions button {
  width: 100%;
}

/* ─── Wizard Nav Buttons ─── */
.wizard-back-btn,
.wizard-cancel-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
  min-height: auto;
}

.wizard-back-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-light);
}

.wizard-back-btn:hover {
  background: var(--primary-gradient);
  color: #ffffff;
  transform: scale(1.05);
  border-color: transparent;
  box-shadow: var(--primary-glow);
}

.wizard-cancel-btn {
  background: rgba(251, 113, 133, 0.06);
  color: var(--danger);
  border: 1px solid rgba(251, 113, 133, 0.1);
}

.wizard-cancel-btn:hover {
  background: var(--danger);
  color: #ffffff;
  transform: scale(1.05);
  border-color: transparent;
}

/* ─── Form Inputs ─── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: var(--font-base);
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: rgba(255, 255, 255, 0.9);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* ─── Notice ─── */
.notice {
  padding: 10px 12px;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: 12px;
  margin-bottom: 12px;
}

/* ─── Print Styles ─── */
@media print {
  body {
    background: white !important;
    font-size: 12px;
    color: #000 !important;
    padding-bottom: 0;
  }
  .top-nav,
  .bottom-tab-bar,
  .floating-mic,
  .floating-bell,
  .undo-banner,
  .alarm-overlay,
  .alerts-sidebar-overlay,
  .no-print,
  button {
    display: none !important;
  }
  .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  .card,
  .calendar-wrap,
  .invoice-card {
    box-shadow: none;
    border: 1px solid #ddd;
    background: white !important;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.06);
  border-radius: 99px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.12);
}

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

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.06) transparent;
}

/* ─── Misc Helpers ─── */
.smart-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}
