/* ==========================================================================
   Prime Planner: Smart Notes & Checklist Organizer
   Core Design System & Theme Styles
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-deep-navy: #0b0c1a;
  --bg-dark-base: #0e0f22;
  --bg-surface: rgba(18, 20, 42, 0.72);
  --bg-surface-elevated: rgba(26, 29, 60, 0.85);
  --bg-glass: rgba(15, 17, 38, 0.65);
  --bg-glass-active: rgba(32, 36, 75, 0.75);
  --bg-input: rgba(11, 12, 26, 0.7);

  /* Primary Electric Glow */
  --primary-orange: #ff3d00;
  --primary-orange-light: #ff6e40;
  --primary-orange-dark: #dd2c00;
  --primary-gradient: linear-gradient(135deg, #ff3d00 0%, #ff6d00 100%);
  --primary-gradient-hover: linear-gradient(135deg, #ff5722 0%, #ff8f00 100%);
  --glow-orange: rgba(255, 61, 0, 0.38);
  --glow-orange-subtle: rgba(255, 61, 0, 0.16);

  /* Secondary Accents */
  --accent-amber: #ffab00;
  --accent-cyan: #00e5ff;
  --accent-green: #00e676;
  --accent-danger: #ff1744;
  --accent-purple: #7c4dff;

  /* Typography Colors */
  --text-white: #ffffff;
  --text-primary: #f8fafc;
  --text-secondary: #a0a6c2;
  --text-muted: #6b7294;

  /* Borders & Highlights */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(255, 61, 0, 0.55);

  /* Shadows */
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.42);
  --shadow-elevated: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 8px 24px rgba(255, 61, 0, 0.4);

  /* Blur & Radius */
  --blur-glass: blur(18px);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --trans-spring: 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Midnight Obsidian Alternate Theme */
.app-container[data-theme="midnight-obsidian"] {
  --bg-deep-navy: #05060a;
  --bg-dark-base: #080911;
  --bg-surface: rgba(12, 13, 22, 0.84);
  --bg-surface-elevated: rgba(18, 19, 32, 0.9);
  --bg-glass: rgba(10, 11, 18, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.11);
}

/* Frosted Glass Alternate Theme */
.app-container[data-theme="frosted-glass"] {
  --bg-deep-navy: #0d122b;
  --bg-dark-base: #13193a;
  --bg-surface: rgba(28, 35, 74, 0.65);
  --bg-surface-elevated: rgba(38, 47, 98, 0.75);
  --bg-glass: rgba(25, 32, 68, 0.58);
  --border-subtle: rgba(255, 255, 255, 0.14);
  --border-glass: rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */

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

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-deep-navy) url('bg.jpg') center/cover no-repeat fixed;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
  outline: none;
  border: none;
}

/* ==========================================================================
   Mobile-First Main App Shell
   ========================================================================== */

.app-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: url('bg.jpg') center/cover no-repeat fixed;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
  overflow-x: hidden;
  overflow-y: visible;
  touch-action: pan-y;
}

/* Ambient color overlay behind UI for optimal readability */
.app-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 15%, rgba(255, 61, 0, 0.12) 0%, rgba(11, 12, 26, 0.68) 55%, rgba(11, 12, 26, 0.9) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Glassmorphic Panel Utility */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast);
}

/* ==========================================================================
   Header Bar
   ========================================================================== */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px 16px;
  background: rgba(11, 12, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  width: 100%;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 4px 12px var(--glow-orange);
  border: 1px solid rgba(255, 61, 0, 0.4);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-white);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-orange-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.05);
}

.highlight-btn {
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  box-shadow: 0 4px 14px var(--glow-orange);
}

.highlight-btn:hover, .highlight-btn:active {
  background: var(--primary-gradient-hover);
  box-shadow: 0 6px 18px rgba(255, 61, 0, 0.6);
}

/* ==========================================================================
   Screens Viewport
   ========================================================================== */

