:root {
  --accent: #2563eb;
  --bg: #070b14;
  --surface: #0f172a;
  --surface-2: #162033;
  --surface-3: #1e293b;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.32);
  --text: #f8fafc;
  --muted: #94a3b8;
  --pos: #10b981;
  --neg: #ef4444;
  --warn: #f59e0b;
  --info: #38bdf8;
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-md: 0 10px 28px -8px rgba(2, 6, 23, 0.65), 0 2px 8px -2px rgba(2, 6, 23, 0.4);
  --shadow-lg: 0 28px 64px -12px rgba(2, 6, 23, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body.theme-light {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.22);
  --text: #0f172a;
  --muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 26px -6px rgba(15, 23, 42, 0.09), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 26px 56px -12px rgba(15, 23, 42, 0.20);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(ellipse 80% 45% at 50% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%),
    radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.06), transparent 42%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

body.theme-light {
  background:
    radial-gradient(ellipse 85% 42% at 50% -8%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%),
    var(--bg);
}

/* Custom sleek scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.26);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.42); }

/* Utilities */
.hidden { display: none !important; }
.w-full { width: 100%; }
.mt-16 { margin-top: 16px; }
.muted { color: var(--muted); font-size: 0.875rem; }
.positive { color: var(--pos); }
.negative { color: var(--neg); }
.warning { color: var(--warn); }

/* Demo Banner */
.demo-banner {
  background: linear-gradient(95deg, #090e1a 0%, color-mix(in srgb, var(--accent) 68%, #0f172a) 55%, var(--accent) 100%);
  color: #ffffff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.84rem;
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.35);
  position: relative;
  z-index: 40;
}

.demo-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-pill {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.demo-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-hire {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  font-weight: 800;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 0.81rem;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s ease;
}

.btn-hire:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.44);
}

/* App Shell & Sidebar */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 264px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #090e1a));
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 45%, transparent);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 45%, rgba(2, 6, 23, 0.45));
}

.sidebar-brand strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.sidebar-brand small {
  color: var(--muted);
  font-size: 0.74rem;
  display: block;
  margin-top: 2px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
  flex: 1;
}

.nav-btn {
  position: relative;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.nav-btn.active {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  color: var(--text);
  box-shadow: 0 2px 10px -2px color-mix(in srgb, var(--accent) 22%, transparent);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.copyright-tag {
  color: var(--muted);
  font-size: 0.71rem;
  text-align: center;
  line-height: 1.4;
  margin-top: 4px;
}

/* Main Area */
.main-area {
  flex: 1;
  padding: 24px 28px 92px;
  max-width: 1440px;
  width: 100%;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.topbar h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons & Inputs */
button, input, select, textarea {
  font-family: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 75%, #fff);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 92%, #fff), var(--accent));
  color: #ffffff;
  border: 1px solid color-mix(in srgb, var(--accent) 80%, #fff);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.87rem;
  cursor: pointer;
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--accent) 42%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -2px color-mix(in srgb, var(--accent) 52%, transparent);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 15px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.87rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-ghost-sm {
  background: rgba(148, 163, 184, 0.10);
  color: inherit;
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-ghost-sm:hover {
  background: rgba(148, 163, 184, 0.20);
  border-color: var(--border-strong);
}

.btn-link {
  background: none;
  border: none;
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  font-weight: 700;
  cursor: pointer;
  font-size: 0.84rem;
  transition: opacity 0.15s ease;
}

.btn-link:hover {
  opacity: 0.82;
  text-decoration: underline;
}

.btn-wa {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28);
  transition: transform 0.14s ease, filter 0.14s ease;
}

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

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
}

body.theme-light .btn-danger-sm {
  color: #dc2626;
}

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.89rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.input-sm {
  padding: 7px 11px;
  font-size: 0.83rem;
  max-width: 240px;
}

/* Screens */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 45%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 17px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  box-shadow: var(--shadow-md);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: block;
}

.kpi-value {
  font-size: 1.62rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  display: block;
  margin: 6px 0 4px;
}

/* Anti-SaaS Card */
.anti-saas-card {
  background:
    radial-gradient(circle at 95% 20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.anti-saas-card .demo-pill {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
}

.anti-saas-card h3 {
  margin: 9px 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.anti-saas-metrics {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.anti-saas-metrics > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 11px 15px;
  border-radius: 12px;
  min-width: 155px;
  box-shadow: var(--shadow-sm);
}

.anti-saas-metrics span {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.anti-saas-metrics strong {
  font-size: 1.22rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Panels & Layouts */
.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-header h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-header.wrap { flex-wrap: wrap; }

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.simple-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.simple-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--surface-2);
  border-radius: 11px;
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.simple-row:hover {
  border-color: var(--border-strong);
}

.simple-row strong {
  font-size: 0.89rem;
  display: block;
  font-variant-numeric: tabular-nums;
}

.simple-row small {
  color: var(--muted);
  font-size: 0.77rem;
}

/* PDV */
.pdv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  gap: 10px;
  max-height: 365px;
  overflow-y: auto;
  padding-right: 2px;
}

.pdv-tile {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pdv-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pdv-tile small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.pdv-tile strong {
  display: block;
  font-size: 0.86rem;
  margin: 4px 0;
  line-height: 1.3;
}

.pdv-tile span {
  color: var(--pos);
  font-weight: 800;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  max-height: 280px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cart-footer {
  border-top: 1px solid var(--border);
  padding-top: 13px;
  margin-top: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
}

.cart-total-row strong {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--pos);
  font-variant-numeric: tabular-nums;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
}

/* Badges & Filter Pills */
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 34%, transparent);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-open {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.30);
}

.badge-wait {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.30);
}

.badge-prog {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.30);
}

.badge-done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.30);
}

