/* ============================================================
   SIGECO — Sistema Integrado de Gestão de Estoque e Consumo
   Design System / Tema Dark
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Base surfaces */
  --bg-0: #f2f5ec;          /* app background — branco levemente esverdeado */
  --bg-1: #ffffff;          /* sidebar / panels */
  --bg-2: #ffffff;          /* cards */
  --bg-3: #eef2e6;          /* raised / hover (verde claro) */
  --bg-4: #e7ede0;          /* inputs / rows */

  /* Borders */
  --border: #e2e7d8;
  --border-strong: #cfd7c2;

  /* Text */
  --text-1: #26301f;        /* primary — verde-cinza escuro */
  --text-2: #526049;        /* secondary */
  --text-3: #8a9580;        /* muted */

  /* Brand — paleta Gabata São Roque (verde) */
  --brand: #5c9a34;          /* verde folha (accent principal) */
  --brand-2: #4a8129;        /* verde hover */
  --brand-soft: rgba(92, 154, 52, .13);
  --brand-deep: #3c6a2c;     /* verde escuro da marca */
  --teal: #2f9e73;           /* verde-teal complementar */
  --teal-soft: rgba(47, 158, 115, .13);
  --cream: #eae6df;          /* creme da marca */

  /* Status */
  --success: #2e9e57;
  --success-soft: rgba(46, 158, 87, .14);
  --warning: #c7891b;
  --warning-soft: rgba(199, 137, 27, .15);
  --danger: #d64339;
  --danger-soft: rgba(214, 67, 57, .12);
  --info: #1f8aa6;
  --info-soft: rgba(31, 138, 166, .13);
  --violet: #7a5bd6;
  --violet-soft: rgba(122, 91, 214, .13);

  /* Chart palette */
  --c1: #5c9a34; --c2: #2f9e73; --c3: #e0961f; --c4: #7a5bd6; --c5: #d64339; --c6: #3aa0bd;

  /* Radius / shadow / spacing */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
  --shadow-1: 0 1px 2px rgba(38,48,31,.06);
  --shadow-2: 0 8px 24px rgba(38,48,31,.10);
  --shadow-3: 0 16px 48px rgba(38,48,31,.16);

  --sidebar-w: 264px;
  --topbar-h: 60px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 8px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-1); z-index: 2;
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 16px;
  box-shadow: var(--shadow-2);
}
/* Marca Gabata São Roque — logo "G" verde circular */
.brand-logo.gabata {
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #7ec242 0%, #4f9d2e 55%, #2f7d1f 100%);
  font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 700;
  color: #fff; box-shadow: 0 0 0 3px rgba(126,194,66,.18), var(--shadow-2);
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--text-3); }

.nav { padding: 12px 10px; flex: 1; }
.nav-group { margin-bottom: 6px; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-3); padding: 14px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  cursor: pointer; user-select: none; transition: .12s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text-1); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-deep); }
.nav-item.active .nav-ico { color: var(--brand); }
.nav-ico { width: 18px; text-align: center; color: var(--text-3); flex-shrink: 0; }
.nav-item.active .nav-ico { color: var(--brand); }
.nav-parent { justify-content: space-between; }
.nav-parent .chev { font-size: 10px; transition: .2s; color: var(--text-3); }
.nav-parent.open .chev { transform: rotate(90deg); }
.nav-sub { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.nav-sub.open { max-height: 500px; }
.nav-sub .nav-item { padding-left: 42px; font-size: 13px; }
.nav-badge {
  margin-left: auto; background: var(--bg-4); color: var(--text-2);
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-full);
}
.nav-badge.hot { background: var(--danger-soft); color: var(--danger); }
.nav-badge.soon { background: var(--warning-soft); color: var(--warning); text-transform: uppercase; letter-spacing: .5px; font-size: 9.5px; }
.nav-item.is-soon { color: var(--text-3); }
.nav-item.is-soon:hover { color: var(--text-2); }
.nav-parent.soon-parent .nav-ico { opacity: .7; }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.search-global {
  flex: 1; max-width: 460px; position: relative;
}
.search-global input {
  width: 100%; height: 38px; background: var(--bg-0); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text-1); padding: 0 14px 0 38px; font-size: 13.5px;
}
.search-global input:focus { outline: none; border-color: var(--brand); background: var(--bg-3); }
.search-global .s-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--bg-0);
  border: 1px solid var(--border); color: var(--text-2); display: grid; place-items: center;
  position: relative; font-size: 15px;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-1); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-2);
}

