/* ═══════════════════════════ RESET & TOKENS ══ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Light theme (default) */
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --bg-hover: #eef0f3;
  --bg-input: #ffffff;
  --border: #e2e5eb;
  --border-hi: #cfd4dc;

  --text: #1a1d23;
  --text-2: #5c6570;
  --text-3: #8b939e;

  --accent: #d97706;
  --accent-dk: #b45309;
  --accent-lt: rgba(217, 119, 6, 0.12);

  --green: #16a34a;
  --green-lt: rgba(22, 163, 74, 0.12);
  --red: #dc2626;
  --red-lt: rgba(220, 38, 38, 0.1);
  --blue: #2563eb;
  --blue-lt: rgba(37, 99, 235, 0.1);
  --purple: #7c3aed;
  --purple-lt: rgba(124, 58, 237, 0.1);

  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 20px rgba(26, 29, 35, 0.08);

  --font: "DM Sans", sans-serif;
  --mono: "DM Mono", monospace;

  --sidebar-w: 230px;
  --transition: 160ms ease;
}

html,
body {
  height: 100%;
  overflow-x: hidden; /* Fixes global horizontal scrolling */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════ SCREENS ══ */
.screen {
  display: none;
}
.screen.active {
  display: flex;
}

/* ════════════════════════════ LOGIN ══ */
#login-screen {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(
    ellipse 60% 50% at 50% -10%,
    rgba(245, 158, 11, 0.08) 0%,
    transparent 100%
  );
}

.login-box {
  width: 100%;
  max-width: 380px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.logo-mark {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}
.logo-text {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.logo-sub {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 1px;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}
.login-hint {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 28px;
}

/* ════════════════════════════ LAYOUT ══ */
#admin-screen,
.admin-shell {
  display: block;
  min-height: 100vh;
  width: 100%;
  position: relative;
  background: var(--bg);
}

.page,
.page.active,
.page-content {
  display: block;
}

.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-top: 10px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo-mark {
  font-size: 20px;
}
.sidebar-header .logo-text {
  font-size: 16px;
  font-weight: 600;
}
.sidebar-header .logo-sub {
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-3);
  padding: 0 8px;
  margin-bottom: 6px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 450;
  transition:
    background var(--transition),
    color var(--transition);
}
.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-item.active {
  background: var(--accent-lt);
  color: var(--accent);
}

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.admin-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-lt);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-info {
  min-width: 0;
}
.admin-email {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-role {
  font-size: 11px;
  color: var(--text-3);
}

/* ══════════════════════════════ MAIN ══ */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 32px 36px;
  width: calc(
    100% - var(--sidebar-w)
  ); /* Changed to 100% instead of 100vw to fix horizontal scroll */
  box-sizing: border-box;
  overflow-x: hidden;
}

.page,
.page.active,
.page-content {
  display: block;
}

.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-top: 10px;
}

.message-card label {
  display: block;
  margin-top: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #9ca3af;
}

.message-card input,
.message-card select,
.message-card textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: 0.2s ease;
}

/* focus effect like your UI */
.message-card input:focus,
.message-card select:focus,
.message-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

.message-card button {
  margin-top: 18px;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: rgb(42, 38, 38);
  color: rgb(245, 178, 8);
  font-weight: 600;
  transition: 0.2s ease;
}

.message-card button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(66, 66, 68, 0.3);
}

#userIdContainer {
  margin-top: 10px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.page h2 {
  font-size: 22px;
  margin-bottom: 5px;
}

.page p {
  color: #616365;
  margin-bottom: 20px;
}
/* ════════════════════════ PAGE HEADER ══ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ══════════════════════════ TOOLBAR ══ */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
}

.filter-group {
  display: flex;
  gap: 8px;
}

/* ════════════════════════════ INPUTS ══ */
.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.field select,
.field textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="datetime-local"],
input[type="time"],
input[type="file"],
textarea.search-input,
textarea,
.search-input,
.select-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  padding: 10px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

input[type="file"] {
  padding: 8px 12px;
  cursor: pointer;
  line-height: 1.4;
}

