*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-padding-top: 140px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  z-index: 9999;
  background: #18181b;
  color: #f5f5f5;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Global focus ring — visible for keyboard users only */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  --bg: #111113;
  --surface: #1c1c22;
  --surface-hover: #26262e;
  --border: #2e2e38;
  --border-subtle: #27272a;
  --border-mid: #3f3f46;
  --text: #e4e4e7;
  --text-dim: #b3b3be;
  --text-dimmer: #a8a8b4;
  --text-dimmest: #a0a0aa;
  --accent: #b09dfc;
  --accent-bg: #2e2a45;
  --accent-hover: #3d3460;
  --color-positive: #4ade80;
  --color-negative: #fa8585;
  --color-warning: #fbbf24;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  min-height: 100vh;
  padding-bottom: 40px;
  transition: background .25s ease, color .25s ease;
}
body.light {
  --bg: #f9f9fb;
  --surface: #ffffff;
  --surface-hover: #f3f3f6;
  --border: #e4e4e7;
  --border-subtle: #f0f0f2;
  --border-mid: #d4d4d8;
  --text: #18181b;
  --text-dim: #52525b;
  --text-dimmer: #525262;
  --text-dimmest: #606070;
  --accent: #5b21b6;
  --accent-bg: #ede9fe;
  --accent-hover: #ddd6fe;
  --color-positive: #14532d;
  --color-negative: #991b1b;
  --color-warning: #78350f;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 16px 16px 12px;
  transition: background .25s ease;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.header-top-right { display: flex; gap: 8px; align-items: center; }
.app-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.app-logo { height: 28px; }
@media (min-width: 375px) { .app-logo { height: 36px; } }
@media (min-width: 768px) { .app-logo { height: 48px; } }

.reset-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  transition: color .15s, border-color .15s;
}
.reset-btn:hover { color: var(--color-negative); border-color: var(--color-negative); }

.theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 15px;
  width: 30px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }

.auth-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-btn:hover { color: var(--accent); border-color: var(--accent); }
.auth-btn.logged:hover { color: var(--color-negative); border-color: var(--color-negative); }
.auth-avatar { width: 18px; height: 18px; border-radius: 50%; }

.kcal-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.kcal-consumed { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.kcal-sep { font-size: 16px; color: var(--text-dimmest); }
.kcal-target-wrap { display: flex; align-items: baseline; gap: 4px; }
.kcal-target {
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 1px dashed var(--text-dimmest);
  padding-bottom: 1px;
}
.kcal-target-input {
  font-size: 14px;
  width: 60px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  padding: 1px 4px;
}
.kcal-label { font-size: 12px; color: var(--text-dimmer); }
.kcal-remaining { font-size: 12px; color: var(--text-dimmer); margin-left: auto; }

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 3px; transition: width .4s ease, background .4s ease; }

.tabs-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  transition: background .25s ease;
}
.tabs-inner { max-width: 520px; margin: 0 auto; display: flex; position: relative; }
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dimmer);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  margin-bottom: -1px;
  transition: color .25s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); }
.tab-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transition: left .3s cubic-bezier(.4,0,.2,1), width .3s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

.content { max-width: 520px; margin: 0 auto; padding: 16px 12px 0; min-height: calc(100dvh - 180px); }

.category-card {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  transition: border-color .15s, background .25s ease;
}
.category-card.has-checked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.category-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  border-radius: 10px;
}
.category-btn[aria-expanded="true"] { border-radius: 10px 10px 0 0; }
.category-btn:hover { background: var(--surface-hover); }
.cat-icon { font-size: 18px; line-height: 1; }
.cat-name { flex: 1; }
.cat-meta { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.cat-kcal-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 4px;
  padding: 2px 6px;
}
.cat-arrow { font-size: 10px; color: var(--text-dimmest); transition: transform .2s; }
.cat-arrow.open { transform: rotate(180deg); }

