:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #fff7ed;
  --border: #e2e8f0;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #ea580c;
  --primary-600: #dc2626;
  --primary-700: #b91c1c;
  --accent: #f59e0b;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --sidebar: #2a0f0b;
  --sidebar-2: #451a12;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 28px rgba(17, 24, 39, .08);
  --ring: 0 0 0 4px rgba(234, 88, 12, .14);
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--primary) #ffedd5; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #ffedd5; border-radius: 999px; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  border: 2px solid #ffedd5;
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--primary-700); }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.page-loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 247, 237, .82);
  backdrop-filter: blur(8px);
  z-index: 999;
}
.page-loader.show { display: flex; }
.loader-card {
  min-width: 170px;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid #fed7aa;
  box-shadow: 0 24px 60px rgba(69, 26, 18, .18);
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--primary-700);
}
.loader-ring {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid #fed7aa;
  border-top-color: var(--primary);
  animation: day-spin .75s linear infinite;
}
@keyframes day-spin { to { transform: rotate(360deg); } }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 15%, rgba(245, 158, 11, 0.24), transparent 28%),
    linear-gradient(135deg, #3b0f0b 0%, #7f1d1d 42%, #ea580c 100%);
}
.auth-shell { width: min(100%, 420px); }
.auth-brand { color: #fff; text-align: center; margin-bottom: 22px; }
.brand-mark {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: inline-grid;
  place-items: center;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 18px 45px rgba(69, 26, 18, 0.32);
}
.brand-mark svg { width: 44px; height: 44px; }
.auth-brand h1 { font-size: 1.55rem; margin: 14px 0 4px; }
.auth-brand p { margin: 0; color: #fed7aa; font-size: .82rem; text-transform: uppercase; font-weight: 700; }
.auth-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 26px 70px rgba(69, 26, 18, 0.34);
}
.auth-card h2 { margin: 0 0 6px; font-size: 1.25rem; }
.auth-card .subtitle { margin: 0 0 22px; color: var(--muted); font-size: .92rem; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px;
  position: fixed;
  inset: 0 auto 0 0;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #fee2e2;
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: width .2s ease, transform .2s ease;
}
.sidebar-brand {
  height: 68px;
  min-height: 68px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.sidebar-brand .brand-mark svg { width: 28px; height: 28px; }
.sidebar-brand strong { display: block; color: #fff; font-size: .98rem; line-height: 1.05; }
.sidebar-brand span { color: #fff; font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.sidebar-nav {
  padding: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(253, 186, 116, .2) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; height: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(253, 186, 116, .14);
  border: 0;
  border-radius: 999px;
}
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(253, 186, 116, .28); }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fed7aa;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: .86rem;
  white-space: nowrap;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,0.11);
  color: #fff;
}
.sidebar-link svg { width: 19px; height: 19px; }
.content {
  margin-left: 272px;
  width: calc(100% - 272px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .2s ease, width .2s ease;
}
body.sidebar-collapsed .sidebar { width: 84px; }
body.sidebar-collapsed .content {
  margin-left: 84px;
  width: calc(100% - 84px);
}
body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  height: 68px;
  min-height: 68px;
  padding: 0;
}
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-link span { display: none; }
body.sidebar-collapsed .sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
body.sidebar-collapsed .sidebar-link {
  width: 48px;
  height: 48px;
  padding: 0;
  margin-bottom: 0;
  justify-content: center;
  border-radius: 12px;
  flex: 0 0 48px;
}
body.sidebar-collapsed .sidebar-link svg { width: 19px; height: 19px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(390px, calc(100vw - 28px));
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 22px 52px rgba(15, 23, 42, .16);
  padding: 8px;
  display: none;
  z-index: 70;
}
.dropdown.open .dropdown-panel { display: block; }
.notification-panel-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}
.notification-panel-header .btn { white-space: nowrap; }
.notification-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
}
.notification-item:hover { background: #fff7ed; }
.notification-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  margin-top: 6px;
  flex: 0 0 auto;
}
.notification-item strong { display: block; font-size: .9rem; }
.notification-item small { color: var(--muted); }
.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 800;
}
.topbar {
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
}
.topbar h1 { margin: 0; font-size: .95rem; white-space: nowrap; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  border: 2px solid #fff;
  box-shadow: var(--shadow-accent);
}
.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.main { padding: 24px; flex: 1; }
.footer { padding: 16px 24px; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--border); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.card { padding: 18px; }
.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.panel-body { padding: 20px; }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-title h2 { margin: 0; font-size: 1.35rem; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.stat {
  position: relative;
  overflow: hidden;
}
.stat .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
}
.stat label { color: var(--muted); display: block; font-size: .84rem; margin: 12px 0 6px; }
.stat strong { font-size: 1.5rem; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  min-height: 40px;
  font-size: .88rem;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-600)); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { min-height: 32px; padding: 7px 10px; font-size: .78rem; }
.btn-icon {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  position: relative;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row-full { grid-column: 1 / -1; }
.field label {
  display: block;
  font-size: .82rem;
  color: #475569;
  margin-bottom: 6px;
  font-weight: 700;
  white-space: nowrap;
}
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 42px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.textarea { min-height: 92px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.password-field {
  position: relative;
}
.password-field .input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  background: transparent;
  color: var(--muted);
}
.password-toggle:hover {
  background: #fff7ed;
  color: var(--primary);
}
.password-toggle svg {
  width: 18px;
  height: 18px;
}
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbar .input { max-width: 320px; }
.quick-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.quick-link-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 560px);
}
.quick-link-actions .input {
  min-width: 290px;
}

.table-wrap { overflow-x: visible; width: 100%; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .84rem;
  vertical-align: middle;
  overflow-wrap: normal;
  word-break: normal;
}
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; user-select: none; }
th.sortable { cursor: pointer; }
th.sortable::after { content: "  <>"; color: #cbd5e1; font-size: .72rem; }
th.sort-asc::after { content: "  ^"; color: var(--primary); }
th.sort-desc::after { content: "  v"; color: var(--primary); }
tbody tr:hover { background: #fff7ed; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  background: #ffedd5;
  color: #9a3412;
}
.badge.green { background: #d1fae5; color: #047857; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.gray { background: #f1f5f9; color: #475569; }

.flash-stack { position: fixed; right: 18px; top: 84px; display: grid; gap: 10px; z-index: 60; width: min(380px, calc(100vw - 32px)); }
.flash { border-radius: 10px; padding: 12px 14px; background: #fff; border-left: 4px solid var(--primary); box-shadow: var(--shadow); }
.flash.success { border-left-color: var(--success); }
.flash.error { border-left-color: var(--danger); }
.flash.warning { border-left-color: var(--warning); }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 16px; align-items: start; }
.kanban-col { background: #fff; border: 1px solid var(--border); border-radius: 12px; min-height: 180px; }
.kanban-col h3 { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: .96rem; }
.ticket { margin: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fffaf5; }
.ticket strong { display: block; margin-bottom: 4px; }
.ticket small { color: var(--muted); }

.delivery-rules-panel {
  margin-bottom: 18px;
}
.delivery-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}
.delivery-rule-cell {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fffaf5;
}
.delivery-rule-cell span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}
.delivery-rules-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: .9rem;
}