textarea,
.field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.field textarea:focus,
input:focus,
textarea:focus,
.select-input:focus,
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lt);
}

.select-input,
.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%208b939e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════ TABLE ══ */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  font-weight: 500;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.th-actions {
  text-align: right;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.cell-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.cell-email {
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--mono);
  margin-top: 1px;
}
.cell-id {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}
.cell-date {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

/* ══════════════════════════ BADGES ══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-role-admin {
  background: var(--accent-lt);
  color: var(--accent);
}
.badge-role-user {
  background: var(--blue-lt);
  color: var(--blue);
}

.badge-active {
  background: var(--green-lt);
  color: var(--green);
}
.badge-inactive {
  background: var(--red-lt);
  color: var(--red);
}

.badge-yes {
  background: var(--green-lt);
  color: var(--green);
}
.badge-no {
  background: var(--bg-hover);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.badge-notified {
  background: var(--blue-lt);
  color: var(--blue);
}
.badge-pending {
  background: var(--accent-lt);
  color: var(--accent);
}

.badge-meal-breakfast {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.badge-meal-lunch {
  background: var(--green-lt);
  color: var(--green);
}
.badge-meal-dinner {
  background: var(--purple-lt);
  color: var(--purple);
}
.badge-meal-all-day {
  background: var(--blue-lt);
  color: var(--blue);
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.auth-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.auth-chip {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: var(--mono);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* ═══════════════════════════ ROW ACTIONS ══ */
.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition);
}
.btn-icon svg {
  width: 14px;
  height: 14px;
}
.btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text);
}
.btn-icon.btn-icon-danger:hover {
  background: var(--red-lt);
  border-color: transparent;
  color: var(--red);
}

/* ══════════════════════════════ SKELETON ══ */
.loading-row td {
  padding: 0;
}
.skeleton-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.skeleton {
  height: 52px;
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
  border-bottom: 1px solid var(--border);
}

/* ════════════════════════ EMPTY STATE ══ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state svg {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  display: block;
  opacity: 0.4;
}
.empty-state p {
  font-size: 13px;
}

/* ════════════════════════════ ALERTS ══ */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--red-lt);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #b91c1c;
}
.alert-success {
  background: var(--green-lt);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #15803d;
}

/* ══════════════════════════════ BUTTONS ══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: #2a2626;
  color: #f5b208;
}
.btn-primary:hover {
  background: var(--accent-dk);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-spinner.white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

/* ════════════════════════ FORM FIELDS ══ */
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.required {
  color: var(--red);
}
.field-hint {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 400;
}

/* Checkbox */
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px !important;
  color: var(--text) !important;
  font-weight: 400 !important;
  margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border-hi);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: "";
  display: block;
  width: 9px;
  height: 6px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg) translateY(-1px);
}

.form-grid .field,
.form-row .field {
  margin-bottom: 0;
}

/* ══════════════════════════════ DRAWER ══ */
.drawer-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 35, 0.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

.drawer,
.modal {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  width: min(440px, 100vw);
  height: 100%;
  max-height: 100vh;
  box-shadow: -8px 0 32px rgba(26, 29, 35, 0.12);
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.22s ease;
  border-radius: 0;
}

.drawer-sm,
.modal-sm {
  width: min(380px, 100vw);
}

.drawer-lg,
.modal-lg {
  width: min(560px, 100vw);
}

.drawer-header,
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-header h2,
.modal-header h2,
.drawer-header h3,
.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.drawer-body,
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.drawer-footer,
.modal-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
}

@keyframes drawerIn {
  from {
    transform: translateX(16px);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.confirm-text {
  color: var(--text-2);
  font-size: 13.5px;
}

/* ════════════════════════ SUB-TABS ══ */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.sub-tab,
a.sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  bottom: -1px;
  text-decoration: none;
}
.sub-tab svg {
  width: 14px;
  height: 14px;
}
.sub-tab:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.sub-tab.active {
  color: var(--accent);
  background: var(--bg-card);
  border-color: var(--border);
  border-bottom-color: var(--bg-card);
}

.sub-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--text-3);
  font-size: 11px;
  font-family: var(--mono);
}
.sub-tab.active .sub-tab-count {
  background: var(--accent-lt);
  color: var(--accent);
}