body.theme-light .badge-open { color: #1d4ed8; }
body.theme-light .badge-wait { color: #b45309; }
body.theme-light .badge-prog { color: #7e22ce; }
body.theme-light .badge-done { color: #047857; }

/* Orders & Clients Cards */
.orders-grid, .clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.order-card, .client-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.order-card:hover, .client-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: var(--shadow-md);
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.order-items-box {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 11px;
  border-radius: 9px;
}

.order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Modals & Login */
.login-overlay, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.80);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 900;
}

.login-card, .modal-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.login-card {
  max-width: 400px;
  text-align: center;
}

.login-card form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.brand-badge {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #090e1a));
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--accent) 48%, transparent);
  overflow: hidden;
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-footer {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.74rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-stack label {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.error-msg {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.30);
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.82rem;
}

/* Cases / Modules list */
.case-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  margin-bottom: 8px;
}

.case-item a {
  color: color-mix(in srgb, var(--accent) 82%, var(--text));
  font-weight: 700;
  text-decoration: none;
  font-size: 0.84rem;
}

/* ==========================================================================
   V2 ENTERPRISE COMPONENTS
   ========================================================================== */

/* 1. Welcome Proposal Modal */
#welcome-proposal-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.84);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 950;
}

.welcome-card {
  background:
    radial-gradient(circle at 92% 6%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 52%),
    radial-gradient(circle at 8% 95%, rgba(56, 189, 248, 0.08), transparent 45%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border-strong));
  border-radius: 22px;
  padding: 28px 30px;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: fadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-logo-full {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 18px;
  margin-bottom: 18px;
  box-shadow: 0 12px 28px -8px rgba(2, 6, 23, 0.55);
}

.welcome-logo-full img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.welcome-card h2,
.welcome-card h3 {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 8px;
}

.welcome-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
  list-style: none;
}

.welcome-highlights > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text);
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.welcome-grid > * {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.welcome-grid > *:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  transform: translateY(-1px);
}

.welcome-grid strong {
  font-size: 0.94rem;
  font-weight: 700;
}

.welcome-grid span,
.welcome-grid small {
  font-size: 0.78rem;
  color: var(--muted);
}

/* 2. 7-Day Cashflow Chart */
.chart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-top: 6px;
}

.svg-chart-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.svg-chart-wrap text {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

/* 3. Specialized Vertical Modules */
.vmod-header {
  background:
    radial-gradient(circle at 96% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.vmod-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.vmod-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 5px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.vmod-tabs button,
.vmod-tabs .vmod-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.vmod-tabs button:hover,
.vmod-tabs .vmod-tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.vmod-tabs button.active,
.vmod-tabs .vmod-tab.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 38%, transparent);
}

.vmod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 14px;
}

.box-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.box-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
  box-shadow: var(--shadow-md);
}

