

:root {
  --background-gradient: linear-gradient(135deg, #fcfbf6 0%, #efece7 52%, #f7f4ef 100%);
  --glass-bg: rgba(255,255,255,0.95);
  --glass-bg-dark: rgba(32,35,50,0.93);
  --glass-blur: 24px;
  --glass-border: rgba(255,255,255,0.30);
  --glass-shine: linear-gradient(120deg,rgba(255,255,255,0.55) 0%,rgba(255,255,255,0.15) 100%);
  --primary-gradient: linear-gradient(92deg, #cabbad 0%, #e8e5d7 100%);
  --accent: #9b8878;
  --accent-light: #e7e0d9;
  --accent-dark: #6d5f52;
  --teal-accent: #91c6bd;
  --shadow-shine: 0 0 0 2.2px #fff, 0 2px 24px 0 rgba(186,170,162,0.13), 0 2px 9px rgba(109,95,82,0.11);
  --shadow-card: 0 0 0 2px var(--glass-border), 0 6px 18px 0 rgba(176,160,152,0.15), 0 1.5px 4.5px rgba(109,95,82,0.07);
  --shadow-button: 0 3px 14px 0 rgba(186,170,162,0.19);
  --radius-xl: 30px;
  --radius-lg: 19px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 62px;
  --input-bg: rgba(255,255,255,0.99);
  --input-bg-dark: rgba(40,43,62,0.96);
  --border-shine: rgba(190,170,120,0.22);
  --font-family: 'Inter','Segoe UI',Arial,sans-serif;
  --font-size-base: 1.08rem;
  --font-size-heading: 2.05rem;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
body {
  background: var(--background-gradient);
  color: #31291e;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  transition: background 0.34s, color 0.29s;
}

body.dark {
  background: linear-gradient(125deg,#21242e 0%,#2e3240 41%,#1b1e27 100%);
  color: #fefaf2;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 13px; }
::-webkit-scrollbar-thumb {
  background: var(--accent-light);
  border-radius: 16px;
  border: 2.4px solid #f7f3ef;
}
::-webkit-scrollbar-track { background: transparent; }
body.dark ::-webkit-scrollbar-thumb { background: var(--accent); border-color: #21242e; }
body.dark ::-webkit-scrollbar-track { background: #1b1e27; }

/* ============================================
   LAYOUT & STRUCTURE
   ============================================ */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

main {
  padding: 2.2rem 1.2rem 2rem 1.2rem;
  flex-direction: column;
  margin: 0 auto;
  max-width: 1258px;
  box-sizing: border-box;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-top-right-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  border: 2.5px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: width 0.27s;
  padding: 2rem 0 2rem 1rem;
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

body.dark .sidebar {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.16);
}

.sidebar.collapsed {
  width: var(--sidebar-width-collapsed) !important;
}

.sidebar-controls {
  display: flex;
  justify-content: space-around;
  padding: 18px 0 10px 0;
  gap: 0.8rem;
}

.sidebar-controls button {
  border: none;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 1.45rem;
  padding: 0.58rem 1.1rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  margin: 0 6px;
  transition: background 0.16s, color 0.16s;
}

.sidebar-controls button:hover { 
  background: var(--accent-light); 
  color: #3d3126; 
}

#toggle-sidebar {
  background: none;
  border: none;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  color: #ac9784;
  cursor: pointer;
  padding: 0.55rem 2.2rem 0.55rem 1.05rem;
  
  /* ADD THESE LINES: */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* ============================================
   THEME TOGGLE
   ============================================ */

/* Base styles for theme toggle - applies to all screens */
#theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  margin: 0;
  background: rgba(172, 151, 132, 0.18);
  border: 1.5px solid rgba(172, 151, 132, 0.35);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  color: #ac9784;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  z-index: 10;
}

/* iPad/Desktop positioning - centered */
@media (min-width: 901px), (min-width: 769px) and (orientation: landscape) {
  #theme-toggle {
    top: 1rem;
    left: 50%;
    transform: translateX(8px);
  }

  #theme-toggle:hover {
    background: rgba(172, 151, 132, 0.28);
    transform: translateX(8px) scale(1.08);
    box-shadow: 0 4px 12px rgba(172, 151, 132, 0.25);
  }

  #theme-toggle:active {
    transform: translateX(8px) scale(0.95);
  }
}

/* Mobile positioning - right side */
@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  #theme-toggle {
    top: 1rem;
    right: 1rem;
  }

  #theme-toggle:hover {
    background: rgba(172, 151, 132, 0.28);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(172, 151, 132, 0.25);
  }

  #theme-toggle:active {
    transform: scale(0.95);
  }
}

/* Dark mode styles */
body.dark #theme-toggle {
  background: rgba(255, 226, 188, 0.12);
  border-color: rgba(255, 226, 188, 0.25);
  color: #ffe2bc;
}

body.dark #theme-toggle:hover {
  background: rgba(255, 226, 188, 0.2);
  box-shadow: 0 4px 12px rgba(255, 226, 188, 0.2);
}

/* ========================================
   STORAGE INDICATOR
   ======================================== */

.storage-indicator {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #654d36;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
  background: rgba(172, 151, 132, 0.18);
  border: 2px solid rgba(172, 151, 132, 0.35);
  box-shadow: 
    0 0 20px rgba(172, 151, 132, 0.3),
    0 0 35px rgba(255, 255, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  overflow: hidden;
  width: fit-content;
}

/* iPad/Desktop positioning */
@media (min-width: 901px), (min-width: 769px) and (orientation: landscape) {
  .storage-indicator {
    margin: 4rem auto 1.5rem auto;
    left: 50%;
    transform: translateX(-82%);
  }
}

/* Animated brown border glow (subtle) */
.storage-indicator::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 22px;
  background: linear-gradient(45deg, 
    rgba(172, 151, 132, 0.6),
    rgba(202, 187, 173, 0.4),
    rgba(172, 151, 132, 0.6));
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  z-index: -1;
  opacity: 0.7;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Hover effect */
.storage-indicator:hover {
  background: rgba(172, 151, 132, 0.25);
  border-color: rgba(172, 151, 132, 0.5);
  box-shadow: 
    0 0 25px rgba(172, 151, 132, 0.5),
    0 0 45px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Circle progress indicator */
.storage-progress-circle {
  flex-shrink: 0;
}

.progress-bg {
  stroke: rgba(101, 77, 54, 0.3);
}

.progress-fill {
  transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
  stroke: #9b8878;
  stroke-width: 3;
}

.storage-text {
  letter-spacing: 0.3px;
  white-space: nowrap;
}

#storage-percent {
  font-weight: 700;
  font-size: 1.05em;
}

/* WARNING state (80-94%) */
.storage-indicator.warning {
  color: #8b6914;
  background: rgba(255, 235, 59, 0.22);
  border-color: rgba(255, 235, 59, 0.65);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
}

.storage-indicator.warning::before {
  background: linear-gradient(45deg, 
    rgba(255, 235, 59, 0.7),
    rgba(255, 193, 7, 0.5));
}

.storage-indicator.warning .progress-bg {
  stroke: rgba(139, 105, 20, 0.4);
}

.storage-indicator.warning .progress-fill {
  stroke: #ffeb3b;
}

/* CRITICAL state (95%+) */
.storage-indicator.critical {
  color: #c8518f;
  background: rgba(255, 152, 0, 0.25);
  border-color: rgba(255, 152, 0, 0.75);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
  animation: criticalPulse 1.5s ease-in-out infinite;
}

.storage-indicator.critical::before {
  background: linear-gradient(45deg, 
    rgba(255, 152, 0, 0.8),
    rgba(255, 193, 7, 0.5));
}

.storage-indicator.critical .progress-bg {
  stroke: rgba(200, 81, 143, 0.4);
}

.storage-indicator.critical .progress-fill {
  stroke: #ff9800;
}

@keyframes criticalPulse {
  0%, 100% { 
    box-shadow: 
      0 0 20px rgba(255, 152, 0, 0.4),
      0 0 35px rgba(255, 255, 255, 0.2); 
  }
  50% { 
    box-shadow: 
      0 0 30px rgba(255, 152, 0, 0.7),
      0 0 55px rgba(255, 255, 255, 0.4); 
  }
}

/* DARK MODE */
body.dark .storage-indicator {
  color: #f7e9d4;
  background: rgba(255, 226, 188, 0.12);
  border-color: rgba(255, 226, 188, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

body.dark .storage-indicator::before {
  background: linear-gradient(45deg, 
    rgba(255, 226, 188, 0.5),
    rgba(232, 229, 215, 0.3));
}

body.dark .storage-indicator:hover {
  background: rgba(255, 226, 188, 0.2);
  box-shadow: 0 4px 12px rgba(255, 226, 188, 0.2);
}

body.dark .progress-bg {
  stroke: rgba(247, 233, 212, 0.3);
}

body.dark .progress-fill {
  stroke: #ffe2bc;
}

/* COLLAPSED SIDEBAR - Hide completely */
.sidebar.collapsed .storage-indicator {
  display: none;
}

/* ========================================
   MOBILE STORAGE INDICATOR IN SIDEBAR
   ======================================== */

/* Mobile version - circle only in sidebar */
#storage-indicator-mobile {
  display: none; /* Hidden on desktop */
}

/* Show mobile version on mobile/tablet portrait */
@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  /* Hide full sidebar version on mobile */
  .storage-indicator {
    display: none !important;
  }

  /* Show mobile circle in sidebar (left of audio icon) */
  #storage-indicator-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 1rem;
    right: 8rem; /* ← CHANGED from 9rem */
    background: rgba(172, 151, 132, 0.18);
    border: 2px solid rgba(172, 151, 132, 0.35);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 100;
    padding: 0;
  }

  #storage-indicator-mobile:hover {
    background: rgba(172, 151, 132, 0.28);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(172, 151, 132, 0.25);
  }

  #storage-indicator-mobile:active {
    transform: scale(0.95);
  }

  body.dark #storage-indicator-mobile {
    background: rgba(255, 226, 188, 0.12);
    border-color: rgba(255, 226, 188, 0.25);
  }

  body.dark #storage-indicator-mobile:hover {
    background: rgba(255, 226, 188, 0.2);
    box-shadow: 0 4px 12px rgba(255, 226, 188, 0.2);
  }

  /* Adjust SVG size for mobile circle */
  #storage-indicator-mobile .storage-progress-circle {
    width: 30px;  /* ← CHANGED from 28px */
    height: 30px; /* ← CHANGED from 28px */
  }

  /* Warning state mobile */
  #storage-indicator-mobile.warning {
    background: rgba(255, 235, 59, 0.22);
    border-color: rgba(255, 235, 59, 0.65);
  }

  #storage-indicator-mobile.warning .progress-fill {
    stroke: #ffeb3b;
  }

  /* Critical state mobile */
  #storage-indicator-mobile.critical {
    background: rgba(255, 152, 0, 0.25);
    border-color: rgba(255, 152, 0, 0.75);
    animation: criticalPulse 1.5s ease-in-out infinite;
  }

  #storage-indicator-mobile.critical .progress-fill {
    stroke: #ff9800;
  }
}

/* ============================================
   AUDIO TOGGLE BUTTONS
   ============================================ */

/* HIDE desktop audio button */
#audio-toggle-desktop {
  display: none !important;
}

/* Base styles for audio toggle - applies to all screens */
#audio-toggle-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  background: rgba(172, 151, 132, 0.18);
  border: 1.5px solid rgba(172, 151, 132, 0.35);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  color: #ac9784;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  z-index: 10;
}

/* iPad/Desktop positioning - centered */
@media (min-width: 901px), (min-width: 769px) and (orientation: landscape) {
  #audio-toggle-mobile {
    top: 1rem;
    left: 50%;
    transform: translateX(-56px);
  }

  #audio-toggle-mobile:hover {
    background: rgba(172, 151, 132, 0.28);
    transform: translateX(-56px) scale(1.08);
    box-shadow: 0 4px 12px rgba(172, 151, 132, 0.25);
  }

  #audio-toggle-mobile:active {
    transform: translateX(-56px) scale(0.95);
  }
}

/* Mobile positioning - right side */
@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  #audio-toggle-mobile {
    top: 1rem;
    right: 4.5rem;
  }

  #audio-toggle-mobile:hover {
    background: rgba(172, 151, 132, 0.28);
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(172, 151, 132, 0.25);
  }

  #audio-toggle-mobile:active {
    transform: scale(0.95);
  }
}

/* Dark mode styles */
body.dark #audio-toggle-mobile {
  background: rgba(255, 226, 188, 0.12);
  border-color: rgba(255, 226, 188, 0.25);
  color: #ffe2bc;
}

body.dark #audio-toggle-mobile:hover {
  background: rgba(255, 226, 188, 0.2);
  box-shadow: 0 4px 12px rgba(255, 226, 188, 0.2);
}



/* ============================================
   TAB NAVIGATION
   ============================================ */
.tab-list {
  flex-grow: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  min-height: 55vh;
}

.tab-list li { 
  margin: 0.7rem 0; 
  transition: opacity 0.17s; 
}

.tab-list button {
  width: 90%;
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  color: #37312c;
  padding: 1.08rem 1.2rem;
  margin: 0.14rem 0;
  text-align: left;
  font-size: 1.12rem;
  font-weight: 540;
  border-radius: var(--radius-lg);
  transition: background 0.14s, color 0.17s, box-shadow 0.21s;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

body.dark .tab-list button {
  background: var(--glass-bg-dark);
  color: #f7f1e5;
  border-color: rgba(255,255,255,0.14);
}

.sidebar.collapsed .tab-list button {
  font-size: 0;
  padding: 1rem 0;
  width: 36px;
}

.sidebar.collapsed .tab-list li { 
  opacity: 0.58; 
}

.tab-list button[aria-selected="true"] {
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 5px 28px 0 rgba(180,170,162,0.18), 0 0 1.5px white inset;
}

.tab-list button:hover { 
  background: var(--accent-light); 
  color: #3d3126; 
  box-shadow: var(--shadow-shine);
}

body.dark .tab-list button:hover { 
  background: var(--teal-accent); 
  color: #fff; 
}

/* ============================================
   HEADER
   ============================================ */
header {
  margin-bottom: 1.2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-shine);
  padding: 1.5rem 2.2rem 0.8rem 2.2rem;
  display: flex;
  flex-direction: column;
align-items: center;
  position: relative;
}

body.dark header { 
  background: var(--glass-bg-dark); 
  border-color: rgba(255,255,255,0.14);
}