.screens-viewport {
  position: relative;
  z-index: 5;
  flex: 1 1 auto;
  width: 100%;
  display: block;
  overflow: visible;
  min-height: 0;
}

.screen-view {
  width: 100%;
  min-height: 100%;
  overflow: visible;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeInScreen 0.28s ease-out;
  touch-action: pan-y;
}

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

.screen-content-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 115px); /* Space for fixed bottom nav */
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   1. Welcome Screen
   ========================================================================== */

.welcome-screen {
  padding: 24px 18px calc(env(safe-area-inset-bottom, 0px) + 40px) 18px;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  display: block;
}

.welcome-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
  justify-content: space-between;
  box-sizing: border-box;
}

.welcome-hero-card {
  text-align: center;
  padding: 24px 20px;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 61, 0, 0.16);
  border: 1px solid rgba(255, 61, 0, 0.35);
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary-orange-light);
  margin-bottom: 14px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-orange);
  box-shadow: 0 0 8px var(--primary-orange);
}

.welcome-logo-box {
  width: 90px;
  height: 90px;
  margin: 0 auto 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid rgba(255, 61, 0, 0.4);
  box-shadow: 0 10px 28px var(--glow-orange);
}

.welcome-3d-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-headline {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-white);
  margin-bottom: 6px;
}

.welcome-lead {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.welcome-slides-container {
  position: relative;
  overflow: hidden;
}

.welcome-carousel {
  position: relative;
  min-height: 160px;
}

.welcome-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.35s ease-out;
  pointer-events: none;
}

.welcome-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.feature-card {
  padding: 18px 16px;
  text-align: center;
}

.feature-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-orange {
  background: rgba(255, 61, 0, 0.18);
  color: var(--primary-orange-light);
  border: 1px solid rgba(255, 61, 0, 0.4);
}

.icon-glow {
  background: rgba(255, 171, 0, 0.18);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 171, 0, 0.4);
}

.icon-cyan {
  background: rgba(0, 229, 255, 0.18);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.icon-amber {
  background: rgba(0, 230, 118, 0.18);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.feature-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  transition: all var(--trans-fast);
  cursor: pointer;
}

.dot.active {
  width: 22px;
  background: var(--primary-orange);
  box-shadow: 0 0 10px var(--primary-orange);
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   Buttons & Micro-Interactions
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: var(--shadow-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover, .btn-primary:active {
  background: var(--primary-gradient-hover);
  box-shadow: 0 8px 28px rgba(255, 61, 0, 0.55);
  transform: translateY(-1px);
}

.btn-pulse {
  animation: pulseGlow 2.4s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 6px 20px rgba(255, 61, 0, 0.4);
  }
  50% {
    box-shadow: 0 8px 30px rgba(255, 61, 0, 0.7);
  }
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

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

.btn-ghost:hover, .btn-ghost:active {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.06);
}

.btn-danger {
  background: linear-gradient(135deg, #d50000 0%, #ff1744 100%);
  color: var(--text-white);
  box-shadow: 0 6px 18px rgba(255, 23, 68, 0.4);
}

.btn-danger-outline {
  background: rgba(255, 23, 68, 0.12);
  color: #ff5252;
  border: 1px solid rgba(255, 23, 68, 0.35);
}

.btn-danger-outline:hover, .btn-danger-outline:active {
  background: rgba(255, 23, 68, 0.22);
  border-color: rgba(255, 23, 68, 0.6);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

.btn-icon-only {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

/* ==========================================================================
   2. Dashboard Screen
   ========================================================================== */

.dashboard-greeting-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.greeting-time {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-orange-light);
}

.greeting-user {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.4px;
}

.energy-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 61, 0, 0.14);
  color: var(--primary-orange-light);
  border: 1px solid rgba(255, 61, 0, 0.3);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}

.action-card:hover, .action-card:active {
  transform: translateY(-2px);
  border-color: rgba(255, 61, 0, 0.45);
}

.action-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-gradient-orange {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: 0 4px 14px var(--glow-orange);
}

.bg-dark-glass {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-orange-light);
  border: 1px solid rgba(255, 61, 0, 0.35);
}

.action-details {
  display: flex;
  flex-direction: column;
}

.action-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-white);
}

