/* ── NORA — Checklist & Tab System ──────────────────── */

/* ── Checklist Items ─────────────────────────────────── */
#tab-container .tab-content { display: flex; flex-direction: column; gap: 6px; }

.time-group-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--hint);
  padding: 10px 4px 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  cursor: default;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s,
              background 0.2s;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}
.item-row.done {
  opacity: 0.55;
  background: rgba(0, 204, 136, 0.04);
  border-color: rgba(0, 204, 136, 0.12);
}
.item-row.paused { opacity: 0.5; pointer-events: auto; }
.item-row.critical:not(.done) {
  border-left: 3px solid var(--warning);
  background: rgba(255, 170, 0, 0.06);
}
.critical-badge { font-size: var(--text-xs); }

/* ── Item mark area (left ~80%) ── */
.item-mark-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 4;
  padding: 13px 14px;
  cursor: pointer;
  min-width: 0;
}
.item-mark-area:active { background: var(--glass-bg-strong); }

/* ── Item expand button (right ~20%) ── */
.item-expand-btn {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  font-size: 14px;
  color: var(--hint);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: color 0.15s;
}
.item-expand-btn:active { color: var(--fg); }
.item-expand-btn.open { color: var(--fg); }
.item-expand-btn .chevron {
  display: inline-block;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.item-expand-btn.open .chevron {
  transform: rotate(90deg);
}

/* ── Item detail panel (CSS grid animated) ── */
.item-panel-grid {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.item-panel-grid.open {
  grid-template-rows: 1fr;
}
.item-panel-grid > .item-panel {
  overflow: hidden;
}
.item-panel {
  padding: 0 14px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-panel-grid.open > .item-panel {
  padding: 10px 14px 14px;
}
.item-panel-stats { display: flex; flex-direction: column; gap: 2px; }
.item-panel-line {
  font-size: var(--text-xs);
  color: var(--hint);
  line-height: 1.5;
}
.item-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}
.item-stock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.stock-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stock-stepper-btn {
  width: 36px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.stock-stepper-btn:active { background: rgba(255, 255, 255, 0.14); }
.stock-stepper-val {
  min-width: 40px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg);
  padding: 0 4px;
  line-height: 34px;
  background: transparent;
}
.stock-restock-btn {
  margin-left: auto;
}

/* ── Edit modal extras ── */
.item-edit-label {
  font-size: var(--text-sm);
  color: var(--hint);
  margin-bottom: -4px;
}
.item-edit-hint {
  font-size: var(--text-xs);
  color: var(--hint);
  font-style: italic;
  margin: -4px 0 4px;
}

/* Custom circular checkbox */
.item-check {
  width: 26px; height: 26px;
  border: 2.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.8rem;
  color: #fff;
  position: relative;
}
.item-row.done .item-check {
  background: linear-gradient(135deg, var(--success), #00e09a);
  border-color: transparent;
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(0, 204, 136, 0.4);
}
.item-row.done .item-check::after {
  content: '✓';
  font-weight: 700;
}
/* Hide checkmark when spinner is showing (inflight) */
.item-check.loading::after {
  display: none;
}

.item-info { flex: 1; min-width: 0; }
.item-name { font-size: var(--text-base); font-weight: 500; }
.item-streak {
  font-size: var(--text-xs);
  color: var(--warning);
  margin-left: 4px;
  white-space: nowrap;
}
.item-low-stock {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-left: 4px;
  white-space: nowrap;
}
.item-detail {
  font-size: var(--text-xs);
  color: var(--hint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Item Spinner (in-flight) ────────────────────────── */
.item-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--hint);
  border-top-color: var(--btn-bg);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════════════════
   Tab System (Glassmorphism)
   ═══════════════════════════════════════════════════════ */
#tab-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

/* ── Tab Wrapper ── */
.tab-wrapper {
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-wrapper.expanded {
  transform: translateY(-1px);
}

/* ── Tab Grid (CSS grid height animation — no JS measurement) ── */
.tab-grid {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.tab-grid.open {
  grid-template-rows: 1fr;
}
.tab-grid > .tab-content {
  overflow: hidden;
  min-height: 0;
}

/* State-based outer glow */
.tab-wrapper[data-state="needs-action"] {
  box-shadow: var(--shadow-glow-amber), var(--shadow-card);
}
.tab-wrapper[data-state="all-done"] {
  box-shadow: var(--shadow-glow-green), var(--shadow-card);
}
.tab-wrapper[data-state="in-progress"] {
  box-shadow: var(--shadow-card), 0 0 12px rgba(91, 141, 239, 0.15);
}

/* ── Tab Header (Glassmorphism) ── */
.tab-header {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.tab-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.tab-header:active {
  transform: scale(0.97);
}

/* State colours */
.tab-header[data-state="needs-action"] {
  background: var(--tab-needs-action);
  border-color: rgba(255, 170, 0, 0.4);
}
.tab-header[data-state="in-progress"] {
  background: linear-gradient(135deg, rgba(91, 141, 239, 0.10), rgba(108, 92, 231, 0.06));
  border-color: rgba(91, 141, 239, 0.3);
}
.tab-header[data-state="all-done"] {
  background: var(--tab-complete);
  border-color: rgba(0, 204, 136, 0.35);
}
.tab-header[data-state="not-yet-due"] {
  background: var(--glass-bg);
  border-color: rgba(255, 255, 255, 0.06);
  opacity: 0.6;
}

.tab-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.tab-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.tab-title {
  font-size: var(--text-lg);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
/* Bold header when needs action + glow */
.tab-header[data-state="needs-action"] .tab-title {
  font-weight: 700;
  color: var(--warning);
  text-shadow: 0 0 8px rgba(255, 170, 0, 0.3);
}
/* Green title when done + glow */
.tab-header[data-state="all-done"] .tab-title {
  color: var(--success);
  text-shadow: 0 0 8px rgba(0, 204, 136, 0.3);
}

.tab-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Badge state coloring */
.tab-header[data-state="needs-action"] .tab-badge {
  background: rgba(255, 170, 0, 0.2);
  color: var(--warning);
  border-color: rgba(255, 170, 0, 0.3);
}
.tab-header[data-state="all-done"] .tab-badge {
  background: rgba(0, 204, 136, 0.2);
  color: var(--success);
  border-color: rgba(0, 204, 136, 0.3);
}
/* Badge pop animation on update */
.tab-badge.pop {
  transform: scale(1.25);
}

.tab-chevron {
  font-size: 0.65rem;
  color: var(--hint);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  opacity: 0.7;
}
.tab-wrapper.expanded .tab-chevron {
  transform: rotate(0deg);
}
.tab-wrapper.collapsed .tab-chevron {
  transform: rotate(-90deg);
}

/* ── Collapsed Preview ── */
.tab-preview {
  padding: 2px 16px 10px;
  font-size: var(--text-sm);
  color: var(--hint);
  line-height: 1.4;
}
.tab-preview.hidden { display: none; }

/* ── Tab Content (expandable) ── */
.tab-content {
  padding: 4px 12px 14px;
  min-height: 0;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 0 var(--radius) var(--radius);
}
.tab-content.hidden {
  display: none;
}

/* ── Tab Actions (inside expanded tab) ── */
.tab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tab-actions .action-btn {
  font-size: var(--text-sm);
  padding: 10px 14px;
}

/* ── Dashboard Actions (global, below tabs) ── */
#dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Celebration Overlay ── */
.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease;
}
.celebration-overlay.fade-out {
  animation: fadeOut 0.5s ease forwards;
}
.celebration-content {
  text-align: center;
  animation: celebPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.celebration-emoji {
  font-size: var(--text-hero);
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.celebration-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--success);
  text-shadow: 0 0 30px rgba(0, 204, 136, 0.6), 0 0 60px rgba(0, 204, 136, 0.2);
  letter-spacing: 0.5px;
}
.celebration-streak {
  font-size: var(--text-lg);
  margin-top: 10px;
  color: var(--fg);
  opacity: 0.9;
}
.celebration-msg {
  font-size: 0.9rem;
  color: var(--hint);
  margin-top: 6px;
  max-width: 280px;
}

@keyframes celebPop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Confetti Particles ── */
.confetti-particle {
  pointer-events: none;
  z-index: 9999;
}

/* ── Attention Ping Animation ──────────────────────── */
@keyframes attentionPingAmber {
  0%   { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.45); }
  50%  { box-shadow: 0 0 18px 4px rgba(255, 170, 0, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0); }
}
@keyframes attentionPingGreen {
  0%   { box-shadow: 0 0 0 0 rgba(0, 204, 136, 0.45); }
  50%  { box-shadow: 0 0 18px 4px rgba(0, 204, 136, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(0, 204, 136, 0); }
}
.tab-header.attention-amber {
  animation: attentionPingAmber 0.6s ease-out 3;
}
.tab-header.attention-green {
  animation: attentionPingGreen 0.6s ease-out 3;
}

/* ── Drag-to-Reorder ─────────────────────────────────── */
.drag-ghost {
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.collapsible-tab.drag-over-above { border-top: 2px solid var(--accent-blue); }
.collapsible-tab.drag-over-below { border-bottom: 2px solid var(--accent-blue); }

/* ═══════════════════════════════════════════════════════
   Stock Management Modal
   ═══════════════════════════════════════════════════════ */
.stock-modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.stock-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--hint);
  font-size: 1.2rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stock-modal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.stock-modal-section:last-of-type { border-bottom: none; }
.stock-section-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--hint);
  margin: 0;
}
.stock-modal-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0 8px 0;
}
.stock-status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  padding: 4px 0;
}
.stock-label { flex: 1; color: var(--hint); min-width: 0; }
.stock-value { font-weight: 600; color: var(--fg); white-space: nowrap; }
.stock-days { color: var(--hint); opacity: 0.7; font-size: 0.8rem; white-space: nowrap; }
.stock-detail { font-size: 0.75rem; color: var(--hint); opacity: 0.6; white-space: nowrap; }
.stock-input-label {
  display: block;
  font-size: 0.8rem;
  color: var(--hint);
  margin-bottom: 6px;
  margin-top: 8px;
}
.stock-modal-section > .stock-input-label:first-of-type { margin-top: 0; }
.stock-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.stock-number-input {
  flex: 1;
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  color: var(--fg);
  font-family: monospace;
  font-size: var(--text-base);
  text-align: right;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
.stock-number-input:focus {
  outline: none;
  border-color: var(--btn-bg);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}
.stock-number-input::-webkit-outer-spin-button,
.stock-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stock-input-unit { flex: 0 0 auto; font-size: 0.85rem; color: var(--hint); white-space: nowrap; }
.stock-unit-select {
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 6px 8px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.stock-unit-select option { background: #1a1a2e; color: var(--text); }
.stock-untracked { color: var(--hint); font-style: italic; font-size: 0.85rem; }
.stock-stepper-extended {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.stock-stepper-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
}
.stock-stepper-main {
  width: 80px;
  height: 44px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.stock-stepper-main:active { background: rgba(255, 255, 255, 0.14); }
.stock-stepper-main:disabled { opacity: 0.5; cursor: not-allowed; }
.stock-stepper-symbol { font-size: 1.1rem; line-height: 1; }
.stock-stepper-amount { font-size: 0.85rem; font-weight: 700; }
.stock-stepper-unit { font-size: 0.8rem; color: var(--hint); flex: 0 0 auto; }
.stock-stepper-sub {
  width: 50px;
  height: 32px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--hint);
  cursor: pointer;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.stock-stepper-sub:active { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }
.stock-stepper-sub:disabled { opacity: 0.5; cursor: not-allowed; }
.stock-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.stock-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.stock-preset:active { background: rgba(255, 255, 255, 0.08); border-color: rgba(108, 92, 231, 0.4); }
.stock-preset.selected { background: rgba(108, 92, 231, 0.15); border-color: rgba(108, 92, 231, 0.5); }
.preset-label { font-weight: 600; font-size: 0.85rem; }
.preset-qty { font-size: 0.7rem; color: var(--hint); opacity: 0.7; }
.stock-date-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--fg);
}
.stock-date-toggle input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.stock-date-display {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  color: var(--fg);
  font-size: 0.85rem;
}
.stock-date-picker { margin-top: 8px; }
.stock-date-picker.hidden { display: none; }
.stock-date-picker input[type="date"] { width: 100%; box-sizing: border-box; }
.stock-threshold-group { display: flex; flex-direction: column; gap: 8px; }
.stock-threshold-unit-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}
.unit-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--hint);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.unit-btn:active { background: rgba(255, 255, 255, 0.08); }
.unit-btn.active {
  background: rgba(108, 92, 231, 0.3);
  color: var(--btn-bg);
}
.stock-threshold-info {
  font-size: 0.75rem;
  color: var(--hint);
  opacity: 0.7;
  margin-top: 2px;
}
.stock-modal-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--hint);
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 4px;
}
.stock-modal-scrollable {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

/* ── Scheduled Events Tab ──────────────────────────── */
.scheduled-add-btn { margin-bottom: 8px; }
.ev-card {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px 12px 8px;
  margin-bottom: 6px;
}
.ev-card.ev-past { opacity: 0.55; }
.ev-card.ev-done { opacity: 0.5; }
.ev-card.ev-mini { padding: 6px 10px; display: flex; align-items: center; gap: 8px; }
.ev-header { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.ev-name { font-weight: 600; font-size: var(--text-sm); }
.ev-cd { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.3px; }
.ev-today  { color: #f5a623; }
.ev-soon   { color: #4cd964; }
.ev-future { color: var(--hint); }
.ev-overdue { color: #ff3b30; }
.ev-meta { display: flex; gap: 10px; font-size: var(--text-xs); color: var(--hint); margin-top: 3px; }
.ev-notes { font-size: var(--text-xs); color: var(--subtext); margin-top: 4px; font-style: italic; }
.ev-actions { display: flex; gap: 6px; margin-top: 8px; }
.ev-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
}
.ev-btn-done { border-color: rgba(76, 217, 100, 0.4); color: #4cd964; }
.ev-btn-undo { border-color: rgba(255,255,255,0.15); }
.ev-btn-dismiss { opacity: 0.6; }
.ev-btn-delete { color: #ff3b30; border-color: rgba(255,59,48,0.3); }
.ev-past-header { margin-top: 16px; }
.modal-label { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-sm); color: var(--hint); margin-bottom: 10px; }
.modal-label-text { font-size: var(--text-sm); color: var(--hint); margin-bottom: 6px; }
.modal-textarea { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 8px 10px; color: var(--text); font-size: var(--text-sm); resize: vertical; box-sizing: border-box; }

/* ── Abstinence Streak Tab ─────────────────────────── */
.abstinence-add-btn { margin-bottom: 8px; }
.abstinence-card {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 12px 14px 10px;
  margin-bottom: 8px;
  transition: border-color 0.3s;
}
.abstinence-card.affirmed { border-color: rgba(76, 217, 100, 0.35); }
.abs-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.abs-name { font-weight: 700; font-size: var(--text-base); }
.abs-affirmed-badge { font-size: var(--text-xs); color: #4cd964; background: rgba(76,217,100,0.12); padding: 2px 7px; border-radius: 10px; }
.abs-streak-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.abs-streak-main { display: flex; align-items: baseline; gap: 4px; }
.abs-streak-num { font-size: 36px; font-weight: 800; line-height: 1; color: #4cd964; }
.abs-streak-unit { font-size: var(--text-sm); color: var(--hint); }
.abs-streak-meta { display: flex; flex-direction: column; gap: 2px; font-size: var(--text-xs); color: var(--hint); }
.abs-reason { font-size: var(--text-xs); color: var(--subtext); font-style: italic; margin-bottom: 8px; }
.abs-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.abs-btn {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
}
.abs-btn-affirm { border-color: rgba(76,217,100,0.4); color: #4cd964; background: rgba(76,217,100,0.08); }
.abs-btn-relapse { opacity: 0.65; font-size: 12px; }
.abs-relapse-intro { font-size: var(--text-sm); color: #4cd964; margin-bottom: 10px; }