.header-glow {
  background: var(--glass-shine);
  position: absolute; 
  top:0; 
  left:0;
  height:100%; 
  width:100%;
  mix-blend-mode: lighten; 
  opacity: 0.2; 
  pointer-events: none; 
  border-radius: var(--radius-xl);
}

h1 {
  margin: 0;
  font-weight: 800;
  font-size: var(--font-size-heading);
  color: #6d5f52;
  letter-spacing: 0.08em;
  filter: brightness(0.97) contrast(1.05);
  z-index: 1;
 text-align: center; 
}

body.dark h1 { 
  color: #fffbe7; 
  filter: brightness(1.23); 
}

.last-modified {
  font-size: 1.08rem;
  font-style: italic;
  color: #806f62;
  margin-bottom: 0.8rem;
  z-index: 1;
 text-align: center; 
}

body.dark .last-modified { 
  color: #e7e0d9;
}

.export-import {
  margin-top: 1.3rem;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn, .add-btn, .action-btn {
  background: var(--primary-gradient);
  border: 1.4px solid var(--glass-border);
  color: #6d5f52;
  box-shadow: var(--shadow-button);
  border-radius: var(--radius-lg);
  font-weight: 650;
  font-size: 1.11rem;
  cursor: pointer;
  padding: 0.84rem 2.14rem;
  margin: 0.38rem 1.15rem 0.38rem 0;
  transition: background 0.10s, box-shadow 0.09s, color 0.14s;
  outline: none;
  display: inline-block;
}

.btn:hover, .add-btn:hover, .action-btn:hover,
.btn:focus, .add-btn:focus, .action-btn:focus {
  background: var(--accent-light);
  box-shadow: var(--shadow-shine);
  color: #3d3126;
}

.btn:active, .add-btn:active {
  background: var(--accent-dark);
  color: #fdeeda;
}

body.dark .btn, body.dark .add-btn, body.dark .action-btn {
  color: #fff;
}

body.dark .btn:hover, body.dark .add-btn:hover, body.dark .action-btn:hover {
  background: var(--teal-accent);
  color: #fff;
}

.btn-primary, .btn-secondary {
  min-width: 95px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  border: 1.4px solid var(--glass-border);
  padding: 0.92rem 1.62rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-button);
  cursor: pointer;
  font-size: 1.10rem;
}

.btn-primary:hover, .btn-primary:focus {
  background: var(--accent-light);
  color: #3d3126;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 2px solid var(--accent);
  padding: 0.92rem 1.62rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: none;
  cursor: pointer;
  font-size: 1.09rem;
}

.btn-secondary:hover, .btn-secondary:focus {
  background: var(--glass-bg);
  color: var(--accent-dark);
}

body.dark .btn-secondary:hover {
  background: var(--glass-bg-dark);
  color: #fefaf2;
}

/* ============================================
   FORM INPUTS & CONTROLS
   ============================================ */
.edit-textarea, input[type="text"], input[type="url"], input[type="number"], input[type="date"], select {
  font-family: inherit;
  font-size: 1.13rem;
  padding: 0.77rem 1.08rem;
  min-width: 0;
  border-radius: var(--radius-md);
 border: 1.8px solid #bbb5ac;
  box-sizing: border-box;
  background: var(--input-bg);
  color: #3d3126;
  margin: 0.22rem 0 0.4rem 0;
  width: 98%;
  max-width: 98vw;
  box-shadow: 0 1px 8px 0 rgba(155,136,120,0.08);
  resize: vertical;
  transition: border-color 0.14s, box-shadow 0.12s;
}

body.dark .edit-textarea, body.dark input, body.dark textarea, body.dark select {
  background: var(--input-bg-dark);
  color: #fefaf2;
  border-color: rgba(255,255,255,0.14);
}

.edit-textarea:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 5px 0 var(--teal-accent);
}

input[type="checkbox"] {
  appearance: none;
  background: var(--input-bg);
  border: 2.3px solid var(--accent);
  border-radius: 50%;
  width: 1.33em;
  height: 1.33em;
  margin-right: 0.39rem;
  cursor: pointer;
  outline: none;
  vertical-align: middle;
  display: inline-block;
  min-width: 1.33em;
  min-height: 1.33em;
  max-width: 1.33em;
  max-height: 1.33em;
}

.todo-list li, .todo-list li * {
  align-items: center !important;
}

body.dark input[type="checkbox"] {
  background: var(--input-bg-dark);
  border-color: var(--teal-accent);
}

input[type="checkbox"]:checked {
  background: var(--teal-accent);
  border-color: var(--accent-dark);
}

body.dark input[type="checkbox"]:checked {
  background: linear-gradient(120deg,#7ff7c6 0%,#52bea9 100%);
  border-color: #a5ffe2;
  box-shadow: 0 0 8px #7ff7c687;
}

input[type="checkbox"]:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0px 7px 0 var(--teal-accent);
}

/* ============================================
   MODAL SYSTEM
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw; 
  height: 100vh;
  background-color: rgba(232,208,177,0.12);
  display: flex; 
  justify-content: center; 
  align-items: center;
  z-index: 10010;
  backdrop-filter: blur(7px);
  padding: 2rem 1rem;
}

.modal-dialog {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  padding: 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-shine);
  max-width: 550px;
  width: 98%;
  max-height: 85vh;
  color: #3d3126;
  border: 2.3px solid var(--glass-border);
  text-align: left;
  font-family: var(--font-family);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.dark .modal-dialog {
  background: var(--glass-bg-dark);
  color: #fefaf2;
  border-color: rgba(255,255,255,0.14);
}

.modal-dialog h2 {
  margin: 0;
  padding: 2rem 2.11rem 1.2rem 2.11rem;
  font-size: 1.30rem;
  font-weight: 770;
  color: #3d3126;
  border-bottom: 1.5px solid var(--glass-border);
  flex-shrink: 0;
}

body.dark .modal-dialog h2 {
  color: #fefaf2;
  border-bottom-color: rgba(255,255,255,0.14);
}

.modal-message {
  padding: 1.5rem 2.11rem;
  white-space: pre-wrap;
  font-size: 1.09rem;
  overflow-y: auto;
  flex: 1;
}

body.dark .modal-message { 
  color: #fefaf2;
}

.modal-message::-webkit-scrollbar {
  width: 8px;
}

.modal-message::-webkit-scrollbar-track {
  background: rgba(172, 151, 132, 0.08);
  border-radius: 4px;
}

.modal-message::-webkit-scrollbar-thumb {
  background: var(--accent-light);
  border-radius: 4px;
}

body.dark .modal-message::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

body.dark .modal-message::-webkit-scrollbar-thumb {
  background: var(--teal-accent);
}

.modal-input {
  width: 100%;
  padding: 0.89rem 1.21rem;
  margin-bottom: 1.08rem;
  border: 1.7px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-size: 1.12rem;
  background: var(--input-bg);
  color: #3d3126;
}

body.dark .modal-input {
  background: var(--input-bg-dark);
  color: #fefaf2;
  border-color: rgba(255,255,255,0.14);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 1.13rem;
  padding: 1.2rem 2.11rem 2rem 2.11rem;
  border-top: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  flex-shrink: 0;
}

body.dark .modal-buttons {
  border-top-color: rgba(255,255,255,0.14);
  background: var(--glass-bg-dark);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 0;
}

.modal-form label {
  font-weight: 600;
  color: #654d36;
  margin-top: 0.5rem;
}

body.dark .modal-form label {
  color: #f7e9d4;
}

.modal-input, .modal-select {
  width: 100%;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1.5px solid var(--border-shine);
  background: var(--input-bg);
  color: #654d36;
  font-size: 1rem;
  font-family: var(--font-family);
  transition: border-color 0.2s;
}

.modal-input:focus, .modal-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 6px var(--accent);
}

body.dark .modal-input,
body.dark .modal-select {
  background: var(--input-bg-dark);
  color: #d2d6d7;
  border-color: #393f3e;
}


.modal-dialog input[type="password"] {
  width: 90% !important;         /* makes field shorter */
  max-width: 420px !important;   /* sets a clear pixel maximum */
  box-sizing: border-box;
  padding: 0.77rem 1.08rem;
  font-size: 1.13rem;
  margin: 0 auto;                /* centers the input if it's shorter than modal */
  display: block;                /* for centering effect */
}

body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100vh !important;
}


/* ============================================
   SHARED TABLE STYLES (Questions Tab)
   ============================================ */
.questions-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shine);
  margin-top: 1.4rem;
  overflow: hidden;
  position: relative;
}

body.dark .questions-table {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.14);
}

.questions-table th, .questions-table td {
  border: none;
  padding: 1.10rem 1.07rem;
  vertical-align: middle;
  font-size: 1.08rem;
  position: relative;
}

.questions-table th {
  background: var(--glass-shine), var(--accent-light);
  color: #5d5043;
  font-size: 1.10rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  text-align: left;
  box-shadow: none;
  padding: 1.15rem 1.10rem;
  white-space: nowrap;
}

body.dark .questions-table th {
  background: linear-gradient(120deg, rgba(75,73,88, 0.88) 0%, rgba(49,53,70, 0.89) 100%);
  color: #ffe;
  text-shadow: 0 2px 8px rgba(18,12,36,0.15);
}

.questions-table td {
  background: var(--glass-bg);
  border-radius: var(--radius-sm);
  color: #3d3126;
  font-weight: 500;
  box-shadow: 0 1px 6px rgba(155,136,120,0.10);
  max-width: 37vw;
  overflow-wrap: break-word;
  min-width: 115px;
}

body.dark .questions-table td {
  background: var(--glass-bg-dark);
  color: #fefaf2;
}

.questions-table tr:not(:last-child) td {
  border-bottom: 1.5px solid rgba(155,136,120,0.14);
}

/* ============================================
   PRODUCTS TAB
   ============================================ */
.products-tab-container {
  width: 100%;
  overflow-x: auto;
}

.products-table {
  width: 100%;
  min-width: 750px; /* REDUCED from 900px to 750px */
  border-collapse: separate;
  border-spacing: 0;
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shine);
  margin-top: 1.4rem;
  overflow: hidden;
}

body.dark .products-table {
  background: var(--glass-bg-dark);
  border-color: rgba(255, 255, 255, 0.14);
}

.products-table th {
  background: linear-gradient(120deg, rgba(172, 151, 132, 0.15) 0%, rgba(155, 136, 120, 0.12) 100%);
  color: #5d5043;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem;
  text-align: left;
  border-bottom: 1.5px solid var(--glass-border);
  white-space: nowrap;
}

body.dark .products-table th {
  background: linear-gradient(120deg, rgba(75, 73, 88, 0.3) 0%, rgba(49, 53, 70, 0.25) 100%);
  color: #ffe;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.products-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(155, 136, 120, 0.1);
  color: #3d3126;
  vertical-align: middle;
}

body.dark .products-table td {
  color: #fefaf2;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

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

.products-table .actions-cell {
  width: 80px;
  text-align: center;
  white-space: nowrap;
}

.priority-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.priority-high {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

body.dark .priority-high {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

body.dark .priority-medium {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.priority-low {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

body.dark .priority-low {
  background: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.products-cards-mobile {
  display: none;
}

/* ============================================
   PRODUCTS TAB - DESKTOP/TABLET OPTIMIZED
   ============================================ */

@media (min-width: 769px) {
  /* Launch Date column - slightly compressed */
  .products-table th:nth-child(3),
  .products-table td:nth-child(3) {
    width: 100px;
    white-space: nowrap;
  }

  /* Launch To column - COMPRESSED */
  .products-table th:nth-child(4),
  .products-table td:nth-child(4) {
    width: 110px !important;
    max-width: 110px;
    text-align: left;
    white-space: nowrap;
  }

  /* Price column - COMPRESSED (like Priority) */
  .products-table th:nth-child(5),
  .products-table td:nth-child(5) {
    width: 65px !important;
    max-width: 65px;
    text-align: center;
    white-space: nowrap;
  }

  /* Priority column - ensure consistent width */
  .products-table th:nth-child(6),
  .products-table td:nth-child(6) {
    width: 95px;
    text-align: center;
  }

  /* Actions column - ensure consistent width */
  .products-table th:nth-child(7),
  .products-table td:nth-child(7) {
    width: 95px;
    text-align: center;
  }
}

/* ============================================
   ROLES TAB
   ============================================ */
.roles-tab-container {
  width: 100%;
}

.role-panel {
  background: var(--glass-bg);
  border: 1.8px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shine);
  margin: 1.5rem 0;
  padding: 0;
  overflow: hidden;
}

body.dark .role-panel {
  background: var(--glass-bg-dark);
  border-color: rgba(255, 255, 255, 0.14);
}

.role-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(120deg, rgba(172, 151, 132, 0.15) 0%, rgba(155, 136, 120, 0.12) 100%);
  border-bottom: 1.5px solid var(--glass-border);
 gap: 1rem;
}

body.dark .role-panel-header {
  background: linear-gradient(120deg, rgba(75, 73, 88, 0.3) 0%, rgba(49, 53, 70, 0.25) 100%);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.role-panel-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #654d36;
  flex: 1;
  min-width: 0;
}


body.dark .role-panel-title {
  color: #f7e9d4;
}

.role-panel-header-actions {
  display: flex;
  gap: 0.5rem;
flex-shrink: 0;
}

.role-empty-message {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #8b7355;
  font-style: italic;
}

body.dark .role-empty-message {
  color: #b8a896;
}

.role-tasks-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.role-tasks-table thead {
  background: rgba(172, 151, 132, 0.08);
}

body.dark .role-tasks-table thead {
  background: rgba(255, 255, 255, 0.04);
}

.role-tasks-table th {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: #654d36;
  border-bottom: 1.5px solid var(--glass-border);
}

body.dark .role-tasks-table th {
  color: #f7e9d4;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.role-tasks-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(155, 136, 120, 0.1);
  color: #3d3126;
}

body.dark .role-tasks-table td {
  color: #fefaf2;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.role-tasks-table tbody tr:last-child td {
  border-bottom: none;
}

.task-desc-cell {
  font-weight: 500;
  max-width: 400px;
}

.task-checkbox-cell {
  text-align: center;
  width: 100px;
}

.task-others-cell {
  font-size: 0.95rem;
  color: #7a6b5d;
  width: 150px;
}

body.dark .task-others-cell {
  color: #b8a896;
}

.task-actions-cell {
  text-align: right;
  width: 100px;
}

.task-actions-cell .action-btn {
  margin-left: 0.3rem;
}

.role-tasks-cards {
  display: none;
}

.add-task-btn {
  display: block;
  width: calc(100% - 3rem);
  margin: 1rem 1.5rem;
  padding: 0.8rem;
  background: rgba(172, 151, 132, 0.12);
  border: 1.5px dashed var(--accent-light);
  border-radius: var(--radius-md);
  color: #654d36;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.add-task-btn:hover {
  background: rgba(172, 151, 132, 0.2);
  border-color: var(--accent);
  transform: translateY(-1px);
}

body.dark .add-task-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--teal-accent);
  color: #f7e9d4;
}

body.dark .add-task-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   TO-DO TAB
   ============================================ */
.todo-root {
  width: 100%;
}

.todo-tabs {
  display: flex;
  gap: 1.6rem;
  justify-content: flex-start;
  margin-bottom: 1.3rem;
  margin-top: 0.3rem;
}

.todo-tab-btn {
  padding: 0.7rem 2.2rem;
  font-size: 1.14rem;
  font-weight: 700;
  color: #78624b;
  background: var(--glass-bg);
  border-radius: 20px;
  border: 1.5px solid var(--accent-light);
  transition: all 0.23s cubic-bezier(.6,0,.6,1.2);
  box-shadow: 0 2px 6px 0 rgba(186,170,162,0.13);
  margin-bottom: 0.4rem;
  cursor: pointer;
  outline: none;
}

.todo-tab-btn.active,
.todo-tab-btn:focus {
  color: #2d2112;                       /* Deep brown for high contrast */
  background: var(--accent-light);       /* Lighter accent for contrast */
  border-color: var(--accent-dark);      /* Stronger border for selected */
  box-shadow: 0 4px 16px rgba(141,122,92,0.16);
  font-weight: 800;
  transform: translateY(-2px) scale(1.08);
}

body.dark .todo-tab-btn.active,
body.dark .todo-tab-btn:focus {
  color: #fff;
  background: var(--teal-accent);
  border-color: #fff6;
}


.todo-section {
  margin-bottom: 1.65rem;
}

.todo-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.05rem;
}

.todo-card {
  background: var(--glass-bg);
  border: 1.8px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-shine);
  padding: 1.19rem 1.29rem;
  margin-bottom: 0.8rem;
  position: relative;
  min-height: 28vh;
  animation: none;
  opacity: 1;
  transition: opacity 0.28s, transform 0.32s, box-shadow 0.2s;
  width: 100%;
  margin: 0 auto;
}

