:root {
  /* Theme & Glass variables (customizable via "Màu & kính") */
  --bg-blur: 18px;
  --glass-opacity: 0.78;
  --card-opacity: 0.88;
  --accent-primary: #1c1e1d;
  --accent-burgundy: #6d1016;
  --accent-burgundy-light: #8b1e24;
  --accent-slate: #5c8397;
  --accent-slate-light: #89b0c4;
  --accent-forest: #2d5a43;
  --accent-sage: #dce5dc;
  --deadline-bg: #fde2e4;
  --deadline-text: #b81d24;
  --text-main: #181a19;
  --text-secondary: #5a625e;
  --text-muted: #88928d;
  --border-glass: rgba(255, 255, 255, 0.55);
  --shadow-soft: 0 10px 32px rgba(20, 32, 24, 0.08);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.04);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Dynamic Forest Background Layer */
.app-wallpaper {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #d7dfd5;
  background-image:
    radial-gradient(at 12% 18%, rgba(244, 247, 238, 0.92) 0px, transparent 55%),
    radial-gradient(at 85% 15%, rgba(235, 240, 228, 0.85) 0px, transparent 50%),
    radial-gradient(at 20% 85%, rgba(164, 186, 160, 0.65) 0px, transparent 55%),
    radial-gradient(at 75% 82%, rgba(145, 169, 142, 0.6) 0px, transparent 55%),
    linear-gradient(160deg, #eef2eb 0%, #dce4d8 52%, #c4d1bf 100%);
  transition: background 0.5s ease;
}

.app-wallpaper.theme-mist {
  background-image:
    radial-gradient(at 12% 18%, rgba(244, 247, 238, 0.92) 0px, transparent 55%),
    radial-gradient(at 85% 15%, rgba(235, 240, 228, 0.85) 0px, transparent 50%),
    radial-gradient(at 20% 85%, rgba(164, 186, 160, 0.65) 0px, transparent 55%),
    radial-gradient(at 75% 82%, rgba(145, 169, 142, 0.6) 0px, transparent 55%),
    linear-gradient(160deg, #eef2eb 0%, #dce4d8 52%, #c4d1bf 100%);
}

.app-wallpaper.theme-deep-pine {
  background-image:
    radial-gradient(at 15% 20%, rgba(215, 230, 218, 0.85) 0px, transparent 55%),
    radial-gradient(at 80% 80%, rgba(88, 129, 104, 0.55) 0px, transparent 60%),
    linear-gradient(145deg, #e2ece4 0%, #bfd3c4 50%, #9ab6a3 100%);
}

.app-wallpaper.theme-autumn {
  background-image:
    radial-gradient(at 20% 15%, rgba(252, 243, 232, 0.9) 0px, transparent 55%),
    radial-gradient(at 80% 85%, rgba(212, 163, 130, 0.45) 0px, transparent 55%),
    linear-gradient(155deg, #f7f0e6 0%, #eadbc8 55%, #d9c2a9 100%);
}

.app-wallpaper.theme-rainy {
  background-image:
    radial-gradient(at 15% 20%, rgba(232, 239, 245, 0.9) 0px, transparent 55%),
    radial-gradient(at 82% 78%, rgba(138, 162, 179, 0.5) 0px, transparent 55%),
    linear-gradient(155deg, #e8eef2 0%, #cfdbe3 55%, #b3c5d1 100%);
}

.app-backdrop-blur {
  position: fixed;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(var(--bg-blur));
  -webkit-backdrop-filter: blur(var(--bg-blur));
  pointer-events: none;
}

/* Main App Grid */
.app-shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px 16px 16px;
  background: rgba(242, 245, 239, calc(var(--glass-opacity) * 0.82));
  border-right: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  user-select: none;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 4px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 20px 8px;
  cursor: pointer;
}

.brand-icon {
  width: 30px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  flex-shrink: 0;
}

.brand-text {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #141615;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c857f;
  padding: 0 10px 8px 10px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #323834;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.55);
  color: #111;
}

.nav-item.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.nav-item.active svg {
  color: #ffffff;
}

.nav-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6.5px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.08);
  color: #3a403d;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.nav-badge.pulse-playing {
  background: #2d6a4f;
  color: #fff;
  animation: softPulse 2s infinite;
}

@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.sidebar-spacer {
  flex: 1;
  min-height: 14px;
}

.nav-secondary {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Sidebar Bottom Quick Note Box (Matches Screenshot) */
.sidebar-quick-note {
  margin-top: 12px;
  padding-top: 10px;
}

.sidebar-qn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding: 0 4px;
}

.sidebar-qn-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #6c7570;
  text-transform: uppercase;
}

.sidebar-qn-save {
  font-size: 11px;
  font-weight: 600;
  color: #5a635e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

.sidebar-qn-save:hover {
  background: rgba(0, 0, 0, 0.07);
  color: #111;
}

.sidebar-qn-textarea {
  width: 100%;
  height: 82px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.72);
  font-family: inherit;
  font-size: 12.5px;
  color: #222;
  resize: none;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s;
}

.sidebar-qn-textarea:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(28, 30, 29, 0.35);
}