.action-hint {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* KPI Counter Cards */
.kpi-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.kpi-card {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.kpi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.orange-dot { background: var(--primary-orange); box-shadow: 0 0 6px var(--primary-orange); }
.amber-dot { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); }
.green-dot { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.cyan-dot { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-white);
}

.kpi-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Daily Focus Card */
.focus-progress-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.focus-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--primary-orange-light);
}

.focus-headline {
  font-family: 'Outfit', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-white);
}

.focus-percent {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-orange);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  box-shadow: 0 0 10px var(--glow-orange);
  transition: width 0.45s ease;
}

.focus-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.focus-streak {
  font-weight: 700;
  color: var(--accent-amber);
}

/* Section Blocks */
.section-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
}

.text-orange { color: var(--primary-orange); }
.text-amber { color: var(--accent-amber); }
.text-green { color: var(--accent-green); }

.section-link-btn {
  background: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-orange-light);
  cursor: pointer;
}

.section-link-btn:hover {
  text-decoration: underline;
}

.pinned-cards-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.pinned-cards-scroller::-webkit-scrollbar {
  height: 4px;
}
.pinned-cards-scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 61, 0, 0.3);
  border-radius: var(--radius-full);
}

.pinned-mini-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  padding: 14px 12px;
  cursor: pointer;
}

.pinned-mini-card:hover {
  border-color: rgba(255, 61, 0, 0.5);
  transform: translateY(-2px);
}

.pinned-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mini-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 61, 0, 0.16);
  color: var(--primary-orange-light);
}

.pinned-mini-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.pinned-mini-preview {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.items-list-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   3. Notes & Checklists (Main Tool Screen)
   ========================================================================== */

.search-box-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
}

.search-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  font-size: 0.88rem;
  color: var(--text-white);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tag Carousel */
.tag-carousel-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

.tag-carousel-wrap::-webkit-scrollbar {
  display: none;
}

.tag-chips-track {
  display: flex;
  gap: 8px;
  width: max-content;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.tag-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
}

.tag-chip.active {
  background: var(--primary-gradient);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px var(--glow-orange);
}

/* Filter Segments & Sorter */
.filter-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.seg-btn.active {
  background: rgba(255, 61, 0, 0.22);
  color: var(--primary-orange-light);
  border: 1px solid rgba(255, 61, 0, 0.45);
}

.sort-dropdown-wrap {
  position: relative;
}

.sort-select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.items-collection-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Item Card (Note / Checklist) */
.item-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
}

.item-card:hover {
  border-color: rgba(255, 61, 0, 0.4);
  transform: translateY(-1px);
}

.item-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.item-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.type-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-pill.pill-note {
  background: rgba(255, 61, 0, 0.16);
  color: var(--primary-orange-light);
  border: 1px solid rgba(255, 61, 0, 0.3);
}

.type-pill.pill-checklist {
  background: rgba(0, 229, 255, 0.16);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
}

.card-tag-pill {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

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

.card-action-btn {
  background: none;
  padding: 4px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--trans-fast);
  display: flex;
  align-items: center;
}

.card-action-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.1);
}

.card-action-btn.pinned-active {
  color: var(--primary-orange);
}

.item-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.3;
}

.item-card-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Card Checklists Preview */
.card-checklist-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.checklist-row-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-primary);
  user-select: none;
}

.checklist-custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.8px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans-fast);
  flex-shrink: 0;
}

.checklist-custom-checkbox.checked {
  background: var(--primary-gradient);
  border-color: var(--primary-orange);
  box-shadow: 0 0 8px var(--glow-orange);
}

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