body.dark .todo-card {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.14);
}

.slidein {
  animation: cardSlideIn 0.23s cubic-bezier(.18,1.06,.35,.93);
}

.slideout-left {
  animation: cardSlideOutLeft 0.21s ease forwards;
}

.slideout-right {
  animation: cardSlideOutRight 0.21s ease forwards;
}

@keyframes cardSlideIn {
  from {opacity:0;transform:translateX(22vw) scale(0.93);}
  to {opacity:1;transform:translateX(0) scale(1);}
}

@keyframes cardSlideOutLeft {
  from { opacity:1;transform:translateX(0);}
  to { opacity:0; transform:translateX(-20vw);}
}

@keyframes cardSlideOutRight {
  from { opacity:1; transform:translateX(0);}
  to { opacity:0; transform:translateX(20vw);}
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0;
}

.todo-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.49rem 0;
  border-bottom: 1.09px solid rgba(155,136,120,0.15);
}

.todo-list li:last-child { 
  border-bottom: none; 
}

.todo-completed .todo-task-label {
  text-decoration: line-through;
  opacity: 0.42;
}

.todo-task-label {
  margin-right: 1.1rem;
  cursor: pointer;
  max-width: 210px;
  display: inline-block;
  vertical-align: middle;
}

.todo-edit-input {
  min-width: 172px !important;
  display: inline-block !important;
  font-size: 1.13rem !important;
  margin-right: 1.2rem !important;
}

.todo-doneby-select {
  margin: 0 0.8rem;
  padding: 0.39rem 0.73rem !important;
  border-radius: 12px;
  border: 1.1px solid var(--accent-light);
  background: var(--input-bg);
  font-size: 1.07rem;
  color: #654d36;
  min-width: 100px;
  width: 100px;
  max-width: 120px;
}

body.dark .todo-doneby-select {
  background: var(--input-bg-dark);
  color: #fee;
  border-color: #394343;
}

.todo-date-input, .todo-date-input-range, .todo-month-select {
  background: var(--input-bg);
  border-radius: var(--radius-md);
  border: 1.6px solid var(--border-shine);
  color: #654d36;
  font-size: 1.06rem;
  padding: 0.36rem 0.7rem;
  margin: 0 0.8rem 0 0.4rem;
  min-width: 75px !important;
  max-width: 75px !important;
  width: 75px !important;
  transition: border-color 0.22s;
  font-family: var(--font-family);
}

.todo-date-input-range {
  width: 75px !important;
  max-width: 75px !important;
}

body.dark .todo-date-input,
body.dark .todo-date-input-range,
body.dark .todo-month-select {
  background: var(--input-bg-dark);
  border-color: #393f3e;
  color: #d2d6d7;
  width: 75px !important;
  max-width: 75px !important;
}

.todo-date-input:focus,
.todo-date-input-range:focus,
.todo-month-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 6px var(--accent);
}

.empty-state {
  color: #8b7355;
  font-style: italic;
  padding: 1.5rem;
  text-align: center;
}

body.dark .empty-state {
  color: #b8a896;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  flex-wrap: wrap;
}

.project-meta {
  font-size: 0.9rem;
  color: #7a6b5d;
  padding: 0.3rem 0.6rem;
  background: rgba(172, 151, 132, 0.1);
  border-radius: 8px;
}

body.dark .project-meta {
  color: #b8a896;
  background: rgba(255, 255, 255, 0.08);
}

.project-select-label {
  display: block;
  font-weight: 600;
  margin: 1rem 0;
  font-size: 1.1rem;
  color: #654d36;
}

body.dark .project-select-label {
  color: #f7e9d4;
}

.project-select {
  width: 100%;
  max-width: 400px;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-shine);
  background: var(--input-bg);
  color: #654d36;
  font-size: 1.05rem;
  margin-top: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.project-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 6px var(--accent);
}

body.dark .project-select {
  background: var(--input-bg-dark);
  color: #d2d6d7;
  border-color: #393f3e;
}

.project-header {
  color: #654d36;
  margin: 1.5rem 0 1rem 0;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 0.5rem;
}

body.dark .project-header {
  color: #f7e9d4;
  border-color: var(--teal-accent);
}

.task-date, .task-doneby {
  font-size: 0.9rem;
  color: #7a6b5d;
  padding: 0.25rem 0.5rem;
  background: rgba(172, 151, 132, 0.08);
  border-radius: 6px;
  margin: 0 0.3rem;
}

body.dark .task-date,
body.dark .task-doneby {
  color: #b8a896;
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================
   SHARED CARD STYLES (Other Tabs)
   ============================================ */
.meeting-entry, .goal-entry, .resource-entry, .canvas-section {
  background: var(--glass-bg);
  border: 1.8px solid var(--glass-border);
  box-shadow: var(--shadow-shine);
  border-radius: var(--radius-lg);
  margin: 1.13rem 0;
  padding: 1.12rem 1.4rem 1.0rem 1.4rem;
}

body.dark .meeting-entry, body.dark .goal-entry, body.dark .resource-entry, body.dark .canvas-section {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.14);
}