.subtab-panel {
  display: block;
}

/* ═══════════════════ DETAIL SECTIONS (inside modals) ══ */
.detail-section {
  margin-bottom: 20px;
}
.detail-section:last-child {
  margin-bottom: 0;
}
.detail-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.detail-kv {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-key {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.detail-val {
  font-size: 13px;
  color: var(--text);
  font-family: var(--mono);
}

.ingredient-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ingredient-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: var(--bg-hover);
  border-radius: var(--radius);
  font-size: 12.5px;
}
.ingredient-name {
  color: var(--text);
}
.ingredient-qty {
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 12px;
}
.ingredient-ok {
  color: var(--green);
  font-size: 11px;
}
.ingredient-miss {
  color: var(--red);
  font-size: 11px;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: step-counter;
}
.step-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}
.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.missing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.missing-chip {
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--red-lt);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #b91c1c;
  font-size: 12px;
  font-family: var(--mono);
}

.recipe-card-mini {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.recipe-card-mini:last-child {
  margin-bottom: 0;
}
.recipe-card-mini-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* ════════════════════════ ANIMATIONS ══ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

/* ════════════════════════ CUSTOM AUTOCOMPLETE ══ */
.autocomplete-wrapper {
  position: relative;
}
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: var(--shadow);
  display: none;
}
.autocomplete-dropdown.show {
  display: block;
  animation: fadeIn 0.15s ease;
}
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover {
  background: var(--bg-hover);
}
.autocomplete-item strong {
  color: var(--accent);
  font-weight: 600;
}

/* ════════════════════════ SCROLLBAR FIX (TARGETED) ══ */

/* Target the body ONLY when the Message Center page is active */
body:has(#page-messages.active) {
  /* Firefox */
  scrollbar-width: none !important;
  /* IE/Edge */
  -ms-overflow-style: none !important;
}

/* Chrome, Safari, Edge */
body:has(#page-messages.active)::-webkit-scrollbar {
  display: none;
  width: 0;
  background: transparent;
}

/* Add to bottom of style.css */
.autocomplete-item.autocomplete-active {
  background: var(--bg-hover);
  border-left: 2px solid var(--accent);
}

.engagement-callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.engagement-callout p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}
.engagement-callout p + p {
  margin-top: 8px;
}
.engagement-section {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
  margin: 0 0 10px;
}
.segment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.segment-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px 12px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}
.segment-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.segment-count {
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.segment-label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}
.segment-hint {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  line-height: 1.35;
}
.engagement-more {
  display: flex;
  justify-content: center;
  margin: 12px 0 24px;
}
.engagement-compose {
  padding: 24px;
  margin-bottom: 32px;
}
.engagement-compose h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.engagement-check {
  width: 42px;
  text-align: center;
}
.engagement-check input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.engagement-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 12px 0 16px;
}
.engagement-mode label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.engagement-mode input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
}
.engagement-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-2);
}
.engagement-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.engagement-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid var(--border);
}
.data-table tbody tr.engagement-row-today,
.engagement-swatch.engagement-row-today {
  background: rgba(22, 163, 74, 0.18);
}
.data-table tbody tr.engagement-row-yesterday,
.engagement-swatch.engagement-row-yesterday {
  background: rgba(217, 119, 6, 0.2);
}
.data-table tbody tr.engagement-row-day-before,
.engagement-swatch.engagement-row-day-before {
  background: rgba(37, 99, 235, 0.16);
}
.data-table tbody tr.engagement-row-today:hover {
  background: rgba(22, 163, 74, 0.28);
}
.data-table tbody tr.engagement-row-yesterday:hover {
  background: rgba(217, 119, 6, 0.3);
}
.data-table tbody tr.engagement-row-day-before:hover {
  background: rgba(37, 99, 235, 0.26);
}