.sidebar-qn-hint {
  font-size: 10px;
  color: #88928c;
  padding: 4px 4px 0 4px;
}

/* ================= MAIN CONTENT AREA ================= */
.main-stage {
  height: 100vh;
  overflow-y: auto;
  padding: 22px 28px 28px 24px;
  display: flex;
  flex-direction: column;
}

.view-section {
  display: none;
  flex-direction: column;
  height: 100%;
  animation: fadeIn 0.22s ease;
}

.view-section.active {
  display: flex;
}

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.page-title {
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #141615;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

/* Buttons & Pills */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #2c302e;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.78);
  color: #222;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-card);
}

.btn-glass:hover {
  background: #ffffff;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #333;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: #fff;
  transform: scale(1.04);
}

/* ================= VIEW: CÔNG VIỆC (EXACT SCREENSHOT LAYOUT) ================= */
.work-workspace-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

/* Left Warehouse Card with Forest Illustration */
.warehouse-card {
  position: relative;
  background: rgba(250, 251, 247, var(--card-opacity));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.warehouse-top-bar {
  padding: 16px 16px 8px 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.quick-task-inline-form {
  width: 100%;
}

.quick-task-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px dashed rgba(28, 30, 29, 0.25);
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: #181a19;
  outline: none;
  transition: all 0.16s ease;
}

.quick-task-input:focus {
  background: #ffffff;
  border-style: solid;
  border-color: var(--accent-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.segmented-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(235, 238, 232, 0.85);
  padding: 4px;
  border-radius: 99px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.seg-tab {
  padding: 7px 10px;
  border-radius: 99px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #555c58;
  cursor: pointer;
  transition: all 0.18s ease;
}

.seg-tab.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.warehouse-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 16px 90px 16px;
  z-index: 2;
}

.warehouse-scroll::-webkit-scrollbar {
  width: 4px;
}
.warehouse-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.stock-group {
  margin-bottom: 18px;
}

.stock-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.stock-group-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #1f2421;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.waiting { background: #1c1e1d; }
.status-dot.instock { background: var(--accent-burgundy); }
.status-dot.posted { background: var(--accent-slate); }

.stock-count {
  color: #7c857f;
  font-weight: 600;
  font-size: 12.5px;
}

.stock-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stock-item-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 9px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.025);
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
}

.stock-item-card:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.06);
}

.stock-item-card.posted-card {
  background: rgba(242, 245, 238, 0.82);
}

.stock-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e2220;
  line-height: 1.35;
}

.stock-item-brand {
  font-size: 11px;
  color: #7c8580;
  margin-top: 2px;
}

.stock-item-quick-actions {
  position: absolute;
  top: 7px;
  right: 8px;
  display: none;
  gap: 4px;
}

.stock-item-card:hover .stock-item-quick-actions {
  display: flex;
}

.mini-action-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: #333;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-action-btn:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* Pine Forest Illustration at Bottom of Warehouse Card */
.warehouse-forest-art {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 155px;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.warehouse-add-floating {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.9);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2e25;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.16s;
  white-space: nowrap;
}

.warehouse-add-floating:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* Right Calendar Container */
.calendar-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

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

.calendar-month-heading {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #141615;
}

.calendar-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pill-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  padding: 3px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-card);
}

.filter-pill {
  padding: 5px 12px;
  border-radius: 99px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill.active {
  background: var(--accent-primary);
  color: #fff;
}

.month-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.78);
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-card);
}

