/* ═══════════════════════════════════════════
   Mesaup — CSS partilhado de todas as páginas
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root,
html[data-theme="dark"] {
  --dark:       #06090f;
  --dark2:      #0d1117;
  --dark3:      #111827;
  --dark4:      #1a2233;
  --sidebar-w:  260px;
  --card:       rgba(255,255,255,.04);
  --card-hover: rgba(255,255,255,.07);
  --border:     rgba(255,255,255,.07);
  --topbar-bg:  rgba(13,17,23,.88);
  --overlay-bg: rgba(0,0,0,.55);
  --shadow:     rgba(0,0,0,.45);
  --item-foot-bg: rgba(0,0,0,.12);
  --text:       #e2e8f0;
  --muted:      #64748b;
  --muted2:     #94a3b8;
  --white:      #ffffff;
  color-scheme: dark;
}

html[data-theme="light"] {
  --dark:       #e8edf4;
  --dark2:      #ffffff;
  --dark3:      #f1f5f9;
  --dark4:      #e2e8f0;
  --card:       rgba(15,23,42,.045);
  --card-hover: rgba(15,23,42,.08);
  --border:     rgba(15,23,42,.11);
  --topbar-bg:  rgba(255,255,255,.92);
  --overlay-bg: rgba(15,23,42,.35);
  --shadow:     rgba(15,23,42,.12);
  --item-foot-bg: rgba(15,23,42,.05);
  --text:       #1e293b;
  --muted:      #64748b;
  --muted2:     #475569;
  --white:      #0f172a;
  color-scheme: light;
}

:root {
  --orange:     #f97316;
  --orange-dim: rgba(249,115,22,.12);
  --amber:      #fbbf24;
  --amber-dim:  rgba(251,191,36,.12);
  --green:      #22c55e;
  --green-dim:  rgba(34,197,94,.12);
  --blue:       #3b82f6;
  --blue-dim:   rgba(59,130,246,.12);
  --purple:     #a855f7;
  --purple-dim: rgba(168,85,247,.12);
  --red:        #ef4444;
  --red-dim:    rgba(239,68,68,.12);
  --pink:       #ec4899;
  --pink-dim:   rgba(236,72,153,.12);
  --radius:     14px;
  --radius-sm:  10px;
  --radius-xs:  7px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.5;
  transition: background-color .25s ease, color .2s ease;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,.25); border-radius: 99px; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15,23,42,.18); }
::selection { background: var(--orange); color: #fff; }

/* ── SIDEBAR ─────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--dark2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex; align-items: center; gap: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 1.3rem; font-weight: 800;
  color: var(--white); text-decoration: none;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.logo-text span { color: var(--orange); }

.sidebar-section-label {
  padding: 18px 20px 6px;
  font-size: .67rem; font-weight: 700;
  letter-spacing: .09em; color: var(--muted);
  text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 14px; margin: 2px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted2); font-size: .855rem; font-weight: 500;
  cursor: pointer; transition: all .18s;
  text-decoration: none; position: relative;
}
.nav-item:hover { background: var(--card-hover); color: var(--white); }
.nav-item.active { background: var(--orange-dim); color: var(--orange); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 55%;
  background: var(--orange); border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; padding: 2px 7px;
  border-radius: 99px; font-size: .67rem; font-weight: 700;
}
.badge-orange { background: var(--orange-dim); color: var(--orange); }
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.coming-pill {
  margin-left: auto; padding: 2px 7px; border-radius: 99px;
  font-size: .64rem; font-weight: 600;
  background: var(--purple-dim); color: var(--purple); white-space: nowrap;
}

.sidebar-footer {
  margin-top: auto; border-top: 1px solid var(--border);
  padding: 14px; flex-shrink: 0;
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.user-name { font-size: .8rem; font-weight: 700; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.user-role { font-size: .7rem; color: var(--muted2); }
.logout-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted2); cursor: pointer; font-size: .72rem; font-weight: 700;
  padding: 6px 10px; border-radius: 8px; flex-shrink: 0;
  transition: color .2s, border-color .2s, background .2s; font-family: inherit;
}
.logout-btn .logout-ico { font-size: .95rem; line-height: 1; }
.logout-btn .logout-txt { line-height: 1; }
.logout-btn:hover { color: var(--orange); border-color: rgba(249,115,22,.35); background: var(--orange-dim); }

/* ── MAIN ────────────────────────────────── */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── TOPBAR ──────────────────────────────── */
.topbar {
  background: var(--topbar-bg); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 62px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-family: 'Sora', sans-serif; font-size: .95rem; font-weight: 700; color: var(--white); }