.lean-card {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(80,55,18,0.12), 0 2px 14px rgba(120,90,35,0.08);
  border-radius: 2.2rem;
  margin: 0 auto;
  padding: 2.2rem 1.6rem 2.0rem 1.6rem;
  max-width: 580px;
  position: relative;
  transition: box-shadow 0.25s, transform 0.2s cubic-bezier(.32,1.14,.38,1.19);
  opacity: 0;
  transform: translateX(60px) scale(0.96);
  animation: cardEnter 0.38s ease forwards;
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateX(60px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

body.dark .lean-card {
  background: var(--glass-bg-dark);
  border-color: #432e1b;
}
.lean-card.active {
  box-shadow: 0 12px 36px rgba(90,65,40,0.22);
  transform: scale(1.03) translateY(-8px);
}
.segment-icon {
  font-size: 2rem;
  margin-right: 1.2rem;
  vertical-align: middle;
}
.card-heading[contenteditable], .card-prompt[contenteditable] {
  border-bottom: 1px dotted #cbb9a2;
  outline: none;
  transition: background 0.15s;
}
.card-heading:focus, .card-prompt:focus { background: #f9eeda22; }
body.dark .card-heading:focus, body.dark .card-prompt:focus { background: #30251d66; }
.idea-entry {
  display: flex;
  align-items: center;
  margin-bottom: 0.65rem;
}
.idea-text {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  color: inherit;
  padding: 0.32rem 0.12rem;
}
body.dark .idea-text { color: #fffce7; }
.edit-btn, .del-btn {
  background: none;
  border: none;
  font-size: 1.19rem;
  margin-left: 0.16rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.14s;
}
.edit-btn:hover, .del-btn:hover { opacity: 1; }
.add-idea-btn {
  background: var(--accent-light);
  color: #432e1b;
  border: none;
  border-radius: 1.3rem;
  padding: 0.34rem 0.88rem;
  font-weight: 600;
  margin-top: 0.7rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(150,130,91,0.09);
}
body.dark .add-idea-btn {
  background: var(--teal-accent);
  color: #fff;
}
.carousel-arrows {
  display: flex;
  justify-content: space-between;
  margin: 0.8rem 0;
}
.carousel-arrow {
  background: transparent;
  border: none;
  font-size: 2.2rem;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.17s, color 0.11s;
}
.carousel-arrow:hover { opacity: 1; color: var(--accent-dark); }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.27rem;
  margin-bottom: 3rem;    /* Increased spacing below the dots */
  margin-top: 0.6rem;       /* Optional: adds a bit of space above, for extra clarity */
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #b8a896;
  opacity: 0.5;
  transition: background 0.15s, opacity 0.16s;
}
.carousel-dot.active {
  background: var(--accent-dark);
  opacity: 1;
}

/* ============================================
   MOBILE SIDEBAR OVERLAY
   ============================================ */

/* Hamburger menu button - only visible on mobile */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10001;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  color: #654d36;
  cursor: pointer;
  box-shadow: var(--shadow-shine);
  transition: all 0.3s ease;
}

body.dark .mobile-menu-btn {
  background: var(--glass-bg-dark);
  color: #f7e9d4;
  border-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

/* Sidebar backdrop - dark overlay when sidebar is open */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Mobile sidebar adjustments */

@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  /* Show hamburger menu */

.modal-dialog {
  width: 94%;
  max-width: 94vw;
  margin: 0 auto;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Enables smooth momentum scroll on iOS/mobile */
margin: 1.5rem auto 0 auto;
}


  .modal-message {
    padding: 1rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .modal-form {
    max-width: 100%;
    overflow-x: hidden;
  }

  .modal-form label {
    font-size: 0.95rem;
  }

  /* Ensure all form inputs stay within modal */
  .modal-input,
  .modal-select,
  .modal-form input[type="text"],
  .modal-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 0.7rem;
    font-size: 1rem;
  }

  /* Fix checkbox containers */
  .modal-form > div {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Prevent text overflow */
  .modal-form label {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Modal buttons stack on mobile (already in your CSS, but ensure it's there) */
  .modal-buttons {
    padding: 1rem;
    flex-direction: column;
  }

  .modal-buttons .btn-primary,
  .modal-buttons .btn-secondary {
    width: 100%;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Remove grid layout on mobile */
  #app {
    display: block;
    position: relative;
  }

  /* Sidebar - hidden by default, overlays when open */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Hidden off-screen */
    width: 260px;
    height: 100vh;
    z-index: 9999;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    box-shadow: none;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
 overflow-y: auto;
  -webkit-overflow-scrolling: touch;
padding-bottom: 80px;
  }

  .sidebar.open {
    transform: translateX(280px); /* Slide in */
    opacity: 1;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  /* Hide toggle button inside sidebar on mobile */
  #toggle-sidebar {
    display: none;
  }

  /* Main content - full width */
  main {
    width: 100%;
    padding: 5rem 1rem 2rem 1rem; /* Extra top padding for hamburger */
    margin-left: 0;
    min-height: 100vh;
  }

  /* Header adjustments */
  header {
    margin-top: 0;
    padding: 1.2rem 1.5rem 1rem 1.5rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }
}


/* ============================================
   RESPONSIVE / MOBILE
   ============================================ */
@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  .questions-table { 
    display: block; 
    overflow-x:auto; 
    width: 100%; 
  }
  .questions-table thead { display: block; }
  .questions-table tbody { display: block; }
  .questions-table tr { display: block; }
  .questions-table th, .questions-table td {
    display: inline-block;
    vertical-align: top;
    min-width: 220px;
    max-width: 370px;
    white-space: normal;
    box-sizing: border-box;
  }
  .questions-table td { min-width: 190px;}
  
  .todo-columns { 
    grid-template-columns: 1fr; 
    gap: 1.02rem; 
  }
  
  .todo-card { 
    margin-left: 0; 
    margin-right: 0; 
    width: 98vw;
  }

 * {
    max-width: 100vw;
  }

  /* Better card spacing on mobile */
  .meeting-entry, .goal-entry, .resource-entry, .canvas-section, .todo-card,
  .role-panel, .product-card {
    margin: 1.2rem 0.5rem;
  }

  /* To-Do layout for mobile/tablet portrait */
  .todo-columns {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .todo-root, .todo-section {
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .todo-card {
    width: 98vw !important;
    max-width: 480px !important; /* Limit for large devices */
    margin: 1.2rem auto !important;
    box-sizing: border-box !important;
  }
  .todo-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.7rem !important;
    width: 100% !important;
    padding: 0 0.5rem !important;
    margin-top: 0.7rem !important;
    margin-bottom: 1.3rem !important;
  }
  .todo-tab-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0.65rem 0.3rem !important;
    font-size: 1.08rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    line-height: 1.3 !important;
    border-radius: 18px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: var(--glass-bg) !important;
  }

  body.dark .todo-tab-btn.active,
  body.dark .todo-tab-btn:focus {
    color: #fff !important;
    background: var(--teal-accent) !important;
    border-color: #fff6 !important;
  }

  /* Questions table - convert to stacked cards on mobile */
  .questions-table {
    display: block;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .questions-table thead {
    display: none; /* Hide table headers */
  }

  .questions-table tbody {
    display: block;
  }

  .questions-table tr {
    display: block;
    background: var(--glass-bg);
    border: 1.8px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-shine);
    padding: 1rem;
    margin-bottom: 1rem;
  }

  body.dark .questions-table tr {
    background: var(--glass-bg-dark);
    border-color: rgba(255, 255, 255, 0.14);
  }

  .questions-table td {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0.5rem 0;
    border: none;
    box-shadow: none;
  }

  .questions-table td:before {
    content: attr(data-label);
    font-weight: 700;
    display: block;
    margin-bottom: 0.3rem;
    color: #654d36;
  }

  body.dark .questions-table td:before {
    color: #f7e9d4;
  }

  /* Buttons full width on mobile */
  .btn, .add-btn {
    width: 100%;
    margin: 0.5rem 0;
  }

  .export-import {
    flex-direction: column;
  }

  .export-import .btn {
    width: 100%;
  }

 /* Products Tab - Mobile Cards */
  .products-table {
    display: none;
  }

  .products-cards-mobile {
    display: block;
    padding: 1rem 0;
  }

  .product-card {
    background: var(--glass-bg);
    border: 1.8px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-shine);
    padding: 1.2rem;
    margin-bottom: 1rem;
  }

  body.dark .product-card {
    background: var(--glass-bg-dark);
    border-color: rgba(255, 255, 255, 0.14);
  }

  .product-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #654d36;
    margin: 0 0 0.5rem 0;
  }

  body.dark .product-card-title {
    color: #f7e9d4;
  }

  .product-card-desc {
    font-size: 1rem;
    color: #7a6b5d;
    margin: 0 0 1rem 0;
    line-height: 1.5;
  }

  body.dark .product-card-desc {
    color: #b8a896;
  }

  .product-card-details {
    font-size: 0.95rem;
    color: #654d36;
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: rgba(172, 151, 132, 0.08);
    border-radius: 8px;
  }

  .product-card-details div {
    margin-bottom: 0.4rem;
  }

  .product-card-details div:last-child {
    margin-bottom: 0;
  }

  body.dark .product-card-details {
    color: #d2d6d7;
    background: rgba(255, 255, 255, 0.06);
  }

  .product-card-actions {
    display: flex;
    gap: 0.6rem;
  }

  .product-card-actions .btn {
    flex: 1;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
  }

  /* Roles Tab - Mobile Cards */
  .role-tasks-table {
    display: none;
  }

  .role-tasks-cards {
    display: block;
    padding: 1rem;
  }

  .role-task-card {
    background: rgba(172, 151, 132, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
  }

  body.dark .role-task-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .task-card-desc {
    font-size: 1rem;
    font-weight: 500;
    color: #654d36;
    margin: 0 0 0.8rem 0;
  }

  body.dark .task-card-desc {
    color: #f7e9d4;
  }

  .task-card-assigned {
    font-size: 0.9rem;
    color: #7a6b5d;
    margin-bottom: 1rem;
  }

  body.dark .task-card-assigned {
    color: #b8a896;
  }

  .task-card-actions {
    display: flex;
    gap: 0.6rem;
  }

  .task-card-actions .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }
  
}

@media (max-width: 600px) {
  main {
    padding: 1rem 0.1rem 1.4rem 0.1rem;
    min-width: 0;
  }
  
  .questions-table th, .questions-table td {
    font-size: 1.00rem;
    padding: 0.60rem 0.6rem;
    min-width: 130px;
    max-width: 180px;
  }
  
  .questions-table tr {
    margin-bottom: 0.6rem;
  }
  
  .todo-root, .todo-card { 
    width:98vw; 
    min-width:0; 
  }
  
  .todo-tabs { 
    gap:0.42rem; 
  }
  
  /* Modal Mobile Adjustments */
  .modal-overlay {
    padding: 1rem 0.5rem;
  }

  .modal-dialog {
    max-width: 95%;
    max-height: 90vh;
  }

  .modal-dialog h2 {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    font-size: 1.2rem;
  }

  .modal-message {
    padding: 1.2rem 1.5rem;
  }

  .modal-buttons {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    flex-direction: column;
  }

  .modal-buttons .btn-primary,
  .modal-buttons .btn-secondary {
    width: 100%;
  }

  .role-panel-header {
    padding: 1rem 0.8rem; /* Reduced from 1.2rem 1.5rem */
  }
  
  .role-panel-title {
    font-size: 1rem; /* Smaller font */
  }
  
  .role-panel-header-actions {
    gap: 0.4rem; /* Tighter gap between buttons */
  }

}

body.dark .todo-tab-btn.active,
body.dark .todo-tab-btn:focus {
  color: #fff !important;
  background: var(--teal-accent) !important;
  border-color: #fff6 !important;
}

@media (max-width: 900px), (max-width: 768px) {
 .modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 10010;
    padding: 0;
    overflow: hidden;
    backdrop-filter: blur(7px);
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
  }
.modal-dialog {
    width: 96vw;
    max-width: 96vw;
    margin: 0 auto;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-sizing: border-box;
    align-self: flex-start;
    margin-top: 4vh;
  }

  .modal-dialog h2 {
    padding: 0.8rem 1.2rem 0.6rem 1.2rem;
    font-size: 1.1rem;
    margin-bottom: 0;
    border-bottom-width: 1px;
    flex-shrink: 0;
  }

 .modal-message,
  .modal-form {
    flex: 0 1 auto;
    max-height: 55vh; /* <--- RESTORED TO 55vh TO FIX SCROLLING */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.8rem 1.2rem;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
  }

  /* The footer area (buttons) needs to be rigid */
  .modal-footer, 
  .modal-dialog > div:last-child {
      flex-shrink: 0;
      padding-bottom: env(safe-area-inset-bottom, 20px); /* Handle iPhone home bar */
  }

 .modal-form input[type="text"],
  .modal-form input[type="url"],
  .modal-form input[type="number"],
  .modal-form input[type="date"],
  .modal-form input[type="password"],
  .modal-form select,
  .modal-input {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.7rem;
  }

  /* Standardize textarea height */
  .modal-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 80px;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.7rem;
  }


  /* Add spacing between nested credential inputs */
  .modal-form > div input[type="text"],
  .modal-form > div input[type="password"] {
    margin-bottom: 0.8rem;
  }

  .modal-buttons {
    flex-shrink: 0;
    padding: 0.8rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
  }

  body.dark .modal-buttons {
    background: var(--glass-bg-dark);
    border-top-color: rgba(255,255,255,0.14);
  }

  .modal-buttons .btn-primary,
  .modal-buttons .btn-secondary {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

 #theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    left: auto;
    margin: 0;
    
    /* ADD THESE TOO: */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Reduce tab button height for compactness */
  .tab-btn {
    min-height: 44px; /* Minimum for touch targets */
    padding: 0.6rem 1rem; /* Reduced from default */
    margin: 0.2rem 0; /* Tighter spacing */
    font-size: 1rem;
    line-height: 1.2;
  }
/* Adjust sidebar tabs container to account for top icons */
  .sidebar .tab-list {
    margin-top: 4rem; /* Space for hamburger and theme toggle at top */
    padding-bottom: 2rem; /* Safe zone at bottom */
  }
}

/* ============================================
   RESOURCES TAB: DESKTOP & GENERAL
   ============================================ */
.resources-tab-container {
  width: 100%;
  padding: 1.4rem 0 1.4rem 0;
}

.category-management {
  margin-bottom: 1.1rem;
  border-bottom: 1.5px solid var(--glass-border);
  padding-bottom: 0.47rem;
}

.category-list {
  list-style: none;
  display: flex;
  gap: 0.68rem;
  flex-wrap: wrap;
  margin: 0.35rem 0;
  padding-left: 0;
}

.category-list li {
  background: var(--accent-light);
  color: #6d5f52;
  border-radius: var(--radius-lg);
  font-size: 1.02rem;
  font-weight: 650;
  padding: 0.22rem 0.72rem;
  user-select: none;
  letter-spacing: 0.02em;
}

body.dark .category-list li {
  background: var(--accent);
  color: #fefaf2;
}

.resource-list-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
  gap: 1.35rem;
  margin: 1.2rem 0 1.4rem 0;
}


.resource-card {
  background: var(--glass-bg);
  border: 1.8px solid var(--glass-border);
  box-shadow: var(--shadow-shine);
  border-radius: var(--radius-lg);
  margin: 0;
  padding: 1.2rem 1.55rem 1.05rem 1.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

body.dark .resource-card {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.14);
}

.resource-card h3 {
  margin: 0 0 0.44rem 0;
  font-size: 1.23rem;
  font-weight: 800;
  color: #6d5f52;
  letter-spacing: 0.04em;
}

body.dark .resource-card h3 {
  color: #ffeebe;
}

.url-line {
  display: flex;
  align-items: center;
  gap: 0.54rem;
}

.url-line a {
  color: var(--accent-dark);
  text-decoration: underline;
  font-size: 1.07rem;
  font-weight: 550;
  margin-right: 0.2rem;
  flex: 1;
  max-width: 72vw;
  overflow-wrap: anywhere;
  word-break: break-all;
}

body.dark .url-line a {
  color: #ffeebe;
}

.btn-copy {
  background: var(--primary-gradient);
  border: 1.4px solid var(--glass-border);
  color: #6d5f52;
  border-radius: var(--radius-md);
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.41rem 1.09rem;
  margin: 0;
  box-shadow: var(--shadow-button);
  transition: background 0.13s;
  display: inline-block;
}

.btn-copy:hover {
  background: var(--accent-light);
  color: #3d3126;
}

body.dark .btn-copy {
  color: #fff;
}

body.dark .btn-copy:hover {
  background: var(--teal-accent);
  color: #fff;
}

.category-tag {
  font-weight: 600;
  color: #6d5f52;
  background: var(--accent-light);
  border-radius: 19px;
  padding: 0.14rem 0.7rem;
  font-size: 0.89rem;
  align-self: flex-start;
  user-select: none;
  margin-top: 0.08rem;
  margin-bottom: 0.08rem;
  letter-spacing: 0.03em;
}

body.dark .category-tag {
  background: var(--accent);
  color: #fefaf2;
}

.card-action-buttons {
  display: flex;
  gap: 0.9rem;
  margin-top: 1rem;
}

.card-action-buttons .btn {
  flex: 1;
  font-size: 1rem;
  padding: 0.72rem 0.6rem;
  margin: 0.11rem 0;
}

.view-creds-btn {
  margin-top: 0.6rem;
}

.credentials-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-copy-group {
  display: flex;
  gap: 0.51rem;
  align-items: center;
  width: 100%;
}

.input-copy-group .modal-input {
  flex: 1;
  min-width: 0;
}

/* ============================================
   RESOURCES TAB: TABLET RESPONSIVE (2 columns)
   ============================================ */
@media (min-width: 769px) and (max-width: 1200px) {
  .resource-list-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
}
/* ============================================
   RESOURCES TAB: MOBILE & TABLET RESPONSIVE
   ============================================ */
@media (max-width: 900px), (max-width: 768px) {
  .resources-tab-container {
    padding: 1.09rem 0.3rem 1.09rem 0.3rem;
  }
  .category-management {
    margin-bottom: 0.7rem;
    padding-bottom: 0.2rem;
  }
  .category-list {
    gap: 0.37rem;
    margin: 0.18rem 0;
    font-size: 0.99rem;
  }
  .resource-list-container {
 display: flex;          /* ← Add this line */
  flex-direction: column; /* ← Add this line */
  gap: 0.84rem;
  margin: 0.8rem 0 1rem 0;
  }
  .resource-card {
    margin: 0.3rem 0;
    padding: 0.91rem 1.09rem 0.9rem 1.09rem;
    border-radius: var(--radius-lg);
    gap: 0.51rem;
  }
  .resource-card h3 {
    font-size: 1.12rem;
    margin-bottom: 0.36rem;
  }
  .url-line {
    font-size: 1rem;
    gap: 0.37rem;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0.11rem;
  }
  .url-line a {
    font-size: 0.97rem;
    max-width: 99vw;
    margin-bottom: 0.10rem;
  }
  .btn-copy {
    font-size: 0.93rem;
    padding: 0.39rem 0.93rem;
    border-radius: var(--radius-md);
    margin: 0.09rem 0;
    width: auto;
    min-width: 90px;
  }
  .category-tag {
    font-size: 0.77rem;
    padding: 0.12rem 0.34rem;
    margin-top: 0.04rem;
    margin-bottom: 0.04rem;
  }
  .card-action-buttons {
    flex-direction: column;
    gap: 0.42rem;
    margin-top: 0.72rem;
    width: 100%;
  }
  .card-action-buttons .btn {
    width: 100%;
    font-size: 0.98rem;
    padding: 0.68rem 0.53rem;
    margin: 0.13rem 0;
  }
  .view-creds-btn {
    margin-top: 0.44rem;
    width: 100%;
  }
  .credentials-container {
    gap: 0.51rem;
  }
 
   }

/* ============================================
   RESOURCES TAB: DARK MODE
   ============================================ */
body.dark .resource-card,
body.dark .category-list li {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.14);
}

body.dark .resource-card h3,
body.dark .category-tag {
  color: #ffeebe;
}

/* ============================================
   RESOURCES TAB: OPEN LINK
   ============================================ */

/* Open Link Button - Centered and Prominent */
.btn-open-link {
  background: var(--primary-gradient);
  border: 1.8px solid var(--glass-border);
  color: #6d5f52;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.75rem 2rem;
  margin: 0.5rem auto;
  box-shadow: var(--shadow-button);
  transition: all 0.2s ease;
  display: block;
  width: fit-content;
  text-align: center;
  letter-spacing: 0.03em;
}

.btn-open-link:hover {
  background: var(--accent-light);
  color: #3d3126;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 136, 120, 0.25);
}