/* Mercosul License Plate */
.mercosul-plate {
  display: inline-flex;
  flex-direction: column;
  min-width: 148px;
  max-width: 196px;
  background: #ffffff;
  border: 2px solid #0f172a;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(2, 6, 23, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  flex-shrink: 0;
}

.mercosul-top {
  background: #003399;
  color: #ffffff;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.mercosul-code {
  background: #ffffff;
  color: #000000;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 10px 5px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* Checklist 360 */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 0.84rem;
  font-weight: 600;
}

.check-btn {
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.check-btn.ok {
  background: rgba(16, 185, 129, 0.13);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.check-btn.ok.active,
.check-btn.ok[aria-pressed="true"] {
  background: #10b981;
  color: #052e16;
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.28);
}

.check-btn.warn {
  background: rgba(245, 158, 11, 0.13);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.check-btn.warn.active,
.check-btn.warn[aria-pressed="true"] {
  background: #f59e0b;
  color: #451a03;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.28);
}

.check-btn.crit {
  background: rgba(239, 68, 68, 0.13);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.check-btn.crit.active,
.check-btn.crit[aria-pressed="true"] {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.28);
}

body.theme-light .check-btn.ok { color: #047857; }
body.theme-light .check-btn.warn { color: #b45309; }
body.theme-light .check-btn.crit { color: #dc2626; }
body.theme-light .check-btn.ok.active,
body.theme-light .check-btn.ok[aria-pressed="true"] { color: #ffffff; }
body.theme-light .check-btn.warn.active,
body.theme-light .check-btn.warn[aria-pressed="true"] { color: #ffffff; }

/* Fuel Bar */
.fuel-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.fuel-pills button,
.fuel-pills .pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.fuel-pills button:hover,
.fuel-pills .pill:hover {
  color: var(--text);
  background: var(--surface-3);
}

.fuel-pills button.active,
.fuel-pills .pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 34%, transparent);
}

/* 4. Hotelaria / Hospedagem */
.suites-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.suite-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  border-radius: 15px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.suite-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.suite-free {
  border-color: rgba(16, 185, 129, 0.34);
  border-top-color: #10b981;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), var(--surface) 45%);
}

.suite-busy {
  border-color: rgba(239, 68, 68, 0.36);
  border-top-color: #ef4444;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.09), var(--surface) 45%);
}

.suite-reserved {
  border-color: rgba(245, 158, 11, 0.38);
  border-top-color: #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.09), var(--surface) 45%);
}

.suite-clean {
  border-color: rgba(14, 165, 233, 0.38);
  border-top-color: #0ea5e9;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.09), var(--surface) 45%);
}

.booking-calc-box {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, var(--surface)), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 15px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

/* 5. Clínica / Fitness & Obras / Sob Medida */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}

.slot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 13px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.slot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.imc-gauge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.imc-gauge .imc-track,
.imc-gauge .imc-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 0%, #10b981 35%, #f59e0b 68%, #ef4444 100%);
  overflow: visible;
}

.imc-gauge .imc-marker,
.imc-gauge .imc-pointer {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--text);
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.blueprint-box {
  background-color: #081326;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.11) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid rgba(59, 130, 246, 0.34);
  border-radius: 15px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

body.theme-light .blueprint-box {
  background-color: #eff6ff;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.09) 1px, transparent 1px);
  border-color: rgba(37, 99, 235, 0.28);
}

.blueprint-svg-wrap {
  width: 100%;
  min-height: 190px;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 11px;
  background: rgba(2, 6, 23, 0.44);
  border: 1px dashed rgba(96, 165, 250, 0.36);
  overflow: hidden;
}

body.theme-light .blueprint-svg-wrap {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(37, 99, 235, 0.35);
}

.blueprint-svg-wrap svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Desktop-hidden mobile helpers (keep desktop layout intact) */
.demo-pill-short,
.mobile-menu-btn,
.sidebar-close-btn,
.sidebar-overlay,
.demo-bottom-bar {
  display: none;
}

/* Mobile Tabbar & Toast */
.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 500;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.tab-btn span {
  font-size: 0.67rem;
  font-weight: 600;
  margin-top: 2px;
}

.tab-btn.active {
  color: var(--accent);
}

.toast {
  position: fixed;
  bottom: 76px;
  right: 20px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--border));
  padding: 11px 16px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

.print-only { display: none; }

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-cols { grid-template-columns: 1fr; }
  .welcome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  /* 1. Compact 1-line top demo/trial banner */
  .demo-banner {
    padding: 7px 12px;
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 44px;
    font-size: 0.8rem;
  }
  .demo-banner-info {
    flex-wrap: nowrap;
    min-width: 0;
    flex: 1;
    gap: 8px;
  }
  .demo-banner-logo {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0;
  }
  .demo-banner-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
  }
  .demo-hide-mobile { display: none; }
  .demo-pill { flex-shrink: 0; padding: 3px 8px; font-size: 0.65rem; }
  .demo-pill-full { display: none; }
  .demo-pill-short { display: inline; }
  .demo-banner-actions { display: none; }

  /* 2. Off-canvas Sidebar Drawer & Clean Mobile Header */
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
  }
  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
  }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 690;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 300px);
    height: 100dvh;
    z-index: 700;
    transform: translateX(-105%);
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .sidebar.open {
    transform: translateX(0);
  }
  body.drawer-open {
    overflow: hidden;
  }

  .topbar {
    margin-bottom: 14px;
    padding-bottom: 12px;
    gap: 10px;
  }
  .topbar-left {
    width: 100%;
    min-width: 0;
    gap: 10px !important;
  }
  .topbar-logo {
    display: none !important;
  }
  .topbar-title-wrap {
    min-width: 0;
    flex: 1;
  }
  .topbar h2 {
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar #screen-subtitle {
    display: block;
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .topbar-actions > * {
    flex: 1;
    min-width: 0;
    text-align: center;
    justify-content: center;
    padding: 10px 10px;
    font-size: 0.82rem;
  }

  /* 3. Bottom Tabbar vs Fixed Demo Conversion Bottom Bar */
  .mobile-tabbar { display: flex; }
  body.is-demo-mode .mobile-tabbar { display: none; }
  .demo-bottom-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 600;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-strong);
    box-shadow: 0 -8px 28px rgba(2, 6, 23, 0.45);
  }
  .demo-bottom-btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.86rem;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
  }
  .demo-bottom-cta {
    flex: 1.5;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #052e16;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  .demo-bottom-wa {
    flex: 1;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
  }

  .main-area {
    padding: 12px 12px calc(94px + env(safe-area-inset-bottom, 0px));
  }
  body.is-demo-mode .main-area {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }

  /* 4. KPIs 2 cols, Full-width Modals, 16px Inputs (no iOS zoom), >=44px Buttons */
  .kpi-grid,
  .xa-kpi-strip,
  .xvm-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .kpi-card {
    padding: 13px 12px;
  }
  .kpi-value {
    font-size: 1.24rem;
    word-break: break-word;
  }

  .login-overlay,
  .modal-backdrop,
  #welcome-proposal-modal {
    padding: 0;
    align-items: end;
    justify-items: stretch;
  }
  .modal-card,
  .welcome-card,
  .login-card {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
  select,
  textarea,
  .input-sm {
    font-size: 16px !important;
    min-height: 44px;
    max-width: 100%;
  }

  button,
  .btn-primary,
  .btn-secondary,
  .btn-ghost-sm,
  .btn-hire,
  .btn-wa,
  .btn-danger-sm,
  .nav-btn,
  .pill,
  .tab-btn,
  .vmod-tabs button,
  .vmod-tabs .vmod-tab {
    min-height: 44px;
  }
  .btn-primary,
  .btn-secondary,
  .btn-ghost-sm,
  .btn-hire,
  .btn-wa,
  .btn-danger-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .panel {
    padding: 14px 13px;
    border-radius: 14px;
  }
  .form-row-2,
  .welcome-grid,
  .vmod-grid,
  .suites-map-grid,
  .schedule-grid,
  .checklist-grid,
  .orders-grid,
  .clients-grid {
    grid-template-columns: 1fr;
  }
  .anti-saas-metrics { width: 100%; }
  .anti-saas-metrics > div { flex: 1; min-width: 130px; }
  .mercosul-plate:not(.sm) { max-width: 170px; }
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    text-align: center;
  }
}

