/* Tiko OS — sistema visual medieval compartilhado, etapa 1 */
:root {
  --bg: #080706;
  --panel: #12110f;
  --panel2: #1a1712;
  --wood: #2a1a0d;
  --wood-deep: #120c07;
  --iron: #292823;
  --bronze: #8e5a20;
  --gold: #e1a73f;
  --gold-bright: #ffd477;
  --purple: #7b43a8;
  --line: #5c3a18;
  --text: #f4e8ce;
  --muted: #b7a98e;
  --green: #6fb653;
  --red: #d45a4d;
  --blue: #6b83c8;
  --orange: #d98932;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --radius: 5px;
  --shadow: 0 14px 36px rgba(0, 0, 0, .42);
  --font-title: Georgia, "Times New Roman", serif;
  --font-ui: "Segoe UI", Arial, sans-serif;
}

html { background: var(--bg); }

body {
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% -12%, rgba(132, 76, 22, .16), transparent 35%),
    radial-gradient(circle at 20% 110%, rgba(92, 48, 117, .11), transparent 35%),
    linear-gradient(135deg, #090806, #050505 68%);
  color: var(--text);
  font-family: var(--font-ui);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .008) 1px, transparent 1px);
  background-size: 5px 5px;
  content: "";
  pointer-events: none;
}

button, input, select, textarea { font-family: var(--font-ui); }

.app {
  grid-template-columns: 258px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  position: sticky;
  isolation: isolate;
  padding: 16px 13px 18px;
  overflow: hidden auto;
  border-right: 1px solid #8c5a23;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 14%, transparent 86%, rgba(0,0,0,.42)),
    repeating-linear-gradient(0deg, transparent 0 42px, rgba(190,111,31,.025) 43px 44px),
    linear-gradient(180deg, #18130d, #0b0a08 55%, #12100c);
  box-shadow: 12px 0 36px rgba(0, 0, 0, .42), inset -5px 0 18px rgba(0, 0, 0, .42);
}

.sidebar::before,
.sidebar::after {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: -1;
  height: 5px;
  border: 1px solid #6d451d;
  background: linear-gradient(90deg, transparent, #bd7b2b 50%, transparent);
  content: "";
  opacity: .7;
}

.sidebar::before { top: 8px; }
.sidebar::after { bottom: 8px; }

.sidebar .brand {
  justify-content: center;
  min-height: 154px;
  margin: 0 0 12px;
  padding: 4px 12px 8px;
  border-bottom: 1px solid rgba(191, 124, 39, .32);
}

.sidebar-logo {
  width: 146px !important;
  max-width: 100% !important;
  max-height: 150px;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.72));
}

.sidebar nav { min-height: 0; }

.sidebar .nav,
.sidebar summary {
  position: relative;
  min-height: 43px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #d8c7a4;
  letter-spacing: .01em;
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease;
}

.sidebar .nav:hover,
.sidebar .nav:focus-visible,
.sidebar summary:hover {
  border-color: rgba(210, 144, 48, .38);
  background: rgba(115, 68, 23, .18);
  color: #ffe0a1;
}

.sidebar .nav.active {
  border-color: #a66a25;
  background:
    linear-gradient(90deg, rgba(210, 138, 37, .3), rgba(88, 51, 18, .25)),
    #17120c;
  color: var(--gold-bright);
  box-shadow: inset 3px 0 #e0a33e, 0 4px 16px rgba(0,0,0,.22);
}

.sidebar nav > details {
  border-top: 1px solid rgba(142, 90, 32, .18);
}

.sidebar nav > details > summary {
  color: #e2b764;
  font-family: var(--font-title);
  font-size: 14px;
  letter-spacing: .03em;
}

.sidebar nav > details.has-active > summary {
  background: rgba(123, 67, 168, .1);
  color: #efd5ff;
}