.map-box { min-height: 460px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; background: #e2e8f0; }
.empty { padding: 22px; border: 1px dashed #fdba74; background: #fff7ed; border-radius: 12px; color: #9a3412; }
.mobile-menu { display: none; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .58);
  padding: 18px;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: min(920px, 100%);
  max-height: min(86vh, 900px);
  overflow: hidden;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .28);
  border: 1px solid rgba(255,255,255,.36);
}
.modal-header {
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--sidebar), var(--primary-700), var(--primary));
}
.modal-header h3 { margin: 0; }
.modal-header p { margin: 4px 0 0; color: #fed7aa; }
.modal-body { padding: 20px; max-height: calc(86vh - 84px); overflow-y: auto; }
.modal-close {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  color: #fff;
}
.table-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.modal-actions { margin-top:16px; display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
.check-row { display:flex; align-items:center; gap:8px; font-weight:800; color:#334155; }
.category-chips { margin-top:14px; display:flex; flex-wrap:wrap; gap:8px; }
.category-chip-action {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
.field-help {
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:700;
}
.orders-toolbar { margin-bottom:18px; }
.orders-board {
  display:grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap:16px;
  align-items:start;
}
.orders-column {
  min-height:240px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.orders-column-head {
  min-height:58px;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--border);
}
.orders-column-head span {
  min-width:30px;
  min-height:30px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#ffedd5;
  color:var(--primary-700);
  font-weight:800;
}
.orders-list { display:grid; gap:10px; padding:12px; }
.order-ticket {
  border:1px solid #fed7aa;
  border-radius:10px;
  background:#fffaf5;
  overflow:hidden;
}
.order-ticket-main {
  width:100%;
  border:0;
  background:transparent;
  padding:12px;
  text-align:left;
  display:grid;
  gap:5px;
  color:inherit;
  cursor:pointer;
}
.order-ticket-main strong,
.order-ticket-main small {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  overflow-wrap:normal;
  white-space:nowrap;
}
.order-ticket-code { font-size:.78rem; font-weight:800; color:var(--primary-700); }
.order-ticket-total { font-weight:900; color:#111827; }
.order-ticket-actions {
  padding:10px 12px;
  border-top:1px solid #fed7aa;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.orders-empty { margin:0; box-shadow:none; }
.order-detail-grid {
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:12px;
}
.order-detail-grid > div {
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  display:grid;
  gap:4px;
}
.order-detail-grid label {
  font-size:.72rem;
  text-transform:uppercase;
  color:var(--muted);
  font-weight:800;
}
.order-detail-grid small { color:var(--muted); overflow-wrap:break-word; white-space:normal; }
.inventory-category-grid,
.purchase-list { display:grid; gap:16px; }
.inventory-name-cell { display:flex; align-items:center; gap:10px; min-width:220px; }
.inventory-name-cell span { display:grid; gap:3px; min-width:0; }
.inventory-name-cell strong,
.inventory-name-cell small { white-space:nowrap; }
.inventory-name-cell small { color:var(--muted); }
.purchase-card .panel-header { align-items:center; }
.purchase-summary { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; }
.purchase-details summary {
  cursor:pointer;
  font-weight:800;
  margin-bottom:12px;
}
.manual-items-box {
  margin-top:18px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}
.manual-items-box p { margin:4px 0 12px; color:var(--muted); }
.table-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: var(--primary);
  vertical-align: middle;
}
.table-thumb svg { width: 18px; height: 18px; }
.empty-thumb { overflow: hidden; }
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-photo-preview {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: var(--primary);
  flex: 0 0 auto;
}
.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-photo-preview svg { width: 32px; height: 32px; }

.public-menu-page {
  min-height: 100vh;
  background: #fff7ed;
}
.public-menu-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid #fed7aa;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.public-brand img,
.public-brand .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
}
.public-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--primary-700);
}
.public-brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .86rem;
}
.public-menu-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}
.public-menu-shell-full {
  display: block;
}
.public-cart-button {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
}
.public-cart-button span {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary-700);
  font-size: .72rem;
  font-weight: 900;
  border: 1px solid #fed7aa;
}
.public-category { margin-bottom: 22px; }
.public-category h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  color: #7f1d1d;
}
.public-products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.product-card {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  box-shadow: 0 12px 26px rgba(69, 26, 18, .08);
}
.product-photo {
  min-height: 150px;
  background: #ffedd5;
  display: grid;
  place-items: center;
  color: var(--primary);
}
.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-photo svg { width: 34px; height: 34px; }
.product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-info h3 {
  margin: 0;
  font-size: 1rem;
}
.product-info p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}
.product-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.public-cart {
  position: sticky;
  top: 96px;
}
.public-order-drawer[hidden],
.checkout-step[hidden] {
  display: none !important;
}
.public-order-drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 23, 42, .5);
  z-index: 120;
}
.public-order-drawer.open { display: flex; }
.public-order-card {
  width: min(520px, 100%);
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(15, 23, 42, .18);
}
.public-order-card form {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.public-order-header {
  padding: 18px 20px;
  min-height: 78px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--sidebar), var(--primary-700), var(--primary));
}
.public-order-header strong,
.public-order-header small {
  display: block;
}
.public-order-header small {
  color: #fed7aa;
  margin-top: 4px;
}
.public-order-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.checkout-step { display: none; }
.checkout-step.active { display: block; }
.checkout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.segmented-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.segmented-options label {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
}
.address-title {
  padding-top: 6px;
  color: var(--primary-700);
}
.delivery-quote-box {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fffaf5;
}
.delivery-quote-box .form-grid {
  gap: 10px;
}
.delivery-quote-box .form-grid + .form-grid {
  margin-top: 12px;
}
.pickup-location-box {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff;
}
.pickup-location-box strong,
.pickup-location-box span {
  display: block;
}
.pickup-location-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .88rem;
}
.delivery-quote-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.delivery-quote-status {
  flex: 1;
  min-width: 180px;
  color: var(--muted);
  font-size: .88rem;
}
.delivery-quote-status.is-ok {
  color: #047857;
  font-weight: 700;
}
.delivery-quote-status.is-error {
  color: #b91c1c;
  font-weight: 700;
}
.cart-items {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cart-line small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.qty-control .btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}
.cart-totals {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.cart-totals div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.cart-totals div:last-child {
  padding-top: 8px;
  border-top: 1px solid #fed7aa;
  color: var(--primary-700);
}
.public-result {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}
.public-result .panel {
  width: min(520px, 100%);
}
.tracking-page {
  min-height: 100vh;
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 22px;
  display: grid;
  align-items: start;
}
.tracking-card {
  margin-top: 18px;
}
.tracking-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.tracking-head h1 {
  margin: 10px 0 4px;
  font-size: 1.45rem;
}
.tracking-head p {
  margin: 0;
  color: var(--muted);
}
.security-code {
  min-width: 160px;
  padding: 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  text-align: center;
}
.security-code span {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.security-code strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-700);
  font-size: 1.9rem;
  letter-spacing: 0;
}
.tracking-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}
.tracking-step {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.tracking-step.done {
  background: #ffedd5;
  border-color: #fed7aa;
  color: var(--primary-700);
}
.tracking-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.tracking-section p {
  color: var(--muted);
  margin: 6px 0;
}
.result-icon {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  margin-bottom: 12px;
}
.result-icon.ok { background: var(--success); }
.result-icon.fail { background: var(--danger); }
.result-icon svg { width: 34px; height: 34px; }

/* Modern system refresh */
body {
  background:
    linear-gradient(180deg, #fffaf5 0%, #f8fafc 42%, #f1f5f9 100%);
}
.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  box-shadow: 8px 0 28px rgba(69, 26, 18, .14);
}
.sidebar-link,
.btn,
.input,
.select,
.textarea,
.card,
.panel,
.modal-card,
.order-ticket,
.product-card {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}
.sidebar-link {
  border: 1px solid transparent;
}
.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .12);
  transform: translateX(2px);
}
body.sidebar-collapsed .sidebar-link:hover,
body.sidebar-collapsed .sidebar-link.active { transform: translateY(-1px); }
.topbar {
  background: rgba(255, 255, 255, .82);
  border-bottom-color: rgba(226, 232, 240, .86);
  box-shadow: 0 8px 28px rgba(17, 24, 39, .05);
}
.card,
.panel {
  border-radius: 14px;
  border-color: rgba(216, 224, 234, .86);
  box-shadow: var(--shadow-soft);
}
.card:hover,
.panel:hover {
  box-shadow: 0 18px 46px rgba(17, 24, 39, .1);
}
.panel-header {
  background: linear-gradient(180deg, #fff, #fffaf5);
  border-radius: 14px 14px 0 0;
}
.page-title h2 {
  font-size: 1.35rem;
  letter-spacing: 0;
}
.btn {
  border-radius: 12px;
  box-shadow: 0 7px 18px rgba(17, 24, 39, .08);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, .13);
}
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
}
.btn-secondary {
  background: #fff;
  border-color: #d8e0ea;
}
.btn-danger {
  background: linear-gradient(135deg, #e11d48, #be123c);
}
.input,
.select,
.textarea {
  min-height: 44px;
  border-radius: 12px;
  background: #fff;
  border-color: #e2e8f0;
  font-size: .9rem;
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b9c6d6;
  background: #fff;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
  background: #fff;
}
.field:focus-within label { color: var(--primary-700); }
.required-mark {
  color: var(--danger);
  margin-left: 4px;
  font-weight: 900;
}
.check-row {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  font-size: .88rem;
  white-space: nowrap;
}
.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.channel-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.table-wrap {
  overflow-x: auto;
}
table.modern-table,
.table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}
table.modern-table th,
.table-wrap table th {
  background: #fff7ed;
  color: #475569;
  font-size: .74rem;
  letter-spacing: 0;
  white-space: nowrap;
}
table.modern-table th:first-child,
.table-wrap table th:first-child { border-top-left-radius: 12px; }
table.modern-table th:last-child,
.table-wrap table th:last-child { border-top-right-radius: 12px; }
table.modern-table td,
table.modern-table th,
.table-wrap table td,
.table-wrap table th {
  border-bottom-color: #e7edf4;
  white-space: nowrap;
}
tbody tr {
  transition: background .14s ease, transform .14s ease;
}
tbody tr:hover {
  background: #fff7ed;
}
th.sortable::after {
  content: "  ";
}
th.sortable {
  position: relative;
}
th.sortable::before {
  content: "<>";
  color: #94a3b8;
  font-size: .82rem;
  margin-right: 6px;
}
th.sort-asc::before { content: "^"; color: var(--primary); }
th.sort-desc::before { content: "v"; color: var(--primary); }
.data-table-wrap {
  display: grid;
  gap: 12px;
}
.data-table-controls,
.data-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.data-table-search,
.data-table-size {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}
.data-table-search .input {
  width: min(360px, 72vw);
}
.data-table-size .select {
  width: 92px;
}
.data-table-info {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}
.data-table-pages {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.data-table-pages span {
  min-width: 62px;
  text-align: center;
  font-weight: 800;
  color: #334155;
}
.data-table-pages .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.badge {
  border-radius: 999px;
  border: 1px solid #fed7aa;
  background: #ffedd5;
  color: #9a3412;
  white-space: nowrap;
}
.badge.green { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.badge.red { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge.gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.modal-backdrop {
  backdrop-filter: blur(10px);
}
.modal-card {
  border-radius: 16px;
}
.modal-header {
  background: linear-gradient(135deg, var(--sidebar), var(--primary-700), var(--primary));
}
.modal-close:hover {
  background: rgba(255,255,255,.2);
  transform: rotate(4deg);
}
.orders-column {
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}
.orders-column-head {
  background: #fffaf5;
}
.order-ticket {
  background: #fff;
  border-color: #fed7aa;
}
.order-ticket:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(17, 24, 39, .1);
}
.order-ticket-actions {
  border-top-color: #fed7aa;
  background: #fffaf5;
}
.table-thumb {
  border-radius: 12px;
  background: #fff7ed;
  border-color: #fed7aa;
  color: var(--primary);
}
.flash {
  border-radius: 14px;
  border: 1px solid #e7edf4;
  border-left-width: 5px;
}
.manual-items-box,
.delivery-rule-cell,
.empty {
  border-radius: 14px;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-menu-shell { grid-template-columns: 1fr; }
  .public-cart { position: static; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .content, body.sidebar-collapsed .content { margin-left: 0; width: 100%; }
  body.sidebar-collapsed .sidebar { width: 272px; }
  body.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .sidebar-link span { display: inline; }
  body.sidebar-collapsed .sidebar-link { justify-content: flex-start; }
  .mobile-menu { display: inline-flex; }
  .grid-4, .grid-3, .grid-2, .form-grid, .kanban, .orders-board, .order-detail-grid { grid-template-columns: 1fr; }
  .channel-picker { grid-template-columns: 1fr; }
  .data-table-controls,
  .data-table-footer { align-items: stretch; flex-direction: column; }
  .data-table-search,
  .data-table-size,
  .data-table-search .input,
  .data-table-size .select { width: 100%; }
  .page-header, .panel-header { flex-direction: column; }
  .quick-link-row,
  .quick-link-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .quick-link-actions .input {
    min-width: 0;
  }
  .delivery-rules-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .main { padding: 16px; }
  th, td { padding: 10px 8px; font-size: .82rem; }
  .topbar { padding: 0 14px; }
  .topbar [data-sidebar-collapse] { display: none; }
  .topbar-actions .btn span:not(.notification-count) { display: none; }
  .public-menu-header { padding: 12px 14px; }
  .public-menu-shell { padding: 14px; }
  .public-products { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 110px minmax(0, 1fr); }
  .product-photo { min-height: 132px; }
  .product-actions { align-items: flex-start; flex-direction: column; }
  .public-order-card { width: 100%; }
  .checkout-actions { flex-direction: column-reverse; }
  .pickup-location-box {
    align-items: stretch;
    flex-direction: column;
  }
  .segmented-options { grid-template-columns: 1fr; }
  .tracking-head { flex-direction: column; }
  .security-code { width: 100%; }
  .tracking-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Layout alinhado ao exemplo, preservando identidade Dayane Confeitaria */
:root {
  color-scheme: dark;
  --font-head: "Manrope", sans-serif;
  --font-body: "Manrope", sans-serif;
  --bg: #100807;
  --bg-alt: #1b0d0a;
  --surface: rgba(31, 16, 12, .92);
  --surface-2: rgba(44, 21, 14, .82);
  --panel: rgba(31, 16, 12, .9);
  --panel-strong: #1a0d0a;
  --panel-soft: rgba(53, 25, 16, .72);
  --field: rgba(16, 9, 7, .84);
  --field-focus: #26130f;
  --border: rgba(253, 186, 116, .2);
  --brd: var(--border);
  --brd-strong: rgba(253, 186, 116, .36);
  --text: #fff7ed;
  --txt-p: #fff7ed;
  --txt-m: #f4c9a8;
  --txt-s: #ffe3ca;
  --txt-soft: #b9896a;
  --muted: var(--txt-m);
  --primary: #ea580c;
  --primary-600: #dc2626;
  --primary-700: #b91c1c;
  --accent: #f59e0b;
  --accent-2: #ea580c;
  --accent-soft: rgba(234, 88, 12, .16);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --sidebar: var(--panel-strong);
  --sidebar-2: #2a0f0b;
  --shadow: 0 28px 72px rgba(5, 2, 1, .38);
  --shadow-soft: 0 18px 44px rgba(5, 2, 1, .22);
  --ring: 0 0 0 4px rgba(234, 88, 12, .2);
  --scroll-track: rgba(253, 186, 116, .08);
  --scroll-thumb: rgba(234, 88, 12, .72);
}

html[data-tema="light"] {
  color-scheme: light;
  --bg: #f6f0ea;
  --bg-alt: #fff7ed;
  --surface: rgba(255, 255, 255, .94);
  --surface-2: rgba(255, 247, 237, .94);
  --panel: rgba(255, 255, 255, .92);
  --panel-strong: #ffffff;
  --panel-soft: rgba(255, 247, 237, .86);
  --field: #fffaf5;
  --field-focus: #ffffff;
  --border: rgba(154, 52, 18, .15);
  --brd: var(--border);
  --brd-strong: rgba(154, 52, 18, .28);
  --text: #25110d;
  --txt-p: #25110d;
  --txt-m: #76503c;
  --txt-s: #4b2118;
  --txt-soft: #9b7866;
  --muted: var(--txt-m);
  --shadow: 0 24px 60px rgba(69, 26, 18, .12);
  --shadow-soft: 0 14px 34px rgba(69, 26, 18, .08);
  --scroll-track: rgba(154, 52, 18, .08);
  --scroll-thumb: rgba(234, 88, 12, .56);
}

* {
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

*::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-color: transparent;
}

body {
  min-height: 100%;
  background:
    linear-gradient(180deg, var(--bg-alt), var(--bg) 48%, #090403);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
}

html[data-tema="light"] body {
  background:
    linear-gradient(180deg, #fff7ed 0%, #f6f0ea 46%, #eef2f7 100%);
}

a,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.page-loader {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(16, 8, 7, .92);
  backdrop-filter: blur(16px);
  transition: opacity .28s ease, visibility .28s ease;
}

html[data-tema="light"] .page-loader {
  background: rgba(255, 247, 237, .9);
}

.page-loader.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loader-card {
  min-width: 190px;
  padding: 22px 24px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--brd);
  box-shadow: var(--shadow);
  color: var(--txt-p);
}

.loader-ring {
  border-color: rgba(253, 186, 116, .22);
  border-top-color: var(--primary);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--brd);
  box-shadow: var(--shadow-brand);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.app-shell.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  background: transparent;
  transition: grid-template-columns .28s cubic-bezier(.22, 1, .36, 1);
}

.content,
body.sidebar-collapsed .content {
  width: auto;
  min-width: 0;
  margin-left: 0;
}

.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar {
  position: sticky;
  inset: auto;
  top: 0;
  width: auto;
  height: 100vh;
  padding: 18px 14px 14px;
  gap: 16px;
  background: var(--panel-strong);
  border-right: 1px solid var(--brd);
  box-shadow: none;
  transition: padding .28s cubic-bezier(.22, 1, .36, 1), transform .28s cubic-bezier(.22, 1, .36, 1);
}

html[data-tema="light"] .sidebar {
  background: rgba(255, 255, 255, .94);
}

.sb-profile {
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--brd);
}

.sidebar-brand {
  height: auto;
  min-height: 48px;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--txt-p);
}

.sidebar-brand .brand-mark {
  flex: 0 0 44px;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  color: var(--txt-p);
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: .04em;
}

.sidebar-brand small {
  margin-top: 3px;
  color: var(--txt-soft);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.tb-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid var(--brd);
  border-radius: 12px;
  background: var(--panel);
  color: var(--txt-p);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.tb-btn:hover {
  transform: translateY(-1px);
  border-color: var(--brd-strong);
  background: var(--panel-soft);
  box-shadow: none;
}

.tb-btn svg,
.tb-btn i,
.sidebar-link svg,
.sidebar-link i {
  width: 18px;
  height: 18px;
}

.tb-bars {
  width: 18px;
  height: 14px;
  position: relative;
  display: block;
}

.tb-bars span {
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.tb-bars span:nth-child(1) { top: 0; }
.tb-bars span:nth-child(2) { top: 6px; }
.tb-bars span:nth-child(3) { top: 12px; }

.sb-sidebar-toggle {
  justify-self: center;
}

.sidebar-nav,
.sb-nav {
  padding: 0;
  display: grid;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(234, 88, 12, .32) transparent;
}

.sidebar-link,
.sb-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--txt-m);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.sidebar-link:hover,
.sidebar-link.active,
.sb-item:hover,
.sb-item.on {
  color: #fff;
  border-color: rgba(253, 186, 116, .16);
  background: var(--accent-soft);
  transform: translateX(2px);
}

.sidebar-link.active,
.sb-item.on {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  box-shadow: var(--shadow-accent);
}

.sbi-lbl {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell.sidebar-collapsed,
html.sidebar-collapsed-initial .app-shell.app,
body.sidebar-collapsed .app-shell.app {
  grid-template-columns: 84px minmax(0, 1fr);
}

html.sidebar-collapsed-initial .sidebar,
body.sidebar-collapsed .sidebar {
  width: auto;
  padding-inline: 14px;
}

html.sidebar-collapsed-initial .sb-profile,
body.sidebar-collapsed .sb-profile {
  justify-items: center;
}

html.sidebar-collapsed-initial .sidebar-brand,
body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

html.sidebar-collapsed-initial .sidebar-brand-text,
html.sidebar-collapsed-initial .sbi-lbl,
html.sidebar-collapsed-initial .sidebar-link span,
body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sbi-lbl,
body.sidebar-collapsed .sidebar-link span {
  display: none;
}

html.sidebar-collapsed-initial .sidebar-link,
html.sidebar-collapsed-initial .sb-item,
body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sb-item {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  justify-content: center;
  border-radius: 12px;
}

body.sidebar-collapsed .sidebar-link:hover,
body.sidebar-collapsed .sidebar-link.active {
  transform: translateY(-1px);
}

.topbar {
  height: 68px;
  min-height: 68px;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 24px;
  background: rgba(16, 8, 7, .78);
  border-bottom: 1px solid var(--brd);
  backdrop-filter: blur(18px);
  box-shadow: none;
}

html[data-tema="light"] .topbar {
  background: rgba(255, 247, 237, .82);
}

.tb-l,
.tb-r,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tb-l {
  min-width: 0;
}

.tb-r,
.topbar-actions {
  flex-shrink: 0;
  margin-left: auto;
}

.tb-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--txt-p);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.tb-brand-link .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex: 0 0 38px;
}

.tb-brand-link span {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bc {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--txt-m);
  font-size: 12px;
}

.bc-item:hover,
.bc-cur {
  color: var(--txt-p);
}

.bc-cur {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown {
  position: relative;
}

.dropdown-panel {
  top: calc(100% + 10px);
  width: min(390px, calc(100vw - 28px));
  max-height: 70vh;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--brd);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--txt-p);
  backdrop-filter: blur(18px);
}

.notification-panel-header {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--brd);
  color: var(--txt-p);
}