.stepper-arrow {
  border: none;
  background: transparent;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-arrow:hover {
  background: rgba(0, 0, 0, 0.06);
}

.stepper-label {
  font-size: 12px;
  font-weight: 600;
  padding: 0 6px;
  min-width: 64px;
  text-align: center;
}

/* Calendar Grid */
.calendar-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  padding-bottom: 8px;
}

.weekday-label {
  font-size: 12px;
  font-weight: 700;
  color: #2c322e;
}

.calendar-days-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 5px;
  min-height: 0;
}

.cal-day-cell {
  background: rgba(250, 251, 249, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 12px;
  padding: 6px 6px 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 3.5px;
  min-height: 92px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
}

.cal-day-cell:hover {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cal-day-cell.other-month {
  background: rgba(242, 245, 240, 0.55);
}

.cal-day-cell.other-month .cal-day-num {
  color: #7c8580;
}

.cal-day-cell.drag-over {
  outline: 2px dashed var(--accent-forest);
  background: rgba(220, 238, 226, 0.9);
}

.cal-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
}

.cal-day-num {
  font-size: 11.5px;
  font-weight: 800;
  color: #1c1e1d;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
}

.cal-day-cell.is-today .cal-day-num {
  background: #181a19;
  color: #fff;
  padding: 0 7px;
  width: auto;
}

.cal-events-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow: hidden;
}

/* Calendar Event Pills (Exact Match to Screenshot) */
.cal-pill {
  padding: 3.5px 7px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.22;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.cal-pill:hover {
  filter: brightness(1.1);
}

.cal-pill.pill-burgundy {
  background: var(--accent-burgundy);
}

.cal-pill.pill-slate {
  background: var(--accent-slate);
}

.cal-pill.pill-slate-soft {
  background: var(--accent-slate-light);
  color: #182a34;
}

.cal-pill.pill-black {
  background: #161817;
}

/* Pink Deadline Card inside Calendar Cell (`! Hạn đăng ...`) */
.cal-deadline-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  border-radius: 7px;
  background: var(--deadline-bg);
  border: 1px solid rgba(220, 38, 38, 0.12);
  color: var(--deadline-text);
  cursor: pointer;
  overflow: hidden;
}

.cal-deadline-pill.deadline-gray {
  background: rgba(232, 235, 233, 0.95);
  color: #49504c;
  border-color: rgba(0, 0, 0, 0.06);
}

.deadline-bang {
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.deadline-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.deadline-tag {
  font-size: 8.5px;
  font-weight: 700;
  opacity: 0.85;
}

.deadline-name {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-more-count {
  font-size: 10px;
  font-weight: 700;
  color: #525a55;
  padding: 1px 4px;
}

/* ================= VIEW: DASHBOARD (WOW FOREST COMMAND CENTER) ================= */
.hero-forest-banner {
  position: relative;
  border-radius: 24px;
  padding: 22px 26px;
  margin-bottom: 16px;
  color: #ffffff;
  background: linear-gradient(132deg, #162e22 0%, #264c38 48%, #3b6b52 100%);
  box-shadow: 0 14px 34px rgba(18, 40, 28, 0.18);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}

.hero-art-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
}

.hero-left {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
  flex: 1;
}

.hero-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #e2f1e8;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-greeting {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #ffffff;
}

.hero-focus-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 6px 12px;
  margin-top: 2px;
  backdrop-filter: blur(8px);
}

.hero-focus-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #b8d8c5;
  white-space: nowrap;
}

.hero-focus-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

.hero-focus-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.hero-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  backdrop-filter: blur(6px);
}

.hero-chip:hover {
  background: #ffffff;
  color: #162e22;
  transform: translateY(-1px);
}

.hero-chip.active-sound {
  background: #dcfce7;
  color: #14532d;
  border-color: #86efac;
}