.topbar-sub   { font-size: .75rem; color: var(--muted2); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 99px; padding: 7px 14px; transition: border-color .2s;
}
.topbar-search:focus-within { border-color: var(--orange); }
.topbar-search input { background: none; border: none; outline: none; color: var(--text); font-size: .82rem; width: 180px; font-family: inherit; }
.topbar-search input::placeholder { color: var(--muted); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .9rem; transition: all .18s; position: relative;
}
.icon-btn:hover { border-color: var(--orange); background: var(--orange-dim); }
.notif-dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; background: var(--orange); border-radius: 50%; border: 1.5px solid var(--dark2); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--green-dim); border: 1px solid rgba(34,197,94,.2); color: var(--green); font-size: .73rem; font-weight: 600; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 2s infinite; }
@keyframes blink { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(1.35)} }

/* ── CONTENT ─────────────────────────────── */
.content { padding: 26px 28px; flex: 1; }

/* ── PAGE HEADER ─────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 14px; }
.page-header h1 { font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--white); }
.page-header p  { font-size: .845rem; color: var(--muted2); margin-top: 3px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── BUTTONS ─────────────────────────────── */
.btn {
  padding: 9px 18px; border-radius: 99px;
  font-size: .82rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .2s; border: none; font-family: inherit;
  white-space: nowrap; line-height: 1;
}
.btn-sm   { padding: 6px 13px; font-size: .775rem; border-radius: 8px; }
.btn-xs   { padding: 4px 10px; font-size: .72rem;  border-radius: 6px; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; justify-content: center; flex-shrink: 0; }
.btn-primary { background: linear-gradient(135deg, var(--orange), #ea580c); color: #fff; box-shadow: 0 4px 16px rgba(249,115,22,.3); }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(249,115,22,.45); transform: translateY(-1px); }
.btn-outline { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }
.btn-danger  { background: var(--red-dim);   border: 1px solid rgba(239,68,68,.2);  color: var(--red); }
.btn-danger:hover  { background: rgba(239,68,68,.22); }
.btn-success { background: var(--green-dim); border: 1px solid rgba(34,197,94,.2);  color: var(--green); }
.btn-success:hover { background: rgba(34,197,94,.22); }
.btn-blue    { background: var(--blue-dim);  border: 1px solid rgba(59,130,246,.2); color: var(--blue); }
.btn-blue:hover    { background: rgba(59,130,246,.22); }
.btn-purple  { background: var(--purple-dim);border: 1px solid rgba(168,85,247,.2); color: var(--purple); }

/* ── PANELS ──────────────────────────────── */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { padding: 16px 18px 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-title  { font-family: 'Sora', sans-serif; font-size: .9rem; font-weight: 700; color: var(--white); display: flex; align-items: center; gap: 7px; }
.panel-action { font-size: .74rem; color: var(--orange); text-decoration: none; font-weight: 600; }
.panel-action:hover { text-decoration: underline; }
.panel-body   { padding: 18px; }
.panel-body-flush { padding: 0; }

/* ── GRID LAYOUTS ────────────────────────── */
.g2   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.g3   { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 18px; }
.g4   { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 18px; }
.g31  { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.g13  { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; margin-bottom: 18px; }
.gfull { margin-bottom: 18px; }

/* ── METRICS ─────────────────────────────── */
.metric-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all .22s; position: relative; overflow: hidden; }
.metric-card::after { content:''; position:absolute; top:0; left:0; right:0; height:2px; opacity:0; transition:opacity .22s; }
.metric-card.mc-orange::after { background: linear-gradient(90deg,var(--orange),var(--amber)); }
.metric-card.mc-green::after  { background: linear-gradient(90deg,var(--green),#4ade80); }
.metric-card.mc-blue::after   { background: linear-gradient(90deg,var(--blue),#60a5fa); }
.metric-card.mc-purple::after { background: linear-gradient(90deg,var(--purple),#c084fc); }
.metric-card.mc-red::after    { background: linear-gradient(90deg,var(--red),#f87171); }
.metric-card.mc-amber::after  { background: linear-gradient(90deg,var(--amber),#fde68a); }
.metric-card:hover { background: var(--card-hover); transform: translateY(-2px); }
.metric-card:hover::after { opacity: 1; }
.metric-top   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.metric-icon  { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.metric-change { display: flex; align-items: center; gap: 3px; font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.change-up    { background: var(--green-dim); color: var(--green); }
.change-down  { background: var(--red-dim);   color: var(--red); }
.metric-value { font-family: 'Sora', sans-serif; font-size: 1.65rem; font-weight: 800; color: var(--white); line-height: 1; margin-bottom: 3px; }
.metric-label { font-size: .77rem; color: var(--muted2); }
.metric-sub   { font-size: .7rem; color: var(--muted); margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--border); }

/* ── DATA TABLE ──────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 9px 14px; text-align: left; font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 14px; font-size: .815rem; color: var(--text); border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--card-hover); cursor: pointer; }
.t-avatar { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: #fff; margin-right: 8px; flex-shrink: 0; vertical-align: middle; }
.t-avatar-round { border-radius: 50%; }

/* ── STATUS PILLS ────────────────────────── */
.sp { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .68rem; font-weight: 600; white-space: nowrap; }
.sp-green  { background: var(--green-dim);  color: var(--green); }
.sp-orange { background: var(--orange-dim); color: var(--orange); }
.sp-blue   { background: var(--blue-dim);   color: var(--blue); }
.sp-red    { background: var(--red-dim);    color: var(--red); }
.sp-purple { background: var(--purple-dim); color: var(--purple); }
.sp-amber  { background: var(--amber-dim);  color: var(--amber); }
.sp-muted  { background: rgba(100,116,139,.15); color: var(--muted2); }

/* ── STARS ───────────────────────────────── */
.stars    { color: var(--amber); letter-spacing: 1px; font-size: .9rem; }
.stars-sm { font-size: .75rem; letter-spacing: .5px; }
.stars-lg { font-size: 1.3rem; }

/* ── FORM ELEMENTS ───────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: 6px; }
.form-label   { font-size: .8rem; font-weight: 600; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 13px;
  background: var(--dark3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--white);
  font: inherit; font-size: .875rem; transition: border-color .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted); }
.form-select option { background: var(--dark3); }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-hint  { font-size: .72rem; color: var(--muted); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .83rem; color: var(--text); }
.form-check input { accent-color: var(--orange); }

/* ── SEARCH / FILTER ─────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap .si { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.search-input { width: 100%; padding: 9px 13px 9px 34px; background: var(--card); border: 1px solid var(--border); border-radius: 99px; color: var(--text); font: inherit; font-size: .835rem; transition: border-color .2s; }
.search-input:focus { outline: none; border-color: var(--orange); }
.search-input::placeholder { color: var(--muted); }
.filter-chip { padding: 6px 14px; border-radius: 99px; font-size: .775rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--muted2); transition: all .18s; white-space: nowrap; }
.filter-chip:hover { border-color: var(--orange); background: var(--orange-dim); color: var(--orange); }
.filter-chip.active { border-color: var(--orange); background: var(--orange-dim); color: var(--orange); }

/* ── MODAL ───────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay-bg); backdrop-filter: blur(4px); z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--dark2); border: 1px solid var(--border); border-radius: 18px; width: 100%; max-width: 520px; box-shadow: 0 24px 80px var(--shadow); max-height: min(90vh, calc(100dvh - 40px)); display: flex; flex-direction: column; overflow: hidden; }
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 380px; }
.modal-header { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-title  { font-family: 'Sora', sans-serif; font-size: 1rem; font-weight: 800; color: var(--white); }
.modal-close  { background: none; border: none; color: var(--muted2); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color .2s; }
.modal-close:hover { color: var(--white); }
.modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.modal-body   { padding: 20px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-height: 0; }
.modal-footer { padding: 14px 22px 18px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; background: var(--dark2); position: relative; z-index: 2; }

/* ── DEMO BANNER ─────────────────────────── */
.demo-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--radius-sm); background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.2); color: var(--amber); font-size: .8rem; margin-bottom: 18px; }

/* Modo demonstração: formulários só leitura (alterações não vão para a BD) */
html.mesaup-demo-mode form[method="post"] button[type="submit"]:not(.nav-auth-submit):not(.btn-nav-logout):not(.mesaup-logout-btn):not(.topbar-logout-btn),
html.mesaup-demo-mode form[method="post"] input[type="submit"] {
  opacity: 0.45;
  cursor: not-allowed;
}
html.mesaup-demo-mode .mesaup-logout-btn,
html.mesaup-demo-mode .topbar-logout-btn {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
}
html.mesaup-demo-mode .btn-danger,
html.mesaup-demo-mode .btn-primary[onclick*="Modal"],
html.mesaup-demo-mode [data-demo-hide] {
  pointer-events: none;
  opacity: 0.45;
}

/* ── ALERT ───────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .82rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.alert-success { background: var(--green-dim);  border: 1px solid rgba(34,197,94,.2);   color: var(--green); }
.alert-error   { background: var(--red-dim);    border: 1px solid rgba(239,68,68,.2);   color: var(--red); }
.alert-info    { background: var(--blue-dim);   border: 1px solid rgba(59,130,246,.2);  color: var(--blue); }
.alert-warn    { background: var(--amber-dim);  border: 1px solid rgba(251,191,36,.2);  color: var(--amber); }

/* ── EMPTY STATE ─────────────────────────── */
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .ei { font-size: 3rem; margin-bottom: 14px; }
.empty-state h3  { font-family: 'Sora', sans-serif; font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 8px; }
.empty-state p   { font-size: .85rem; color: var(--muted2); max-width: 300px; margin: 0 auto 20px; line-height: 1.6; }

/* ── TOGGLE SWITCH ───────────────────────── */
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle-track { width: 38px; height: 22px; border-radius: 99px; background: rgba(255,255,255,.1); position: relative; transition: background .2s; flex-shrink: 0; }
.toggle input:checked ~ .toggle-track { background: var(--green); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.toggle input:checked ~ .toggle-track .toggle-thumb { left: 19px; }
.toggle-label { font-size: .82rem; color: var(--text); }

/* ── PROGRESS BAR ────────────────────────── */
.progress-wrap { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--amber)); transition: width .5s ease; }
.progress-bar.green  { background: linear-gradient(90deg, var(--green), #4ade80); }
.progress-bar.blue   { background: linear-gradient(90deg, var(--blue),  #60a5fa); }
.progress-bar.purple { background: linear-gradient(90deg, var(--purple),#c084fc); }

/* ── KANBAN ──────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kanban-hdr { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.kanban-hdr-title { font-family: 'Sora', sans-serif; font-size: .82rem; font-weight: 700; color: var(--white); display: flex; align-items: center; gap: 7px; }
.kanban-count { padding: 2px 8px; border-radius: 99px; font-size: .68rem; font-weight: 700; }
.kanban-body  { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kanban-card  { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; transition: all .18s; cursor: pointer; }
.kanban-card:hover { background: var(--card-hover); border-color: rgba(255,255,255,.12); transform: translateY(-1px); }
.kanban-card-id    { font-size: .68rem; color: var(--muted); margin-bottom: 6px; }
.kanban-card-title { font-size: .835rem; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.kanban-card-sub   { font-size: .75rem; color: var(--muted2); }
.kanban-card-foot  { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.kanban-card-total { font-family: 'Sora', sans-serif; font-size: .875rem; font-weight: 700; color: var(--white); }
.kanban-card-time  { font-size: .68rem; color: var(--muted); }

/* ── FLOOR GRID (MESAS) ──────────────────── */
.floor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 14px; }
.table-tile {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  text-align: center; cursor: pointer;
  transition: all .2s; position: relative; overflow: hidden;
}
.table-tile::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.table-tile.free    { }
.table-tile.free::before  { background: var(--green); }
.table-tile.busy   { background: rgba(249,115,22,.06); border-color: rgba(249,115,22,.25); }
.table-tile.busy::before  { background: var(--orange); }
.table-tile.reserved::before { background: var(--blue); }
.table-tile:hover  { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.table-num  { font-family: 'Sora', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--white); line-height: 1; }
.table-cap  { font-size: .72rem; color: var(--muted2); margin: 4px 0; }
.table-status-dot { width: 8px; height: 8px; border-radius: 50%; margin: 8px auto 0; }
.table-status-dot.free   { background: var(--green); }
.table-status-dot.busy   { background: var(--orange); }
.table-status-dot.reserved { background: var(--blue); }
.table-order-info { font-size: .7rem; color: var(--muted2); margin-top: 6px; }

/* ── ITEM CARD (CARDÁPIO) ────────────────── */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; align-items: stretch; }
.item-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all .2s;
  display: flex; flex-direction: column; height: 100%;
}
.item-card:hover { background: var(--card-hover); border-color: rgba(255,255,255,.12); transform: translateY(-2px); }
.item-img  { width: 100%; height: 120px; flex-shrink: 0; background: var(--dark3); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.item-body {
  padding: 14px 14px 10px; flex: 1 1 auto;
  display: flex; flex-direction: column; min-height: 0;
}
.item-name { font-weight: 700; color: var(--white); font-size: .875rem; line-height: 1.35; }
.item-desc {
  font-size: .75rem; color: var(--muted2); margin-top: 6px; line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  min-height: 2.2em; flex: 1 1 auto;
}
.item-desc:empty { min-height: 2.2em; }
.item-foot {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--item-foot-bg);
}
.item-price {
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem; font-weight: 800; color: var(--orange);
  line-height: 1; white-space: nowrap; letter-spacing: -.02em;
}
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn.topbar-logout-btn {
  width: 36px; height: 36px; padding: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 99px; color: var(--muted2);
  font-size: 1rem; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .18s;
}
.icon-btn.topbar-logout-btn:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,.1); }
.topbar-actions .icon-btn .tb-ico-fallback { font-size: 1rem; line-height: 1; }
.topbar-actions .icon-btn:has(svg) .tb-ico-fallback { display: none; }
.topbar-actions .icon-btn:not(:has(svg)) .tb-ico-lucide { display: none; }
.theme-toggle .theme-ico { position: static; display: inline-flex; font-size: 1rem; line-height: 1; }
.theme-toggle:has(svg) .theme-ico { display: none; }
html[data-theme="dark"] .theme-toggle .theme-ico-light,
html[data-theme="light"] .theme-toggle .theme-ico-dark { display: none; }

/* ── THEME TOGGLE ────────────────────────── */
.theme-toggle {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.theme-toggle .theme-ico {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  transition: transform .25s ease, opacity .2s;
  pointer-events: none;
}
html[data-theme="dark"] .theme-toggle .theme-ico-light { opacity: .45; transform: scale(.85); }
html[data-theme="dark"] .theme-toggle .theme-ico-dark  { opacity: 1; }
html[data-theme="light"] .theme-toggle .theme-ico-dark  { opacity: .45; transform: scale(.85); }
html[data-theme="light"] .theme-toggle .theme-ico-light { opacity: 1; }
html[data-theme="light"] .theme-toggle:hover { background: rgba(251,191,36,.15); border-color: rgba(251,191,36,.35); }

/* ── REVIEW ITEM ─────────────────────────── */
.review-item { padding: 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,.025); border: 1px solid var(--border); transition: border-color .2s; }
.review-item:hover { border-color: rgba(255,255,255,.12); }
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.review-author { display: flex; align-items: center; gap: 10px; }
.r-av   { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.r-name { font-size: .875rem; font-weight: 700; color: var(--white); }
.r-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.r-text { font-size: .82rem; color: var(--muted2); line-height: 1.65; }
.r-reply { margin-top: 12px; padding: 9px 12px; background: var(--orange-dim); border-left: 2px solid var(--orange); border-radius: 0 6px 6px 0; font-size: .78rem; color: var(--muted2); }
.r-reply-form { margin-top: 10px; display: flex; gap: 8px; }
.r-reply-form input { flex: 1; padding: 7px 12px; background: var(--dark3); border: 1px solid var(--border); border-radius: 8px; color: var(--white); font: inherit; font-size: .82rem; }
.r-reply-form input:focus { outline: none; border-color: var(--orange); }

/* ── WAITER CARD ─────────────────────────── */
.waiter-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: all .2s; }
.waiter-card:hover { background: var(--card-hover); border-color: rgba(249,115,22,.2); transform: translateY(-3px); }
.wc-avatar { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; color: #fff; margin: 0 auto 12px; }
.wc-name   { font-family: 'Sora', sans-serif; font-size: .95rem; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.wc-meta   { font-size: .75rem; color: var(--muted2); margin-bottom: 12px; }
.wc-rating { font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--white); }
.wc-stars  { color: var(--amber); font-size: .8rem; margin: 2px 0 8px; }
.wc-stats  { display: flex; justify-content: center; gap: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.wc-stat   { text-align: center; }
.wc-stat-num   { font-family: 'Sora', sans-serif; font-size: .95rem; font-weight: 700; color: var(--white); }
.wc-stat-label { font-size: .68rem; color: var(--muted); }
.wc-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* ── DISTRIBUTOR CARD ────────────────────── */
.dist-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: all .2s; }
.dist-card:hover { background: var(--card-hover); border-color: rgba(249,115,22,.2); transform: translateY(-2px); }
.dist-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dist-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--dark3); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.dist-name { font-weight: 700; font-size: .9rem; color: var(--white); }
.dist-cat  { font-size: .72rem; color: var(--muted2); margin-top: 2px; }
.dist-desc { font-size: .78rem; color: var(--muted2); line-height: 1.55; margin-bottom: 14px; }
.dist-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.dist-promo { font-size: .75rem; font-weight: 600; color: var(--green); }

/* ── LOYALTY ─────────────────────────────── */
.reward-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all .2s; }
.reward-card:hover { background: var(--card-hover); }
.reward-icon { font-size: 2rem; margin-bottom: 10px; }
.reward-name { font-weight: 700; font-size: .9rem; color: var(--white); margin-bottom: 4px; }
.reward-pts  { font-family: 'Sora', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--orange); }
.reward-desc { font-size: .77rem; color: var(--muted2); margin-top: 6px; line-height: 1.5; }

/* ── CHART ───────────────────────────────── */
.chart-legend { display: flex; gap: 14px; margin-bottom: 14px; }
.legend-item  { display: flex; align-items: center; gap: 5px; font-size: .73rem; color: var(--muted2); }
.legend-dot   { width: 8px; height: 8px; border-radius: 2px; }
.bar-chart    { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bar-wrap     { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bar          { width: 100%; border-radius: 5px 5px 0 0; min-height: 3px; transition: height .45s cubic-bezier(.34,1.56,.64,1); cursor: pointer; }
.bar:hover    { filter: brightness(1.2); }
.bar-label    { font-size: .63rem; color: var(--muted); white-space: nowrap; }
.bar-orange   { background: linear-gradient(180deg,var(--orange),rgba(249,115,22,.35)); }
.bar-blue     { background: linear-gradient(180deg,var(--blue),rgba(59,130,246,.3)); }
.bar-green    { background: linear-gradient(180deg,var(--green),rgba(34,197,94,.3)); }

/* ── OVERLAY + MOBILE ────────────────────── */
.overlay { display: none; position: fixed; inset: 0; z-index: 99; background: var(--overlay-bg); backdrop-filter: blur(4px); }
.overlay.show { display: block; }
body.mesaup-sidebar-open { overflow: hidden; }
.menu-toggle {
  display: none; background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  width: 36px; height: 36px; align-items: center; justify-content: center; cursor: pointer;
  font-size: 1.05rem; color: var(--text); flex-shrink: 0; position: relative; z-index: 2;
}
body.mesaup-sidebar-open .topbar { z-index: 106; }
body.mesaup-sidebar-open .menu-toggle { z-index: 3; }
body.mesaup-sidebar-open .sidebar { z-index: 107; }

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 1200px) {
  .g4   { grid-template-columns: repeat(2,1fr); }
  .g31, .g13 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 18px 14px; }
  .topbar {
    padding: 8px 12px; min-height: 56px; height: auto; flex-wrap: nowrap;
    gap: 8px; z-index: 105; align-items: center;
  }
  .topbar > div:first-of-type { flex: 1; min-width: 0; }
  .topbar-title { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-sub { display: none; }
  .topbar-search { display: none; }
  .menu-toggle { display: flex; }
  .topbar-right {
    flex-wrap: nowrap; gap: 6px; margin-left: auto; max-width: 58%; justify-content: flex-end;
  }
  .mesaup-dash-switcher { display: none !important; }
  .live-badge { font-size: .62rem; padding: 4px 8px; white-space: nowrap; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .icon-btn { width: 32px; height: 32px; }
  .mesaup-dash-switcher .dsw-btn { height: 32px; padding: 0 10px; font-size: .67rem; }
  .demo-banner { margin: 0 0 14px; font-size: .75rem; line-height: 1.45; }
  .g2 { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .g3, .g4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .floor-grid { grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); }
}