.card-checklist-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-checklist-bar {
  flex: 1;
  max-width: 130px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 10px;
}

.card-checklist-fill {
  height: 100%;
  background: var(--accent-cyan);
  border-radius: var(--radius-full);
}

.item-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Empty State Card */
.empty-state-card {
  text-align: center;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 61, 0, 0.12);
  color: var(--primary-orange-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.empty-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-white);
}

.empty-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 280px;
  line-height: 1.4;
  margin-bottom: 8px;
}

/* ==========================================================================
   4. Statistics & Analytics Screen
   ========================================================================== */

.stats-header-banner, .settings-header-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-heading-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary-orange-light);
  text-transform: uppercase;
}

.screen-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.4px;
}

.screen-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.stat-pills-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-pill-card {
  padding: 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-pill-num {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

.stat-pill-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.chart-box-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
}

.chart-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.canvas-container {
  width: 100%;
  position: relative;
}

.canvas-container canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
}

.chart-legend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.bg-orange { background: var(--primary-orange); }
.bg-cyan { background: var(--accent-cyan); }
.bg-amber { background: var(--accent-amber); }
.bg-green { background: var(--accent-green); }
.bg-muted { background: var(--text-muted); }

/* Donut Chart Layout */
.donut-chart-layout {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 14px;
}

.donut-canvas-wrap {
  width: 130px;
  height: 130px;
  position: relative;
  flex-shrink: 0;
}

.donut-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-stats-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.donut-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-stat-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.donut-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.donut-num {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-white);
}

.tag-insights-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.tag-insight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   5. Settings & Profile Screen
   ========================================================================== */

.settings-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-group-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
}

.settings-subtext {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-white);
  box-shadow: 0 4px 16px var(--glow-orange);
  flex-shrink: 0;
}

.profile-info-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-name-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-white);
  width: 100%;
}

.inline-name-input:focus {
  border-color: var(--primary-orange);
  background: rgba(0, 0, 0, 0.4);
}

.profile-subtitle {
  font-size: 0.72rem;
  color: var(--primary-orange-light);
}

/* Theme Options */
.theme-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.theme-choice-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.theme-choice-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.theme-choice-btn.active {
  border-color: var(--primary-orange);
  background: rgba(255, 61, 0, 0.14);
  box-shadow: 0 0 12px var(--glow-orange-subtle);
}

.theme-preview {
  width: 38px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.swatch { flex: 1; }
.orange-swatch { background: #ff3d00; }
.navy-swatch { background: #0b0c1a; }
.ember-swatch { background: #ff9100; }
.obsidian-swatch { background: #05060a; }
.light-glass-swatch { background: #262f62; }

.theme-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-white);
}

.theme-tag {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* Settings Toggles */
.setting-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-label-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-white);
}

.setting-item-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.select-small {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-white);
}

/* Custom Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
}

input:checked + .slider {
  background: var(--primary-gradient);
  box-shadow: 0 0 10px var(--glow-orange);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.data-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-replay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */

.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 8px) 12px;
  background: rgba(11, 12, 26, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  box-sizing: border-box;
}

.nav-tab {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--trans-fast);
  flex: 1;
}

.nav-tab:hover {
  color: var(--text-secondary);
}

.nav-tab.active {
  color: var(--primary-orange);
}

.nav-tab.active svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 6px var(--primary-orange));
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Prominent Floating Center Action Button */
.nav-floating-action {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: -24px;
  border: 3px solid rgba(11, 12, 26, 0.9);
  box-shadow: 0 8px 24px rgba(255, 61, 0, 0.55);
  transition: all var(--trans-spring);
  flex-shrink: 0;
}

.nav-floating-action:hover, .nav-floating-action:active {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 12px 30px rgba(255, 61, 0, 0.75);
}