.hero-right {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 32, 23, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 14px 18px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.hero-ring-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-ring-pct {
  position: absolute;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.hero-score-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hero-score-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.hero-score-sub {
  font-size: 11.5px;
  color: #c7e2d2;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.stat-card {
  background: rgba(255, 255, 255, var(--card-opacity));
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 15px 17px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20, 32, 24, 0.11);
}

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

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.stat-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-badge.burgundy { background: rgba(109, 16, 22, 0.1); color: var(--accent-burgundy); }
.stat-icon-badge.amber { background: rgba(217, 119, 6, 0.12); color: #b45309; }
.stat-icon-badge.forest { background: rgba(45, 90, 67, 0.12); color: var(--accent-forest); }
.stat-icon-badge.emerald { background: rgba(21, 128, 61, 0.12); color: #15803d; }

.stat-value {
  font-size: 25px;
  font-weight: 800;
  margin: 6px 0 3px 0;
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.stat-bar-track {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-top: 10px;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s ease;
}

.dash-inline-form {
  margin-bottom: 10px;
}

.dash-inline-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px dashed rgba(28, 30, 29, 0.22);
  background: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 12.5px;
  color: #181a19;
  outline: none;
  transition: all 0.16s;
}

.dash-inline-input:focus {
  background: #ffffff;
  border-style: solid;
  border-color: var(--accent-forest);
}

.empty-visual-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(236, 243, 236, 0.55) 0%, rgba(255, 255, 255, 0.75) 100%);
  border: 1px dashed rgba(45, 90, 67, 0.22);
  gap: 8px;
}

.empty-starter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.starter-chip {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid rgba(45, 90, 67, 0.22);
  background: #ffffff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #264c38;
  cursor: pointer;
  transition: all 0.15s;
}

.starter-chip:hover {
  background: var(--accent-forest);
  color: #ffffff;
}

.dash-mini-focus {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(45, 90, 67, 0.1) 0%, rgba(255, 255, 255, 0.85) 100%);
  border: 1px solid rgba(45, 90, 67, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-main-cols {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.glass-card {
  background: rgba(252, 253, 250, var(--card-opacity));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.card-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #161817;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.card-scroll::-webkit-scrollbar {
  width: 4px;
}
.card-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

/* ================= VIEW: REMINDER & HABIT TRACKER ================= */
.reminder-habit-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.reminder-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 9px;
  transition: all 0.16s;
}

.reminder-item:hover {
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.04);
}

.reminder-item.done {
  opacity: 0.58;
}

.reminder-item.done .rem-title {
  text-decoration: line-through;
}

.rem-left {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #88928d;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
}

.custom-checkbox.checked {
  background: var(--accent-forest);
  border-color: var(--accent-forest);
  color: #fff;
}

.rem-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1c1e1d;
}

.rem-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11.5px;
  color: #6c7570;
}

.tag-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 700;
}