@media (max-width: 640px) {
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
  table.table-cards,
  table.table-cards thead,
  table.table-cards tbody,
  table.table-cards th,
  table.table-cards td,
  table.table-cards tr {
    display: block;
  }
  table.table-cards thead {
    display: none;
  }
  table.table-cards tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  table.table-cards tbody tr {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 10px 13px;
    box-shadow: var(--shadow-sm);
  }
  table.table-cards tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
    min-height: 38px;
    word-break: break-word;
  }
  table.table-cards tbody td:last-child {
    border-bottom: none;
    padding-bottom: 2px;
  }
  table.table-cards tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
  }
  table.table-cards tbody td[colspan] {
    display: block;
    text-align: center;
  }
  table.table-cards tbody td[colspan]::before {
    display: none;
  }
}

@media print {
  .no-print,
  .demo-banner,
  .demo-bottom-bar,
  .sidebar,
  .sidebar-overlay,
  .mobile-tabbar,
  .modal-backdrop,
  .login-overlay,
  #welcome-proposal-modal,
  .toast {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-shell { display: none !important; }
  .print-only {
    display: block !important;
    padding: 24px;
    color: #000000;
  }
}


/* ===================== IDENTIDADE VISUAL EXCLUSIVA POR VERTICAL ===================== */
/* 1. Clínica Médica & SUS — Clean Medical Light (Azul Hospitalar + Branco Gelo) */
body[data-vertical="clinica_sus"] {
  --accent: #0284c7;
  --bg: #f0f6fb;
  --surface: #ffffff;
  --surface-2: #f7fafd;
  --surface-3: #e8f1f8;
  --border: rgba(2, 132, 199, 0.16);
  --border-strong: rgba(2, 132, 199, 0.34);
  --text: #0c233c;
  --muted: #52718f;
}
body[data-vertical="clinica_sus"] .sidebar {
  background: linear-gradient(180deg, #0b3b66 0%, #072847 100%);
  color: #e0f2fe;
}
body[data-vertical="clinica_sus"] .sidebar .nav-item { color: #bae6fd; }
body[data-vertical="clinica_sus"] .sidebar .nav-item.active { background: rgba(56, 189, 248, 0.22); color: #fff; border-color: rgba(125, 211, 252, 0.45); }

/* 2. Salão de Beleza, Manicure & Nails — Rose Editorial Soft Glam */
body[data-vertical="salao"] {
  --accent: #db2777;
  --bg: #fdf5f8;
  --surface: #ffffff;
  --surface-2: #fef9fb;
  --surface-3: #fcebf2;
  --border: rgba(219, 39, 119, 0.15);
  --border-strong: rgba(219, 39, 119, 0.32);
  --text: #2d1020;
  --muted: #7c4d63;
}
body[data-vertical="salao"] .sidebar {
  background: linear-gradient(180deg, #431229 0%, #2a0a19 100%);
  color: #fce7f3;
}
body[data-vertical="salao"] .sidebar .nav-item { color: #fbcfe8; }
body[data-vertical="salao"] .sidebar .nav-item.active { background: rgba(244, 114, 182, 0.24); color: #fff; border-color: rgba(249, 168, 212, 0.45); }

/* 3. Pet Shop, Banho & Tosa — Warm Friendly Teal & Orange */
body[data-vertical="petshop"] {
  --accent: #ea580c;
  --bg: #fff9f2;
  --surface: #ffffff;
  --surface-2: #fffcf8;
  --surface-3: #fef0e1;
  --border: rgba(234, 88, 12, 0.16);
  --border-strong: rgba(234, 88, 12, 0.34);
  --text: #1c1917;
  --muted: #6b5e54;
}
body[data-vertical="petshop"] .sidebar {
  background: linear-gradient(180deg, #0f3d3e 0%, #092829 100%);
  color: #ccfbf1;
}
body[data-vertical="petshop"] .sidebar .nav-item { color: #99f6e4; }
body[data-vertical="petshop"] .sidebar .nav-item.active { background: rgba(234, 88, 12, 0.28); color: #fff; border-color: rgba(251, 146, 60, 0.55); }

/* 4. Loja de Roupas & Varejo — Editorial Fashion Cream & Graphite */
body[data-vertical="varejo"] {
  --accent: #7c3aed;
  --bg: #f8f7f4;
  --surface: #ffffff;
  --surface-2: #fcfbf9;
  --surface-3: #f1efe9;
  --border: rgba(24, 24, 27, 0.12);
  --border-strong: rgba(124, 58, 237, 0.32);
  --text: #18181b;
  --muted: #63636e;
}
body[data-vertical="varejo"] .sidebar {
  background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
  color: #f4f4f5;
}
body[data-vertical="varejo"] .sidebar .nav-item { color: #d4d4d8; }
body[data-vertical="varejo"] .sidebar .nav-item.active { background: rgba(124, 58, 237, 0.26); color: #fff; border-color: rgba(167, 139, 250, 0.5); }

/* 5. Clínica Estética & Studio Fitness — Clean Lavender Wellness */
body[data-vertical="clinica"] {
  --accent: #8b5cf6;
  --bg: #f5f3ff;
  --surface: #ffffff;
  --surface-2: #faf9ff;
  --surface-3: #ede9fe;
  --border: rgba(139, 92, 246, 0.16);
  --border-strong: rgba(139, 92, 246, 0.34);
  --text: #1e1b4b;
  --muted: #5b5582;
}
body[data-vertical="clinica"] .sidebar {
  background: linear-gradient(180deg, #2e1065 0%, #1e0b45 100%);
  color: #ede9fe;
}
body[data-vertical="clinica"] .sidebar .nav-item { color: #ddd6fe; }

/* 6. Pousada, Hotel & Chalés — Resort Esmeralda & Areia */
body[data-vertical="pousada"] {
  --accent: #10b981;
  --bg: #061310;
  --surface: #0b1f1a;
  --surface-2: #102a23;
  --surface-3: #16382f;
  --border: rgba(16, 185, 129, 0.2);
}

/* 7. Imobiliária & Corretores — Luxury Navy & Gold */
body[data-vertical="imobiliaria"] {
  --accent: #d97706;
  --bg: #080d18;
  --surface: #0f172a;
  --surface-2: #16213a;
  --border: rgba(245, 158, 11, 0.22);
}

/* 8. Vidraçaria & Sob Medida — Blueprint Cyan */
body[data-vertical="sob_medida"] {
  --accent: #06b6d4;
  --bg: #07111a;
  --surface: #0c1a27;
  --surface-2: #112436;
  --border: rgba(6, 182, 212, 0.22);
}

/* 9. Assistência Técnica — Tech Indigo */
body[data-vertical="assistencia"] {
  --accent: #6366f1;
  --bg: #090a16;
  --surface: #111326;
  --surface-2: #181b34;
  --border: rgba(99, 102, 241, 0.22);
}


/* ===================== CONTRASTE GLOBAL PARA TEMAS CLAROS (WCAG AA/AAA) ===================== */
body.theme-light .muted,
body.theme-light small,
body.theme-light .text-muted {
  color: #475569 !important;
}
body.theme-light .card,
body.theme-light .panel,
body.theme-light .kpi-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}
body.theme-light .badge,
body.theme-light .pill,
body.theme-light .tag,
body.theme-light [class*="badge"],
body.theme-light [class*="pill"] {
  color: #1e293b;
}
body.theme-light button.btn-sec,
body.theme-light .btn-ghost,
body.theme-light .btn-outline,
body.theme-light .xp-btn-sm {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}
body.theme-light button.btn-sec:hover,
body.theme-light .btn-ghost:hover {
  background: #e2e8f0 !important;
}
body.theme-light .sidebar .nav-item.active {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  font-weight: 700;
}
body.theme-light input,
body.theme-light select,
body.theme-light textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}
/* Pills de tamanho, SKU e subcards dentro dos módulos claros */
body.theme-light [style*="rgba(255,255,255,0.0"],
body.theme-light [style*="rgba(255, 255, 255, 0.0"] {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}
body.theme-light [style*="color:#94a3b8"],
body.theme-light [style*="color: #94a3b8"],
body.theme-light [style*="color:#cbd5e1"],
body.theme-light [style*="color: #cbd5e1"],
body.theme-light [style*="color:#e2e8f0"],
body.theme-light [style*="color: #e2e8f0"] {
  color: #334155 !important;
}
body.theme-light [style*="color:#ddd6fe"],
body.theme-light [style*="color: #ddd6fe"],
body.theme-light [style*="color:#c4b5fd"],
body.theme-light [style*="color: #c4b5fd"],
body.theme-light [style*="color:#e9d5ff"],
body.theme-light [style*="color: #e9d5ff"] {
  color: #5b21b6 !important;
}