.items-grid { display: grid; grid-template-columns: 1fr auto 56px 84px; padding: 0 0 12px; font-size: 13px; align-items: stretch; border-radius: 0 0 10px 10px; overflow: hidden; }
.items-grid :focus-visible { outline-offset: -3px; border-radius: 2px; }
.items-grid-label { padding: 4px 14px 8px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dimmer); }
.items-grid-label.right { text-align: right; }
.items-grid-sep { grid-column: 1 / -1; height: 1px; background: var(--border-subtle); }
.item-name { min-height: 44px; display: flex; align-items: center; padding: 0 0 0 14px; white-space: normal; }
.item-portion { min-height: 44px; display: flex; align-items: center; padding: 0 5px; color: var(--text-dimmer); white-space: nowrap; }
.item-kcal-cell { min-height: 44px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding: 0 5px; white-space: nowrap; }
.item-cell-active { background: var(--accent-bg); }
body.light .item-cell-active { background: #ede9fe; }

.counter { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.counter-btn {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border-mid);
  background: var(--border-subtle);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, border-color .12s;
  padding: 0;
}
/* Extend touch target to 44×44px without affecting layout */
.counter-btn::before {
  content: '';
  position: absolute;
  inset: -11px;
}
.counter-btn:hover { background: var(--border-mid); border-color: var(--text-dimmest); }
.counter-btn.plus { border-color: var(--accent); color: var(--accent); }
.counter-btn.plus:hover { background: var(--accent-bg); }
.counter-btn.minus-disabled { opacity: 0.75; cursor: default; pointer-events: none; }
.counter-num { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 14px; text-align: center; }
.grams-input {
  width: 72px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-mid);
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  padding: 2px 2px;
  -moz-appearance: textfield;
}
.grams-input::placeholder { color: var(--text-dimmest); font-style: italic; }
.grams-input:focus { border-bottom-color: var(--accent); color: var(--text); }
.grams-input::-webkit-inner-spin-button,
.grams-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.item-kcal { font-weight: 600; }

.bar-mini { width: 100%; height: 3px; background: var(--border-subtle); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.bar-mini-fill { height: 100%; border-radius: 2px; }

.extra-input-row { display: flex; gap: 8px; padding: 10px 14px 12px; align-items: center; }
.extra-kcal-input {
  flex: 1;
  background: var(--border-subtle);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
  font-size: 14px;
}
.extra-kcal-input::placeholder { color: var(--text-dimmest); font-style: italic; }
.extra-kcal-input:focus { border-color: var(--accent); }
.extra-add-btn {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 600;
  padding: 7px 12px;
  transition: background .12s;
  white-space: nowrap;
  line-height: 1;
}
.extra-add-btn:hover { background: var(--accent-hover); }
.extra-list { padding: 0 14px 12px; }
.extra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}
.extra-item-label { color: var(--text-dim); }
.extra-item-right { display: flex; align-items: center; gap: 10px; }
.extra-item-kcal { font-weight: 600; }
.extra-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-dimmest);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color .12s;
}
.extra-remove-btn:hover { color: #f87171; }

.legend {
  max-width: 520px;
  margin: 12px auto 0;
  padding: 0 12px;
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 11px;
  color: var(--text-dimmer);
}

.guest-banner {
  margin-top: 24px;
  padding: 18px 16px;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  text-align: center;
}
.guest-banner-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.guest-banner-body { font-size: 13px; color: var(--text-dimmer); line-height: 1.5; margin-bottom: 14px; }
.guest-banner-btn {
  background: var(--accent);
  color: #111113;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
body.light .guest-banner-btn { color: #fff; }
.guest-banner-btn:hover { opacity: .85; }

.history-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 6px;
}
.history-day-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.history-day-date { font-size: 14px; font-weight: 600; text-transform: capitalize; }
.history-day-kcal { font-size: 16px; font-weight: 700; }
.history-items { font-size: 12px; color: var(--text-dimmer); line-height: 1.6; }
.history-log-groups { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.history-log-group { display: flex; gap: 6px; font-size: 12px; line-height: 1.5; }
.history-log-label { font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.history-log-items { color: var(--text-dimmer); }

.menu-tab { padding: 0 0 24px; }
.meal-group { background: var(--surface); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.meal-group-header { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px 9px; border-bottom: 1px solid var(--border); }
.meal-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-dimmer); }
.meal-group-total { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.meal-entry { display: flex; justify-content: space-between; align-items: center; padding: 9px 16px; }
.meal-entry + .meal-entry { border-top: 1px solid var(--border-subtle); }
.meal-entry-name { font-size: 14px; color: var(--text); }
.meal-entry-kcal { font-size: 13px; color: var(--text-dimmer); }
.menu-legend { margin-top: 8px; padding: 12px 16px; background: var(--surface); border-radius: 14px; }
.menu-legend-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-dimmest); margin-bottom: 8px; }
.menu-legend-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dimmer); padding: 3px 0; }
.menu-legend-row span:first-child { color: var(--text-dim); }
.history-empty { text-align: center; color: var(--text-dimmest); padding: 40px 0; font-size: 14px; line-height: 1.8; }