.floating-action-glow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 61, 0, 0.5) 0%, transparent 70%);
  z-index: -1;
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeInOverlay 0.2s ease-out;
}

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

.modal-dialog {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  max-height: 88dvh;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-elevated);
  box-shadow: var(--shadow-elevated);
  animation: slideUpModal 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-white);
}

.modal-subtitle {
  font-size: 0.72rem;
  color: var(--primary-orange-light);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 18px 20px calc(env(safe-area-inset-bottom, 0px) + 30px) 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Mode Switcher */
.editor-type-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.type-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 700;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.type-switch-btn.active {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: 0 4px 12px var(--glow-orange);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.char-count, .checklist-count-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-white);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 12px var(--glow-orange-subtle);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

/* Checklist Builder */
.checklist-builder-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.builder-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
}

.builder-item-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.builder-item-checkbox.checked {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
}

.builder-item-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-white);
}

.builder-item-delete {
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.builder-item-delete:hover {
  color: var(--accent-danger);
}

.add-task-input-row, .add-custom-tag-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-inline-input, .tag-inline-input {
  flex: 1;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.tags-selection-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.editor-tag-pill {
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.editor-tag-pill.selected {
  background: var(--primary-gradient);
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px var(--glow-orange);
}

.pin-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 61, 0, 0.08);
  border: 1px solid rgba(255, 61, 0, 0.25);
  border-radius: var(--radius-sm);
}

.pin-label-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-white);
}

.modal-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

/* Confirmation Dialog */
.confirm-dialog {
  width: 90%;
  max-width: 360px;
  padding: 24px 20px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.confirm-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 23, 68, 0.15);
  color: #ff5252;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-white);
}

.confirm-message {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.confirm-actions .btn {
  flex: 1;
}

/* Toast Notifications */
.toast-hub {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.toast-item {
  background: rgba(18, 20, 42, 0.95);
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-white);
  animation: slideToastIn 0.25s ease-out;
  backdrop-filter: blur(14px);
}

.toast-item.toast-success {
  border-left: 4px solid var(--accent-green);
}

.toast-item.toast-info {
  border-left: 4px solid var(--primary-orange);
}

.toast-item.toast-danger {
  border-left: 4px solid var(--accent-danger);
}

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

/* Compact layout mode when toggled */
.app-container.compact-mode .item-card {
  padding: 10px 12px;
  gap: 6px;
}

.app-container.compact-mode .item-card-body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Scrollbar polish */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Mobile Phone Adaptive Enhancements (100% Smartphone Optimization)
   ========================================================================== */

/* Universal mobile touch ergonomics */
button, .btn, .icon-btn, .nav-tab, .filter-chip, .badge-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

button:active, .btn:active, .icon-btn:active, .nav-tab:active {
  transform: scale(0.97);
}

/* Prevent auto-zoom on mobile inputs */
input, select, textarea {
  font-size: 16px !important;
}

/* Smart phones & mobile screens (up to 480px) */
@media (max-width: 480px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  .app-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .top-bar {
    padding-left: 12px;
    padding-right: 12px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  }

  .bottom-nav-bar {
    max-width: 100% !important;
    left: 0 !important;
    transform: none !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  }

  .screen-view {
    padding: 12px;
  }

  .screen-content-inner {
    gap: 14px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 100px);
  }

  .modal-dialog {
    width: 95% !important;
    max-width: 100% !important;
    margin: 10px auto;
    max-height: 88vh;
    overflow-y: auto;
  }
}

/* Compact phones (iPhone SE, small Androids <= 375px) */
@media (max-width: 375px) {
  .top-bar-left .brand-title {
    font-size: 1.05rem;
  }

  .welcome-headline {
    font-size: 1.5rem;
  }

  .stats-card-val {
    font-size: 1.25rem;
  }

  .nav-tab {
    padding: 4px 4px;
    font-size: 0.7rem;
  }

  .nav-tab svg {
    width: 18px;
    height: 18px;
  }
}
