:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --card: #ffffff;
  --border: #d0d0d0;
  --text: #111111;
  --accent: #45b72e;
  --accent-soft: #45b72e20;
}

body.dark {
  --bg: #272b26;
  --panel: #0000004b;
  --card: #0000004b;
  --border: #29332579;
  --text: #e5e7eb;
  --accent: #4fcc36;
  --accent-soft: #5ef54020;
}

body {
  margin: 0;
  font-family: "Open Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Poppins", "Open Sans", Arial, sans-serif;
}

.master-controls {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 30;
}

.hamburger-btn {
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--panel);
}

.master-actions {
  margin-top: 6px;
  min-width: 260px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.master-actions-title {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.master-action-btn {
  width: 100%;
  text-align: left;
  margin: 0 0 6px 0;
}

.master-action-btn:last-child {
  margin-bottom: 0;
}

.sidebar {
  width: 260px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar {
  scrollbar-color: var(--accent-soft) var(--card);
  scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
  width: 10px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--card);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--accent-soft);
  border-radius: 999px;
  border: 2px solid var(--card);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.sidebar h2 {
  color: var(--accent);
  margin-top: 0;
}

.sidebar-item {
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 5px;
  transition: background 0.15s ease, border 0.15s ease;
  font-size: 12px;
}

.section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  font-weight: 700;
}

.section-toggle:hover {
  opacity: 0.9;
}

.section-body {
  margin-top: 6px;
}

.chevron {
  display: inline-block;
  font-size: 14px;
  transition: transform 0.15s ease;
}

.chevron.collapsed {
  transform: rotate(-90deg);
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--card);
}

.panel-title {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 6px;
}

.panel-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.panel-row input {
  flex: 1;
  width: 100%;
}

.mini-btn {
  font-size: 12px;
  padding: 4px 8px;
}

.context-label {
  font-size: 12px;
  margin-bottom: 8px;
  opacity: 0.9;
}

.location-compact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn {
  margin: 0;
  padding: 4px 8px;
  font-size: 14px;
}

.location-compact-name {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.danger-item {
  background: #5c1010;
  color: #ffffff;
}

.sidebar-item.active {
  background: var(--accent-soft);
}

.sidebar-item:hover {
  background: var(--accent-soft);
}

.main {
  display: flex;
  flex: 1;
  padding: 20px;
  gap: 20px;
}

.column {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px;
  overflow-y: auto;
}

.items-grid {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 170px;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.item-row:last-child {
  border-bottom: 0;
}

.item-header-row {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
  cursor: default;
}

.item-cell {
  padding: 8px 10px;
}

.item-cell-price {
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-cell-price input {
  width: 80px;
}

.item-cell-action {
  display: flex;
  justify-content: flex-end;
}

.item-row.active {
  box-shadow: none;
  background: var(--accent-soft);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border 0.15s ease, background 0.15s ease;
}

.card:hover {
  background: #0000001f;
}

.disabled-entry {
  opacity: 0.45;
}

.disabled-entry .item-name,
.disabled-entry .group-name,
.disabled-entry .mod-name {
  text-decoration: line-through;
}

.active {
  background: var(--accent-soft);
  box-shadow: 0 0 8px #252e22;
}

.active:hover {
  background: var(--accent-soft);
}

button {
  background: var(--border);
  color: var(--text);
  border: none;
  padding: 5px 10px;
  margin: 5px 2px;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

button:hover {
  opacity: 0.85;
}

.danger {
  background: #8f4949;
  color: #ffffff;
}

.disable-btn {
  background: #8a3030;
  color: #fff4f4;
  margin: 0;
}

.disable-btn:hover {
  background: #eccdcd;
}

body.dark .disable-btn:hover {
  background: #902626;
}

.restore-btn {
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  padding: 3px 7px;
}

input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px;
  border-radius: 4px;
  width: 80px;
}

.modifier-box {
  margin: 10px 0 16px 10px;
  padding: 10px;
  border-left: 2px solid var(--accent);
}

.mod-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.mod-name {
  width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mod-price {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mod-price input {
  width: 70px;
}

.mod-row button {
  margin-left: auto;
}

.trash-entry {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 6px;
  background: var(--card);
}

.trash-entry strong {
  color: var(--accent);
}

.hidden {
  display: none;
}

.sidebar-item.locked {
  opacity: 0.38;
  cursor: not-allowed;
}

.sidebar-item.locked:hover {
  background: transparent;
}

.submit-btn {
  min-width: 140px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  margin: 0;
}

.submit-btn:hover {
  opacity: 0.88;
}

.submit-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Screens ──────────────────────────────────────────────────────────────── */

#screenSlider {
  display: flex;
  width: 200vw;
  height: 100vh;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

#screenSlider.phase-review {
  transform: translateX(-50%);
}

#screenSlider.no-transition {
  transition: none !important;
}

.screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-shrink: 0;
}

/* ── Location screen ──────────────────────────────────────────────────────── */

.location-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px 40px;
  overflow-y: auto;
}

.location-screen-title {
  font-family: "Poppins", sans-serif;
  color: var(--accent);
  margin: 0 0 8px;
  font-size: 28px;
}

.location-screen-subtitle {
  margin: 0 0 32px;
  opacity: 0.7;
  font-size: 14px;
}

.location-screen-body {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ls-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--panel);
}

.ls-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-bottom: 10px;
}

.master-status {
  margin-bottom: 10px;
  font-size: 14px;
}

.status-ok {
  color: var(--accent);
}

.status-warn {
  opacity: 0.7;
}

.location-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--card);
  margin-bottom: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.location-entry:hover {
  border-color: var(--accent);
}

.location-entry.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.location-entry-name {
  font-size: 14px;
}

.selected-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.no-locations {
  font-size: 13px;
  opacity: 0.6;
  padding: 4px 0 10px;
}

.store-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.store-field-row:last-child {
  margin-bottom: 0;
}

.store-field-label {
  font-size: 13px;
  width: 100px;
  flex-shrink: 0;
}

.store-text-input {
  flex: 1;
  width: auto;
  min-width: 0;
}

.no-menu-note {
  width: 100%;
  max-width: 520px;
  font-size: 12px;
  opacity: 0.6;
  margin: 8px 0 0;
  min-height: 1em;
}

.location-screen-footer {
  width: 100%;
  max-width: 520px;
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.proceed-btn {
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.proceed-btn:hover {
  opacity: 0.88;
}

.proceed-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.admin-access {
  position: fixed;
  bottom: 14px;
  left: 18px;
  font-size: 11px;
  opacity: 0.18;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
  letter-spacing: 0.04em;
}
.admin-access:hover {
  opacity: 0.55;
}

/* ── Review screen ────────────────────────────────────────────────────────── */

.review-location-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.review-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.review-content {
  flex: 1;
  display: flex;
  padding: 20px;
  gap: 20px;
  overflow-y: auto;
  min-height: 0;
}

.review-columns {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.review-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
}

.category-nav-btn {
  min-width: 140px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--text);
  margin: 0;
}

.category-nav-btn:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
}

.category-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.nav-center {
  font-size: 13px;
  opacity: 0.65;
}