.sidebar nav > details .nav.sub { padding-left: 38px; }
.sidebar nav > details .nav.sub::before { left: 20px; background: #b3762c; }

.sidebar #logoutBtn {
  min-height: 44px;
  border-color: #80501e;
  background: linear-gradient(#1c1710, #0e0d0a);
  color: #e9b85a;
  font-family: var(--font-title);
}

.sidebar #logoutBtn:hover { border-color: var(--gold); color: #ffe0a1; }

.main {
  min-width: 0;
  padding: 0 24px 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 86px;
  margin: 0 -24px 22px;
  padding: 13px 24px;
  border-bottom: 1px solid rgba(153, 97, 34, .48);
  background: linear-gradient(180deg, rgba(12, 11, 9, .97), rgba(9, 9, 8, .92));
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  backdrop-filter: blur(12px);
}

.topbar-heading { min-width: 190px; }
.topbar .eyebrow { margin: 0; color: #9d7440; }

.topbar h1 {
  margin: 2px 0 0;
  color: var(--gold-bright);
  font: 32px/1.05 var(--font-title);
  text-shadow: 0 2px 12px rgba(198, 116, 25, .15);
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.admin-search { width: min(330px, 26vw); margin: 0; }

.admin-search input {
  min-height: 42px;
  padding-left: 38px;
  border-color: #4d351d;
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 31px, rgba(175,112,37,.26) 32px, transparent 33px),
    linear-gradient(#11100e, #0a0a09);
}

.admin-search::before {
  position: absolute;
  margin: 11px 0 0 13px;
  color: #b87c31;
  content: "⌕";
  font-size: 18px;
}

.operation-watch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  color: #a8d989;
  font-size: 12px;
  white-space: nowrap;
}

.operation-watch::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(111,182,83,.12);
  content: "";
}

.notification-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #5b3c1b;
  border-radius: 50%;
  background: #13110d;
  color: #ad8c56;
  opacity: .72;
}