body.dark .btn-open-link {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark .btn-open-link:hover {
  background: var(--teal-accent);
  color: #fff;
}

/* Mobile adjustments for Open Link button */
@media (max-width: 900px), (max-width: 768px) {
  .btn-open-link {
    font-size: 1rem;
    padding: 0.65rem 1.5rem;
    width: 100%;
    margin: 0.4rem 0;
  }
}

/* ============================================
   TABLET MODAL FIX (All orientations)
   ============================================ */

@media (min-width: 768px) and (max-width: 1366px) {
  .modal-overlay {
    align-items: flex-start !important;
  }
  .modal-dialog {
    margin-top: 3vh !important;
    max-height: 75vh !important;
  }
  .modal-form,
  .modal-message {
    max-height: 45vh !important;
  }
  
  /* Fix textarea height for iPad */
  .modal-form textarea {
    min-height: 80px !important; /* Match mobile behavior */
  }
}

/* ============================================
   MEETINGS TAB CUSTOM STYLES
   ============================================ */
.meetings-tab-container {
  background: var(--glass-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-shine);
  margin: 0 auto;
  padding: 2.2rem 2rem 2rem 2rem;
  max-width: 980px;
  min-width: 310px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Reduce top gap under filter/nav on desktop/tablet */
.meetings-tab-container > .filter-row,
.meetings-tab-container > .calendar-nav-row {
  margin-bottom: 0.7rem;
}

/* Calendar grid: fix table cell alignment */
.questions-table.meetings-calendar {
  table-layout: fixed;
  width: 100%;
  margin-top: 0.6rem;
}

.questions-table.meetings-calendar th,
.questions-table.meetings-calendar td {
  padding: 0.6rem 0.3rem;
  height: 2.7rem;
  min-width: 38px;
  max-width: 70px;
  text-align: center;
  vertical-align: middle;
}

.questions-table.meetings-calendar th {
  background: var(--glass-shine);
  color: #6d5f52;
  font-size: 1.07rem;
}

/* Responsive: mobile grid becomes compact with readable date squares */
@media (max-width: 700px) {
  .meetings-tab-container {
    padding: 1.1rem 0.13rem 1rem 0.13rem;
    max-width: 97vw;
    font-size: 0.98rem;
  }

  .questions-table.meetings-calendar {
    font-size: 0.92rem;
  }
  .questions-table.meetings-calendar th,
  .questions-table.meetings-calendar td {
    padding: 0.35rem 0.05rem;
    height: 2.1rem;
    min-width: 27px;
    max-width: 34px;
  }
}

/* Meeting filter buttons: reduce gap, enable row wrap */
.meetings-tab-container .btn,
.meetings-tab-container .add-btn,
.meetings-tab-container .action-btn {
  margin-bottom: 0.45rem;
  margin-right: 0.7rem;
}

/* Calendar nav & filter bar as horizontal row */
.meetings-tab-container .filter-row,
.meetings-tab-container .calendar-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.33rem;
  align-items: center;
}

/* Add member button range for Members tab (optional if editing Members tab CSS) */
.lean-card .add-btn {
  margin-top: 1.2rem;
  padding: 0.83rem 2rem;
}

.meetings-tab-container {
  transition: none !important;
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.meeting-date-glow {
  background: linear-gradient(135deg, #3777BF 0%, #38e8d1 100%) !important;
  border: 2px solid #38e8d1 !important;
  border-radius: 12px !important;
  box-shadow: 0 0 8px 3px ##38e8d199, 0 6px 16px ##38e8d144 !important;
  color: #fff !important;
  font-weight: 700 !important;
  position: relative;
  z-index: 2;
  transition: box-shadow 0.22s, background 0.22s;
}
.meeting-date-glow:hover {
  box-shadow: 0 0 16px 5px ##38e8d1BB, 0 8px 24px ##38e8d166 !important;
  background: linear-gradient(135deg, #4A90E2 0%, #3577BF 100%) !important;
  transform: scale(1.08);
}


.questions-table td {
  box-sizing: border-box;
  border: 2px solid transparent; /* Reserve space */
  border-radius: 12px;
  transition: border 0.18s, box-shadow 0.16s;
}

/* Member management row: wrap members, prevent overflow */
.member-management-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  max-width: 100%;
}

.member-card {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: #f1ede7;
  border-radius: 12px;
  padding: 0.42rem 0.78rem;
  font-weight: 600;
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: fit-content;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1rem;
}




/* ============================================
   MEETINGS TAB: MOBILE & TABLET RESPONSIVE
   ============================================ */
@media (max-width: 900px), (max-width: 768px) {
  .meetings-tab-container {
    padding: 1.08rem 0.3rem 1.1rem 0.3rem;
    max-width: 98vw;
    min-width: 0;
    font-size: 1rem;
    overflow-x: hidden;
  }

  /* + Add Member button: full width, separate row at top */
  .meetings-tab-container > .add-btn:first-of-type {
    width: 100% !important;
    display: block !important;
    margin: 0 0 0.6rem 0 !important;
    font-size: 1.06rem;
    padding: 0.66rem 0;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
  }

  /* Member management row: 2-column grid */
  .member-management-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.44rem 0.28rem !important;
    margin-bottom: 0.65rem !important;
    width: 100%;
  }

  /* Member cards in grid */
.member-card {
    width: 100% !important;
    font-size: 0.88rem !important;
    padding: 0.38rem 0.42rem !important;
    margin: 0 !important;
    border-radius: var(--radius-md) !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.15rem !important;
    flex-wrap: nowrap !important;
    min-height: 38px;
  }

.member-card > span:first-child {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
  }

  /* Action buttons inside member cards */
  .member-card .action-btn {
    font-size: 1.05rem !important;
    padding: 0.08rem 0.18rem !important;
    margin: 0 !important;
    min-width: 26px;
    flex-shrink: 0;
    background: transparent;
    border: none;
  }

  /* Filter Buttons: Vertical stack, full-width */
  .filter-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.56rem !important;
    margin-bottom: 0.69rem !important;
    width: 100%;
  }
  .filter-row .btn {
    width: 100% !important;
    justify-content: center;
    font-size: 1.08rem;
    padding: 0.76rem 0;
    border-radius: 1.4rem;
    margin: 0 !important;
    box-sizing: border-box;
  }

  /* Calendar Navigation Row */
  .meetings-tab-container .calendar-nav-row {
    flex-wrap: wrap;
    gap: 0.38rem;
    margin-bottom: 0.32rem;
    align-items: center;
    font-size: 1.02rem;
  }
  .meetings-tab-container .calendar-nav-row .btn {
    font-size: 1.03rem;
    padding: 0.54rem 0.86rem;
    min-width: 86px;
  }

  /* Calendar Grid: 7-column table layout */
  .questions-table.meetings-calendar {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin-top: 0.45rem;
    font-size: 0.99rem;
    display: table !important;
  }
  .questions-table.meetings-calendar thead {
    display: table-header-group !important;
  }
  .questions-table.meetings-calendar tbody {
    display: table-row-group !important;
  }
  .questions-table.meetings-calendar tr {
    display: table-row !important;
    width: 100%;
  }
  .questions-table.meetings-calendar th,
  .questions-table.meetings-calendar td {
    display: table-cell !important;
    width: 14.28%;
    min-width: 0;
    max-width: none;
    padding: 0.21rem 0.03rem !important;
    height: 2.2rem;
    box-sizing: border-box;
    font-size: 0.94rem;
    text-align: center !important;
    vertical-align: middle !important;
    background: none;
    border-radius: 7px;
    overflow: visible;
  }
  .questions-table.meetings-calendar th {
    background: var(--glass-shine);
    color: #7b695a;
    font-size: 1.03rem;
    font-weight: 600;
  }

  /* Meeting highlight cell */
  .meeting-date-glow {
    border-radius: 9px !important;
    box-shadow: 0 0 7px 2px #38e8d199, 0 4px 10px #38e8d188 !important;
    background: #38e8d1 !important;
    color: #fff !important;
    border: 2px solid #38e8d1 !important;
    font-weight: 700 !important;
    transition: all 0.17s cubic-bezier(0.42, 0, 0.21, 1);
  }

  /* Meeting cards */
  .meetings-list {
    gap: 0.67rem;
    margin: 0.38rem 0;
  }
  .meeting-card {
    margin: 0.13rem 0;
    padding: 0.62rem 0.73rem;
    border-radius: 1.07rem;
    font-size: 0.93rem;
  }
  .meeting-card h3 {
    font-size: 1.04rem;
    margin-bottom: 0.17rem;
  }

  /* Meeting action buttons */
  .meeting-actions {
    flex-direction: column !important;
    gap: 0.37rem;
    margin-top: 0.52rem;
    width: 100%;
  }
  .meeting-actions .btn,
  .meeting-actions .action-btn {
    width: 100%;
    font-size: 0.97rem;
    padding: 0.54rem 0.39rem;
    margin: 0.11rem 0;
  }

  /* Add Meeting button: full width at bottom */
  .meetings-tab-container > .add-btn:last-of-type {
    width: 100%;
    margin-top: 0.63rem;
    font-size: 1.03rem;
    padding: 0.78rem 0;
    box-sizing: border-box;
    border-radius: 1.21rem;
  }

  /* Modal buttons: ensure clickable on mobile */
  .modal-actions .btn {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  }
}
@media (max-width: 900px), (max-width: 768px) {
  /* Meeting modal specific styling */
  .meeting-modal-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.5rem 0;
  }

  /* Attendees row in meeting modal */
  .meeting-modal-form > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.6rem !important;
    margin-bottom: 0.5rem !important;
  }

  /* Attendee checkbox pairs */
  .meeting-modal-form > div > span {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    margin: 0 !important;
    padding: 0.3rem 0;
  }

  /* Checkbox styling in meeting modal */
  .meeting-modal-form input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  /* Label styling in meeting modal */
  .meeting-modal-form label {
    font-size: 1rem;
    flex: 1;
  }

  /* Modal inputs in meeting modal */
  .meeting-modal-form .modal-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 0.6rem 0.8rem;
  }

  /* Textarea in meeting modal */
  .meeting-modal-form textarea {
    min-height: 60px;
    resize: vertical;
  }
}

/* ============================================
   MEETING MODAL: DATE & TIME INPUTS FIX
   ============================================ */

/* Ensure date and time inputs show full dropdown width */
.meeting-modal-form input[type="date"],
.meeting-modal-form input[type="time"] {
  width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.7rem 0.8rem !important;
  font-size: 1rem !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

/* Mobile: ensure inputs remain full-width */
@media (max-width: 900px), (max-width: 768px) {
  .meeting-modal-form input[type="date"],
  .meeting-modal-form input[type="time"] {
    width: 100% !important;
    padding: 0.65rem 0.75rem !important;
    font-size: 1.05rem !important;
  }
}


/* ============================================
   TO-DO TAB MOBILE FIXES - CORRECTED OVERLAP
   ============================================ */

@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  
  /* Monthly Projects: Proper spacing to avoid overlap */
  .project-item {
    display: grid !important;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    gap: 0.6rem 0.8rem;
    align-items: center;
    padding: 0.8rem;
    background: rgba(172, 151, 132, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 0.8rem;
  }

  body.dark .project-item {
    background: rgba(255, 255, 255, 0.04);
  }

  /* Row 1: Checkbox + Project Name */
  .project-item input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
  }

  .project-item .todo-task-label {
    grid-column: 2;
    grid-row: 1;
    font-weight: 600;
    font-size: 1.05rem;
  }

  /* Row 2: Month and Done by - full width, no overlap */
  .project-item .project-meta {
    grid-column: 1 / 3;
    font-size: 0.9rem;
    color: #7a6b5d;
  }

  .project-item .project-meta:nth-of-type(1) {
    grid-row: 2;
  }

  .project-item .project-meta:nth-of-type(2) {
    grid-row: 3;
  }

  body.dark .project-item .project-meta {
    color: #b8a896;
  }

  /* Row 4: Edit and Delete buttons side-by-side */
  .project-item .action-btn {
    grid-row: 4;
    font-size: 1.3rem;
    padding: 0.4rem 0.8rem;
    background: rgba(172, 151, 132, 0.12);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
    justify-self: start;
  }

  .project-item .action-btn:nth-of-type(1) {
    grid-column: 1;
  }

  .project-item .action-btn:nth-of-type(2) {
    grid-column: 2;
  }

  body.dark .project-item .action-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }

  /* Weekly/Daily Tasks: Keep as-is */
  .todo-list > li:not(.project-item) {
    display: grid !important;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 0.5rem 0.6rem;
    align-items: center;
    padding: 0.8rem;
    background: rgba(172, 151, 132, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 0.8rem;
  }

  body.dark .todo-list > li:not(.project-item) {
    background: rgba(255, 255, 255, 0.04);
  }

  .todo-list > li input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
  }

  .todo-list > li .todo-task-label {
    grid-column: 2 / 5;
    grid-row: 1;
    font-weight: 600;
    font-size: 1.02rem;
  }

  .todo-list > li .task-date {
    grid-column: 1;
    grid-row: 2;
    font-size: 0.88rem;
    color: #7a6b5d;
  }

  .todo-list > li .task-doneby {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.88rem;
    color: #7a6b5d;
  }

  body.dark .todo-list > li .task-date,
  body.dark .todo-list > li .task-doneby {
    color: #b8a896;
  }

  .todo-list > li .action-btn {
    grid-row: 2;
    font-size: 1.3rem;
    padding: 0.4rem 0.6rem;
    background: rgba(172, 151, 132, 0.12);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
  }

  .todo-list > li .action-btn:nth-of-type(1) {
    grid-column: 3;
  }

  .todo-list > li .action-btn:nth-of-type(2) {
    grid-column: 4;
  }

  body.dark .todo-list > li .action-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
  }
}


/* ============================================
   GOALS & KPIs TAB - COMPLETE REDESIGN
   ============================================ */

.goals-container {
  max-width: 1200px;
  margin: 0 auto;
}

.goals-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.year-comparison-selector {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.year-selector {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--glass-border);
  background: var(--glass-bg);
  color: #654d36;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.year-selector:hover {
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

body.dark .year-selector {
  background: var(--input-bg-dark);
  color: #d2d6d7;
  border-color: rgba(255, 255, 255, 0.2);
}

.goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Always 2 columns, never more */
  gap: 2rem;
  margin-bottom: 2rem;
}

.goal-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-xl);
  border: 2px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.goal-card.goal-achieved {
  border-color: #22c55e;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.3);
  animation: pulse-success 2s ease-in-out infinite;
}

.goal-card.goal-missed {
  border-color: #f59e0b;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.2);
}

@keyframes pulse-success {
  0%, 100% { box-shadow: 0 0 24px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 32px rgba(34, 197, 94, 0.5); }
}

body.dark .goal-card {
  background: var(--glass-bg-dark);
  border-color: rgba(255, 255, 255, 0.14);
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.goal-name-input {
  font-size: 1.3rem;
  font-weight: 700;
  color: #3d3126;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.3rem 0;
  width: 70%;
  transition: border-color 0.2s;
}

.goal-name-input:focus {
  outline: none;
  border-bottom-color: var(--teal-accent);
}

body.dark .goal-name-input {
  color: #fefaf2;
}

.goal-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(172, 151, 132, 0.15);
  color: #654d36;
}

body.dark .goal-type-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #d2d6d7;
}

.goal-target-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(145, 198, 189, 0.08);
  border-radius: var(--radius-md);
  border: 1px dashed var(--teal-accent);
}

.goal-target-label {
  font-size: 0.9rem;
  color: #654d36;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

body.dark .goal-target-label {
  color: #d2d6d7;
}

.goal-target-input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 2px solid var(--glass-border);
  background: var(--input-bg);
  color: #654d36;
  text-align: center;
}