.notification-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  color: var(--txt-p);
}

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

.notification-item small {
  color: var(--txt-m);
}

.notification-item .dot,
.dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--primary);
}

.dot-success {
  background: var(--success);
}

.notification-count,
.tb-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 10px;
  font-weight: 900;
}

.topbar-avatar,
.tb-avatar-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: 1px solid var(--brd);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: none;
  overflow: hidden;
}

.topbar-avatar:hover,
.tb-avatar-button:hover {
  border-color: var(--brd-strong);
  transform: translateY(-1px);
}

.tb-avatar,
.topbar-avatar > span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.main,
.page {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 22px 24px 28px;
}

.page > * + * {
  margin-top: 16px;
}

.footer {
  padding: 14px 24px;
  color: var(--txt-soft);
  border-top: 1px solid var(--brd);
  font-size: 11px;
}

.page-header {
  align-items: center;
  margin-bottom: 18px;
}

.page-title h2,
.auth-card h2,
.panel-header strong,
.orders-column-head strong,
.public-category h2 {
  color: var(--txt-p);
  font-family: var(--font-head);
}

.page-title h2 {
  font-size: 22px;
  line-height: 1.15;
}

.page-title p,
.panel-header p,
.auth-card .subtitle,
.field-help,
.empty,
.public-brand p,
.product-info p,
.tracking-head p,
.tracking-section p {
  color: var(--txt-m);
}

.grid {
  gap: 16px;
}

.card,
.panel,
.orders-column,
.kanban-col,
.modal-card,
.manual-items-box,
.delivery-rule-cell,
.order-detail-grid > div,
.product-card,
.public-order-card,
.security-code,
.tracking-card {
  background: var(--panel);
  border: 1px solid var(--brd);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.card,
.panel {
  overflow: hidden;
}

.card {
  padding: 18px;
}

.card:hover,
.panel:hover,
.orders-column:hover,
.product-card:hover {
  border-color: var(--brd-strong);
  box-shadow: var(--shadow);
}

.panel-header,
.orders-column-head {
  padding: 16px 18px;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--brd);
  border-radius: 0;
}

.panel-body {
  padding: 18px;
}

.stat .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  box-shadow: var(--shadow-accent);
}

.stat label,
.card > label {
  color: var(--txt-m) !important;
  font-size: 12px;
  font-weight: 800;
}

.stat strong,
.card h3 {
  color: var(--txt-p);
}

.btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--txt-p);
  font-size: 12px;
  font-weight: 800;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, filter .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border-color: transparent;
}

.btn-secondary {
  color: var(--txt-p);
  background: var(--field);
  border-color: var(--brd);
}

.btn-secondary:hover {
  background: var(--panel-soft);
  border-color: var(--brd-strong);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 11px;
}

.btn-icon {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.field label,
.data-table-search,
.data-table-size,
.check-row {
  color: var(--txt-s);
}

html[data-tema="dark"] .field:focus-within label {
  color: var(--accent);
}

.input,
.select,
.textarea {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--brd);
  background: var(--field);
  color: var(--txt-p);
  box-shadow: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--txt-soft);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--brd-strong);
  background: var(--field-focus);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  background: var(--field-focus);
  box-shadow: var(--ring);
}

.password-toggle {
  color: var(--txt-m);
}

.password-toggle:hover {
  background: var(--accent-soft);
  color: var(--txt-p);
}

.check-row,
.segmented-options label,
.cart-line,
.cart-totals,
.delivery-quote-box,
.pickup-location-box,
.empty,
.ticket,
.order-ticket,
.manual-items-box {
  background: var(--panel-soft);
  border-color: var(--brd);
}

.check-row input,
.segmented-options input {
  accent-color: var(--primary);
}

.table-wrap {
  overflow-x: auto;
}

table.modern-table,
.table-wrap table,
table {
  border-collapse: separate;
  border-spacing: 0;
}

table.modern-table,
.table-wrap table {
  min-width: 720px;
}

th,
td,
.table-wrap table th,
.table-wrap table td {
  border-bottom: 1px solid var(--brd);
  color: var(--txt-p);
  white-space: nowrap;
}

th,
.table-wrap table th {
  background: var(--field);
  color: var(--txt-m);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}

tbody tr {
  transition: background .14s ease;
}

tbody tr:hover {
  background: var(--accent-soft);
}

.data-table-wrap {
  display: grid;
  gap: 12px;
}

.data-table-controls,
.data-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.data-table-search,
.data-table-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}

.data-table-search .input {
  width: min(360px, 72vw);
}

.data-table-size .select {
  width: 92px;
}

.data-table-info,
.data-table-pages span {
  color: var(--txt-m);
  font-weight: 800;
}

.badge {
  border: 1px solid rgba(253, 186, 116, .34);
  background: rgba(245, 158, 11, .14);
  color: #fed7aa;
  white-space: nowrap;
}

html[data-tema="light"] .badge {
  color: #9a3412;
}

.badge.green {
  background: rgba(34, 197, 94, .14);
  border-color: rgba(34, 197, 94, .34);
  color: #86efac;
}

html[data-tema="light"] .badge.green {
  color: #047857;
}

.badge.red {
  background: rgba(239, 68, 68, .14);
  border-color: rgba(239, 68, 68, .34);
  color: #fecaca;
}

html[data-tema="light"] .badge.red {
  color: #b91c1c;
}

.badge.gray {
  background: rgba(148, 163, 184, .12);
  border-color: rgba(148, 163, 184, .26);
  color: var(--txt-m);
}

.flash-stack {
  top: 84px;
}

.flash {
  background: var(--panel);
  border: 1px solid var(--brd);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  color: var(--txt-p);
  box-shadow: var(--shadow);
}

.modal-backdrop {
  background: rgba(5, 2, 1, .68);
  backdrop-filter: blur(10px);
}

.modal-card {
  max-height: min(88vh, 920px);
  color: var(--txt-p);
}

.modal-header,
.public-order-header {
  background: linear-gradient(135deg, var(--sidebar-2), var(--primary-700), var(--primary));
}

.modal-header p,
.public-order-header small {
  color: #fed7aa;
}

.modal-body {
  background: var(--panel);
}