.userbox {
  min-width: 156px;
  padding: 6px 9px;
  border: 1px solid #54381a;
  border-radius: 5px;
  background: linear-gradient(135deg, #19140d, #0d0c0a);
}

.profile-sigil {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #a26924;
  border-radius: 50%;
  background: radial-gradient(circle, #74451c, #24160b 70%);
  color: #ffd783;
  font: 700 16px var(--font-title);
}

.userbox-copy { display: grid; min-width: 0; }
#userName { overflow: hidden; color: #f2dfb8; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.userbox .pill { padding: 2px 0; background: none; color: #9b8b74; }

.main > .page { animation: page-arrive .2s ease-out; }
@keyframes page-arrive { from { opacity: 0; transform: translateY(5px); } }

.panel,
.metrics article,
.dashboard-panel,
.dashboard-kpi,
.dashboard-financial-card,
.production-summary article,
.tablet-admin-summary article {
  position: relative;
  border: 1px solid #533719;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 32%),
    linear-gradient(180deg, #171511, #0f0f0d);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,.42);
}

.panel::before,
.dashboard-panel::before {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(179, 111, 32, .12);
  border-radius: 2px;
  content: "";
  pointer-events: none;
}

.panel h2,
.dashboard-panel h2,
.dashboard-section-title h2 {
  color: #edba61;
  font-family: var(--font-title);
  font-weight: 500;
}

.panel p,
.dashboard-panel p,
.dashboard-section-title p { color: var(--muted); }

.btn {
  min-height: 40px;
  border-radius: 4px;
  font-weight: 600;
}

.btn.primary {
  border-color: #d3993d;
  background: linear-gradient(180deg, #b87a2d, #704113);
  color: #fff0c8;
  box-shadow: inset 0 1px rgba(255,255,255,.2);
}

.btn.ghost {
  border-color: #68451f;
  background: linear-gradient(#1a1711, #0d0d0b);
  color: #e3b45c;
}

.btn:hover { filter: brightness(1.12); }
.btn:focus-visible, .nav:focus-visible, .kds-filter-tabs button:focus-visible { outline: 2px solid #dba64d; outline-offset: 2px; }

input, select, textarea {
  border-color: #4e361d;
  border-radius: 4px;
  background: #0c0c0b;
  color: #f2e5cc;
}

input:focus, select:focus, textarea:focus {
  border-color: #ba7b2d;
  box-shadow: 0 0 0 3px rgba(186,123,45,.14);
}

.table th { color: #d5a652; font-family: var(--font-title); }
.table th, .table td { border-bottom-color: rgba(111,75,36,.55); }
.table tbody tr:hover { background: rgba(177,109,31,.06); }

dialog {
  border-color: #805322;
  border-radius: 6px;
  background: #12110e;
  box-shadow: 0 28px 80px #000c;
}

dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(3px); }

/* Visão Geral */
.dashboard-operational { gap: 14px; }

.dashboard-statusbar {
  min-height: 76px;
  border-color: #7e5527;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(185,116,36,.2), transparent 24%, rgba(96,52,16,.15)),
    linear-gradient(180deg, #211a10, #12100c);
  box-shadow: var(--shadow), inset 0 0 18px rgba(203,127,35,.07);
}

.dashboard-statusbar h2 { color: #f0c174; font-weight: 500; }
.dashboard-live { color: #a7d883; }
.dashboard-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }

.dashboard-kpi {
  min-height: 142px;
  padding: 16px 13px;
  text-align: center;
}

.dashboard-kpi::before {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  place-items: center;
  border: 1px solid #6d481f;
  border-radius: 50%;
  background: radial-gradient(circle, #2d2111, #11100d 70%);
  color: var(--gold);
  content: "◆";
}

.dashboard-kpi:nth-child(3)::before { color: var(--blue); content: "▲"; }
.dashboard-kpi:nth-child(4)::before { color: #b66fcb; content: "▣"; }
.dashboard-kpi:nth-child(5)::before { color: #77c8a0; content: "▯"; }
.dashboard-kpi:nth-child(6)::before { color: var(--red); content: "!"; }
.dashboard-kpi strong { color: #ffc65c; }
.dashboard-kpi .label { min-height: 34px; color: #c9b896; }
.dashboard-kpi small { color: #8f836d; }

.dashboard-section-title {
  padding: 9px 12px;
  border-left: 3px solid #b77727;
  background: linear-gradient(90deg, rgba(122,71,24,.22), transparent 65%);
}

.dashboard-financial { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dashboard-financial-card { min-height: 126px; border-radius: 4px; }
.dashboard-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard-grid { grid-template-columns: minmax(260px,.85fr) minmax(420px,1.15fr); gap: 12px; }
.dashboard-panel { border-radius: 4px; }
.dashboard-ranking-row, .dashboard-alert, .dashboard-action, .dashboard-routine { border-radius: 3px; background: rgba(255,255,255,.018); }
.dashboard-action { border-color: #533719; }
.dashboard-action:hover { border-color: #b77727; background: rgba(183,119,39,.1); }

/* KDS */
#kdsPage .operation-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#kdsPage > .panel { padding: 18px; }

.kds-toolbar { align-items: center; margin: 14px 0 10px; }
.kds-filter-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.kds-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid #4d351b;
  border-radius: 4px;
  background: #0b0b0a;
}

.kds-filter-tabs button {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #c2ad84;
  cursor: pointer;
}

.kds-filter-tabs button:hover { color: #ffd171; }
.kds-filter-tabs button.active { border-color: #9d6726; background: #2b1b0d; color: #ffd171; }
.kds-filter-tabs button:disabled { color: #6f6658; cursor: not-allowed; }

.kds-board {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  align-items: start;
  gap: 10px;
  margin-top: 12px;
}

.kds-column {
  min-width: 0;
  border: 1px solid #4f3519;
  border-radius: 4px;
  background: rgba(7,7,6,.72);
}

.kds-column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 8px 10px;
  border-bottom: 1px solid #5d3b18;
  color: #e5b85e;
  font: 600 13px var(--font-title);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.kds-column-heading span {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(213,151,54,.1);
  color: #e9b95a;
  font-family: var(--font-ui);
}

.kds-column-list { display: grid; gap: 8px; padding: 8px; }
.kds-column-empty { margin: 0; padding: 22px 10px; color: #807665; text-align: center; }

.kds-ticket {
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.02), transparent 38%),
    linear-gradient(180deg, #17140f, #0d0d0b);
  box-shadow: 0 8px 20px rgba(0,0,0,.3);
}

.kds-ticket.status-in_progress { border-color: #9a641f; }
.kds-ticket.status-ready { border-color: #537b34; }
.kds-ticket.status-cancelled { border-color: #7a302a; }
.kds-ticket h3 { color: #efba57; font-size: 19px; }
.kds-ticket p { margin: 9px 0; color: #b8a98d; font-size: 13px; }
.kds-ticket-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 10px 0; }
.kds-ticket-meta span { color: #9e9077; font-size: 12px; }
.kds-ticket-items { gap: 5px; }

.kds-ticket-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-radius: 3px;
  background: #0a0a09;
}

.kds-item-check {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.kds-item-copy b, .kds-item-copy small { display: block; }
.kds-item-copy small { margin-top: 3px; color: #a68e72; }
.kds-item-contract-note { padding: 9px; border-left: 2px solid #74489a; background: rgba(123,67,168,.08); color: #bda6c9; font-size: 11px; }
.kds-ticket-actions { margin-top: 10px; }

.admin-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
  padding: 13px 4px 0;
  border-top: 1px solid rgba(116,76,32,.35);
  color: #756b5b;
  font-size: 11px;
}

.mobile-bottom-nav { display: none; }

@media (min-width: 1550px) {
  .main { padding-inline: 30px; }
  .topbar { margin-inline: -30px; padding-inline: 30px; }
  .kds-board { grid-template-columns: repeat(4, minmax(250px, 1fr)); }
}

@media (max-width: 1250px) {
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .operation-watch { display: none; }
  .admin-search { width: min(280px, 25vw); }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .app { grid-template-columns: 210px minmax(0,1fr); }
  .sidebar .brand { min-height: 128px; }
  .sidebar-logo { width: 116px !important; }
  .sidebar .nav, .sidebar summary { font-size: 13px !important; text-align: left; }
  .sidebar nav > details > summary { justify-content: flex-start; }
  .sidebar nav > details > summary::before { font-size: 1.15rem; }
  .sidebar nav > details .nav.sub { padding-inline: 12px 8px; padding-left: 30px; text-align: left; }
  .sidebar nav > details .nav.sub::before { display: block; left: 16px; }
  .topbar-tools { flex-wrap: wrap; }
  .notification-button { display: none; }
  .userbox { min-width: 130px; }
  .dashboard-products-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .kds-board { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
}

@media (max-width: 900px) and (min-width: 761px) {
  .app { grid-template-columns: 180px minmax(0, 1fr); }
  .sidebar-logo { width: 98px !important; }
  .sidebar .brand { min-height: 112px; }
  .topbar { min-height: 78px; }
  .topbar-heading { min-width: 138px; }
  .topbar h1 { font-size: 27px; }
  .topbar-tools { flex-wrap: nowrap; }
  .admin-search { width: 180px; }
  .userbox { min-width: auto; padding: 3px; border: 0; background: none; }
  .userbox-copy { display: none; }
}

@media (max-width: 760px) {
  .app { display: block; }
  .main { padding: 0 12px calc(92px + env(safe-area-inset-bottom)); }
  .topbar {
    position: sticky;
    min-height: 72px;
    margin: 0 -12px 14px;
    padding: 10px 12px;
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }
  .topbar-heading { min-width: 0; flex: 1; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { overflow: hidden; font-size: 24px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-tools { flex: 0 1 auto; gap: 6px; }
  .admin-search, .operation-watch, .notification-button, .userbox-copy { display: none; }
  .userbox { min-width: auto; padding: 3px; border: 0; background: none; }
  .profile-sigil { width: 38px; height: 38px; flex-basis: 38px; }
  .mobile-menu-button, .mobile-menu-toggle { border-color: #69461f !important; border-radius: 4px !important; background: #14110d !important; color: #e5ad4d !important; }
  .sidebar { background: linear-gradient(180deg, #17120c, #090908) !important; border-right-color: #8c5a23 !important; }
  .sidebar .brand { min-height: 78px; border-bottom: 0; }
  .mobile-brand-copy strong { color: #f0c66d; font-family: var(--font-title); }
  .mobile-brand-copy span { color: #9d7a45; }
  .mobile-brand-sigil { border-color: #aa6e27; }
  .dashboard-statusbar { padding: 14px; }
  .dashboard-statusbar h2 { font-size: 20px; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .dashboard-kpi { min-height: 130px; padding: 12px 8px; }
  .dashboard-kpi::before { width: 32px; height: 32px; margin-bottom: 7px; }
  .dashboard-kpi .label { min-height: 30px; font-size: 12px; }
  .dashboard-kpi strong { font-size: 1.55rem; }
  .dashboard-kpi small { margin-top: 6px; font-size: 10px; }
  .dashboard-financial { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .dashboard-financial-card { min-height: 116px; padding: 12px; }
  .dashboard-products-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-panel { padding: 14px; }
  .dashboard-quick-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-routines { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #kdsPage .operation-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  #kdsPage .operation-metrics article { padding: 11px 8px; }
  #kdsPage .operation-metrics strong { font-size: 22px; }
  #kdsPage > .panel { padding: 12px; }
  .kds-filter-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); width: 100%; }
  .kds-filter-tabs button { padding: 6px 3px; font-size: 11px; }
  .kds-board { grid-template-columns: 1fr; }
  .panel-head { gap: 10px; }
  .admin-footer { flex-direction: column; margin-bottom: 4px; }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid #7e501e;
    background: rgba(10, 9, 7, .97);
    box-shadow: 0 -8px 28px rgba(0,0,0,.45);
    backdrop-filter: blur(12px);
  }
  .mobile-bottom-nav button {
    display: grid;
    gap: 2px;
    min-width: 0;
    min-height: 56px;
    place-items: center;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #94856c;
    font-size: 10px;
  }
  .mobile-bottom-nav button span { color: #b2792d; font-size: 18px; }
  .mobile-bottom-nav button.active { background: rgba(151,91,24,.14); color: #ffd071; }
  .mobile-bottom-nav button.active span { color: #ffbd49; }
}

@media (max-width: 380px) {
  .main { padding-inline: 9px; }
  .topbar { margin-inline: -9px; }
  .dashboard-kpi { min-height: 124px; }
  .dashboard-financial { grid-template-columns: 1fr; }
  .dashboard-routines { grid-template-columns: 1fr; }
  .kds-filter-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Refinamento de fidelidade à referência oficial */
* {
  scrollbar-width: thin;
  scrollbar-color: #35263b #0b0a09;
}

*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: #0b0a09; }
*::-webkit-scrollbar-thumb {
  border: 1px solid #201925;
  border-radius: 999px;
  background: #35263b;
}
*::-webkit-scrollbar-thumb:hover { background: #493152; }

.sidebar {
  background:
    radial-gradient(circle at 50% 9%, rgba(224,150,51,.1), transparent 22%),
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 13%, transparent 86%, rgba(0,0,0,.55)),
    repeating-linear-gradient(2deg, rgba(128,74,23,.055) 0 1px, transparent 1px 19px),
    repeating-linear-gradient(91deg, rgba(0,0,0,.1) 0 2px, transparent 2px 44px),
    linear-gradient(180deg, #21170d, #100d09 42%, #080807 82%, #151008);
}

.sidebar .brand {
  min-height: 140px;
  background: radial-gradient(ellipse at center, rgba(151,84,21,.11), transparent 68%);
}

.sidebar-logo { width: 128px !important; max-height: 132px; }

.sidebar .nav.active::after {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(242,175,66,.18);
  border-radius: 2px;
  content: "";
  pointer-events: none;
}

.topbar {
  background:
    radial-gradient(circle at 72% 0, rgba(197,116,30,.08), transparent 28%),
    repeating-linear-gradient(1deg, rgba(145,80,23,.035) 0 1px, transparent 1px 17px),
    linear-gradient(180deg, rgba(27,20,12,.98), rgba(10,10,9,.96));
  box-shadow: 0 10px 28px rgba(0,0,0,.34), inset 0 -1px rgba(225,157,55,.1);
}

.topbar::after {
  position: absolute;
  right: 22px;
  bottom: -2px;
  left: 22px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #82521e 22%, #c88b34 50%, #82521e 78%, transparent);
  content: "";
  opacity: .7;
  pointer-events: none;
}

.main > .page.active {
  position: relative;
  isolation: isolate;
}

.main > .page.active::before {
  position: absolute;
  inset: -12px;
  z-index: -1;
  border: 1px solid rgba(92,58,24,.16);
  background:
    radial-gradient(circle at 50% 0, rgba(166,91,23,.035), transparent 32%),
    linear-gradient(180deg, rgba(24,19,12,.16), transparent 130px);
  content: "";
  pointer-events: none;
}

.panel,
.dashboard-panel,
.dashboard-kpi,
.dashboard-financial-card,
.metrics article,
.production-summary article,
.tablet-admin-summary article {
  border-color: #68451f;
  background:
    radial-gradient(circle at 20% 0, rgba(208,133,36,.055), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.025), transparent 32%),
    repeating-linear-gradient(1deg, rgba(126,73,25,.025) 0 1px, transparent 1px 15px),
    linear-gradient(180deg, #1a1711, #0e0e0c);
  box-shadow:
    0 14px 34px rgba(0,0,0,.38),
    inset 0 0 0 1px #080807,
    inset 0 0 20px rgba(187,105,26,.025);
}

.panel::after,
.dashboard-panel::after,
.dashboard-kpi::after,
.dashboard-financial-card::after,
.metrics article::after,
.production-summary article::after,
.tablet-admin-summary article::after {
  position: absolute;
  inset: -1px;
  width: auto;
  height: auto;
  border-radius: inherit;
  background:
    linear-gradient(135deg, #d49332 0 2px, #3a2815 2px 5px, transparent 5px) left top / 18px 18px no-repeat,
    linear-gradient(225deg, #d49332 0 2px, #3a2815 2px 5px, transparent 5px) right top / 18px 18px no-repeat,
    linear-gradient(45deg, #d49332 0 2px, #3a2815 2px 5px, transparent 5px) left bottom / 18px 18px no-repeat,
    linear-gradient(315deg, #d49332 0 2px, #3a2815 2px 5px, transparent 5px) right bottom / 18px 18px no-repeat;
  content: "";
  opacity: .75;
  pointer-events: none;
}

.panel-head,
.dashboard-panel-header {
  position: relative;
  margin: -9px -9px 14px;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(151,95,31,.42);
  background:
    repeating-linear-gradient(0deg, rgba(144,78,21,.045) 0 1px, transparent 1px 11px),
    linear-gradient(90deg, rgba(95,54,20,.34), rgba(27,20,13,.15) 65%, transparent);
}

.dashboard-section-title {
  min-height: 54px;
  align-items: center;
  border: 1px solid #65431f;
  border-left: 4px solid #c0832d;
  background:
    linear-gradient(90deg, rgba(111,61,19,.44), rgba(34,25,15,.34) 60%, transparent),
    repeating-linear-gradient(1deg, rgba(143,80,24,.045) 0 1px, transparent 1px 13px);
  box-shadow: inset 0 0 0 1px #0c0b09, 0 8px 20px rgba(0,0,0,.2);
}

.dashboard-statusbar {
  border-width: 2px;
  box-shadow:
    0 14px 32px rgba(0,0,0,.34),
    inset 0 0 0 1px #181009,
    inset 0 0 38px rgba(208,127,31,.055);
}

.dashboard-kpi {
  min-height: 132px;
  padding: 13px 11px 12px;
}

.dashboard-kpi::before {
  width: 42px;
  height: 42px;
  margin-bottom: 7px;
  border-width: 2px;
  box-shadow: inset 0 0 12px rgba(223,150,46,.12), 0 0 16px rgba(199,116,29,.08);
  font-size: 18px;
}

.dashboard-kpi:nth-child(1) { border-top-color: #b57c2f; }
.dashboard-kpi:nth-child(2) { border-top-color: #c39a39; }
.dashboard-kpi:nth-child(3) { border-top-color: #687eb2; }
.dashboard-kpi:nth-child(4) { border-top-color: #87549a; }
.dashboard-kpi:nth-child(5) { border-top-color: #4f8d70; }
.dashboard-kpi:nth-child(6) { border-top-color: #98443c; }

.dashboard-kpi .label {
  min-height: auto;
  color: #d4c3a1;
  font-weight: 600;
  line-height: 1.25;
}

.dashboard-kpi strong {
  margin-top: 6px;
  color: #ffc75e;
  font: 700 2rem/1 var(--font-title);
  text-shadow: 0 0 16px rgba(223,147,42,.13);
}

.dashboard-kpi small { margin-top: 6px; line-height: 1.3; }

.dashboard-financial-card {
  min-height: 116px;
  padding: 14px;
}

.dashboard-financial-card .label { color: #d2c09e; font-weight: 600; }
.dashboard-financial-card strong { margin-top: 8px; }

.dashboard-ranking-row {
  border-color: rgba(128,82,35,.48);
  background: linear-gradient(90deg, rgba(116,66,24,.12), rgba(255,255,255,.012));
}

.dashboard-ranking-position {
  border: 1px solid #785023;
  background: radial-gradient(circle, #36220f, #15110b 70%);
  font-family: var(--font-title);
}

.dashboard-alert {
  border-color: rgba(126,79,31,.5);
  background: linear-gradient(90deg, rgba(92,52,20,.16), rgba(255,255,255,.012));
}

.dashboard-alert.critical { border-color: rgba(173,62,50,.62); }

.dashboard-action {
  position: relative;
  min-height: 66px;
  padding-left: 16px;
  background: linear-gradient(135deg, rgba(119,68,22,.16), rgba(255,255,255,.012));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}

.dashboard-action::after {
  position: absolute;
  top: 8px;
  right: 9px;
  color: #765225;
  content: "✦";
  font-size: 10px;
}

.dashboard-routine {
  border-color: rgba(125,79,31,.52);
  background: linear-gradient(180deg, rgba(106,60,21,.14), rgba(255,255,255,.01));
}

.admin-footer {
  min-height: 42px;
  padding: 12px 14px;
  border: 1px solid rgba(102,66,29,.42);
  background:
    repeating-linear-gradient(0deg, rgba(130,72,23,.03) 0 1px, transparent 1px 12px),
    linear-gradient(90deg, rgba(53,34,17,.44), rgba(12,11,9,.3));
  color: #918168;
}

.kds-column {
  border-color: #67441f;
  box-shadow: 0 12px 28px rgba(0,0,0,.34), inset 0 0 0 1px #090807;
}

.kds-column-heading {
  background:
    repeating-linear-gradient(0deg, rgba(138,76,22,.04) 0 1px, transparent 1px 10px),
    linear-gradient(90deg, #28190c, #11100c);
}

.kds-ticket {
  border-color: #745022;
  box-shadow: 0 8px 20px rgba(0,0,0,.36), inset 0 0 0 1px #080807;
}

.kds-ticket.is-late,
.kds-column.status-late { border-color: #9a3d31; }
.kds-column.status-late .kds-column-heading { color: #ef7868; }
.kds-ticket.is-late .kds-ticket-head h3 { color: #ef7868; }

@media (max-width: 760px) {
  .main { padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important; }
  .topbar { min-height: 62px; padding-block: 7px; }
  .topbar h1 { font-size: 21px; }
  .profile-sigil { width: 34px; height: 34px; flex-basis: 34px; }
  .mobile-menu-button, .mobile-menu-toggle { width: 40px !important; height: 40px !important; min-height: 40px !important; }
  .dashboard-operational { gap: 9px; }
  .dashboard-statusbar { min-height: auto; padding: 11px; gap: 9px; }
  .dashboard-statusbar h2 { font-size: 18px; }
  .dashboard-statusbar p { margin: 4px 0; font-size: 12px; }
  .dashboard-refresh { min-height: 37px; }
  .dashboard-kpis { gap: 6px; }
  .dashboard-kpi { min-height: 112px; padding: 9px 6px; }
  .dashboard-kpi::before { width: 29px; height: 29px; margin-bottom: 4px; border-width: 1px; font-size: 13px; }
  .dashboard-kpi .label { min-height: 29px; font-size: 11px; line-height: 1.2; }
  .dashboard-kpi strong { margin-top: 3px; font-size: 1.4rem; }
  .dashboard-kpi small { margin-top: 4px; font-size: 9px; line-height: 1.22; overflow-wrap: anywhere; }
  .dashboard-section-title { min-height: 46px; padding: 7px 9px; }
  .dashboard-section-title h2 { font-size: 18px; }
  .dashboard-section-title p { font-size: 11px; }
  .dashboard-financial { gap: 6px; }
  .dashboard-financial,
  .dashboard-routines { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dashboard-financial-card { min-height: 98px; padding: 10px; }
  .dashboard-financial-card .label { font-size: 11px; }
  .dashboard-financial-card strong { margin-top: 5px; font-size: 1.25rem; }
  .dashboard-financial-card small { margin-top: 5px; font-size: 9px; line-height: 1.2; }
  .dashboard-panel { padding: 11px; }
  .dashboard-panel-header { margin: -5px -5px 9px; padding: 8px; }
  .dashboard-action { min-height: 58px; padding: 9px; }
  .dashboard-action b { font-size: 12px; }
  .dashboard-action span { margin-top: 3px; font-size: 10px; }
  .dashboard-routine { padding: 10px; }
  .dashboard-routine span { font-size: 11px; }
  .dashboard-routine strong { font-size: 1.3rem; }
  .admin-footer { margin-bottom: 8px; padding: 9px; font-size: 10px; }
  .mobile-bottom-nav { min-height: 68px; }
  .mobile-bottom-nav button { min-height: 53px; }
  #kdsPage .operation-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  #kdsPage .operation-metrics article { min-height: 76px; padding: 9px 6px; }
  #kdsPage .operation-metrics span { font-size: 10px; line-height: 1.15; }
  #kdsPage .operation-metrics strong { margin-top: 5px; font-size: 20px; }
  .kds-filter-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .kds-ticket { padding: 12px; }
  .kds-ticket-meta { margin: 7px 0; }
  .kds-ticket-items { margin: 9px 0; }
}