body.dark .goal-target-input {
  background: var(--input-bg-dark);
  color: #fefaf2;
  border-color: rgba(255, 255, 255, 0.2);
}

.quarterly-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quarter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.quarter-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.quarter-label {
  min-width: 40px;
  font-weight: 700;
  color: #654d36;
  font-size: 1.1rem;
}

body.dark .quarter-label {
  color: #d2d6d7;
}

.quarter-input {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--glass-border);
  background: var(--input-bg);
  color: #654d36;
  transition: all 0.2s ease;
}

.quarter-input:focus {
  border-color: var(--teal-accent);
  box-shadow: 0 0 8px rgba(145, 198, 189, 0.3);
  outline: none;
}

body.dark .quarter-input {
  background: var(--input-bg-dark);
  color: #fefaf2;
  border-color: rgba(255, 255, 255, 0.2);
}

.connector-line {
  width: 3px;
  height: 30px;
  margin: 0 auto;
  background: linear-gradient(to bottom, transparent, var(--teal-accent), transparent);
  opacity: 0;
  animation: grow-line 0.6s ease-out forwards, pulse-flow 1.5s ease-in-out infinite;
}

@keyframes grow-line {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    height: 30px;
    opacity: 1;
  }
}

@keyframes pulse-flow {
  0%, 100% {
    background: linear-gradient(to bottom, transparent, var(--teal-accent), transparent);
  }
  50% {
    background: linear-gradient(to bottom, var(--teal-accent), transparent, var(--teal-accent));
  }
}

.goal-total-section {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: rgba(172, 151, 132, 0.08);
  border-radius: var(--radius-md);
  text-align: center;
}

.goal-total-label {
  font-size: 0.9rem;
  color: #654d36;
  margin-bottom: 0.5rem;
}

body.dark .goal-total-label {
  color: #d2d6d7;
}

.goal-total-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-dark);
  margin-bottom: 1rem;
}

body.dark .goal-total-value {
  color: var(--teal-accent);
}

.goal-progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(172, 151, 132, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-accent), #22c55e);
  transition: width 0.6s ease;
  border-radius: 10px;
}

.goal-progress-fill.missed {
  background: linear-gradient(90deg, #f59e0b, #fb923c);
}

.goal-progress-text {
  font-size: 0.85rem;
  color: #654d36;
  font-weight: 600;
}

body.dark .goal-progress-text {
  color: #d2d6d7;
}

.calculate-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  margin-top: 1rem;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: all 0.2s ease;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(172, 151, 132, 0.3);
}

.calculate-btn:active {
  transform: translateY(0);
}