.tag-high { background: #fee2e2; color: #b91c1c; }
.tag-medium { background: #fef3c7; color: #b45309; }
.tag-low { background: #e0f2fe; color: #0369a1; }

/* Habit Tracker Matrix */
.habit-row-card {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.habit-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.habit-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(45, 90, 67, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.habit-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #1a1d1b;
}

.habit-streak {
  font-size: 11.5px;
  color: #d97706;
  font-weight: 700;
  margin-top: 2px;
}

.habit-week-days {
  display: flex;
  align-items: center;
  gap: 6px;
}

.habit-day-btn {
  width: 30px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(244, 246, 242, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.habit-day-btn span.d-label {
  font-size: 9px;
  font-weight: 700;
  color: #7c857f;
}

.habit-day-btn span.d-check {
  font-size: 11px;
  font-weight: 800;
  margin-top: 1px;
}

.habit-day-btn.completed {
  background: var(--accent-forest);
  border-color: var(--accent-forest);
  color: #fff;
}

.habit-day-btn.completed span.d-label {
  color: rgba(255, 255, 255, 0.8);
}

/* ================= VIEW: RELAX (WHITE NOISE + POMODORO + CHILL) ================= */
.relax-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.sound-mixer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.sound-channel-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}

.sound-channel-card.active {
  background: rgba(45, 90, 67, 0.12);
  border-color: rgba(45, 90, 67, 0.45);
  box-shadow: 0 4px 14px rgba(45, 90, 67, 0.1);
}

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

.sound-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sound-channel-card.active .sound-icon-box {
  background: var(--accent-forest);
  color: #fff;
}

.sound-name {
  font-size: 13.5px;
  font-weight: 700;
}

.sound-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.sound-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.07);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s;
}

.sound-channel-card.active .sound-toggle-btn {
  background: var(--accent-forest);
  color: #fff;
}

.volume-slider {
  width: 100%;
  accent-color: var(--accent-forest);
  height: 5px;
  cursor: pointer;
}

/* Pomodoro Focus Card */
.pomodoro-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(160deg, rgba(45, 90, 67, 0.12), rgba(255, 255, 255, 0.75));
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.pomo-mode-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.pomo-Digits {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #16241c;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin: 6px 0 14px 0;
}


/* ================= AUTHENTICATION & RBAC (SUPABASE) ================= */
.auth-topbar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-btn-login {
  background: var(--text-main, #161817);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.auth-btn-login:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.auth-user-box {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1b4332;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-user-info-text {
  display: flex;
  flex-direction: column;
}

.auth-user-name {
  font-size: 12px;
  font-weight: 700;
  color: #161817;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.auth-role-badge.role-admin {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.auth-role-badge.role-member {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.auth-admin-btn {
  display: none;
  background: #fef3c7;
  color: #92400e;
  border: 1.2px solid #f59e0b;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  align-items: center;
  gap: 4px;
}

.auth-logout-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 2px;
}

.auth-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ================= NOTION / APPLE STYLE USER PILL & DROPDOWN ================= */
.sidebar-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.sidebar-user-pill:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.sidebar-user-pill .auth-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(27, 67, 50, 0.22);
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-user-info .auth-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #161817;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.sidebar-user-info .auth-user-role {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 2px;
}

.sidebar-user-chevron {
  width: 14px;
  height: 14px;
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sidebar-user-pill.active .sidebar-user-chevron {
  transform: rotate(180deg);
}

/* Floating Glass Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 6px;
  z-index: 1000;
  display: none;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-menu.show {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
  font-family: inherit;
}

.user-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #111827;
}

.user-dropdown-item.admin-item {
  color: #92400e;
  font-weight: 700;
}

.user-dropdown-item.admin-item:hover {
  background: #fef3c7;
}

.user-dropdown-item.logout-item {
  color: #dc2626;
}

.user-dropdown-item.logout-item:hover {
  background: #fee2e2;
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 4px 6px;
}

/* ================= TACTILE CLICK RIPPLE & MICRO-SPRING EFFECT ================= */
.forest-click-ripple {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%) scale(0.3);
  background: radial-gradient(circle, rgba(45, 106, 79, 0.35) 0%, rgba(45, 106, 79, 0) 72%);
  border: 1.5px solid rgba(45, 106, 79, 0.45);
  animation: forestRippleOut 0.46s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.forest-click-ripple.is-interactive {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.42) 0%, rgba(27, 67, 50, 0) 75%);
  border-color: rgba(22, 163, 74, 0.65);
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.25);
}

@keyframes forestRippleOut {
  0% {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(4.2);
    opacity: 0;
  }
}

button,
.btn,
.nav-item,
.mob-nav-btn,
.stat-card,
.stock-item-card,
.reminder-item,
.custom-checkbox,
.habit-day-btn,
.sidebar-user-pill,
.starter-chip,
.filter-pill,
.utility-tile {
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease, background 0.18s ease;
}

button:active,
.btn:active,
.nav-item:active,
.mob-nav-btn:active,
.stat-card:active,
.stock-item-card:active,
.custom-checkbox:active,
.habit-day-btn:active,
.sidebar-user-pill:active,
.starter-chip:active,
.filter-pill:active,
.utility-tile:active {
  transform: scale(0.96) !important;
}

/* ================= AUTH GATE SCREEN (FULLSCREEN GLASSMORPHISM LOCK) ================= */
body.auth-locked .app-shell,
body.auth-locked .mobile-topbar,
body.auth-locked .mobile-bottom-nav {
  display: none !important;
}

body:not(.auth-locked) #authGateScreen {
  display: none !important;
}

.auth-gate-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.45), rgba(240, 245, 241, 0.95)),
              linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: authFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.auth-gate-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.06);
  border-radius: 28px;
  padding: 36px 30px;
  text-align: center;
}

.auth-gate-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 22px;
}

.auth-gate-title {
  font-size: 26px;
  font-weight: 800;
  color: #161817;
  letter-spacing: -0.03em;
  margin: 10px 0 4px 0;
}

.auth-gate-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.auth-gate-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 20px;
}

.auth-gate-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.auth-gate-tab.active {
  background: #fff;
  color: #161817;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Auth Modal Form */
.auth-modal-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  text-align: left;
}