.modal-close {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.orders-board,
.kanban {
  gap: 14px;
}

.orders-column {
  overflow: hidden;
}

.orders-column-head span {
  background: var(--accent-soft);
  color: var(--txt-p);
}

.order-ticket {
  overflow: hidden;
  background: var(--panel);
}

.order-ticket:hover {
  transform: translateY(-1px);
}

.order-ticket-code {
  color: var(--accent);
}

.order-ticket-total {
  color: var(--txt-p);
}

.order-ticket-actions {
  border-top: 1px solid var(--brd);
  background: var(--panel-soft);
}

.table-thumb,
.profile-photo-preview,
.product-photo {
  background: var(--field);
  border-color: var(--brd);
  color: var(--primary);
}

.auth-page {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(145deg, #1d0b07, #3b110c 48%, #7f1d1d 100%);
}

html[data-tema="light"] .auth-page {
  background:
    linear-gradient(145deg, #fff7ed, #f6f0ea 52%, #fed7aa 100%);
}

.auth-shell {
  width: min(100%, 430px);
}

.auth-brand {
  color: #fff;
}

html[data-tema="light"] .auth-brand {
  color: var(--txt-p);
}

.auth-brand .brand-mark {
  width: 72px;
  height: 72px;
  margin-inline: auto;
  border-radius: 18px;
}

.auth-brand h1 {
  margin: 14px 0 4px;
  color: inherit;
  font-size: 24px;
}

.auth-brand p {
  color: #fed7aa;
}

html[data-tema="light"] .auth-brand p {
  color: var(--txt-m);
}

.auth-card {
  padding: 26px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: var(--panel);
  color: var(--txt-p);
  box-shadow: var(--shadow);
}

.searchbar,
.quick-link-row,
.quick-link-actions,
.purchase-summary,
.table-actions,
.modal-actions,
.checkout-actions,
.delivery-quote-actions {
  gap: 10px;
}

.quick-link-row {
  align-items: center;
}

.quick-link-actions .input {
  min-width: 290px;
}

.public-menu-page,
.public-result,
.tracking-page {
  background:
    linear-gradient(180deg, var(--bg-alt), var(--bg));
  color: var(--txt-p);
}

html[data-tema="light"] .public-menu-page,
html[data-tema="light"] .public-result,
html[data-tema="light"] .tracking-page {
  background:
    linear-gradient(180deg, #fff7ed, #f6f0ea);
}

.public-menu-header {
  min-height: 72px;
  background: rgba(16, 8, 7, .82);
  border-bottom: 1px solid var(--brd);
  backdrop-filter: blur(18px);
}

html[data-tema="light"] .public-menu-header {
  background: rgba(255, 247, 237, .9);
}

.public-brand h1,
.public-category h2 {
  color: var(--txt-p);
}

.public-brand img,
.public-brand .brand-mark {
  border-radius: 12px;
}

.public-menu-shell {
  width: min(1260px, 100%);
}

.public-products {
  gap: 14px;
}

.product-card {
  grid-template-columns: 132px minmax(0, 1fr);
}

.product-info h3 {
  color: var(--txt-p);
}

.cart-totals div:last-child,
.security-code strong,
.tracking-step.done {
  color: var(--txt-p);
}

.tracking-step {
  border-color: var(--brd);
  background: var(--panel);
  color: var(--txt-m);
}

.tracking-step.done {
  background: var(--accent-soft);
  border-color: var(--brd-strong);
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-board,
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-menu-shell { grid-template-columns: 1fr; }
  .public-cart { position: static; }
}

@media (max-width: 980px) {
  .app-shell.app,
  .app-shell.sidebar-collapsed,
  html.sidebar-collapsed-initial .app-shell.app,
  body.sidebar-collapsed .app-shell.app {
    grid-template-columns: 1fr;
  }

  .sidebar,
  html.sidebar-collapsed-initial .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
    width: min(286px, 88vw);
    max-width: 88vw;
    transform: translateX(-100%);
    padding: 18px 14px 14px;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(5, 2, 1, .62);
    backdrop-filter: blur(4px);
  }

  html.sidebar-collapsed-initial .sidebar-brand-text,
  html.sidebar-collapsed-initial .sbi-lbl,
  html.sidebar-collapsed-initial .sidebar-link span,
  body.sidebar-collapsed .sidebar-brand-text,
  body.sidebar-collapsed .sbi-lbl,
  body.sidebar-collapsed .sidebar-link span {
    display: block;
  }

  html.sidebar-collapsed-initial .sidebar-brand,
  body.sidebar-collapsed .sidebar-brand {
    justify-content: flex-start;
  }

  html.sidebar-collapsed-initial .sidebar-link,
  html.sidebar-collapsed-initial .sb-item,
  body.sidebar-collapsed .sidebar-link,
  body.sidebar-collapsed .sb-item {
    width: 100%;
    height: auto;
    min-height: 42px;
    padding: 10px 12px;
    justify-content: flex-start;
  }

  .sb-sidebar-toggle {
    display: none;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .topbar [data-sidebar-collapse] {
    display: none;
  }

  .tb-brand-link span,
  .bc-item,
  .bc > span {
    display: none;
  }

  .topbar {
    padding: 0 14px;
  }

  .main,
  .page {
    padding: 16px 14px 22px;
  }
}

/* Temas de cor do sistema */
html[data-color="blue"] {
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e3a8a;
  --accent: #60a5fa;
  --accent-2: #2563eb;
  --accent-soft: rgba(37, 99, 235, .16);
  --scroll-thumb: rgba(37, 99, 235, .58);
}

html[data-color="orange"],
html:not([data-color]) {
  --primary: #ea580c;
  --primary-600: #dc2626;
  --primary-700: #b91c1c;
  --accent: #f59e0b;
  --accent-2: #ea580c;
  --accent-soft: rgba(234, 88, 12, .16);
  --scroll-thumb: rgba(234, 88, 12, .56);
}

html[data-color="green"] {
  --primary: #16a34a;
  --primary-600: #15803d;
  --primary-700: #166534;
  --accent: #4ade80;
  --accent-2: #16a34a;
  --accent-soft: rgba(22, 163, 74, .16);
  --scroll-thumb: rgba(22, 163, 74, .56);
}

html[data-color="red"] {
  --primary: #dc2626;
  --primary-600: #b91c1c;
  --primary-700: #7f1d1d;
  --accent: #f87171;
  --accent-2: #dc2626;
  --accent-soft: rgba(220, 38, 38, .15);
  --scroll-thumb: rgba(220, 38, 38, .56);
}

html[data-color="pink"] {
  --primary: #db2777;
  --primary-600: #be185d;
  --primary-700: #831843;
  --accent: #f472b6;
  --accent-2: #db2777;
  --accent-soft: rgba(219, 39, 119, .15);
  --scroll-thumb: rgba(219, 39, 119, .54);
}

html[data-color="purple"] {
  --primary: #7c3aed;
  --primary-600: #6d28d9;
  --primary-700: #4c1d95;
  --accent: #a78bfa;
  --accent-2: #7c3aed;
  --accent-soft: rgba(124, 58, 237, .16);
  --scroll-thumb: rgba(124, 58, 237, .54);
}

html[data-color="gold"] {
  --primary: #d4a017;
  --primary-600: #b8860b;
  --primary-700: #8b6508;
  --accent: #f4c430;
  --accent-2: #d4a017;
  --accent-soft: rgba(212, 160, 23, .18);
  --scroll-thumb: rgba(212, 160, 23, .56);
}

html[data-color="black"] {
  --primary: #333333;
  --primary-600: #2b2b2b;
  --primary-700: #1f1f1f;
  --accent: #555555;
  --accent-2: #333333;
  --accent-soft: rgba(51, 51, 51, .18);
  --scroll-thumb: rgba(51, 51, 51, .62);
}

.color-dropdown .dropdown-panel {
  width: 260px;
}

.color-theme-panel {
  display: none;
  gap: 12px;
}

.dropdown.open .color-theme-panel {
  display: grid;
}

.color-theme-panel > strong {
  padding: 4px 4px 0;
  color: var(--txt-p);
  font-size: 12px;
}

.color-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.color-theme-button {
  position: relative;
}

.color-current-dot,
.color-swatch span {
  display: block;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
}

.color-current-dot[data-color="blue"] { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.color-current-dot[data-color="orange"] { background: linear-gradient(135deg, #ea580c, #dc2626); }
.color-current-dot[data-color="green"] { background: linear-gradient(135deg, #16a34a, #15803d); }
.color-current-dot[data-color="red"] { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.color-current-dot[data-color="pink"] { background: linear-gradient(135deg, #db2777, #be185d); }
.color-current-dot[data-color="purple"] { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.color-current-dot[data-color="gold"] { background: linear-gradient(135deg, #d4a017, #b8860b); }
.color-current-dot[data-color="black"] { background: linear-gradient(135deg, #4a4a4a, #333333); }

.color-current-dot {
  width: 18px;
  height: 18px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22);
}

.color-swatch {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--brd);
  border-radius: 10px;
  background: var(--field);
  color: var(--txt-p);
  cursor: pointer;
}

.color-swatch:hover,
.color-swatch.active {
  border-color: var(--brd-strong);
  background: var(--accent-soft);
}

.color-swatch.active {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.color-swatch span {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.color-swatch small {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-swatch[data-color-theme="blue"] span { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.color-swatch[data-color-theme="orange"] span { background: linear-gradient(135deg, #ea580c, #dc2626); }
.color-swatch[data-color-theme="green"] span { background: linear-gradient(135deg, #16a34a, #15803d); }
.color-swatch[data-color-theme="red"] span { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.color-swatch[data-color-theme="pink"] span { background: linear-gradient(135deg, #db2777, #be185d); }
.color-swatch[data-color-theme="purple"] span { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.color-swatch[data-color-theme="gold"] span { background: linear-gradient(135deg, #d4a017, #b8860b); }
.color-swatch[data-color-theme="black"] span { background: linear-gradient(135deg, #4a4a4a, #333333); }

html.sidebar-collapsed-initial .sb-profile,
body.sidebar-collapsed .sb-profile {
  justify-items: center;
  padding-right: 9px;
}

html.sidebar-collapsed-initial .sidebar-brand,
body.sidebar-collapsed .sidebar-brand {
  width: 48px;
  min-height: 48px;
}

html.sidebar-collapsed-initial .sidebar-brand .brand-mark,
body.sidebar-collapsed .sidebar-brand .brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
}

html.sidebar-collapsed-initial .sidebar-brand .brand-mark svg,
body.sidebar-collapsed .sidebar-brand .brand-mark svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 760px) {
  .grid-4,
  .grid-3,
  .grid-2,
  .form-grid,
  .orders-board,
  .kanban,
  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .panel-header,
  .quick-link-row,
  .quick-link-actions,
  .data-table-controls,
  .data-table-footer,
  .delivery-rules-footer,
  .tracking-head {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-link-actions .input,
  .searchbar .input,
  .data-table-search,
  .data-table-size,
  .data-table-search .input,
  .data-table-size .select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .tb-r,
  .topbar-actions {
    gap: 6px;
  }

  .tb-btn,
  .topbar-avatar,
  .tb-avatar-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 11px;
  }

  .public-products,
  .segmented-options {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .public-order-card {
    width: 100%;
  }

  .checkout-actions {
    flex-direction: column-reverse;
  }
}

/* Ajustes finais do menu lateral e topo */
.tb-brand-link {
  display: none !important;
}

.tb-sidebar-toggle-top {
  display: inline-flex !important;
}

.sidebar {
  overflow: hidden;
}

.sb-profile {
  justify-items: center;
  gap: 0;
  padding-bottom: 18px;
}

.sidebar-brand {
  width: 100%;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.sidebar-brand .brand-mark {
  margin-inline: auto;
}

.sidebar-brand-text {
  display: grid;
  justify-items: center;
  max-width: 100%;
  min-width: 0;
}

.sidebar-brand strong,
.sidebar-brand small,
.sbi-lbl {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav,
.sb-nav {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 8px 0 2px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar,
.sb-nav::-webkit-scrollbar {
  width: 6px;
  height: 0;
}

.sidebar-nav::-webkit-scrollbar-track,
.sb-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.sb-nav::-webkit-scrollbar-thumb {
  border: 0;
  border-radius: 999px;
  background: rgba(234, 88, 12, .34);
}

.sidebar-link,
.sb-item {
  max-width: 100%;
  min-width: 0;
}

.app-shell.sidebar-collapsed,
html.sidebar-collapsed-initial .app-shell.app,
body.sidebar-collapsed .app-shell.app {
  grid-template-columns: 96px minmax(0, 1fr);
}

html.sidebar-collapsed-initial .sidebar,
body.sidebar-collapsed .sidebar {
  padding-inline: 16px 10px;
}

html.sidebar-collapsed-initial .sidebar-nav,
html.sidebar-collapsed-initial .sb-nav,
body.sidebar-collapsed .sidebar-nav,
body.sidebar-collapsed .sb-nav {
  align-items: center;
  padding: 0 9px 0 0;
  gap: 8px;
}

html.sidebar-collapsed-initial .sidebar-brand .brand-mark,
body.sidebar-collapsed .sidebar-brand .brand-mark {
  width: 44px;
  height: 44px;
}

html.sidebar-collapsed-initial .sidebar-link,
html.sidebar-collapsed-initial .sb-item,
body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sb-item {
  flex: 0 0 48px;
}

@media (max-width: 980px) {
  html.sidebar-collapsed-initial .app-shell.app,
  body.sidebar-collapsed .app-shell.app {
    grid-template-columns: 1fr;
  }

  .sidebar,
  html.sidebar-collapsed-initial .sidebar,
  body.sidebar-collapsed .sidebar {
    overflow: hidden;
    padding-inline: 16px;
  }

  html.sidebar-collapsed-initial .sidebar-nav,
  html.sidebar-collapsed-initial .sb-nav,
  body.sidebar-collapsed .sidebar-nav,
  body.sidebar-collapsed .sb-nav {
    align-items: stretch;
    padding: 0 8px 0 2px;
  }
}

/* Refinamentos solicitados: ordenacao, chips de categoria e modais */
th.sortable,
table.modern-table th.sortable,
.table-wrap table th.sortable {
  position: relative;
  padding-right: 34px;
  cursor: pointer;
}

th.sortable::before,
th.sortable::after {
  content: "";
  position: absolute;
  right: 14px;
  width: 0;
  height: 0;
  margin: 0;
  opacity: .42;
  pointer-events: none;
  transition: opacity .16s ease, border-color .16s ease, transform .16s ease;
}

th.sortable::before {
  top: calc(50% - 7px);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-bottom: 5px solid var(--txt-soft);
}

th.sortable::after {
  top: calc(50% + 2px);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid var(--txt-soft);
}

th.sortable:hover::before,
th.sortable:hover::after {
  opacity: .8;
}

th.sort-asc::before {
  border-bottom-color: var(--primary);
  opacity: 1;
  transform: translateY(-1px);
}

th.sort-asc::after {
  opacity: .18;
}

th.sort-desc::after {
  border-top-color: var(--primary);
  opacity: 1;
  transform: translateY(1px);
}

th.sort-desc::before {
  opacity: .18;
}

.category-chip-action {
  background: var(--panel-soft);
  border-color: var(--brd);
  border-radius: 10px;
}

.category-chip-action .badge {
  border-color: rgba(253, 186, 116, .28);
  background: rgba(234, 88, 12, .14);
  color: #fed7aa;
}

html[data-tema="light"] .category-chip-action {
  background: #ffffff;
  border-color: rgba(154, 52, 18, .16);
}

html[data-tema="light"] .category-chip-action .badge {
  border-color: #fed7aa;
  background: #ffedd5;
  color: #9a3412;
}

.modal-backdrop,
.modal-backdrop.open {
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  overflow-y: auto;
  padding: 32px 18px;
}

.modal-card {
  margin: auto;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: none;
}

@media (max-width: 760px) {
  .modal-backdrop {
    padding: 16px 10px;
  }

  .modal-card {
    max-height: calc(100vh - 32px);
  }
}

/* Paletas completas: a cor escolhida controla fundos, linhas e superficies */
:root,
html[data-color="orange"] {
  --bg: #100807;
  --bg-alt: #1b0d0a;
  --bg-end: #080302;
  --surface: rgba(31, 16, 12, .92);
  --surface-2: rgba(44, 21, 14, .82);
  --panel: rgba(31, 16, 12, .92);
  --panel-strong: #1a0d0a;
  --panel-soft: rgba(53, 25, 16, .72);
  --field: rgba(16, 9, 7, .84);
  --field-focus: #26130f;
  --topbar-bg: rgba(16, 8, 7, .78);
  --loader-bg: rgba(16, 8, 7, .92);
  --border: rgba(253, 186, 116, .2);
  --brd: var(--border);
  --brd-strong: rgba(253, 186, 116, .36);
  --line: rgba(253, 186, 116, .18);
  --row-hover: rgba(234, 88, 12, .14);
  --table-head: rgba(53, 25, 16, .86);
  --text: #fff7ed;
  --txt-p: #fff7ed;
  --txt-m: #f4c9a8;
  --txt-s: #ffe3ca;
  --txt-soft: #b9896a;
  --muted: var(--txt-m);
  --primary: #ea580c;
  --primary-600: #dc2626;
  --primary-700: #b91c1c;
  --accent: #f59e0b;
  --accent-2: #ea580c;
  --accent-soft: rgba(234, 88, 12, .16);
  --soft-chip-bg: rgba(234, 88, 12, .14);
  --soft-chip-text: #fed7aa;
  --shadow: 0 28px 72px rgba(5, 2, 1, .38);
  --shadow-soft: 0 18px 44px rgba(5, 2, 1, .22);
  --shadow-hover: 0 18px 46px rgba(69, 26, 18, .24);
  --shadow-accent: 0 14px 30px rgba(234, 88, 12, .24);
  --shadow-brand: 0 18px 45px rgba(234, 88, 12, .28);
  --ring: 0 0 0 4px rgba(234, 88, 12, .2);
  --scroll-track: rgba(253, 186, 116, .08);
  --scroll-thumb: rgba(234, 88, 12, .58);
}

html[data-color="blue"] {
  --bg: #07101f;
  --bg-alt: #0b1730;
  --bg-end: #030812;
  --surface: rgba(12, 23, 42, .92);
  --surface-2: rgba(19, 35, 62, .82);
  --panel: rgba(12, 23, 42, .92);
  --panel-strong: #091426;
  --panel-soft: rgba(23, 42, 72, .72);
  --field: rgba(6, 14, 28, .84);
  --field-focus: #10213d;
  --topbar-bg: rgba(7, 16, 31, .78);
  --loader-bg: rgba(7, 16, 31, .92);
  --border: rgba(96, 165, 250, .2);
  --brd: var(--border);
  --brd-strong: rgba(96, 165, 250, .36);
  --line: rgba(96, 165, 250, .17);
  --row-hover: rgba(37, 99, 235, .14);
  --table-head: rgba(17, 34, 64, .86);
  --text: #f5f8ff;
  --txt-p: #f5f8ff;
  --txt-m: #b9c9e5;
  --txt-s: #dbeafe;
  --txt-soft: #7f94b7;
  --muted: var(--txt-m);
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e3a8a;
  --accent: #60a5fa;
  --accent-2: #2563eb;
  --accent-soft: rgba(37, 99, 235, .16);
  --soft-chip-bg: rgba(37, 99, 235, .14);
  --soft-chip-text: #bfdbfe;
  --shadow: 0 28px 72px rgba(3, 10, 27, .38);
  --shadow-soft: 0 18px 44px rgba(8, 28, 66, .24);
  --shadow-hover: 0 18px 46px rgba(8, 28, 66, .28);
  --shadow-accent: 0 14px 30px rgba(37, 99, 235, .24);
  --shadow-brand: 0 18px 45px rgba(37, 99, 235, .28);
  --ring: 0 0 0 4px rgba(37, 99, 235, .2);
  --scroll-track: rgba(96, 165, 250, .08);
  --scroll-thumb: rgba(37, 99, 235, .58);
}

html[data-color="green"] {
  --bg: #07140e;
  --bg-alt: #0d2118;
  --bg-end: #030905;
  --surface: rgba(12, 31, 21, .92);
  --surface-2: rgba(19, 47, 33, .82);
  --panel: rgba(12, 31, 21, .92);
  --panel-strong: #09180f;
  --panel-soft: rgba(21, 56, 38, .72);
  --field: rgba(6, 20, 12, .84);
  --field-focus: #102a1b;
  --topbar-bg: rgba(7, 20, 14, .78);
  --loader-bg: rgba(7, 20, 14, .92);
  --border: rgba(74, 222, 128, .2);
  --brd: var(--border);
  --brd-strong: rgba(74, 222, 128, .35);
  --line: rgba(74, 222, 128, .16);
  --row-hover: rgba(22, 163, 74, .14);
  --table-head: rgba(16, 47, 31, .86);
  --text: #f0fdf4;
  --txt-p: #f0fdf4;
  --txt-m: #b9dec4;
  --txt-s: #dcfce7;
  --txt-soft: #7fa88a;
  --muted: var(--txt-m);
  --primary: #16a34a;
  --primary-600: #15803d;
  --primary-700: #166534;
  --accent: #4ade80;
  --accent-2: #16a34a;
  --accent-soft: rgba(22, 163, 74, .16);
  --soft-chip-bg: rgba(22, 163, 74, .14);
  --soft-chip-text: #bbf7d0;
  --shadow: 0 28px 72px rgba(2, 19, 10, .38);
  --shadow-soft: 0 18px 44px rgba(8, 47, 24, .24);
  --shadow-hover: 0 18px 46px rgba(8, 47, 24, .28);
  --shadow-accent: 0 14px 30px rgba(22, 163, 74, .24);
  --shadow-brand: 0 18px 45px rgba(22, 163, 74, .28);
  --ring: 0 0 0 4px rgba(22, 163, 74, .2);
  --scroll-track: rgba(74, 222, 128, .08);
  --scroll-thumb: rgba(22, 163, 74, .56);
}

html[data-color="red"] {
  --bg: #160909;
  --bg-alt: #2a1010;
  --bg-end: #090303;
  --surface: rgba(39, 15, 15, .92);
  --surface-2: rgba(62, 22, 22, .82);
  --panel: rgba(39, 15, 15, .92);
  --panel-strong: #1f0b0b;
  --panel-soft: rgba(70, 25, 25, .72);
  --field: rgba(22, 8, 8, .84);
  --field-focus: #351313;
  --topbar-bg: rgba(22, 9, 9, .78);
  --loader-bg: rgba(22, 9, 9, .92);
  --border: rgba(248, 113, 113, .2);
  --brd: var(--border);
  --brd-strong: rgba(248, 113, 113, .34);
  --line: rgba(248, 113, 113, .16);
  --row-hover: rgba(220, 38, 38, .14);
  --table-head: rgba(56, 18, 18, .86);
  --text: #fff1f2;
  --txt-p: #fff1f2;
  --txt-m: #ecc0c0;
  --txt-s: #fee2e2;
  --txt-soft: #b98585;
  --muted: var(--txt-m);
  --primary: #dc2626;
  --primary-600: #b91c1c;
  --primary-700: #7f1d1d;
  --accent: #f87171;
  --accent-2: #dc2626;
  --accent-soft: rgba(220, 38, 38, .15);
  --soft-chip-bg: rgba(220, 38, 38, .13);
  --soft-chip-text: #fecaca;
  --shadow: 0 28px 72px rgba(28, 5, 5, .38);
  --shadow-soft: 0 18px 44px rgba(69, 10, 10, .24);
  --shadow-hover: 0 18px 46px rgba(69, 10, 10, .28);
  --shadow-accent: 0 14px 30px rgba(220, 38, 38, .24);
  --shadow-brand: 0 18px 45px rgba(220, 38, 38, .28);
  --ring: 0 0 0 4px rgba(220, 38, 38, .2);
  --scroll-track: rgba(248, 113, 113, .08);
  --scroll-thumb: rgba(220, 38, 38, .56);
}

html[data-color="pink"] {
  --bg: #160912;
  --bg-alt: #2a1020;
  --bg-end: #090306;
  --surface: rgba(39, 15, 31, .92);
  --surface-2: rgba(62, 23, 49, .82);
  --panel: rgba(39, 15, 31, .92);
  --panel-strong: #1f0b18;
  --panel-soft: rgba(70, 25, 55, .72);
  --field: rgba(22, 8, 17, .84);
  --field-focus: #351329;
  --topbar-bg: rgba(22, 9, 18, .78);
  --loader-bg: rgba(22, 9, 18, .92);
  --border: rgba(244, 114, 182, .2);
  --brd: var(--border);
  --brd-strong: rgba(244, 114, 182, .34);
  --line: rgba(244, 114, 182, .16);
  --row-hover: rgba(219, 39, 119, .14);
  --table-head: rgba(56, 19, 44, .86);
  --text: #fff1f7;
  --txt-p: #fff1f7;
  --txt-m: #edbfd3;
  --txt-s: #fce7f3;
  --txt-soft: #b9859b;
  --muted: var(--txt-m);
  --primary: #db2777;
  --primary-600: #be185d;
  --primary-700: #831843;
  --accent: #f472b6;
  --accent-2: #db2777;
  --accent-soft: rgba(219, 39, 119, .15);
  --soft-chip-bg: rgba(219, 39, 119, .13);
  --soft-chip-text: #fbcfe8;
  --shadow: 0 28px 72px rgba(28, 5, 19, .38);
  --shadow-soft: 0 18px 44px rgba(69, 10, 42, .24);
  --shadow-hover: 0 18px 46px rgba(69, 10, 42, .28);
  --shadow-accent: 0 14px 30px rgba(219, 39, 119, .24);
  --shadow-brand: 0 18px 45px rgba(219, 39, 119, .28);
  --ring: 0 0 0 4px rgba(219, 39, 119, .2);
  --scroll-track: rgba(244, 114, 182, .08);
  --scroll-thumb: rgba(219, 39, 119, .54);
}

html[data-color="purple"] {
  --bg: #0f0a1f;
  --bg-alt: #1b1230;
  --bg-end: #06030d;
  --surface: rgba(28, 18, 50, .92);
  --surface-2: rgba(42, 28, 73, .82);
  --panel: rgba(28, 18, 50, .92);
  --panel-strong: #150d28;
  --panel-soft: rgba(49, 32, 86, .72);
  --field: rgba(15, 9, 28, .84);
  --field-focus: #24183f;
  --topbar-bg: rgba(15, 10, 31, .78);
  --loader-bg: rgba(15, 10, 31, .92);
  --border: rgba(167, 139, 250, .2);
  --brd: var(--border);
  --brd-strong: rgba(167, 139, 250, .34);
  --line: rgba(167, 139, 250, .16);
  --row-hover: rgba(124, 58, 237, .14);
  --table-head: rgba(40, 25, 75, .86);
  --text: #f7f2ff;
  --txt-p: #f7f2ff;
  --txt-m: #d1c1ec;
  --txt-s: #ede9fe;
  --txt-soft: #9382b9;
  --muted: var(--txt-m);
  --primary: #7c3aed;
  --primary-600: #6d28d9;
  --primary-700: #4c1d95;
  --accent: #a78bfa;
  --accent-2: #7c3aed;
  --accent-soft: rgba(124, 58, 237, .16);
  --soft-chip-bg: rgba(124, 58, 237, .13);
  --soft-chip-text: #ddd6fe;
  --shadow: 0 28px 72px rgba(12, 6, 30, .38);
  --shadow-soft: 0 18px 44px rgba(34, 18, 78, .24);
  --shadow-hover: 0 18px 46px rgba(34, 18, 78, .28);
  --shadow-accent: 0 14px 30px rgba(124, 58, 237, .24);
  --shadow-brand: 0 18px 45px rgba(124, 58, 237, .28);
  --ring: 0 0 0 4px rgba(124, 58, 237, .2);
  --scroll-track: rgba(167, 139, 250, .08);
  --scroll-thumb: rgba(124, 58, 237, .54);
}

html[data-color="gold"] {
  --bg: #120f06;
  --bg-alt: #211a0b;
  --bg-end: #080602;
  --surface: rgba(35, 29, 13, .92);
  --surface-2: rgba(55, 43, 18, .82);
  --panel: rgba(35, 29, 13, .92);
  --panel-strong: #181307;
  --panel-soft: rgba(61, 48, 20, .74);
  --field: rgba(18, 14, 6, .86);
  --field-focus: #2a210d;
  --topbar-bg: rgba(18, 14, 6, .78);
  --loader-bg: rgba(18, 14, 6, .92);
  --border: rgba(230, 191, 90, .22);
  --brd: var(--border);
  --brd-strong: rgba(230, 191, 90, .38);
  --line: rgba(230, 191, 90, .17);
  --row-hover: rgba(196, 147, 34, .14);
  --table-head: rgba(53, 42, 17, .86);
  --text: #fff9e8;
  --txt-p: #fff9e8;
  --txt-m: #ead6a5;
  --txt-s: #f8e7b2;
  --txt-soft: #b59b5d;
  --muted: var(--txt-m);
  --primary: #c49322;
  --primary-600: #a77713;
  --primary-700: #6f4e0a;
  --accent: #e6bf5a;
  --accent-2: #c49322;
  --accent-soft: rgba(196, 147, 34, .16);
  --soft-chip-bg: rgba(196, 147, 34, .14);
  --soft-chip-text: #f8dfa3;
  --shadow: 0 28px 72px rgba(20, 14, 3, .38);
  --shadow-soft: 0 18px 44px rgba(50, 36, 8, .24);
  --shadow-hover: 0 18px 46px rgba(50, 36, 8, .28);
  --shadow-accent: 0 14px 30px rgba(196, 147, 34, .24);
  --shadow-brand: 0 18px 45px rgba(196, 147, 34, .28);
  --ring: 0 0 0 4px rgba(196, 147, 34, .2);
  --scroll-track: rgba(230, 191, 90, .08);
  --scroll-thumb: rgba(196, 147, 34, .56);
}

html[data-color="black"] {
  --bg: #0f0f0f;
  --bg-alt: #171717;
  --bg-end: #070707;
  --surface: rgba(34, 34, 34, .94);
  --surface-2: rgba(42, 42, 42, .86);
  --panel: rgba(34, 34, 34, .94);
  --panel-strong: #111111;
  --panel-soft: rgba(48, 48, 48, .76);
  --field: rgba(24, 24, 24, .9);
  --field-focus: #333333;
  --topbar-bg: rgba(20, 20, 20, .82);
  --loader-bg: rgba(20, 20, 20, .94);
  --border: rgba(180, 180, 180, .2);
  --brd: var(--border);
  --brd-strong: rgba(210, 210, 210, .34);
  --line: rgba(180, 180, 180, .16);
  --row-hover: rgba(255, 255, 255, .08);
  --table-head: rgba(46, 46, 46, .9);
  --text: #f5f5f5;
  --txt-p: #f5f5f5;
  --txt-m: #d4d4d4;
  --txt-s: #ffffff;
  --txt-soft: #a3a3a3;
  --muted: var(--txt-m);
  --primary: #333333;
  --primary-600: #2b2b2b;
  --primary-700: #1f1f1f;
  --accent: #6b6b6b;
  --accent-2: #333333;
  --accent-soft: rgba(255, 255, 255, .1);
  --soft-chip-bg: rgba(255, 255, 255, .12);
  --soft-chip-text: #f5f5f5;
  --shadow: 0 28px 72px rgba(0, 0, 0, .44);
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, .28);
  --shadow-hover: 0 18px 46px rgba(0, 0, 0, .34);
  --shadow-accent: 0 14px 30px rgba(0, 0, 0, .28);
  --shadow-brand: 0 18px 45px rgba(0, 0, 0, .3);
  --ring: 0 0 0 4px rgba(255, 255, 255, .14);
  --scroll-track: rgba(255, 255, 255, .08);
  --scroll-thumb: rgba(120, 120, 120, .64);
}

html[data-tema="light"][data-color="orange"],
html[data-tema="light"]:not([data-color]) {
  --bg: #f7efe8;
  --bg-alt: #fff8f1;
  --bg-end: #edf0f5;
  --surface: rgba(255, 255, 255, .94);
  --surface-2: rgba(255, 248, 241, .94);
  --panel: rgba(255, 255, 255, .94);
  --panel-strong: #ffffff;
  --panel-soft: rgba(255, 248, 241, .88);
  --field: #fffaf6;
  --field-focus: #ffffff;
  --topbar-bg: rgba(255, 248, 241, .84);
  --loader-bg: rgba(255, 248, 241, .92);
  --border: rgba(154, 52, 18, .15);
  --brd: var(--border);
  --brd-strong: rgba(154, 52, 18, .28);
  --line: rgba(154, 52, 18, .12);
  --row-hover: rgba(234, 88, 12, .09);
  --table-head: #fff3e8;
  --text: #25110d;
  --txt-p: #25110d;
  --txt-m: #76503c;
  --txt-s: #4b2118;
  --txt-soft: #9b7866;
  --muted: var(--txt-m);
  --soft-chip-bg: #ffedd5;
  --soft-chip-text: #9a3412;
  --shadow: 0 24px 60px rgba(69, 26, 18, .12);
  --shadow-soft: 0 14px 34px rgba(69, 26, 18, .08);
  --shadow-hover: 0 18px 46px rgba(69, 26, 18, .12);
  --shadow-accent: 0 14px 30px rgba(234, 88, 12, .18);
  --shadow-brand: 0 18px 45px rgba(234, 88, 12, .18);
  --scroll-track: rgba(154, 52, 18, .08);
}

html[data-tema="light"][data-color="blue"] {
  --bg: #eef5ff;
  --bg-alt: #f8fbff;
  --bg-end: #e7edf7;
  --surface-2: rgba(248, 251, 255, .94);
  --panel-soft: rgba(239, 246, 255, .88);
  --field: #f8fbff;
  --topbar-bg: rgba(239, 246, 255, .84);
  --loader-bg: rgba(239, 246, 255, .92);
  --border: rgba(37, 99, 235, .15);
  --brd: var(--border);
  --brd-strong: rgba(37, 99, 235, .28);
  --line: rgba(37, 99, 235, .12);
  --row-hover: rgba(37, 99, 235, .08);
  --table-head: #eff6ff;
  --text: #0f1f3a;
  --txt-p: #0f1f3a;
  --txt-m: #516782;
  --txt-s: #1e3a5f;
  --txt-soft: #76869d;
  --soft-chip-bg: #dbeafe;
  --soft-chip-text: #1e3a8a;
  --shadow: 0 24px 60px rgba(30, 64, 175, .12);
  --shadow-soft: 0 14px 34px rgba(30, 64, 175, .08);
  --shadow-hover: 0 18px 46px rgba(30, 64, 175, .12);
  --shadow-accent: 0 14px 30px rgba(37, 99, 235, .18);
  --shadow-brand: 0 18px 45px rgba(37, 99, 235, .18);
}

html[data-tema="light"][data-color="green"] {
  --bg: #eef8f0;
  --bg-alt: #f8fff9;
  --bg-end: #e8f1eb;
  --surface-2: rgba(248, 255, 249, .94);
  --panel-soft: rgba(240, 253, 244, .88);
  --field: #f8fff9;
  --topbar-bg: rgba(240, 253, 244, .84);
  --loader-bg: rgba(240, 253, 244, .92);
  --border: rgba(22, 163, 74, .15);
  --brd: var(--border);
  --brd-strong: rgba(22, 163, 74, .28);
  --line: rgba(22, 163, 74, .12);
  --row-hover: rgba(22, 163, 74, .08);
  --table-head: #f0fdf4;
  --text: #102419;
  --txt-p: #102419;
  --txt-m: #4f705a;
  --txt-s: #17442a;
  --txt-soft: #728b78;
  --soft-chip-bg: #dcfce7;
  --soft-chip-text: #166534;
  --shadow: 0 24px 60px rgba(20, 83, 45, .12);
  --shadow-soft: 0 14px 34px rgba(20, 83, 45, .08);
  --shadow-hover: 0 18px 46px rgba(20, 83, 45, .12);
  --shadow-accent: 0 14px 30px rgba(22, 163, 74, .18);
  --shadow-brand: 0 18px 45px rgba(22, 163, 74, .18);
}

html[data-tema="light"][data-color="red"] {
  --bg: #fbefef;
  --bg-alt: #fff8f8;
  --bg-end: #f2e8e8;
  --surface-2: rgba(255, 248, 248, .94);
  --panel-soft: rgba(254, 242, 242, .88);
  --field: #fffafa;
  --topbar-bg: rgba(254, 242, 242, .84);
  --loader-bg: rgba(254, 242, 242, .92);
  --border: rgba(220, 38, 38, .15);
  --brd: var(--border);
  --brd-strong: rgba(220, 38, 38, .28);
  --line: rgba(220, 38, 38, .12);
  --row-hover: rgba(220, 38, 38, .08);
  --table-head: #fef2f2;
  --text: #281111;
  --txt-p: #281111;
  --txt-m: #765050;
  --txt-s: #4f1f1f;
  --txt-soft: #967373;
  --soft-chip-bg: #fee2e2;
  --soft-chip-text: #7f1d1d;
  --shadow: 0 24px 60px rgba(127, 29, 29, .12);
  --shadow-soft: 0 14px 34px rgba(127, 29, 29, .08);
  --shadow-hover: 0 18px 46px rgba(127, 29, 29, .12);
  --shadow-accent: 0 14px 30px rgba(220, 38, 38, .18);
  --shadow-brand: 0 18px 45px rgba(220, 38, 38, .18);
}

html[data-tema="light"][data-color="pink"] {
  --bg: #fbf0f6;
  --bg-alt: #fff8fc;
  --bg-end: #f2e8ef;
  --surface-2: rgba(255, 248, 252, .94);
  --panel-soft: rgba(253, 242, 248, .88);
  --field: #fffafd;
  --topbar-bg: rgba(253, 242, 248, .84);
  --loader-bg: rgba(253, 242, 248, .92);
  --border: rgba(219, 39, 119, .15);
  --brd: var(--border);
  --brd-strong: rgba(219, 39, 119, .28);
  --line: rgba(219, 39, 119, .12);
  --row-hover: rgba(219, 39, 119, .08);
  --table-head: #fdf2f8;
  --text: #2a121f;
  --txt-p: #2a121f;
  --txt-m: #765367;
  --txt-s: #4f2139;
  --txt-soft: #96758a;
  --soft-chip-bg: #fce7f3;
  --soft-chip-text: #831843;
  --shadow: 0 24px 60px rgba(131, 24, 67, .12);
  --shadow-soft: 0 14px 34px rgba(131, 24, 67, .08);
  --shadow-hover: 0 18px 46px rgba(131, 24, 67, .12);
  --shadow-accent: 0 14px 30px rgba(219, 39, 119, .18);
  --shadow-brand: 0 18px 45px rgba(219, 39, 119, .18);
}

html[data-tema="light"][data-color="purple"] {
  --bg: #f4f0fb;
  --bg-alt: #fbf8ff;
  --bg-end: #ece8f3;
  --surface-2: rgba(251, 248, 255, .94);
  --panel-soft: rgba(245, 243, 255, .88);
  --field: #fbfaff;
  --topbar-bg: rgba(245, 243, 255, .84);
  --loader-bg: rgba(245, 243, 255, .92);
  --border: rgba(124, 58, 237, .15);
  --brd: var(--border);
  --brd-strong: rgba(124, 58, 237, .28);
  --line: rgba(124, 58, 237, .12);
  --row-hover: rgba(124, 58, 237, .08);
  --table-head: #f5f3ff;
  --text: #1e1732;
  --txt-p: #1e1732;
  --txt-m: #625676;
  --txt-s: #342656;
  --txt-soft: #837793;
  --soft-chip-bg: #ede9fe;
  --soft-chip-text: #4c1d95;
  --shadow: 0 24px 60px rgba(76, 29, 149, .12);
  --shadow-soft: 0 14px 34px rgba(76, 29, 149, .08);
  --shadow-hover: 0 18px 46px rgba(76, 29, 149, .12);
  --shadow-accent: 0 14px 30px rgba(124, 58, 237, .18);
  --shadow-brand: 0 18px 45px rgba(124, 58, 237, .18);
}

html[data-tema="light"][data-color="gold"] {
  --bg: #f7f1e2;
  --bg-alt: #fffaf0;
  --bg-end: #eee7d7;
  --surface-2: rgba(255, 250, 240, .94);
  --panel-soft: rgba(254, 249, 232, .88);
  --field: #fffaf0;
  --topbar-bg: rgba(254, 249, 232, .84);
  --loader-bg: rgba(254, 249, 232, .92);
  --border: rgba(164, 116, 18, .16);
  --brd: var(--border);
  --brd-strong: rgba(164, 116, 18, .3);
  --line: rgba(164, 116, 18, .13);
  --row-hover: rgba(196, 147, 34, .09);
  --table-head: #fef3c7;
  --text: #261c08;
  --txt-p: #261c08;
  --txt-m: #715b2d;
  --txt-s: #4a350d;
  --txt-soft: #8b7543;
  --soft-chip-bg: #fef3c7;
  --soft-chip-text: #704b05;
  --shadow: 0 24px 60px rgba(112, 75, 5, .12);
  --shadow-soft: 0 14px 34px rgba(112, 75, 5, .08);
  --shadow-hover: 0 18px 46px rgba(112, 75, 5, .12);
  --shadow-accent: 0 14px 30px rgba(196, 147, 34, .18);
  --shadow-brand: 0 18px 45px rgba(196, 147, 34, .18);
}

html[data-tema="light"][data-color="black"] {
  --bg: #f1f1f1;
  --bg-alt: #ffffff;
  --bg-end: #e5e5e5;
  --surface-2: rgba(250, 250, 250, .94);
  --panel-soft: rgba(245, 245, 245, .9);
  --field: #ffffff;
  --topbar-bg: rgba(250, 250, 250, .86);
  --loader-bg: rgba(250, 250, 250, .94);
  --border: rgba(51, 51, 51, .16);
  --brd: var(--border);
  --brd-strong: rgba(51, 51, 51, .32);
  --line: rgba(51, 51, 51, .12);
  --row-hover: rgba(51, 51, 51, .07);
  --table-head: #f3f4f6;
  --text: #1f1f1f;
  --txt-p: #1f1f1f;
  --txt-m: #555555;
  --txt-s: #333333;
  --txt-soft: #737373;
  --soft-chip-bg: #ededed;
  --soft-chip-text: #333333;
  --shadow: 0 24px 60px rgba(51, 51, 51, .12);
  --shadow-soft: 0 14px 34px rgba(51, 51, 51, .08);
  --shadow-hover: 0 18px 46px rgba(51, 51, 51, .12);
  --shadow-accent: 0 14px 30px rgba(51, 51, 51, .16);
  --shadow-brand: 0 18px 45px rgba(51, 51, 51, .16);
}

html[data-tema="light"] {
  --surface: rgba(255, 255, 255, .94);
  --panel: rgba(255, 255, 255, .94);
  --panel-strong: #ffffff;
  --field-focus: #ffffff;
}

html[data-color] {
  --sidebar: var(--primary-700);
  --sidebar-2: var(--primary-600);
}

body,
html[data-tema="light"] body {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg) 48%, var(--bg-end));
}

.page-loader,
html[data-tema="light"] .page-loader { background: var(--loader-bg); }

.loader-ring {
  border-color: var(--soft-chip-bg);
  border-top-color: var(--primary);
}

.loader-card,
.card,
.panel,
.orders-column,
.kanban-col,
.modal-card,
.manual-items-box,
.delivery-rule-cell,
.order-detail-grid > div,
.product-card,
.public-order-card,
.security-code,
.tracking-card,
.dropdown-panel,
.auth-card {
  background: var(--panel);
  border-color: var(--brd);
  box-shadow: var(--shadow-soft);
}

.sidebar,
html[data-tema="light"] .sidebar {
  background: var(--panel-strong);
  border-right-color: var(--brd);
}

.topbar,
html[data-tema="light"] .topbar,
.public-menu-header,
html[data-tema="light"] .public-menu-header {
  background: var(--topbar-bg);
  border-bottom-color: var(--brd);
}

.panel-header,
.orders-column-head,
.cart-totals,
.check-row,
.segmented-options label,
.cart-line,
.delivery-quote-box,
.pickup-location-box,
.empty,
.ticket,
.order-ticket-actions,
.category-chip-action,
.modal-body,
.manual-items-box {
  background: var(--panel-soft);
  border-color: var(--brd);
}

.input,
.select,
.textarea,
.tb-btn,
.btn-secondary,
.password-toggle:hover,
.table-thumb,
.profile-photo-preview,
.product-photo {
  background: var(--field);
  border-color: var(--brd);
  color: var(--txt-p);
}

.input:hover,
.select:hover,
.textarea:hover,
.tb-btn:hover,
.btn-secondary:hover {
  background: var(--field-focus);
  border-color: var(--brd-strong);
  color: var(--txt-p);
}

html[data-tema="light"] .btn-secondary,
html[data-tema="light"] .btn-secondary:hover,
html[data-tema="light"] .tb-btn,
html[data-tema="light"] .tb-btn:hover,
html[data-tema="light"] .btn-icon,
html[data-tema="light"] .btn-icon:hover,
html[data-tema="light"] .btn-ghost,
html[data-tema="light"] .btn-ghost:hover {
  color: var(--txt-p);
}

html[data-tema="light"] .btn-secondary:hover i,
html[data-tema="light"] .btn-secondary:hover svg,
html[data-tema="light"] .tb-btn:hover i,
html[data-tema="light"] .tb-btn:hover svg,
html[data-tema="light"] .btn-icon:hover i,
html[data-tema="light"] .btn-icon:hover svg,
html[data-tema="light"] .btn-ghost:hover i,
html[data-tema="light"] .btn-ghost:hover svg {
  color: var(--primary-700);
  stroke: currentColor;
}

html[data-tema="light"] .modal-close:hover {
  background: rgba(255, 255, 255, .35);
  color: #fff;
}

th,
.table-wrap table th,
table.modern-table th {
  background: var(--table-head);
  color: var(--txt-m);
  border-bottom-color: var(--line);
}

td,
.table-wrap table td,
table.modern-table td,
.panel-header,
.notification-panel-header,
.footer,
.modal-actions,
.order-ticket-actions,
.manual-items-box,
.delivery-rule-cell,
.cart-totals div:last-child {
  border-color: var(--line);
}

tbody tr:hover,
.notification-item:hover {
  background: var(--row-hover);
}

.badge,
.category-chip-action .badge,
html[data-tema="light"] .category-chip-action .badge,
.tracking-step.done,
.orders-column-head span {
  background: var(--soft-chip-bg);
  border-color: var(--brd-strong);
  color: var(--soft-chip-text);
}

.empty,
html[data-tema="light"] .empty {
  color: var(--soft-chip-text);
}

.public-menu-page,
.public-result,
.tracking-page,
html[data-tema="light"] .public-menu-page,
html[data-tema="light"] .public-result,
html[data-tema="light"] .tracking-page {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
}

.auth-page {
  background: linear-gradient(145deg, var(--bg-end), var(--bg) 52%, var(--primary-700) 100%);
}

html[data-tema="light"] .auth-page {
  background: linear-gradient(145deg, var(--bg-alt), var(--bg) 52%, var(--soft-chip-bg) 100%);
}

.auth-brand p,
.modal-header p,
.public-order-header small {
  color: var(--soft-chip-text);
}

.kanban-col,
.ticket,
.order-ticket,
.manual-items-box,
.public-order-card,
.segmented-options label,
.delivery-quote-box,
.pickup-location-box,
.cart-line,
.cart-totals,
.security-code,
.tracking-card {
  background: var(--panel);
  border-color: var(--brd);
}

.orders-column-head,
.order-ticket-actions,
.delivery-rule-cell,
.table-thumb,
.profile-photo-preview,
.product-photo,
.tracking-step.done {
  background: var(--panel-soft);
  border-color: var(--brd-strong);
}

.orders-column-head span,
.public-cart-button span,
.badge,
.tracking-step.done {
  background: var(--soft-chip-bg);
  border-color: var(--brd-strong);
  color: var(--soft-chip-text);
}

.order-ticket-total,
.data-table-pages span,
.check-row {
  color: var(--txt-p);
}

.public-brand h1,
.public-category h2,
.address-title,
.security-code strong,
.order-ticket-code,
.cart-totals div:last-child {
  color: var(--primary-700);
}

.product-card {
  background: var(--panel);
  border-color: var(--brd);
  box-shadow: var(--shadow-soft);
}

.product-photo,
.table-thumb,
.profile-photo-preview {
  color: var(--primary);
}

.sidebar-nav::-webkit-scrollbar-thumb,
.sb-nav::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
}

.sidebar-nav:hover::-webkit-scrollbar-thumb,
.sb-nav:hover::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
}

.sidebar-nav,
.sb-nav {
  scrollbar-color: var(--scroll-thumb) transparent;
}

.sidebar-link:hover,
.sidebar-link.active,
.sb-item:hover,
.sb-item.on {
  border-color: var(--brd-strong);
}

.brand-mark {
  box-shadow: var(--shadow-brand);
}

.brand-mark img,
.company-switch-logo img,
.company-option-logo img,
.theme-preview-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
  background: #fff;
  display: block;
}

.brand-mark:has(img:not([hidden])),
.company-switch-logo:has(img:not([hidden])),
.company-option-logo:has(img:not([hidden])),
.theme-preview-logo:has(img:not([hidden])),
.establishment-preview-mark:has(img:not([hidden])),
.establishment-logo-preview:has(img:not([hidden])) {
  background: #fff;
  padding: 0;
  overflow: hidden;
  border: 0;
}

.establishment-logo-preview:has(img:not([hidden])) .brand-mark {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.establishment-logo-preview:has(img:not([hidden])) .brand-mark img {
  border-radius: inherit;
}

.logo-preview-default,
.logo-preview-default svg {
  width: 100%;
  height: 100%;
  display: block;
}

.loader-card,
.auth-card,
.dropdown-panel,
.public-order-card {
  box-shadow: var(--shadow);
}

.card:hover,
.panel:hover,
.order-ticket:hover {
  box-shadow: var(--shadow-hover);
}

.sb-item.on,
.btn-primary,
.theme-preview-action {
  box-shadow: var(--shadow-accent);
}

.establishment-settings {
  align-items: start;
}

.establishment-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: var(--panel-soft);
}

.establishment-logo-preview {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  box-shadow: var(--shadow-accent);
}

.establishment-logo-field {
  min-width: 0;
}

.establishment-logo-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: var(--panel-soft);
}

.establishment-logo-preview .brand-mark {
  width: 42px;
  height: 42px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.establishment-logo-preview .brand-mark svg {
  width: 42px;
  height: 42px;
}

.establishment-preview-mark {
  width: 64px;
  height: 64px;
  padding: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border-color: var(--brd-strong);
  box-shadow: var(--shadow-accent);
}

.establishment-summary strong,
.establishment-summary span {
  display: block;
}

.establishment-summary span {
  margin-top: 4px;
  color: var(--txt-soft);
  font-size: 12px;
  font-weight: 700;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.settings-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.settings-list div:last-child {
  border-bottom: 0;
}

.settings-list dt,
.settings-list dd {
  margin: 0;
}

.settings-list dt {
  color: var(--txt-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-list dd {
  min-width: 0;
  color: var(--txt-p);
  overflow-wrap: anywhere;
}

.establishment-color-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.establishment-color-swatch {
  min-height: 58px;
  border-radius: 8px;
  justify-content: flex-start;
  padding: 12px;
}

.establishment-color-swatch span {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
}

.establishment-color-swatch.active {
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-soft);
}

.theme-preview {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: var(--shadow-soft);
}

.theme-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--txt-p);
}

.theme-preview-head span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
}

.theme-preview-head .theme-preview-logo {
  width: 38px;
  height: 38px;
  padding: 5px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-accent);
}

.theme-preview-row {
  display: grid;
  gap: 8px;
}

.theme-preview-row span {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
}

.theme-preview-row span:last-child {
  width: 70%;
}

.theme-preview-action {
  width: 120px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
}

.form-actions-end {
  display: flex;
  justify-content: flex-end;
}

.company-switcher {
  min-width: 0;
}

.company-switch-button {
  max-width: 260px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--brd);
  border-radius: 10px;
  background: var(--field);
  color: var(--txt-p);
  box-shadow: none;
}

.company-switch-button > span:not(.company-switch-logo) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.company-switch-button:hover {
  background: var(--field-focus);
  border-color: var(--brd-strong);
}

.company-switch-logo,
.company-option-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff;
}

.company-switch-logo {
  width: 30px;
  height: 30px;
  padding: 4px;
}

.company-switch-button > i {
  width: 16px;
  height: 16px;
  color: var(--txt-soft);
}

.company-switch-panel {
  width: min(320px, calc(100vw - 28px));
  display: none;
  gap: 8px;
}

.dropdown.open .company-switch-panel {
  display: grid;
}

.company-switch-panel > strong {
  padding: 4px 4px 2px;
  color: var(--txt-p);
  font-size: 12px;
}

.company-switch-panel form {
  margin: 0;
}

.company-option {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: var(--field);
  color: var(--txt-p);
  text-align: left;
}

.company-option:hover,
.company-option.active {
  background: var(--accent-soft);
  border-color: var(--brd-strong);
}

.company-option:disabled {
  cursor: default;
  opacity: .9;
}

.company-option-logo {
  width: 38px;
  height: 38px;
  padding: 5px;
}

.company-option strong,
.company-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-option small {
  margin-top: 2px;
  color: var(--txt-soft);
  font-size: 11px;
  font-weight: 800;
}

.company-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
}

.company-color-dot[data-color="blue"] { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.company-color-dot[data-color="orange"] { background: linear-gradient(135deg, #ea580c, #dc2626); }
.company-color-dot[data-color="green"] { background: linear-gradient(135deg, #16a34a, #15803d); }
.company-color-dot[data-color="red"] { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.company-color-dot[data-color="pink"] { background: linear-gradient(135deg, #db2777, #be185d); }
.company-color-dot[data-color="purple"] { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.company-color-dot[data-color="gold"] { background: linear-gradient(135deg, #c49322, #a77713); }
.company-color-dot[data-color="black"] { background: linear-gradient(135deg, #4a4a4a, #333333); }

html[data-tema="dark"] .field label {
  color: var(--txt-m);
}

html[data-tema="dark"] .field:focus-within label {
  color: var(--txt-s);
}

@media (max-width: 760px) {
  .establishment-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-switch-button {
    max-width: 168px;
  }

  .settings-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .establishment-logo-card {
    grid-template-columns: 1fr;
  }
}

.password-strength {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.password-strength-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--brd);
  overflow: hidden;
}

.password-strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--danger);
  border-radius: inherit;
  transition: width .2s ease, background .2s ease;
}

.password-strength.level-1 .password-strength-bar span { background: #ef4444; }
.password-strength.level-2 .password-strength-bar span { background: #f97316; }
.password-strength.level-3 .password-strength-bar span { background: #eab308; }
.password-strength.level-4 .password-strength-bar span { background: #84cc16; }
.password-strength.level-5 .password-strength-bar span { background: #22c55e; }

.password-strength-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
}

.password-strength.level-1 .password-strength-label { color: #ef4444; }
.password-strength.level-2 .password-strength-label { color: #f97316; }
.password-strength.level-3 .password-strength-label { color: #eab308; }
.password-strength.level-4 .password-strength-label { color: #65a30d; }
.password-strength.level-5 .password-strength-label { color: #16a34a; }

.password-rules {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
  font-size: .8rem;
  color: var(--muted);
}

.password-rules li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-rules li i {
  width: 14px;
  height: 14px;
}

.password-rules li.valid {
  color: var(--success, #16a34a);
}

.password-rules li.valid i {
  color: var(--success, #16a34a);
}

.modal-card-wide {
  width: min(1100px, 100%);
}

.modal-backdrop,
.modal-backdrop.open {
  align-items: flex-start;
}

.modal-backdrop {
  padding-top: 18px;
}

.modal-card {
  margin: 0 auto;
}

.order-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .order-builder {
    grid-template-columns: 1fr;
  }
}

.order-builder-section {
  margin-bottom: 18px;
}

.order-builder-section h4 {
  margin: 0 0 10px;
  font-size: .95rem;
  color: var(--txt-p);
}

.order-product-search {
  margin-bottom: 10px;
}

.order-product-list {
  max-height: 360px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.order-product-category > strong {
  display: block;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.order-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.order-product-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--brd);
  border-radius: 10px;
  background: var(--field);
  color: var(--txt-p);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}

.order-product-card:hover {
  border-color: var(--primary);
  background: var(--accent-soft);
}

.order-product-card img,
.order-product-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
  color: var(--muted);
}

.order-product-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.order-product-info strong {
  font-size: .88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-product-info small {
  font-size: .78rem;
  color: var(--muted);
}

.order-product-add {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
}

.order-builder-cart {
  background: var(--panel-soft);
  border: 1px solid var(--brd);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.order-builder-cart h4 {
  margin: 0 0 10px;
  font-size: .95rem;
}

.order-cart-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.order-cart-empty {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
  padding: 16px 0;
}

.order-cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--field);
  border: 1px solid var(--brd);
  border-radius: 8px;
}

.order-cart-line-info strong {
  display: block;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-cart-line-info small {
  font-size: .72rem;
  color: var(--muted);
}

.order-cart-qty {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-soft);
  border-radius: 6px;
  padding: 2px;
}

.order-cart-qty button {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--txt-p);
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.order-cart-qty button:hover {
  background: var(--accent-soft);
}

.order-cart-qty span {
  min-width: 22px;
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
}

.order-cart-line-total {
  font-size: .85rem;
  font-weight: 700;
  color: var(--primary-700);
}

.order-cart-remove {
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.order-cart-remove:hover {
  color: var(--danger);
}

.order-cart-totals {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--brd);
  font-size: .88rem;
}

.order-cart-totals > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-cart-totals .order-cart-total {
  padding-top: 8px;
  border-top: 1px dashed var(--brd);
  font-size: 1.05rem;
}

.order-cart-totals .order-cart-total strong {
  color: var(--primary-700);
  font-size: 1.15rem;
}

.segmented-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.segmented-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.segmented-option {
  position: relative;
  cursor: pointer;
}

.segmented-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--brd);
  border-radius: 10px;
  background: var(--field);
  color: var(--txt-p);
  font-weight: 700;
  font-size: .88rem;
  transition: border-color .15s ease, background .15s ease;
}

.segmented-option input:checked + span {
  border-color: var(--primary);
  background: var(--accent-soft);
  color: var(--primary-700);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.segmented-option span i {
  width: 18px;
  height: 18px;
}

.order-customer-search {
  position: relative;
}

.customer-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 10;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface, var(--panel));
  border: 1px solid var(--brd);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}

.customer-suggestion {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--brd);
  text-align: left;
  cursor: pointer;
  color: var(--txt-p);
}

.customer-suggestion:last-child {
  border-bottom: 0;
}

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

.customer-suggestion strong {
  font-size: .88rem;
}

.customer-suggestion small {
  font-size: .76rem;
  color: var(--muted);
}

.customer-suggestion-empty {
  padding: 12px;
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
}

.btn-link {
  background: transparent;
  border: 0;
  padding: 0 4px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}

.confirm-modal-card {
  width: min(440px, 100%);
}

.confirm-modal-header h3 {
  font-size: 1.05rem;
}

.confirm-modal-header p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, .82);
  font-size: .88rem;
}

.confirm-modal-header-danger {
  background: linear-gradient(135deg, #7f1d1d, #b91c1c, #ef4444) !important;
}

.confirm-modal-card .modal-body {
  padding: 18px 20px;
}

.confirm-modal-card .modal-actions {
  margin-top: 0;
}

.btn-danger {
  background: linear-gradient(135deg, #b91c1c, #ef4444);
  color: #fff;
  border: 0;
}

.btn-danger:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.schedule-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.schedule-order-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: var(--panel-soft);
}

.public-establishment-hero {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--panel), var(--panel-soft));
  box-shadow: var(--shadow-soft);
}

.public-establishment-logo {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-accent);
}

.public-establishment-logo img,
.public-establishment-logo .brand-mark {
  width: 100%;
  height: 100%;
}

.public-establishment-logo img,
.public-establishment-logo .brand-mark img {
  object-fit: cover;
}

.public-establishment-info h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.public-establishment-info p {
  margin: 0;
  color: var(--txt-m);
  line-height: 1.5;
}

.public-establishment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.public-establishment-meta span,
.public-establishment-meta a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--brd);
  border-radius: 8px;
  background: var(--field);
  color: var(--txt-p);
  font-weight: 800;
  font-size: .84rem;
}

.public-establishment-meta svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.delivery-public-page {
  min-height: 100vh;
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 22px;
  display: grid;
  align-items: start;
}

.delivery-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.public-map-box {
  min-height: 300px;
  margin: 14px 0;
  border: 1px solid var(--brd);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
  box-shadow: var(--shadow-soft);
}

.field-help.is-ok,
.empty.is-ok {
  color: var(--success);
}

.field-help.is-error,
.empty.is-error {
  color: var(--danger);
}

.btn.copied {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

@media (max-width: 760px) {
  .schedule-days-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .public-establishment-hero {
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 14px;
  }

  .public-establishment-logo {
    width: 72px;
    height: 72px;
  }
}