.goal-card-actions {
  display: flex;
  gap: 0.5rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.goal-action-btn {
  background: rgba(172, 151, 132, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.goal-action-btn:hover {
  background: rgba(172, 151, 132, 0.3);
  transform: scale(1.1);
}

body.dark .goal-action-btn {
  background: rgba(255, 255, 255, 0.1);
}

/* Goal Achievement Badge */
.goal-achievement-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  animation: bounce-in 0.6s ease;
}

@keyframes bounce-in {
  0% { transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Custom Goal Popups (Not Browser Alerts!) */
.goal-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10020;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.goal-popup {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  border: 3px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: popup-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
}

@keyframes popup-in {
  from {
    transform: scale(0.5) translateY(-50px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

body.dark .goal-popup {
  background: var(--glass-bg-dark);
  border-color: rgba(255, 255, 255, 0.2);
}

.goal-popup.success {
  border-color: #22c55e;
}

.goal-popup.encouragement {
  border-color: #f59e0b;
}

.goal-popup-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: icon-bounce 0.8s ease;
}

@keyframes icon-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.goal-popup-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #3d3126;
}

body.dark .goal-popup-title {
  color: #fefaf2;
}

.goal-popup-message {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: #654d36;
}

body.dark .goal-popup-message {
  color: #d2d6d7;
}

.goal-popup-stats {
  background: rgba(172, 151, 132, 0.1);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.goal-popup-stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.goal-popup-stat-label {
  color: #654d36;
  font-weight: 600;
}

body.dark .goal-popup-stat-label {
  color: #d2d6d7;
}

.goal-popup-stat-value {
  color: var(--accent-dark);
  font-weight: 700;
}

body.dark .goal-popup-stat-value {
  color: var(--teal-accent);
}

.goal-popup-close-btn {
  width: 100%;
  padding: 1rem 2rem;
  background: var(--primary-gradient);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: all 0.2s ease;
}

.goal-popup-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(172, 151, 132, 0.3);
}

.goal-popup-close-btn:active {
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  .goals-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .goal-card {
    padding: 1.5rem;
  }

  .goal-popup {
    padding: 2rem 1.5rem;
    width: 92%;
  }

  .goal-popup-icon {
    font-size: 3.5rem;
  }

  .goal-popup-title {
    font-size: 1.5rem;
  }
}

/* Compact quarterly gap & connector for desktop, mobile, tablet landscape */
@media (min-width: 901px), 
       (max-width: 900px) and (orientation: landscape), 
       (max-width: 768px) {
  .quarterly-inputs {
    gap: 0.5rem;
  }
  .connector-line {
    height: 20px;
    min-height: 20px;
    max-height: 20px;
  }
  .quarter-input {
    height: 45px;
    min-height: 45px;
    max-height: 45px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.goal-year-input {
  width: 90px;
  font-size: 1.02rem;
  padding: 0.44rem 0.7rem;
  border-radius: var(--radius-md);
  border: 1.3px solid var(--glass-border);
  margin-right: 0.5rem;
  background: var(--input-bg);
  color: #654d36;
  transition: all 0.18s;
  min-width: 66px;
  max-width: 110px;
}
body.dark .goal-year-input {
  background: var(--input-bg-dark);
  color: #f7e9d4;
  border-color: #4449;
}

/* Responsive tweaks: Comfort on mobile/tablet */
@media (max-width: 768px) {
  .goal-year-input {
    width: 70px;
    min-width: 56px;
    font-size: 0.98rem;
    padding: 0.40rem 0.45rem;
  }
  .goal-type-badge {
    font-size: 0.95rem;
    padding: 0.35rem 0.7rem;
  }
}

.goals-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.year-filter-label {
  margin-left: 0.5rem;
  margin-right: 0.2rem;
  font-weight: 600;
  font-size: 1.04rem;
  color: #725f47;
}
.year-filter-select {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--glass-border);
  padding: 0.48rem 1.14rem;
  font-size: 1.06rem;
  background: var(--input-bg);
  color: #3d3126;
  min-width: 76px;
  max-width: 120px;
  transition: border-color 0.18s;
}
body.dark .year-filter-select {
  background: var(--input-bg-dark);
  color: #f7e9d4;
  border-color: #4449;
}

@media (max-width: 768px) {
  .year-filter-select {
    min-width: 62px;
    max-width: 88px;
    font-size: 0.98rem;
    padding: 0.38rem 0.85rem;
  }
  .goals-header {
    gap: 0.7rem;
  }
  .year-filter-label {
    font-size: 0.92rem;
  }
}

.goal-year-type-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.85rem;
}

.goal-card-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.2rem;
}

/* --- Financials Tab Styles --- */
.financials-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.2rem;
  align-items: start;
  margin-top: 1.2rem;
}

.financials-card {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  box-shadow: var(--shadow-shine);
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.3rem;
  margin-bottom: 1.6rem;
  max-width: 668px;
  min-width: 0;
  position: relative;
}
body.dark .financials-card {
  background: var(--glass-bg-dark);
  border-color: rgba(255,255,255,0.14);
}
.locked-fin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  font-size: 1.3rem;
  filter: blur(0.09px);
}
.lock-icon {
  font-size: 2.7rem;
  margin-bottom: 1.1rem;
}
.lock-title {
  font-size: 1.09rem;
  margin-bottom: 1.2rem;
}
.passcode-input {
  font-size: 1.15rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid #b3a493;              /* Visible but subtle neutral */
  margin-bottom: 1.1rem;
  max-width: 340px;
  width: 90%;
  background: var(--input-bg, #fff);      /* Glassy or at least soft white */
  box-shadow: 0 2px 18px 0 rgba(176,160,152,0.09); /* Optional, subtle glow */
  transition: border-color 0.14s, box-shadow 0.14s;
}

.passcode-input:focus {
  border-color: var(--accent, #9b8878);
  outline: none;
  box-shadow: 0 0 4px 0 var(--accent, #9b8878);
}


.unlock-btn {
  font-size: 1.11rem;
  padding: 0.3rem 1.7rem;
}
.fin-filter-row {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}
.fin-filter-select {
  font-size: 1.09rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--glass-border);
  background: var(--input-bg);
  color: #3d3126;
}
.fin-input-row {
  display: flex;
  gap: 1.1rem;
  align-items: center;
  margin-bottom: 1.17rem;
}
.fin-year-input, .fin-month-input {
  font-size: 1.1rem;
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  border: 2px solid var(--glass-border);
  background: var(--input-bg);
  color: #654d36;
  min-width: 110px;
}
.fin-section-header {
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--glass-label); /* or var(--text-label) if defined for your dark/light themes */
  margin-bottom: 0.8rem;
}

.fin-rev-section, .fin-exp-section {
  margin-bottom: 1.45rem;
}
.fin-item-row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin-bottom: 0.8rem;
}
.fin-type-input {
  font-size: 1.06rem;
  padding: 0.67rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1.8px solid var(--glass-border);
  background: var(--input-bg);
  min-width: 155px;
}
.fin-amt-input {
  font-size: 1.09rem;
  padding: 0.67rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1.8px solid var(--glass-border);
  background: var(--input-bg);
  min-width: 110px;
  text-align: right;
}
.del-btn {
  font-size: 1.3rem;
  background: none;
  border: none;
  color: #b35a3a;
  cursor: pointer;
  padding: 0.2rem 0.8rem;
  border-radius: 50%;
  transition: background 0.16s;
}
.del-btn:hover { background: #fdeeda55; }

.fin-totals-section {
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin: 1.4rem 0 1.2rem 0;
  padding: 1rem 2rem;
  font-size: 1.18rem;
  background: var(--glass-bg);
  color: var(--text-primary);
}

.fin-total-amt {
  font-weight: 700;
  font-size: 1.13rem;
  margin-left: 0.36rem;
}
.fin-net-box {
  margin-top: 1rem;
  font-weight: 800;
  font-size: 1.21rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.8rem;
  border-radius: 1.2em;
  display: inline-block;
}
.fin-profit-glow .fin-net-box {
  background: rgba(60, 220, 90, 0.12);
  box-shadow: 0 0 12px 0 #4bbd6280;
  color: #299442;
  border: 2.2px solid #58e08e70;
}
.fin-loss-glow .fin-net-box {
  background: rgba(246,12,41,0.10);
  box-shadow: 0 0 12px 0 #f8492176;
  color: #c92f3f;
  border: 2.2px solid #f5353e70;
}
.financials-controls {
  display: flex;
  gap: 1.1rem;
  margin-top: 2.1rem;
  justify-content: flex-end;
}
.quick-calc-card {
  background: var(--glass-bg);
}
.calc-dropdown {
  font-size: 1.12rem;
  margin-bottom: 0.7rem;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.2rem;
  border: 1.8px solid var(--glass-border);
  background: var(--input-bg);
  color: #654d36;
}
.calc-info {
  font-size: 0.99rem;
  color: #5f7667;
  margin-left: 0.8rem;
}
.calc-body {
  margin-top: 1.22rem;
}
.calc-body label {
  display: block;
  font-size: 1.07rem;
  margin-bottom: 0.65rem;
}
.calc-inp {
  font-size: 1.08rem;
  padding: 0.6rem 1rem;
  margin-left: 0.8rem;
  border-radius: 9px;
  border: 1.8px solid var(--glass-border);
  background: var(--input-bg);
  color: #654d36;
}
.calc-result {
  font-size: 1.19rem;
  font-weight: 700;
  color: #194e37;
  margin-top: 1.1rem;
  background: #e0f7efa0;
  border-radius: 6px;
  padding: 0.7rem 1.2rem;
}

@media (max-width: 900px) and (orientation: portrait), (max-width: 768px) {
  .financials-wrapper {
    grid-template-columns: 1fr;  /* Single column on mobile */
    padding-left: 2vw;
    padding-right: 2vw;
    gap: 1.38rem;
  }
  .financials-card {
    width: 94vw;
    max-width: 97vw;
    margin-left: auto;
    margin-right: auto;
    padding: 1.3rem 1.3rem;
    box-sizing: border-box;
  }
  .fin-filter-row,
  .fin-input-row {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  .fin-section-header {
    font-size: 1rem;
    margin-bottom: 0.55rem;
  }
  .calc-body label {
    font-size: 0.97rem;
    margin-bottom: 0.34rem;
  }
  .financials-controls {
    flex-direction: column;
    gap: 1rem;
    justify-content: flex-start;
    align-items: stretch;
  }
}

.sync-reminder-modal .modal-buttons {
  flex-direction: column !important;
  gap: 1.13rem;
}

.sync-reminder-modal .modal-buttons button {
  width: 100% !important;
  min-width: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-search-bar {
   width: 180px !important; 
  max-width: 100%;
  margin-left: 16px;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .product-search-bar {
    display: block;
    margin: 18px auto 12px auto;
    width: 100% !important;
    min-width: 0;
    max-width: 480px;
    float: none;
  }
}

/* Hide menu icon on desktop and tablet landscape */
@media (min-width: 901px) {
  #toggle-sidebar {
    display: none !important;
  }
}

/* Adjust Product table width on desktop and tablet landscape */
@media (min-width: 769px) {

.products-tab-container .products-table th:nth-child(1),
  .products-tab-container .products-table td:nth-child(1) {
    width: 130px !important;
    max-width: 130px !important;
    min-width: 100px !important;
    text-align: left;

  }
  
  /* Description—tighter but allows wrapping to multiple lines */
  .products-tab-container .products-table th:nth-child(2),
  .products-tab-container .products-table td:nth-child(2) {
    width: 200px !important;
    max-width: 200px !important;
    min-width: 150px !important;
    text-align: left;

  }

  .products-tab-container .products-table th:nth-child(4),
  .products-tab-container .products-table td:nth-child(4) {
    width: 90px !important;
    max-width: 90px !important;
    min-width: 55px !important;
    text-align: left;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .products-tab-container .products-table th:nth-child(5),
  .products-tab-container .products-table td:nth-child(5) {
    width: 65px !important;
    max-width: 65px !important;
    min-width: 40px !important;
    text-align: center;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Launch Date—compact, but NO ellipsis so text fits */
  .products-tab-container .products-table th:nth-child(3),
  .products-tab-container .products-table td:nth-child(3) {
    width: 78px !important;
    max-width: 78px !important;
    min-width: 55px !important;
    white-space: nowrap !important;
    text-align: left;
    /* Do NOT set overflow or ellipsis, let short text fit */
  }
}

/* Loading spinner overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  border: 4px solid rgba(172, 151, 132, 0.2);
  border-top: 4px solid #ac9784;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 1rem;
  font-size: 1rem;
  color: #ac9784;
  font-weight: 500;
}

/* Settings tab – limit passcode input width */
.settings-tab .modal-input {
  max-width: 320px;
}

.tab-list-wrapper {
  max-height: calc(100vh - 220px); /* tune this value if needed */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.dark .questions-tab .member-card input.member-name-input {
  color: #222222 !important;
}
body.dark .roles-tab-container .member-card input.member-name-input {
  color: #222222 !important;
}

.wizard-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;                     /* below header/modal, above page bg */
  background: rgba(232,208,177,0.22); /* soft tinted overlay */
  /* IMPORTANT: no backdrop-filter here */
  pointer-events: auto;
}

.lean-card.settings-tab {
  position: relative;
  z-index: 1000;   /* above .wizard-backdrop’s 900 */
}

/* Wizard: block mobile menu and sidebar while setup is active */
body.has-wizard .mobile-menu-btn {
  z-index: 100;
  pointer-events: none;
}

body.has-wizard .sidebar-backdrop {
  pointer-events: none;
}

/* todo close margin between Others and input box */
#project-doneby-other-wrapper,
#task-doneby-other-wrapper {
  margin-top: 0.1rem !important;
}

/* ===== QUICK GUIDE + FAQ MODAL ONLY ===== */

/* Kill white-space preservation in Quick Guide & FAQ */
.modal-message .wizard-help-body,
.modal-message .wizard-help-body * {
  white-space: normal !important;
}

/* Container */
.modal-message .wizard-help-body {
  max-height: 60vh !important;
  overflow-y: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  color: inherit !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  cursor: default !important;
}

/* Paragraphs */

.modal-message .wizard-help-body p {
  all: unset;
  display: block;
  margin: 0 0 0.5rem 0 !important;
  padding: 0 !important;
  text-align: left !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  color: inherit !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  cursor: default !important;
}

/* FAQ answer paragraphs - kill top margin for tighter spacing */
.modal-message .wizard-help-body details p {
  margin-top: 0 !important;
}

/* Kill all gaps between summary and answer */
.modal-message .wizard-help-body details p:first-of-type {
  margin-top: -0.3rem !important;
}


/* Section headings (h3) - MORE space on desktop, LESS on mobile */
.modal-message .wizard-help-body h3 {
  font-weight: bold !important;
  font-size: 1.05rem !important;
  margin: 0.6rem 0 0.4rem 0 !important;
  padding: 0 !important;
  color: inherit !important;
}

/* First h3 - no top margin */
.modal-message .wizard-help-body h3:first-child {
  margin-top: 0 !important;
}

/* Desktop/Tablet Landscape: MORE space between sections */
@media (min-width: 768px) {
  .modal-message .wizard-help-body h3 {
    margin-top: 1.5rem !important; /* Increased from 0.6rem */
  }
  
  .modal-message .wizard-help-body h3:first-child {
    margin-top: 0 !important;
  }
}

/* Mobile: CLOSER spacing between heading and bullets */
@media (max-width: 767px) {
  .modal-message .wizard-help-body h3 {
    margin: 1rem 0 0.3rem 0 !important; /* Reduced bottom from 0.4rem */
  }
  
  .modal-message .wizard-help-body h3:first-child {
    margin-top: 0 !important;
  }
}

/* Bullet lists */
.modal-message .wizard-help-body ul {
  margin: 0 0 0.8rem 0 !important;
  padding-left: 1.2rem !important;
  list-style: disc !important;
}

.modal-message .wizard-help-body li {
  margin-bottom: 0.3rem !important;
  padding: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
}

/* Kill ALL accordion/details styling for FAQ */
.modal-message .wizard-help-body details,
.modal-message .wizard-help-body summary {
  all: unset !important;
  display: block !important;
  list-style: none !important;
  cursor: default !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.modal-message .wizard-help-body summary {
  font-weight: bold !important;
  font-size: 1.05rem !important;
  margin: 1rem 0 0.2rem 0 !important;
  pointer-events: none !important;
}

.modal-message .wizard-help-body summary:first-child {
  margin-top: 0 !important;
}

.modal-message .wizard-help-body details[open] summary {
 margin-bottom: 0.2rem !important;
}

/* Desktop: More spacing between FAQ questions */
@media (min-width: 768px) {
  .modal-message .wizard-help-body summary {
    margin-top: 1.5rem !important;
  }
  
  .modal-message .wizard-help-body summary:first-child {
    margin-top: 0 !important;
  }
}

/* ===== FAQ-SPECIFIC OVERRIDES (keeps grey boxes & section headers) ===== */

/* Grey box styling for FAQ details (inside .faq-section) */
.modal-message .wizard-help-body .faq-section details {
  all: revert !important;
  display: block !important;
  margin-bottom: 0.5rem !important;
  padding: 0.25rem 0.75rem 0.35rem 0.75rem !important; /* tighter top & bottom */
  background: rgba(128, 128, 128, 0.05) !important;
  border: 1px solid rgba(128, 128, 128, 0.15) !important;
  border-radius: 6px !important;
  cursor: default !important;
}

/* FAQ summary (question) styling */
.modal-message .wizard-help-body .faq-section summary {
  all: revert !important;
  display: block !important;
  font-weight: 600 !important;
  font-size: 1.05rem !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
  margin: 0 0 0.35rem 0 !important; /* small gap below question */
  cursor: default !important;
  pointer-events: none !important;
}

/* FAQ answer paragraphs */
.modal-message .wizard-help-body .faq-section details p {
  margin: 0.15rem 0 0.4rem 0 !important;
}

/* First paragraph - tighter to summary */
.modal-message .wizard-help-body .faq-section details p:first-of-type {
  margin-top: 0 !important;
}

/* FAQ lists - tighter spacing */
.modal-message .wizard-help-body .faq-section ul,
.modal-message .wizard-help-body .faq-section ol {
  margin: 0.1rem 0 0.45rem 0 !important;  /* minimal top margin */
  padding-left: 1.2rem !important;
}

.modal-message .wizard-help-body .faq-section li {
  margin-bottom: 0.2rem !important;
}

/* Collapse first & last child margins inside each FAQ box */
.modal-message .wizard-help-body .faq-section details > *:first-child {
  margin-top: 0 !important;
}

.modal-message .wizard-help-body .faq-section details > *:last-child {
  margin-bottom: 0 !important;
}

/* No extra top margin when a list follows a paragraph */
.modal-message .wizard-help-body .faq-section details p + ul,
.modal-message .wizard-help-body .faq-section details p + ol {
  margin-top: 0 !important;
}

/* Section headings (h3) inside .faq-section */
.modal-message .wizard-help-body .faq-section h3 {
  font-weight: bold !important;
  font-size: 1.05rem !important;
  margin: 1rem 0 0.5rem 0 !important;
  padding: 0 !important;
  color: var(--text-primary) !important;
}

/* First h3 in FAQ should have no top margin */
.modal-message .wizard-help-body .faq-section:first-child h3,
.modal-message .wizard-help-body .faq-section h3:first-child {
  margin-top: 0 !important;
}

/* Spacing between FAQ sections */
.modal-message .wizard-help-body .faq-section {
  margin-bottom: 0.75rem !important;
}

/* Last FAQ section should have no bottom margin */
.modal-message .wizard-help-body .faq-section:last-child {
  margin-bottom: 0 !important;
}

/* FAQ bullets: completely remove top margin when list follows text */
.modal-message .wizard-help-body .faq-section details ul,
.modal-message .wizard-help-body .faq-section details ol {
  margin-top: 0 !important;        /* kill the big gap */
  margin-bottom: 0.4rem !important;
  padding-left: 1.2rem !important; /* keep indent */
}

/* Extra safety: if a list is the first thing in the answer, keep it tight too */
.modal-message .wizard-help-body .faq-section details > ul:first-child,
.modal-message .wizard-help-body .faq-section details > ol:first-child {
  margin-top: 0 !important;
}


/* Desktop/Tablet: keep Quick Guide spacing, tighten FAQ */
@media (min-width: 768px) {
  .modal-message .wizard-help-body h3:not(.faq-section h3) {
    margin-top: 1.5rem !important;
  }

  .modal-message .wizard-help-body h3:first-child {
    margin-top: 0 !important;
  }

  /* FAQ sections: tight spacing */
  .modal-message .wizard-help-body .faq-section h3 {
    margin: 1rem 0 0.5rem 0 !important;
  }

  .modal-message .wizard-help-body .faq-section:first-child h3,
  .modal-message .wizard-help-body .faq-section h3:first-child {
    margin-top: 0 !important;
  }

  /* Tighten FAQ box spacing on desktop */
  .modal-message .wizard-help-body .faq-section details {
    margin-bottom: 0.5rem !important;
  }
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
}

.category-pill span {
  margin-right: 6px;
}

.category-delete-btn {
  border: none;
  background: transparent;
  color: #ff6b6b;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.header-pill {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.header-pill.available {
  background: #e8f5e9;
  color: #2e7d32;
}

.header-pill.in-use {
  background: #ffebee;
  color: #c62828;
  animation: pill-pulse 2s ease-in-out infinite;
}

@keyframes pill-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.warning-banner {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 0.75rem 1rem;
  margin: 1rem auto 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #856404;
  max-width: 980px;
}

.warning-banner strong {
  color: #d84315;
}

/* =======================================================
   FIX FOR 'OTHER' INPUT VISIBILITY - CONDITIONAL
   ======================================================= */
@media (max-width: 900px) {
  /* 
     Only apply these fixes if the element is visible.
     We check if the inline style contains "display: block" 
     (which your JS sets when 'Other' is selected).
  */
  #task-doneby-other-wrapper[style*="display: block"],
  #task-doneby-other-wrapper:not([style*="display: none"]) {
    display: block !important; 
    width: 100% !important;
    margin-top: 0.5rem !important;
    min-height: 55px !important;
    flex: 0 0 auto !important;
  }

  /* Ensure the input inside is robust */
  #task-doneby-other-input {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    height: 48px !important;
  }
  
  .modal-form {
    padding-bottom: 2.5rem !important;
  }
}

/* ============================================
   MOBILE CREDENTIALS FIX (Standalone)
   ============================================ */
@media (max-width: 900px) {

  /* 1. Reset the Container */
  .credentials-container {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 10px 0 !important;
    overflow: visible !important;
  }

  /* 2. Force Labels */
  .credentials-container label {
    display: block !important;
    color: #444 !important; /* Force dark text */
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    font-size: 0.95rem !important;
  }
  
  /* 3. Wrapper Group */
  .credentials-container .input-copy-group {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    gap: 8px !important;
    align-items: stretch !important;
    margin-bottom: 15px !important;
    height: auto !important;
    min-height: 44px !important;
  }


  /* 4. FIX THE INPUT (Specific override) */
  .credentials-container .input-copy-group .modal-input {
    /* Reset layout */
    display: block !important;
    flex: 1 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    
    /* Layout Dimensions */
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 10px !important;
    
    /* KILL SCROLLING BEHAVIOR */
    overflow: hidden !important;        /* No scrollbars allowed */
    overflow-y: hidden !important;      /* Double check specifically vertical */
    resize: none !important;            /* No resizing handle */
    
    /* Content Alignment */
    white-space: nowrap !important;     /* Text stays on one line */
    line-height: 42px !important;       /* Perfect vertical center */
    
    /* Visibility */
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    color: #333333 !important;
    opacity: 1 !important;
    visibility: visible !important;
    
    /* Reset Browser Defaults */
    -webkit-appearance: none !important; /* Removes iOS inner shadows/styles */
    appearance: none !important;
  }

  /* 5. Buttons */
  .credentials-container .input-copy-group button {
    flex-shrink: 0 !important;
    height: 44px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Dark Mode support within this block */
  body.dark .credentials-container label {
    color: #ffffff !important;
  }
  body.dark .credentials-container .input-copy-group .modal-input {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }
}

/* ============================================
   QUOTATION TAB STYLES (Final Corrected)
   ============================================ */

/* --- 1. The Main Grid --- */
#quotationTab .quotations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Tablet and Desktop: 2 columns */
@media (min-width: 768px) {
  #quotationTab .quotations-grid {
    grid-template-columns: 1fr 1fr;
  }
}

#quotationTab .quotation-card {
  background: var(--glass-bg, #fff);
  border: 1px solid var(--glass-border, #e0e0e0);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* DARK MODE FIX FOR CARDS */
body.dark #quotationTab .quotation-card {
  background: #2d2d2d !important;
  border-color: #444;
}

body.dark #quotationTab .quotation-card h3 { 
  color: #fff !important; 
}

body.dark #quotationTab .quotation-card div { 
  color: #ddd !important; 
}

body.dark #quotationTab .quotation-card strong { 
  color: #fff !important; 
}

/* Fix all text elements in card to be visible */
body.dark #quotationTab .quotation-card * {
  color: inherit !important;
}

/* Fix specific title text */
body.dark #quotationTab .quotation-card > div:first-child {
  color: #fff !important;
}

/* FIX FOR PRICE IN DARK MODE (was invisible) */
body.dark #quotationTab .quotation-card [style*="color:var(--accent-dark)"] {
  color: #d4a574 !important;
}

body.dark #quotationTab .quotation-card span[style*="background:#e5e5e5"] {
  background: #3a3a3a !important;
  color: #F5F5F7 !important;
}

/* --- Action Buttons --- */
#quotationTab .action-buttons {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

#quotationTab .action-buttons button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  margin: 0;
}

#quotationTab .btn-edit-q { background: #4f46e5; }
#quotationTab .btn-copy-q { background: #edb300; }
#quotationTab .btn-del-q  { background: #ef4444; }
#quotationTab .btn-pdf-q  { background: #10b981; }

/* ============================================
   MODAL FORM OVERRIDES (Targeted Fix)
   ============================================ */

#quotation-modal-content {
  width: 100%;
}

/* 2. OVERRIDE MAIN FORM INPUTS */
#quotation-modal-content input, 
#quotation-modal-content textarea, 
#quotation-modal-content select {
  border-radius: 12px !important;
  border: 1.8px solid #bbb5ac !important;
  background: #fff !important;
  padding: 8px 12px !important;
  font-size: 0.95rem !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
  width: 100% !important;
  margin: 0 0 5px 0 !important; 
  box-sizing: border-box !important;
  display: block !important; 
  color: #333 !important; 
}