.auth-input-group {
  margin-bottom: 14px;
}

.auth-input-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  margin-bottom: 5px;
}

.auth-input-group input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.2px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input-group input:focus {
  border-color: #1b4332;
  background: #fff;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: #1b4332;
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: opacity 0.2s;
}

.auth-submit-btn:hover {
  opacity: 0.92;
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= VIEW: QUICK NOTE (NOTES & SCRIPTS) ================= */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding-bottom: 20px;
}

.note-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 170px;
  transition: all 0.16s;
  cursor: pointer;
}

.note-card:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.note-card.pinned {
  border-left: 4px solid var(--accent-burgundy);
}

.note-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #181a19;
}

.note-body {
  font-size: 12.5px;
  color: #49524d;
  line-height: 1.5;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 11px;
  color: #7c8580;
}

/* ================= VIEW: FINANCE ================= */
.finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.finance-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c7570;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.finance-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.amount-income { color: #15803d; font-weight: 700; }
.amount-expense { color: #b91c1c; font-weight: 700; }

/* ================= VIEW: PROJECT KANBAN ================= */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.kanban-col {
  background: rgba(250, 251, 248, 0.82);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kanban-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-forest);
  border-radius: 99px;
}

/* ================= MODALS ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 18, 0.42);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: #fafbf8;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 22px 24px;
  animation: fadeIn 0.18s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: #3a423e;
}

.form-input, .form-select, .form-textarea {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #d5dcd7;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: #181a19;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #1c1e1d;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Floating Toast & Mini Audio Pill */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 22px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #181a19;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.2s ease;
}

.floating-audio-bar {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: 900;
  background: rgba(24, 26, 25, 0.92);
  color: #fff;
  backdrop-filter: blur(12px);
  padding: 8px 14px;
  border-radius: 99px;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.floating-audio-bar.visible {
  display: inline-flex;
}

/* ================= SYNC BADGE & MOBILE ELEMENTS (DEFAULT DESKTOP HIDDEN) ================= */
.sync-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: #2c3530;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.15s;
}

.sync-badge-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

@media screen and (min-width: 961px) {
  .mobile-topbar,
  .mobile-bottom-nav,
  .mobile-sidebar-overlay,
  .mobile-seg-bar,
  .preset-chips-row {
    display: none !important;
  }
}

.mobile-topbar,
.mobile-bottom-nav,
.mobile-sidebar-overlay,
.mobile-seg-bar,
.preset-chips-row {
  display: none;
}

.filter-pill,
.tag-badge,
.btn {
  white-space: nowrap;
}

.chip-btn {
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid rgba(45, 90, 67, 0.22);
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: #1f3a2c;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover {
  background: var(--accent-forest);
  color: #fff;
}

.chip-btn.danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: transparent;
}