/* Role switcher */
.role-switch { display: flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; }
.role-switch button {
  border: 0; background: transparent; color: var(--text-2); padding: 6px 12px;
  border-radius: 6px; font-size: 12.5px; font-weight: 600;
}
.role-switch button.active { background: var(--brand); color: #fff; }

.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 8px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,var(--violet),var(--brand));
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
}
.user-meta { line-height: 1.2; }
.user-meta b { font-size: 13px; }
.user-meta span { font-size: 11px; color: var(--text-3); display: block; }

/* ---------- Content ---------- */
.content { padding: 22px 24px 48px; max-width: 1440px; width: 100%; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs .cur { color: var(--text-2); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; transition: .12s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: var(--bg-3); color: var(--text-1); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-4); }
.btn-subtle { background: transparent; color: var(--text-2); }
.btn-subtle:hover { background: var(--bg-3); color: var(--text-1); }
.btn-success { background: var(--success); color: #06210f; }
.btn-success:hover { filter: brightness(1.06); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 700; }
.card-title small { color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 6px; }
.card-body { padding: 18px 20px; }

/* Grid helpers */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-5 { grid-template-columns: repeat(5, 1fr); }
.col-span-2 { grid-column: span 2; }
@media (max-width: 1200px){ .g-4,.g-5{grid-template-columns:repeat(2,1fr);} .g-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 720px){ .g-2,.g-3,.g-4,.g-5{grid-template-columns:1fr;} .col-span-2{grid-column:auto;} }

/* ---------- Stat cards (KPI) ---------- */
.stat { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-ico {
  width: 42px; height: 42px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 18px;
}
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.stat-value small { font-size: 14px; color: var(--text-3); font-weight: 600; }
.stat-delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-foot { font-size: 11.5px; color: var(--text-3); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-full); line-height: 1.4;
}
.badge .b-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand-deep); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-muted { background: var(--bg-4); color: var(--text-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-3); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--bg-2); position: sticky; top: 0;
}
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-1); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--bg-3); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .t-right { text-align: right; }
.tbl .t-center { text-align: center; }
.t-primary { font-weight: 600; }
.t-muted { color: var(--text-3); }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---------- Locked value (🔒 read-only) ---------- */
.locked {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-4); border: 1px dashed var(--border-strong);
  padding: 4px 11px; border-radius: var(--r-sm); font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-1);
}
.locked .lock { color: var(--warning); font-size: 12px; }
.locked-note {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2);
  background: var(--warning-soft); border: 1px solid rgba(240,168,53,.25); color: var(--warning);
  padding: 8px 12px; border-radius: var(--r-sm); font-weight: 600;
}

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--danger); }
.input, .select, .textarea {
  height: 40px; background: var(--bg-0); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-1); padding: 0 13px; font-size: 13.5px; font-family: inherit; width: 100%;
}
.textarea { height: auto; padding: 11px 13px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input:disabled, .select:disabled { background: var(--bg-2); color: var(--text-3); cursor: not-allowed; }
.input::placeholder { color: var(--text-3); }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c7891' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.field-hint { font-size: 11.5px; color: var(--text-3); }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 13px; background: var(--bg-3); border: 1px solid var(--border); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2); font-size: 13px; }

/* Segmented / Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Filter bar */
.filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-md); margin-bottom: 16px;
}
.filterbar .input, .filterbar .select { height: 36px; max-width: 220px; background: var(--bg-0); }
.filterbar .search-inline { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.filterbar .search-inline input { width: 100%; padding-left: 34px; }
.filterbar .search-inline .s-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }

/* ---------- Progress bar ---------- */
.progress { height: 8px; background: var(--bg-4); border-radius: var(--r-full); overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--brand), var(--teal)); border-radius: var(--r-full); transition: width .5s ease; }
.progress.thin { height: 6px; }
.progress.success .bar { background: var(--success); }
.progress.warning .bar { background: var(--warning); }
.progress.danger .bar { background: var(--danger); }

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: flex-start; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 17px; left: 50%; width: 100%; height: 2px;
  background: var(--border-strong); z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--success); }
.step-dot {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-3); border: 2px solid var(--border-strong); color: var(--text-3);
  font-weight: 700; font-size: 14px; position: relative; z-index: 1;
}
.step.done .step-dot { background: var(--success); border-color: var(--success); color: #06210f; }
.step.current .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.step-label { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.step.done .step-label, .step.current .step-label { color: var(--text-1); }
.step.current .step-label { color: var(--brand-deep); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); font-size: 13px; align-items: flex-start; }
.alert .a-ico { font-size: 16px; margin-top: 1px; }
.alert > div > b:first-child { display: block; margin-bottom: 2px; }
.alert-info { background: var(--info-soft); border: 1px solid rgba(31,138,166,.25); color: #14657a; }
.alert-info .a-ico { color: var(--info); }
.alert-success { background: var(--success-soft); border: 1px solid rgba(46,158,87,.25); color: #1f7040; }
.alert-success .a-ico { color: var(--success); }
.alert-warning { background: var(--warning-soft); border: 1px solid rgba(199,137,27,.3); color: #8a5e10; }
.alert-warning .a-ico { color: var(--warning); }
.alert-danger { background: var(--danger-soft); border: 1px solid rgba(214,67,57,.25); color: #a02b23; }
.alert-danger .a-ico { color: var(--danger); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(4,7,12,.66); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 24px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column;
  animation: pop .18s ease;
}
.modal.lg { max-width: 780px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* ---------- Drawer ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(4,7,12,.6); z-index: 100; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--bg-1);
  border-left: 1px solid var(--border-strong); box-shadow: var(--shadow-3); z-index: 101;
  display: flex; flex-direction: column; animation: slide .22s ease;
}
@keyframes slide { from { transform: translateX(100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 12px; background: var(--bg-3); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--success); border-radius: var(--r-md); padding: 13px 16px; box-shadow: var(--shadow-2);
  min-width: 280px; animation: slide .2s ease; font-size: 13px;
}
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast .t-ico { font-size: 16px; }

/* ---------- Empty / Loading / Error states ---------- */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 54px 24px; color: var(--text-3); }
.state .st-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--bg-3); display: grid; place-items: center; font-size: 26px; margin-bottom: 16px; }
.state h4 { color: var(--text-1); font-size: 16px; margin-bottom: 5px; }
.state p { max-width: 360px; margin-bottom: 18px; }

.skeleton { background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 37%, var(--bg-3) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.spinner { width: 34px; height: 34px; border: 3px solid var(--bg-4); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.pager { display: flex; gap: 4px; }
.pager button { width: 32px; height: 32px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; }
.pager button:hover { background: var(--bg-3); color: var(--text-1); }
.pager button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-3); }
.kv .v { font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r-full); font-size: 12px; color: var(--text-2); }
.tag-area { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; background: var(--teal-soft); color: var(--teal); }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.w-full { width: 100%; } .flex-1 { flex: 1; }
.hide { display: none !important; }

/* ---------- Home / Boas-vindas ---------- */
.home-hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(124,178,66,.22), transparent 60%),
    linear-gradient(135deg, #10331f 0%, #16401f 45%, #1c2233 100%);
  padding: 54px 48px; text-align: center;
}
.home-hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(138,180,84,.16), transparent 70%); border-radius: 50%;
}
.home-logo {
  width: 108px; height: 108px; border-radius: 50%; margin: 0 auto 22px;
  background: radial-gradient(circle at 32% 30%, #a6d46a 0%, #6fae3b 52%, #3f7d1f 100%);
  display: grid; place-items: center; color: #fff; position: relative; z-index: 1;
  font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 56px;
  box-shadow: 0 0 0 8px rgba(138,180,84,.15), 0 18px 48px rgba(0,0,0,.45);
}
.home-eyebrow { position: relative; z-index: 1; letter-spacing: 4px; text-transform: uppercase; font-size: 12px; font-weight: 700; color: #a6d46a; margin-bottom: 8px; }
.home-brand { position: relative; z-index: 1; font-size: 40px; font-weight: 800; letter-spacing: -.5px; color: #fff; }
.home-tagline { position: relative; z-index: 1; font-size: 17px; font-style: italic; color: var(--cream); margin-top: 8px; }
.home-div { position: relative; z-index: 1; width: 64px; height: 3px; background: var(--brand); border-radius: 3px; margin: 26px auto; }
.home-welcome { position: relative; z-index: 1; font-size: 24px; font-weight: 700; color: #fff; }
.home-welcome span { color: #a6d46a; }
.home-sub { position: relative; z-index: 1; color: #c3ccd8; font-size: 14px; margin-top: 6px; }
.home-quick { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-top: 20px; }
@media (max-width: 900px){ .home-quick { grid-template-columns: repeat(2,1fr);} .home-brand{font-size:30px;} }
.home-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; text-align: left; cursor: pointer; transition: .15s; display: flex; gap: 14px; align-items: flex-start;
}
.home-card:hover { background: var(--bg-3); border-color: var(--brand); transform: translateY(-2px); }
.home-card .hc-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; background: var(--brand-soft); }
.home-card b { font-size: 15px; }
.home-card p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* Contador animado (comprovante de baixa) */
.cnt { display: inline-block; }
.anim-flash { animation: cntPulse 1s ease; }
@keyframes cntPulse {
  0% { color: var(--warning); transform: scale(1.18); text-shadow: 0 0 14px rgba(240,168,53,.6); }
  60% { color: var(--warning); }
  100% { color: inherit; transform: scale(1); text-shadow: none; }
}
/* Flash da linha alterada na tela de Produtos */
.saldo-flash { animation: saldoFlash 1.6s ease; border-radius: 6px; }
@keyframes saldoFlash {
  0%, 18% { background: var(--warning-soft); box-shadow: inset 0 0 0 2px rgba(240,168,53,.4); }
  100% { background: transparent; box-shadow: none; }
}

/* Mapa de quartos / ocupação */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.room { border-left: 4px solid var(--success); cursor: pointer; transition: .15s; }
.room.occ { border-left-color: var(--info); }
.room:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

/* Bars chart (pure CSS) */
.barchart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 10px; }
.barchart .bcol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.barchart .bfill { width: 100%; max-width: 46px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--brand), var(--brand-2)); transition: height .6s ease; position: relative; }
.barchart .bcol:nth-child(even) .bfill { background: linear-gradient(180deg, var(--teal), #159e8c); }
.barchart .blabel { font-size: 11px; color: var(--text-3); }
.barchart .bval { font-size: 11px; font-weight: 700; color: var(--text-2); }

/* Donut (conic) */
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; }
.donut::after { content: ""; position: absolute; inset: 26px; background: var(--bg-2); border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; }
.legend-item .lv { margin-left: auto; font-weight: 700; }

/* Sparkline row */
.mini-spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.mini-spark span { flex: 1; background: var(--brand-soft); border-radius: 2px 2px 0 0; min-height: 3px; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .role-switch, .search-global { display: none; }
}

/* ============ IMPRESSÃO / PDF ============ */
@media print {
  .sidebar, .topbar, #modalRoot, .toast-wrap, #bootOverlay, .filterbar, .role-switch, button, .btn, .cell-actions, .pager { display: none !important; }
  .app, .main { display: block !important; }
  .content, #view { padding: 0 !important; margin: 0 !important; }
  body, .app, .main, .content { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .tbl th, .tbl td { font-size: 11px !important; padding: 5px 8px !important; }
  .breadcrumbs { color: #666 !important; }
}