/* DARK MODE FIX FOR INPUTS */
body.dark #quotation-modal-content input, 
body.dark #quotation-modal-content textarea, 
body.dark #quotation-modal-content select {
  background: #3a3a3a !important;
  border: 1.8px solid #555 !important;
  color: #fff !important;
}

body.dark #quotation-modal-content input::placeholder { 
  color: #aaa !important; 
}

body.dark #quotation-modal-content textarea::placeholder { 
  color: #aaa !important; 
}

/* 3. FOCUS STATES */
#quotation-modal-content input:focus,
#quotation-modal-content textarea:focus,
#quotation-modal-content select:focus {
  border-color: var(--accent, #9b8878) !important;
  box-shadow: 0 0 0 3px rgba(155, 136, 120, 0.2) !important;
  outline: none !important;
}

/* 4. MAIN FORM LAYOUT (Desktop Default) */
#quotation-modal-content .form-row {
  display: flex;
  flex-direction: row;
  gap: 15px !important;       
  margin-bottom: 0 !important; 
  padding-bottom: 12px !important; 
  width: 100%;
}

#quotation-modal-content .form-group {
  margin: 0 !important;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 5. LABELS */
#quotation-modal-content label {
  display: block;
  margin-bottom: 6px !important;
  font-weight: 700;
  font-size: 0.9rem;
  color: #555;
}

body.dark #quotation-modal-content label { 
  color: #F5F5F7 !important; 
}

/* 6. HEADERS */
#quotation-modal-content h4 {
  margin-top: 20px !important; 
  margin-bottom: 15px !important;
  border-bottom: 1px solid #eee;
  font-size: 1.1rem;
  color: var(--accent-dark, #6d5f52);
  font-weight: 800;
}

body.dark #quotation-modal-content h4 { 
  color: #FFEDBD !important; 
  border-bottom-color: #555; 
}

/* 7. ADD ITEM BUTTON */
#quotation-modal-content .btn-add-item {
  width: 100% !important;
  padding: 10px !important;
  margin-top: 5px !important;
  background: transparent !important;
  border: 1px dashed #9b8878 !important;
  color: #9b8878 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-weight: 600 !important;
  display: block !important;
  text-align: center !important;
  transition: all 0.2s ease;
}

#quotation-modal-content .btn-add-item:hover {
  background: rgba(155, 136, 120, 0.05) !important;
}

body.dark #quotation-modal-content .btn-add-item { 
  color: #d4a574 !important; 
  border-color: #d4a574 !important; 
}

/* 8. ITEMS TABLE (Desktop) */
#quotation-modal-content .items-table-header {
  display: grid; 
  grid-template-columns: 2fr 0.6fr 0.8fr 0.8fr 30px; 
  gap: 8px; 
  font-weight: bold; 
  color: #666;
  margin-bottom: 5px;
}

body.dark #quotation-modal-content .items-table-header { 
  color: #bbb !important; 
}

#quotation-modal-content .quote-item-row {
  display: grid;
  grid-template-columns: 2fr 0.6fr 0.8fr 0.8fr 30px;
  gap: 8px;
  align-items: center; 
  margin-bottom: 8px;
}

#quotation-modal-content .delete-btn {
  background: transparent !important;
  border: none !important;
  color: #ef4444 !important;
  font-size: 1.4rem !important;
  cursor: pointer !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#quotation-modal-content .item-total {
  text-align: right;
  font-weight: bold;
  padding-right: 5px;
  color: #333 !important;
}

body.dark #quotation-modal-content .item-total { 
  color: #ffffff !important; 
}

/* 9. TOTALS BOX */
#quotation-modal-content .totals-box {
  margin-top: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 12px;
  color: #333 !important;
}

body.dark #quotation-modal-content .totals-box { 
  background: #333 !important; 
  color: #fff !important; 
}

body.dark #quotation-modal-content .totals-box strong { 
  color: #fff !important; 
}

/* ============================================
   LOGO UPLOAD SECTION
   ============================================ */

#quotation-modal-content .logo-upload-section {
  margin-bottom: 20px;
  padding: 15px;
  background: #faf9f7;
  border: 2px dashed #bbb5ac;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#quotation-modal-content .logo-upload-section:hover {
  border-color: #9b8878;
  background: #f5f3f0;
}

#quotation-modal-content .logo-upload-section.dragging {
  border-color: #6d5f52;
  background: #ebe9e5;
}

body.dark #quotation-modal-content .logo-upload-section {
  background: #2a2a2a;
  border-color: #555;
}

body.dark #quotation-modal-content .logo-upload-section:hover {
  border-color: #bbb5ac;
  background: #333;
}

#quotation-modal-content .logo-upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #6d5f52;
  font-size: 14px;
}

body.dark #quotation-modal-content .logo-upload-content {
  color: #d4a574 !important;
}

#quotation-modal-content .logo-icon {
  font-size: 32px;
}

#quotation-modal-content .choose-file-btn {
  margin-top: 12px;
  padding: 8px 20px;
  background: #9b8878;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

#quotation-modal-content .choose-file-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

#quotation-modal-content .logo-preview {
  max-width: 200px;
  max-height: 80px;
  width: auto;
  height: auto;
  margin: 10px auto;
  display: block;
  object-fit: contain;
}

#quotation-modal-content .logo-upload-text {
  color: #6d5f52;
  font-size: 0.9rem;
  margin-top: 8px;
}

body.dark #quotation-modal-content .logo-upload-text {
  color: #bbb5ac;
}

#quotation-modal-content .remove-logo-btn {
  margin-top: 10px;
  padding: 6px 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

#quotation-modal-content #logo-file-input {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================
   QUOTATION SEARCH BAR
   ============================================ */

.quotation-search-bar {
  width: 180px !important;
  max-width: 100%;
  margin-left: 16px;
  display: inline-block;
  vertical-align: middle;
  border-radius: 12px !important;
  border: 1.8px solid #bbb5ac !important;
  background: #fff !important;
  padding: 8px 12px !important;
  font-size: 0.95rem !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
}

.quotation-search-bar:focus {
  border-color: var(--accent, #9b8878) !important;
  box-shadow: 0 0 0 3px rgba(155, 136, 120, 0.2) !important;
  outline: none !important;
}

body.dark .quotation-search-bar {
  background: #3a3a3a !important;
  border: 1.8px solid #555 !important;
  color: #fff !important;
}

body.dark .quotation-search-bar::placeholder {
  color: #aaa;
}

@media (max-width: 900px) {
  .quotation-search-bar {
    display: block;
    margin: 18px auto 12px auto;
    width: 100% !important;
    min-width: 0;
    max-width: 480px;
    float: none;
  }
}

/* ============================================
   MOBILE OVERRIDES (Phone View Only)
   ============================================ */
@media (max-width: 600px) {
  
  #quotation-modal-content .form-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    padding-bottom: 10px !important;
  }

  #quotation-modal-content .form-group {
    width: 100% !important;
    flex: unset !important;
  }
  
  #quotation-modal-content input,
  #quotation-modal-content select,
  #quotation-modal-content textarea {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  #quotation-modal-content .items-table-header { 
    display: none !important; 
  }

  #quotation-modal-content .quote-item-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 15px !important;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    margin-bottom: 15px !important;
  }

  body.dark #quotation-modal-content .quote-item-row {
    background: #333;
    border: 1px solid #555;
  }

  #quotation-modal-content .quote-item-row input:first-child {
    width: 100% !important; 
    margin-bottom: 8px !important;
  }
  
  #quotation-modal-content .quote-item-row input:nth-child(2),
  #quotation-modal-content .quote-item-row input:nth-child(3) {
    flex: 1;
    min-width: 40% !important;
  }

  #quotation-modal-content .delete-btn {
    width: 100% !important;
    height: 35px !important;
    margin-top: 5px !important;
    background: #ffebee !important;
    border-radius: 6px !important;
    color: #c62828 !important;
  }
  
  /* --- MOBILE TOTAL DISPLAY --- */
  #quotation-modal-content .item-total,
  #quotation-modal-content span.item-total {
    display: block !important;
    width: 100% !important;
    text-align: right !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px dashed #eee !important;
    font-size: 1.1rem !important;
    color: #333 !important;
  }
  
  body.dark #quotation-modal-content .item-total,
  body.dark #quotation-modal-content span.item-total {
    border-top-color: #555 !important;
    color: #ffffff !important;
  }

  #quotation-modal-content .logo-upload-section {
    padding: 25px 15px;
  }
  
  /* Mobile specific item total styling */
  #quotation-modal-content .quote-item-row .item-total,
  #quotation-modal-content .item-total {
    display: block !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    min-height: 30px !important;
    box-sizing: border-box !important;
    margin-top: 12px !important;
    padding: 8px 12px !important;
    border: none !important;
    text-align: right !important;
    font-weight: 800 !important;
    font-size: 1.2rem !important;
    border-radius: 6px !important;
    z-index: 10 !important;
    background-color: #9e9e9e !important;
  }

  body.dark #quotation-modal-content .quote-item-row .item-total,
  body.dark #quotation-modal-content .item-total {
    background-color: #9e9e9e !important;
    border: none !important;
  }
}

/* ============================================
   ITEM TOTAL VISIBILITY (Desktop & All Modes)
   ============================================ */

/* Default Light Mode - Dark Text */
#quotation-modal-content .item-total, 
#quotation-modal-content span.item-total {
  color: #333333 !important;
  font-weight: bold !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Dark Mode - White Text */
body.dark #quotation-modal-content .item-total,
body.dark #quotation-modal-content span.item-total {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.nav-item-glow {
  /* 1. The Deep Interior (Depth) */
  background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%) !important;
  color: #c62828 !important; /* Deep red text */
  font-weight: 700; /* Bolder text to stand out against the glow */
  text-shadow: 0 0 1px rgba(198, 40, 40, 0.2);

  /* 2. The Hybrid Border Structure */
  /* We keep the strong left accent, but make other edges transparent to let the glow shine */
  border: 1px solid transparent !important; 
  border-left: 4px solid #ef5350 !important;
  border-radius: 0 4px 4px 0; /* Softens the right side */

  /* 3. The Living Animation */
  animation: ultimate-fusion-pulse 3s infinite ease-in-out;
  
  /* 4. Polish */
  z-index: 10;
  transition: all 0.5s ease;
}

@keyframes ultimate-fusion-pulse {
  0% {
    /* State: Dormant Energy */
    background: linear-gradient(135deg, #fff5f5 0%, #ffcdd2 100%);
    border-left-color: #ef5350; /* Standard Red */
    
    /* A tight, glassy rim (The Phantom touch) */
    box-shadow: 
      inset 0 0 0 1px rgba(255, 255, 255, 0.5), /* Inner highlight */
      0 0 2px rgba(229, 57, 53, 0.3);          /* Subtle edge */
  }
  50% {
    /* State: Full Illumination */
    background: linear-gradient(135deg, #ffebee 0%, #ef9a9a 100%);
    border-left-color: #ff1744; /* Neon Bright Red */
    
    /* The "Mysterious Glow" expands */
    box-shadow: 
      inset 0 0 15px rgba(255, 255, 255, 0.6),  /* Inner light floods in */
      0 0 12px 2px rgba(229, 57, 53, 0.4),      /* The border dissolves into glow */
      0 0 25px rgba(229, 57, 53, 0.2);          /* Distant aura */
  }
  100% {
    /* Return to Dormant */
    background: linear-gradient(135deg, #fff5f5 0%, #ffcdd2 100%);
    border-left-color: #ef5350;
    
    box-shadow: 
      inset 0 0 0 1px rgba(255, 255, 255, 0.5),
      0 0 2px rgba(229, 57, 53, 0.3);
  }
}

/* --- DARK MODE OVERRIDE (Refined) --- */
body.dark .nav-item-glow {
  /* 1. Background: Lighter "Ruby Red" gradient */
  /* (Moved up from black-red to a distinct deep red) */
  background: linear-gradient(135deg, #441010 0%, #661515 100%) !important;
  
  /* 2. Text: Bright Neon Pink-Red */
  color: #ff8a80 !important; 
  text-shadow: 0 0 8px rgba(255, 82, 82, 0.9);

  /* 3. Border: Bright Laser Red */
  border-left: 4px solid #ff5252 !important;
  border-top: 1px solid rgba(255,82,82,0.2) !important;
  border-right: 1px solid rgba(255,82,82,0.2) !important;
  border-bottom: 1px solid rgba(255,82,82,0.2) !important;

  /* 4. Speed: Slowed to 3s (Matches Light Mode) */
  animation: neon-night-pulse 3s infinite ease-in-out;
}

@keyframes neon-night-pulse {
  0% {
    /* Dim State: Matches the base background above */
    background: linear-gradient(135deg, #441010 0%, #661515 100%) !important;
    box-shadow: 
      inset 0 0 5px rgba(255, 23, 68, 0.1), 
      0 0 0 rgba(255, 23, 68, 0); 
    border-left-color: #d32f2f;
  }
  50% {
    /* ACTIVE STATE: Brightens to a rich Crimson (Visibly redder) */
    background: linear-gradient(135deg, #5c1414 0%, #7f1d1d 100%) !important;
    
    box-shadow: 
      /* Inner Glow */
      inset 0 0 20px rgba(255, 23, 68, 0.3),
      /* Outer Glow */
      0 0 12px rgba(255, 82, 82, 0.7),
      /* Distant Haze */
      0 0 25px rgba(255, 82, 82, 0.4);
      
    border-left-color: #ff1744; 
    color: #ffffff; /* Text flashes white */
  }
  100% {
    /* Return to Dim */
    background: linear-gradient(135deg, #441010 0%, #661515 100%) !important;
    box-shadow: 
      inset 0 0 5px rgba(255, 23, 68, 0.1), 
      0 0 0 rgba(255, 23, 68, 0); 
    border-left-color: #d32f2f;
  }
}

/* Spinner Animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinner-icon {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Fix for Cancel button text alignment in modals - ISOLATED */
#custom-modal .modal-buttons button,
#custom-modal .modal-buttons .btn,
#custom-modal .modal-buttons .btn-primary,
#custom-modal .modal-buttons .btn-secondary {
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Default mobile (your iPhone Max and similar) */
@media (max-width: 768px) {
  .import-options-modal {
    top: -8% !important;
    transform: translateY(0) !important;
  }
}

/* Smaller/shorter phones (e.g. SE / older) */
@media (max-width: 390px) and (max-height: 700px) {
  .import-options-modal {
    top: -10% !important;  /* shift a bit more up */
    transform: translateY(0) !important;
  }
}