.utility-grid-sheet {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.utility-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.utility-tile:active {
  background: #181a19;
  color: #fff;
}

.utility-tile .u-name {
  font-size: 13px;
  font-weight: 700;
  color: inherit;
}

/* ================= IPHONE 16 PRO MAX MINIMALIST UI (<= 960px) ================= */
@media screen and (max-width: 960px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  /* Clean Minimalist Top Bar */
  .mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 950;
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 16px 0 16px;
    background: rgba(244, 247, 241, 0.86);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }

  .brand-icon-sm {
    width: 22px;
    height: 22px;
  }

  .mobile-brand-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #141615;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mob-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.85);
    color: #181a19;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mob-icon-btn:first-child {
    background: #181a19;
    color: #ffffff;
    border-color: #181a19;
  }

  .sidebar {
    display: none;
  }

  .desktop-only-header,
  .desktop-only-actions {
    display: none !important;
  }

  /* Main Stage */
  .main-stage {
    height: auto;
    overflow: visible;
    padding: 12px 14px 20px 14px;
  }

  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }

  .page-title {
    font-size: 21px;
  }

  /* Minimalist 2-Tab Segmented Switcher on Mobile */
  .mobile-seg-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: rgba(232, 237, 230, 0.9);
    padding: 3.5px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .mob-seg-btn {
    padding: 7.5px 10px;
    border-radius: 9px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    color: #555e59;
    cursor: pointer;
    transition: all 0.15s;
  }

  .mob-seg-btn.active {
    background: #181a19;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  }

  /* Pane Switching for Công việc */
  .work-workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .work-workspace-grid.mob-mode-list .calendar-panel {
    display: none;
  }

  .work-workspace-grid.mob-mode-cal .warehouse-card {
    display: none;
  }

  .warehouse-card {
    min-height: 68dvh;
  }

  /* Pane Switching for Reminder & Habits */
  .reminder-habit-layout {
    display: flex;
    flex-direction: column;
  }

  .reminder-habit-layout.mob-rem-habits .rem-pane-todo {
    display: none;
  }

  .reminder-habit-layout.mob-rem-todo .rem-pane-habits {
    display: none;
  }

  /* Pane Switching for Relax (Sound vs Pomodoro) */
  .relax-layout {
    display: flex;
    flex-direction: column;
  }

  .relax-layout.mob-relax-sound .relax-pane-timer {
    display: none;
  }

  .relax-layout.mob-relax-timer .relax-pane-sound {
    display: none;
  }

  .preset-chips-row {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
  }

  .chip-btn {
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    cursor: pointer;
  }

  .chip-btn.danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: transparent;
  }

  /* Clean Calendar on 440px iPhone 16 Pro Max */
  .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .calendar-month-heading {
    font-size: 19px;
  }

  .calendar-controls-right {
    justify-content: space-between;
    gap: 6px;
  }

  .filter-pill {
    padding: 4.5px 9px;
    font-size: 11px;
  }

  .weekday-label {
    font-size: 11px;
    color: #5a625e;
  }

  .calendar-days-grid {
    gap: 3.5px;
  }

  .cal-day-cell {
    min-height: 76px;
    padding: 4px;
    border-radius: 10px;
  }

  .cal-day-num {
    font-size: 10.5px;
    width: 20px;
    height: 20px;
  }

  .cal-pill {
    font-size: 9.5px;
    padding: 2.5px 4.5px;
    border-radius: 5px;
  }

  .cal-deadline-pill {
    padding: 2px 4px;
    gap: 3px;
  }

  .deadline-tag {
    display: none;
  }

  .deadline-name {
    font-size: 9px;
  }

  /* Clean Cards & Grids */
  .hero-forest-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-radius: 20px;
    gap: 14px;
  }

  .hero-greeting {
    font-size: 19px;
  }

  .hero-right {
    justify-content: flex-start;
    padding: 11px 14px;
  }

  .glass-card {
    padding: 14px;
    border-radius: 18px;
  }

  .card-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
  }

  .stat-card {
    padding: 13px 14px;
  }

  .stat-value {
    font-size: 19px;
    margin: 4px 0 2px 0;
  }

  .dashboard-main-cols,
  .sound-mixer-grid,
  .kanban-board,
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Clean Compact Sound Channel Row */
  .sound-channel-card {
    padding: 11px 13px;
    border-radius: 14px;
    gap: 8px;
  }

  .sound-icon-box {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 9px;
  }

  /* Clean Habit Row */
  .habit-row-card {
    flex-direction: column;
    align-items: stretch;
    padding: 11px 12px;
    gap: 9px;
  }

  .habit-week-days {
    justify-content: space-between;
    width: 100%;
  }

  .habit-day-btn {
    flex: 1;
    height: 36px;
  }

  /* Reminder Item Single-Line Meta */
  .reminder-item {
    padding: 11px 12px;
    align-items: center;
  }

  .rem-meta {
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Prevent iOS Safari zoom on input focus */
  .form-input,
  .form-select,
  .form-textarea,
  .quick-task-input,
  .sidebar-qn-textarea {
    font-size: 16px;
  }

  .modal-card {
    padding: 18px 16px;
    border-radius: 20px;
    max-height: 86dvh;
  }

  /* Minimalist Monochrome 5-Tab Bottom Bar */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(246, 248, 244, 0.94);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px;
  }

  .mob-nav-btn {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 10px;
    font-family: inherit;
    color: #88928d;
    cursor: pointer;
    transition: all 0.15s;
  }

  .mob-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .mob-nav-label {
    font-size: 10px;
    font-weight: 700;
  }

  .mob-nav-btn.active {
    color: #141615;
  }

  .floating-audio-bar {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    left: 14px;
    right: 14px;
    justify-content: space-between;
  }
}