.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: background .25s ease;
}
.week-summary {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.week-summary-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); }
.week-summary-row span:last-child { font-weight: 600; color: var(--text); }
.week-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
}
.deficit { color: var(--color-positive); }
.surplus { color: var(--color-negative); }

.bimester-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bimester-label { font-size: 14px; font-weight: 600; color: var(--text); }
.bimester-btn {
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13px;
  padding: 4px 10px;
  transition: color .15s, border-color .15s;
}
.bimester-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-dimmer); }
.bimester-btn:disabled { opacity: 0.3; cursor: default; }

.month-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 20px 0 10px;
  text-transform: capitalize;
}

.week-current-header {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}
.week-accordion-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.week-accordion-header:hover { background: var(--surface-hover); }
.week-accordion-header.incomplete { background: #2a2410; border-bottom: 1px solid #78580a; }
.week-accordion-header.incomplete:hover { background: #332b12; }
body.light .week-accordion-header.incomplete { background: #fefce8; border-bottom: 1px solid #fde047; }
body.light .week-accordion-header.incomplete:hover { background: #fef9c3; }
.week-incomplete-note { font-size: 11px; color: #a16207; margin-top: 8px; }

.surplus-snackbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #2a1a00;
  border-top: 1px solid #78450a;
  border-bottom: 1px solid #78450a;
  padding: 11px 16px;
}
.surplus-snackbar-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.surplus-snackbar-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
}
.surplus-snackbar-text strong { color: #fbbf24; font-weight: 600; }
.surplus-snackbar-text span { color: #d97706; font-size: 12px; }
body.light .surplus-snackbar { background: #fffbeb; border-top-color: #fde68a; border-bottom-color: #fde68a; }
body.light .surplus-snackbar-text strong { color: #b45309; }
body.light .surplus-snackbar-text span { color: #92400e; }

.deficit-snackbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #0a2010;
  border-top: 1px solid #166534;
  border-bottom: 1px solid #166534;
  padding: 11px 16px;
}
.deficit-snackbar .surplus-snackbar-text strong { color: #4ade80; }
.deficit-snackbar .surplus-snackbar-text span { color: #16a34a; }
body.light .deficit-snackbar { background: #f0fdf4; border-top-color: #bbf7d0; border-bottom-color: #bbf7d0; }
body.light .deficit-snackbar .surplus-snackbar-text strong { color: #15803d; }
body.light .deficit-snackbar .surplus-snackbar-text span { color: #166534; }
body:not(.light) .week-incomplete-note { color: #ca8a04; }
.week-acc-left { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.week-acc-dates { font-size: 13px; font-weight: 600; color: var(--text); }
.week-acc-balance { font-size: 12px; white-space: nowrap; margin-right: 4px; }
.week-acc-arrow { font-size: 10px; color: var(--text-dimmest); transition: transform .2s; }
.week-acc-arrow.open { transform: rotate(180deg); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%  { transform: translateX(-5px); }
  40%  { transform: translateX(5px); }
  60%  { transform: translateX(-5px); }
  80%  { transform: translateX(5px); }
}
.shake { animation: shake 0.4s ease; }

.search-wrap {
  position: relative;
  margin-bottom: 10px;
}
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 36px 9px 12px;
  font-size: 14px;
  transition: border-color .15s;
}
.search-input::placeholder { color: var(--text-dimmest); font-style: italic; }
.search-input:focus { border-color: var(--accent); }
.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dimmest);
  font-size: 16px;
  line-height: 1;
  padding: 2px;
  transition: color .12s;
}
.search-clear:hover { color: var(--text); }
.search-highlight { background: var(--accent-bg); color: var(--accent); border-radius: 2px; }

.close-all-btn {
  font-size: 11px;
  color: var(--text-dimmest);
  background: transparent;
  border: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-bottom: 8px;
  display: block;
}
.close-all-btn:hover { color: var(--text-dim); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal-text { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; line-height: 1.5; }
.modal-btn {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  transition: background .12s;
}
.modal-btn:hover { background: var(--accent-hover); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, color .15s;
}
.modal-btn-ghost:hover { border-color: var(--text-dimmer); color: var(--text); }
.modal-btn-danger {
  background: #3a1212;
  border: 1px solid var(--color-negative);
  border-radius: 8px;
  color: var(--color-negative);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .12s;
}
body.light .modal-btn-danger { background: #fee2e2; }
.modal-btn-danger:hover { opacity: .85; }

/* Admin tab — Alimenti */
.admin-tab { padding-bottom: 24px; }

.admin-items-list {
  padding: 4px 14px 12px;
  border-top: 1px solid var(--border-subtle);
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-item-row:last-of-type { border-bottom: none; }

.admin-item-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.admin-item-name { font-size: 14px; color: var(--text); }
.admin-item-meta { font-size: 11px; color: var(--text-dimmest); }

.admin-item-actions { display: flex; gap: 2px; flex-shrink: 0; }

.admin-icon-btn {
  background: transparent;
  border: none;
  font-size: 15px;
  padding: 4px 6px;
  color: var(--text-dimmer);
  cursor: pointer;
  border-radius: 6px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.admin-icon-btn:hover { background: var(--surface-hover); }
.admin-icon-btn-delete:hover { background: #3a1212; }
body.light .admin-icon-btn-delete:hover { background: #fee2e2; }

.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0 8px;
}
.admin-form-new { border-top: 1px solid var(--border-subtle); margin-top: 4px; }

.admin-input {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 9px;
  font-family: inherit;
  transition: border-color .15s;
}
.admin-input:focus { border-color: var(--accent); outline: none; }
.admin-input::placeholder { color: var(--text-dimmest); font-style: italic; }
.admin-input-name { flex: 1; min-width: 120px; }
.admin-input-portion { width: 90px; }
.admin-input-kcal { width: 80px; }
.admin-input-icon { width: 70px; }

.admin-variable-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.admin-form-actions { display: flex; gap: 6px; }

.admin-btn {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  min-height: 32px;
  border: none;
  cursor: pointer;
  transition: opacity .12s;
  font-family: inherit;
}
.admin-btn:hover { opacity: .85; }
.admin-btn-primary { background: var(--accent); color: #111113; }
body.light .admin-btn-primary { color: #fff; }
.admin-btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-mid);
}
.admin-btn-ghost:hover { opacity: 1; border-color: var(--text-dimmer); color: var(--text); }

.admin-add-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 1px dashed var(--border-mid);
  border-radius: 6px;
  color: var(--accent);
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: center;
  min-height: 36px;
  font-family: inherit;
  transition: border-color .15s, background .12s;
}
.admin-add-btn:hover { border-color: var(--accent); background: var(--accent-bg); }

.admin-cat-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.admin-delete-cat-btn {
  background: transparent;
  border: none;
  color: var(--text-dimmest);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  min-height: 32px;
  font-family: inherit;
  transition: color .12s;
}
.admin-delete-cat-btn:hover { color: var(--color-negative); }

.admin-new-cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 6px;
}

.admin-add-cat-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: transparent;
  border: 1px dashed var(--border-mid);
  border-radius: 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 14px;
  cursor: pointer;
  text-align: center;
  min-height: 44px;
  font-family: inherit;
  transition: border-color .15s, background .12s;
}
.admin-add-cat-btn:hover { border-color: var(--accent); background: var(--accent-bg); }

.admin-drag-handle {
  font-size: 16px;
  color: var(--text-dimmest);
  cursor: grab;
  padding: 0 8px 0 0;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  line-height: 1;
}
.admin-drag-handle:active { cursor: grabbing; }
.admin-drag-ghost { opacity: 0.4; background: var(--accent-bg) !important; }
