:root {
  color-scheme: light;
  --ink: #2b211c;
  --muted: #6f6057;
  --accent: #8d472f;
  --accent-hover: #713622;
  --accent-soft: #f4e6db;
  --canvas: #f6f2eb;
  --paper: #fffcf7;
  --line: #e6dcd0;
  --dark: #241c18;
  --side-text: #d4c5b9;
  --round: 20px;
  --shadow: 0 2px 4px #422a1410, 0 12px 30px -22px #422a1460;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, .display, .brand strong { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #b2674d; outline-offset: 4px; }
h1:focus, main:focus { outline: 0; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 10; background: var(--paper); padding: 10px 16px; border-radius: 8px; transform: translateY(-150%); }
.skip:focus { transform: none; }

.layout { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow: auto;
  background: var(--dark);
  padding: 29px 16px 24px;
  color: var(--side-text);
  border-right: 1px solid #3f3028;
}
.brand-line { padding: 3px 7px 26px; border-bottom: 1px solid #4a3930; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; color: #fff4e6; background: #965139; border: 1px solid #b27054; border-radius: 13px; }
.brand-mark .ico { width: 24px; height: 24px; }
.brand strong { display: block; color: #fff7ed; font-size: 28px; line-height: 1.02; letter-spacing: -.065em; }
.brand strong span { color: #dd9975; }
.brand small { display: block; font-size: 11px; margin-top: 5px; }
.menu-toggle { display: none; }
.nav-group { margin-top: 26px; display: grid; gap: 4px; }
.nav-group p { padding: 0 12px 4px; color: #bfa99b; font-weight: 650; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; }
.nav-group a {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 550;
}
.nav-group a:hover { background: #342822; color: #fff6ea; }
.nav-group a[aria-current] { background: #54352a; color: #ffefe2; border-color: #6e4737; }
.nav-group a[aria-current]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #edac85; margin-left: auto; }
.nav-group a[aria-current] .ico { color: #edac85; }
.workspace { min-width: 0; }
.topbar { background: #fbf8f2; border-bottom: 1px solid var(--line); }
.topbar-inner, main { width: min(100%, 1280px); margin-inline: auto; padding-inline: clamp(24px, 4vw, 59px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 69px; }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumb strong { color: var(--ink); font-weight: 650; }
.crumb .ico { width: 14px; height: 14px; }
.channel-chip, .pill { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; border-radius: 999px; font-size: 12px; font-weight: 650; }
.channel-chip { padding: 6px 11px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); min-height: 34px; }
.channel-chip:hover { border-color: #ae8b78; }
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #a29082; }
.channel-chip[data-state="good"] .dot { background: #368457; box-shadow: 0 0 0 3px #e6f1e7; }
.channel-chip[data-state="warn"] .dot { background: #a95b2c; box-shadow: 0 0 0 3px #f9ebde; }

main { padding-top: 35px; padding-bottom: 56px; }
.page-heading { margin-bottom: 25px; }
h1 { font-size: clamp(35px, 4vw, 49px); letter-spacing: -.064em; line-height: 1.1; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.stack { display: grid; align-content: start; gap: 18px; min-width: 0; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(245px, 1fr); gap: 18px; align-items: start; }
.hero {
  background: #332218;
  isolation: isolate;
  color: #fff5e8;
  border-radius: var(--round);
  padding: 27px 34px 29px;
  min-height: 218px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  box-shadow: var(--shadow);
}
.hero::before, .hero::after { content: ""; inset: 0; position: absolute; pointer-events: none; z-index: -1; }
.hero::before { background: url("/estudio.webp") 76% 55% / cover no-repeat; }
.hero::after { background: linear-gradient(90deg, #2c1d16 0%, #2c1d16f7 25%, #2c1d16ad 53%, #2c1d1620 100%); }
.hero-copy { max-width: min(590px, 75%); overflow-wrap: anywhere; }
.hero-label { display: flex; align-items: center; gap: 9px; color: #f3c7a9; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .19em; }
.hero-label::before { content: ""; width: 21px; height: 1px; background: currentColor; }
.display { font-size: clamp(31px, 5vw, 56px); line-height: 1.03; letter-spacing: -.06em; margin-top: 9px; }
.hero-address { display: flex; align-items: baseline; gap: 6px; color: #f5dfd0; margin-top: 8px; font-size: 13.5px; }
.hero-address .ico { width: 15px; height: 15px; transform: translateY(2px); }
.hero .button { margin-top: 17px; background: #fff0e0; color: #542d20; border-color: #fff0e0; min-height: 39px; padding: 7px 12px; }
.hero .button:hover { background: #fffaf1; }

.card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--round); padding: 23px; box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 19px; }
.card-heading h2, .card h2 { font-size: 18px; line-height: 1.27; letter-spacing: -.025em; font-weight: 700; }
.card-heading p, .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.icon-box { display: inline-grid; flex: none; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: var(--accent); background: var(--accent-soft); }
.icon-box .ico { width: 18px; height: 18px; }
.shortcuts { display: grid; }
.shortcut { display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 60px; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.shortcut:first-child { border-top: 0; }
.shortcut > .ico { width: 16px; height: 16px; color: var(--accent); }
.shortcut strong, .shortcut small { display: block; }
.shortcut strong { font-size: 13.5px; line-height: 1.2; }
.shortcut small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.shortcut:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.fields, .field { display: grid; gap: 14px; min-width: 0; }
.field { gap: 5px; }
label, .field > span { font-size: 13px; font-weight: 650; color: var(--ink); }
input, select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid #d8cbbd;
  background: #fdfaf5;
  color: var(--ink);
  font-weight: 400;
  min-height: 43px;
}
input::placeholder, textarea::placeholder { color: #796b63; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b2674d; outline-offset: -1px; background: #fffefa; }
textarea { min-height: 147px; resize: vertical; }
.form-actions, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.form-actions { margin-top: 17px; }
.form-footer { padding-top: 15px; border-top: 1px solid var(--line); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid #d8cbbd;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  background: var(--paper);
}
.button .ico { width: 16px; height: 16px; }
.button:hover { border-color: #b89783; background: #f6ede3; }
.button.primary { color: #fff8ef; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.small { min-height: 36px; padding: 6px 9px; font-size: 12px; }
.button.danger { color: #8a382d; }
.button.link { border-color: transparent; padding-inline: 6px; color: var(--accent); }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.inline-form .field { flex: 1 1 150px; }
.inline-form .compact { flex: .45 1 108px; }
.inline-form .button { min-height: 43px; }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.treino-assistente { border-color: #dfc6b4; }
.treino-controles { display: grid; grid-template-columns: minmax(185px, 1fr) minmax(0, 2fr); align-items: start; gap: 15px; }
.treino-controles .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 0; }
.treino-controles textarea { min-height: 108px; }
.treino-controles .hint[data-error="true"] { color: #813b32; }
.treino-aviso { margin: 0; }
.treino-aviso[data-error="true"] { color: #813b32; }
.treino-resultado { margin-top: 17px; padding: 16px; background: #f7eee5; border: 1px solid #e8d4c3; border-radius: 12px; }
.treino-resultado h3 { font-size: 15px; }
.treino-texto { max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 7px; color: var(--ink); }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 8px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { font-weight: 650; color: var(--muted); font-size: 12px; white-space: nowrap; }
td { border-top: 1px solid var(--line); font-size: 14px; }
td .hint { display: block; }
td .pill { margin-top: 0; }
.service-table .n { min-width: 133px; }
.service-table .d, .service-table .v { min-width: 65px; }
.pill { background: #ece6df; color: #594a40; padding: 4px 9px; }
.pill.good { background: #e6f0e7; color: #285c3b; }
.pill.warn { background: #f6ebdc; color: #784722; }
.pill.bad { background: #f7e7e3; color: #813b32; }
.state-card { padding: 22px 14px; text-align: center; color: var(--muted); border: 1px dashed #d9cabb; border-radius: 12px; background: #fbf7f0; }
.state-card strong { display: block; color: var(--ink); font-size: 15px; }
.state-card .button { margin-top: 12px; }
.loading { color: var(--muted); padding: 22px; }
.team-card { display: grid; gap: 14px; }
.team-card .inline-form { align-items: end; }
.schedule summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--accent); }
.schedule summary::marker { color: var(--accent); }
.schedule .hint { margin: 6px 0 9px; }
.schedule-row { display: grid; grid-template-columns: minmax(55px, 1fr) repeat(2, minmax(68px, 1fr)); align-items: center; gap: 7px; padding: 5px 0; font-size: 13px; }
.schedule-row.head { padding-bottom: 1px; color: var(--muted); font-size: 12px; }
.schedule-row input { padding: 6px; min-height: 36px; }

.chat-log { display: flex; flex-direction: column; gap: 12px; min-height: 305px; max-height: 48vh; overflow: auto; background: #f7f1e8; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty .icon-box { margin-bottom: 8px; }
.bubble { align-self: flex-start; max-width: 87%; padding: 9px 13px; border: 1px solid var(--line); border-radius: 13px 13px 13px 3px; background: var(--paper); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; border-radius: 13px 13px 3px 13px; background: #ede0d1; border-color: #e4d1bf; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 13px; }
.card-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.card-toolbar .card-heading { margin-bottom: 0; }
.steps { color: var(--muted); padding-left: 20px; margin: 10px 0 0; }
.steps li + li { margin-top: 6px; }
.pairing { margin-top: 16px; border-radius: 13px; padding: 12px 15px; background: var(--accent-soft); }
.pairing code { display: block; font: 700 clamp(21px, 7vw, 34px)/1.4 ui-monospace, monospace; letter-spacing: .12em; color: var(--accent-hover); overflow-wrap: anywhere; }

#toast:not(:empty) {
  position: fixed;
  z-index: 5;
  bottom: 20px;
  right: 20px;
  max-width: min(390px, calc(100% - 40px));
  padding: 10px 16px;
  border: 1px solid #c7d9cb;
  border-radius: 12px;
  background: #f0f7ef;
  box-shadow: var(--shadow);
  color: #285c3b;
  font-weight: 650;
}
#toast[data-error="true"] { color: #813b32; background: #fbefec; border-color: #dfc0b9; }

@media (max-width: 1140px) {
  .team-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 213px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .overview-grid, .two-up { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { position: relative; height: auto; overflow: visible; padding: 12px 16px; border-right: 0; }
  .brand-line { display: flex; justify-content: space-between; align-items: center; border: 0; padding: 0; }
  .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .brand-mark .ico { width: 21px; height: 21px; }
  .brand strong { font-size: 24px; }
  .brand small { font-size: 10px; margin-top: 2px; }
  .menu-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; background: #352822; border: 1px solid #594235; color: #fff5e8; }
  .sidebar nav { display: none; padding-bottom: 6px; }
  .sidebar nav.open { display: block; }
  .nav-group { margin-top: 14px; }
  .topbar-inner, main { padding-inline: 16px; }
  .topbar-inner { min-height: 54px; }
  .crumb { font-size: 12px; gap: 4px; }
  .channel-chip { font-size: 11px; padding-inline: 8px; }
  main { padding-top: 24px; }
  .page-heading { margin-bottom: 19px; }
  .page-heading p { font-size: 14px; }
  .card { padding: 17px; border-radius: 16px; }
  .hero { padding: 19px; min-height: 193px; border-radius: 16px; }
  .hero-copy { max-width: 96%; }
  .hero::before { background-position: 68% 54%; }
  .hero::after { background: linear-gradient(90deg, #2c1d16fa 0%, #2c1d16d4 48%, #2c1d1660 100%); }
}
@media (max-width: 620px) {
  .treino-controles { grid-template-columns: minmax(0, 1fr); }
  .table-wrap { overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody { display: grid; gap: 11px; }
  tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
  td, td:first-child, td:last-child { display: block; border: 0; padding: 0; overflow-wrap: anywhere; }
  td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 650; margin-bottom: 3px; }
  td.wide { grid-column: 1 / -1; }
  .chat-log { min-height: 225px; }
}


/* --- Topbar actions & user chip --- */
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.logout-btn { min-height: 34px; padding: 6px 10px; }
.install-btn { min-height: 34px; padding: 6px 10px; }

/* --- Login screen --- */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: radial-gradient(circle at top right, #efe3d4 0%, var(--canvas) 55%);
}
.login-card {
  width: min(100%, 430px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--round);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
}
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand-name {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.05em;
  color: var(--dark);
}
.login-brand-name span { color: var(--accent); }
.login-brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.login-heading h1 { font-size: 30px; letter-spacing: -.05em; }
.login-heading p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.login-erro {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fbefec;
  border: 1px solid #dfc0b9;
  color: #813b32;
  font-size: 13px;
  font-weight: 600;
}
.login-submit { width: 100%; min-height: 45px; margin-top: 4px; }

/* --- Aviso de sessao especial (suporte/rede) e codigos de recuperacao --- */
.aviso-entrada {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 8px 14px;
  background: #fff4d6;
  border-bottom: 1px solid #e3c776;
  color: #6b4e00;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}
.codigos-recuperacao {
  padding: 12px;
  border-radius: 10px;
  background: var(--canvas);
  border: 1px dashed var(--line);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15px;
  line-height: 1.7;
  user-select: all;
}

/* --- Painel da plataforma (superadmin) --- */
.plat-main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 18px; }
.plat-topo { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.plat-topo h1 { font-size: 30px; letter-spacing: -.04em; }
.plat-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.plat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plat-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.plat-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.plat-botoes { display: flex; flex-wrap: wrap; gap: 6px; }
.aviso-conta { padding: 8px 14px; font-size: 13px; font-weight: 650; text-align: center; border-bottom: 1px solid; }
.aviso-conta.info { background: #e3eef6; border-color: #b4d1e8; color: #1f5478; }
.aviso-conta.aviso { background: #fff4d6; border-color: #e3c776; color: #6b4e00; }
.aviso-conta.erro { background: #fbefec; border-color: #dfc0b9; color: #813b32; }

/* --- Pills extras --- */
.pill.info { background: #e3eef6; color: #1f5478; }
.pill.done { background: #e7ebe5; color: #3d523a; }

/* --- Overlays: Modal & Drawer --- */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(36, 28, 24, 0.52);
  backdrop-filter: blur(2px);
  display: flex;
}
.modal-backdrop { align-items: center; justify-content: center; padding: 20px 14px; }
.drawer-backdrop { justify-content: flex-end; }
.modal-dialog {
  width: min(100%, 640px);
  max-height: calc(100dvh - 40px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--round);
  box-shadow: 0 24px 60px -20px rgba(36, 28, 24, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer-panel {
  width: min(100%, 470px);
  height: 100dvh;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px -18px rgba(36, 28, 24, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbf7f0;
}
.overlay-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.2;
}
.overlay-subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.overlay-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.overlay-close:hover { background: #f4ebe1; border-color: #c8b2a2; }
.overlay-body { padding: 20px 22px 24px; overflow-y: auto; flex: 1; }
.modal-lead { font-size: 15px; font-weight: 650; margin-bottom: 6px; }
#toast:not(:empty) { z-index: 60; }

/* --- Modal tabs & form helpers --- */
.modal-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  background: #f2ebe1;
  border-radius: 11px;
}
.modal-tab {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  padding: 6px 10px;
}
.modal-tab.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(36, 28, 24, 0.12);
}
.two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.three-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cliente-picker { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbf7f1; }
.aviso-restricao { color: #8a382d; font-weight: 650; }
.modo-servico-toggle, .checks-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.radio-inline, .check-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.radio-inline input, .check-inline input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.servicos-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  max-height: 175px;
  overflow-y: auto;
  padding: 4px 2px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fdfaf5;
  cursor: pointer;
}
.check-item:hover { border-color: #c5a693; }
.check-item input { width: auto; min-height: 0; margin-top: 3px; accent-color: var(--accent); }
.check-item strong { display: block; font-size: 13px; font-weight: 650; line-height: 1.25; }
.check-item small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; margin-top: 2px; }

.restricao-confirm-box {
  padding: 13px 14px;
  border-radius: 12px;
  background: #fbefec;
  border: 1px solid #dfc0b9;
  color: #813b32;
  display: grid;
  gap: 8px;
}
.restricao-confirm-box strong { font-size: 13.5px; }
.restricao-confirm-box p { font-size: 13px; }
.restricao-confirm-box .button { justify-self: start; }

.rec-sim-area { display: grid; gap: 10px; justify-items: start; }
.rec-previa {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  background: #fbf7f0;
  display: grid;
  gap: 8px;
}
.rec-previa-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.rec-previa-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 165px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}
.rec-previa-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12.5px;
}
.rec-previa-list li.ok { background: #e8f3ea; color: #245735; }
.rec-previa-list li.conflito { background: #f8e9e5; color: #813b32; }

/* --- Agenda Toolbar & Banner --- */
.agenda-shell { display: grid; gap: 14px; }
.agenda-toolbar { padding: 14px 18px; }
.agenda-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.agenda-nav-group, .agenda-controls-group, .agenda-actions-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-group { display: inline-flex; }
.btn-group .button { border-radius: 0; margin-left: -1px; }
.btn-group .button:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.btn-group .button:last-child { border-radius: 0 9px 9px 0; }
.button.icon-only { padding-inline: 8px; }
.agenda-date-input { width: auto; min-height: 36px; padding: 5px 10px; font-size: 13px; }
.agenda-periodo-label { font-size: 14px; font-weight: 700; color: var(--ink); padding-inline: 4px; }
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #efe7dc;
  border: 1px solid var(--line);
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 650;
  min-height: 30px;
}
.seg-btn.active { background: var(--paper); color: var(--accent); box-shadow: 0 1px 3px rgba(36, 28, 24, 0.14); }
.agenda-barber-select { width: auto; min-width: 170px; min-height: 36px; padding: 5px 10px; font-size: 13px; }
.espera-badge.has-items { border-color: #d69f78; background: #fbf0e5; color: #7b421f; }
.badge-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff8ef;
  font-size: 11px;
  font-weight: 700;
}

.fechamento-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 14px;
  background: #f9ebe4;
  border: 1px solid #dfbaa7;
  color: #7c3523;
}
.fechamento-banner .ico { width: 22px; height: 22px; flex: none; }
.fechamento-banner strong { display: block; font-size: 14px; }
.fechamento-banner span { display: block; font-size: 13px; opacity: 0.9; }

/* --- Visão Dia (CSS Grid) --- */
.day-grid-card { padding: 0; overflow: hidden; }
.day-grid-scroll { overflow-x: auto; }
.day-grid-header {
  display: grid;
  width: max-content;
  min-width: 100%;
  border-bottom: 1px solid var(--line);
  background: #faf5ed;
  position: sticky;
  top: 0;
  z-index: 4;
}
.day-corner, .day-barber-head {
  padding: 12px 10px;
  border-left: 1px solid var(--line);
}
.day-corner { border-left: 0; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; justify-content: center; }
.day-barber-head strong { display: block; font-size: 14px; line-height: 1.2; }
.day-barber-head small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.day-grid-body { display: grid; width: max-content; min-width: 100%; position: relative; }
.day-time-col { background: #fcf9f4; }
.day-time-label {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4px 10px 0 4px;
  border-top: 1px solid #ede5da;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
}
.day-time-label:first-child { border-top: 0; }

.day-barber-col {
  position: relative;
  border-left: 1px solid var(--line);
  background: var(--paper);
}
.day-slot {
  border-top: 1px solid #efe8de;
  position: relative;
  transition: background-color .12s ease;
}
.day-slot:first-child { border-top: 0; }
.day-slot.slot-fora {
  background: repeating-linear-gradient(
    -45deg,
    #f3ece3,
    #f3ece3 6px,
    #ece3d7 6px,
    #ece3d7 12px
  );
}
.day-slot.clicavel { cursor: pointer; }
.day-slot.clicavel:hover, .day-slot.clicavel:focus-visible { background: #f8efe6; }
.slot-plus {
  opacity: 0;
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 11px;
  font-weight: 650;
  color: var(--accent);
  pointer-events: none;
}
.day-slot.clicavel:hover .slot-plus, .day-slot.clicavel:focus-visible .slot-plus { opacity: 1; }

.bloqueio-block {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 2;
  background: #ede6de;
  border: 1px dashed #b9a492;
  border-radius: 9px;
  padding: 5px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  overflow: hidden;
  color: #5c4b3f;
}
.bloqueio-info { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.bloqueio-info strong { font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bloqueio-rm {
  flex: none;
  border: 1px solid #c9b5a4;
  background: var(--paper);
  color: #813b32;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 7px;
}
.bloqueio-rm:hover { background: #fbefec; }

.ag-card {
  position: absolute;
  z-index: 3;
  text-align: left;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(36, 28, 24, 0.08);
  transition: transform .1s ease, box-shadow .12s ease;
}
.ag-card > * { flex-shrink: 0; }
.bot-pausa { margin-bottom: 14px; }
.bot-pausa.is-pausado { border-color: #e4c199; background: #faeee0; }
.ag-card:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -4px rgba(36, 28, 24, 0.18); z-index: 5; }
.ag-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; }
.ag-hora { font-weight: 700; }
.ag-status-txt { font-size: 10.5px; font-weight: 650; opacity: 0.85; white-space: nowrap; }
.ag-cliente { font-size: 13px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-servicos { font-size: 11.5px; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Cartao baixo (atendimento curto): hora, nome e servico na mesma linha, sem status nem etiquetas. */
.ag-card.compact { flex-direction: row; align-items: center; gap: 6px; padding: 3px 8px; }
.ag-card.compact .ag-card-top { flex: 0 0 auto; }
.ag-card.compact .ag-status-txt, .ag-card.compact .ag-badges { display: none; }
.ag-card.compact .ag-cliente { flex: 0 1 auto; min-width: 0; }
.ag-card.compact .ag-servicos { flex: 1 1 0; min-width: 0; }
.ag-card.compact .ag-servicos::before { content: "· "; }

/* Cores por status */
.status-agendado { background: #f7efe5; border-color: #d9c2ab; border-left-color: #9e6b43; color: #3d2a1d; }
.status-confirmado { background: #e8f3ea; border-color: #b7d7be; border-left-color: #2f7d4b; color: #1b422a; }
.status-no-local { background: #e4eff8; border-color: #b4d1e8; border-left-color: #256898; color: #173f5c; }
.status-realizado { background: #eceee9; border-color: #c8cec2; border-left-color: #5b6d55; color: #364033; }
.status-ausencia { background: #faeee0; border-color: #e4c199; border-left-color: #b5651d; color: #5c3310; }
.status-cancelado { background: #f8eae7; border-color: #e2beb6; border-left-color: #9e3d32; color: #6f2a22; opacity: 0.72; }
.status-cancelado .ag-cliente { text-decoration: line-through; }

.ag-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.ag-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
}
.badge-whats { background: #d6f0de; color: #1d6436; }
.badge-encaixe { background: #f8dec5; color: #7d3e11; }
.badge-recorrente { background: #e3e2f5; color: #3d3880; }
.badge-global { background: #ded4c9; color: #4d3e33; }

.now-line {
  position: absolute;
  left: 68px;
  right: 0;
  height: 2px;
  background: #c8442a;
  z-index: 6;
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8442a;
}
.now-line span {
  position: absolute;
  left: -56px;
  top: -9px;
  background: #c8442a;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* --- Visão Semana --- */
.week-grid-card { padding: 14px; overflow-x: auto; }
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(152px, 1fr));
  gap: 10px;
  align-items: start;
}
.week-col {
  background: #fbf7f1;
  border: 1px solid var(--line);
  border-radius: 13px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.week-col.is-today { border-color: var(--accent); background: #fffbf6; }
.week-col.is-closed { background: #f6eee8; }
.week-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  background: #f5eee4;
}
.week-col.is-today .week-col-head { background: var(--accent-soft); }
.week-day-jump {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  color: var(--ink);
  display: grid;
}
.week-day-jump:hover strong { color: var(--accent); text-decoration: underline; }
.week-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.week-day-jump strong { font-size: 14px; }
.week-add-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #d5c2b2;
  background: var(--paper);
  color: var(--accent);
}
.week-add-btn:hover { background: var(--accent); color: #fff8ef; border-color: var(--accent); }
.week-add-btn .ico { width: 15px; height: 15px; }
.week-closed-tag {
  padding: 5px 9px;
  background: #f8e3dc;
  color: #813b32;
  font-size: 11.5px;
  font-weight: 650;
  border-bottom: 1px solid #e4c2b8;
}
.week-col-body { padding: 8px; display: grid; gap: 7px; }
.week-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 6px; }
.week-ag-card {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-left-width: 4px;
  border-radius: 9px;
  padding: 7px 8px;
  display: grid;
  gap: 2px;
}
.week-ag-card:hover { filter: brightness(0.97); }
.week-item-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11.5px; }
.week-ag-cliente { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.week-ag-serv, .week-ag-barb { font-size: 11.5px; opacity: 0.9; overflow-wrap: anywhere; }
.week-bloq {
  padding: 7px 8px;
  border-radius: 9px;
  background: #ede6de;
  border: 1px dashed #b9a492;
  color: #5c4b3f;
  display: grid;
  gap: 2px;
  font-size: 12px;
}
.week-bloq-rm {
  border: 0;
  background: transparent;
  color: #813b32;
  padding: 2px;
  display: inline-grid;
  place-items: center;
}
.week-bloq-rm .ico { width: 14px; height: 14px; }

/* --- Drawer de Detalhes & Lista de Espera --- */
.drawer-section { margin-bottom: 18px; }
.drawer-section h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 9px; }
.drawer-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 13px;
  background: #fbf7f0;
  border: 1px solid var(--line);
}
.detail-list > div.wide { grid-column: 1 / -1; }
.detail-list dt { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.detail-list dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.drawer-items-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.drawer-items-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fdfaf5;
  font-size: 13.5px;
}
.drawer-items-list small { color: var(--muted); }
.status-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.status-btn.is-current { background: var(--accent); color: #fff8ef; border-color: var(--accent); }
.cancel-box {
  margin-top: 12px;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid #dfc0b9;
  background: #fcf2ef;
  display: grid;
  gap: 10px;
}
.escopo-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.escopo-fieldset legend { font-size: 12.5px; font-weight: 650; margin-bottom: 6px; }
.drawer-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.espera-alerta {
  margin-top: 14px;
  padding: 14px;
  border-radius: 13px;
  background: #eef6f0;
  border: 1px solid #b5d5be;
  color: #1f4f31;
  display: grid;
  gap: 10px;
}
.espera-alerta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.espera-alerta-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid #cde2d3;
  color: var(--ink);
}
.espera-alerta-list strong { display: block; font-size: 13.5px; }
.espera-alerta-list small { display: block; color: var(--muted); font-size: 12px; }

.espera-card {
  padding: 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fbf7f1;
  display: grid;
  gap: 6px;
}
.espera-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.espera-encaixe-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 105px auto;
  gap: 6px;
  margin-top: 4px;
}
.espera-encaixe-form select, .espera-encaixe-form input { min-height: 36px; padding: 5px 8px; font-size: 12.5px; }

@media (max-width: 760px) {
  .topbar-actions { gap: 6px; }
  .user-chip { font-size: 11px; padding: 4px 9px; }
  .two-cols, .three-cols, .four-cols, .detail-list { grid-template-columns: minmax(0, 1fr); }
  .agenda-barber-select { width: 100%; }
  .espera-encaixe-form { grid-template-columns: minmax(0, 1fr); }
}

/* --- Subtabs, KPIs, Ficha 360º, Equipe, Fila & Importação CSV --- */
.drawer-panel { width: min(100%, 540px); }
.four-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.table-section { margin-top: 16px; }

.subtabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  border-radius: 13px;
  background: #ede5da;
  border: 1px solid var(--line);
  justify-self: start;
}
.drawer-subtabs { width: 100%; display: flex; margin-bottom: 16px; }
.drawer-subtabs .subtab { flex: 1; }
.subtab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  min-height: 36px;
}
.subtab:hover { color: var(--ink); }
.subtab.active {
  background: var(--paper);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(36, 28, 24, 0.14);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #fbf7f0;
  border: 1px solid var(--line);
}
.filter-grow { flex: 1 1 220px; }
.filter-tag-field { flex: 0 1 190px; }

.cli-name-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: #f5eee6;
  border: 1px solid color-mix(in srgb, var(--tag-cor, #8d472f) 38%, #d8cbbd);
  color: var(--ink);
}
.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tag-cor, #8d472f);
  flex: none;
}
.tag-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  min-height: 0;
}
.tag-remove:hover { color: #813b32; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 10px;
}
.kpi-card {
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 4px;
}
.kpi-label { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font-size: 22px; line-height: 1.15; color: var(--ink); }
.kpi-value.kpi-sm { font-size: 15px; padding-top: 4px; }
.kpi-value.kpi-good { color: #285c3b; }
.kpi-value.kpi-warn { color: #9c5218; }
.kpi-value.kpi-bad { color: #813b32; }

.ficha-stack { gap: 16px; }
.compact-inline { margin-top: 10px; }
.color-field { flex: 0 0 74px !important; }
.color-field input[type="color"] { padding: 3px; height: 43px; cursor: pointer; }
.mini-card-form {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbf7f0;
}
.hist-item { align-items: flex-start !important; }
.hist-item strong { display: block; }

.service-table-full input, .service-table-full select { min-height: 36px; padding: 6px 8px; font-size: 13px; }
.service-table-full .s-nome { min-width: 145px; }
.service-table-full .s-cat { min-width: 100px; }
.service-table-full .s-dur, .service-table-full .s-val, .service-table-full .s-com, .service-table-full .s-ret { min-width: 72px; }
.service-table-full .s-tipo { min-width: 112px; }

.team-summary-card { display: grid; gap: 12px; padding: 18px; }
.team-summary-meta { display: grid; gap: 6px; min-width: 0; }
.schedule-2turnos { display: grid; gap: 10px; }
.turno-dia-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 8px;
}
.turno-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.turno-grid input { min-height: 36px; padding: 6px 8px; }
.barber-service-row {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 10px;
}
.barber-service-row input:not([type="checkbox"]) { min-height: 36px; padding: 6px 8px; }

.fila-cards { gap: 10px; }
.fila-item-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbf7f1;
  display: grid;
  gap: 10px;
}
.fila-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.fila-pos-group { display: flex; align-items: center; gap: 12px; }
.fila-pos {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 700;
  font-size: 15px;
  flex: none;
}
.chamar-especifico { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.oc-barb-select { width: auto; min-width: 145px; min-height: 36px; padding: 5px 8px; font-size: 12.5px; }

.rodizio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
}
.rodizio-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 10px;
}
.rodizio-card.rodizio-vez {
  border-color: var(--accent);
  background: #fff9f2;
  box-shadow: 0 4px 14px -8px rgba(141, 71, 47, 0.35);
}
.rodizio-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rodizio-rank { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }

.dropzone-box {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 24px 16px;
  border: 2px dashed #cbb5a2;
  border-radius: 14px;
  background: #fbf7f0;
  text-align: center;
  cursor: pointer;
}
.dropzone-box:hover { border-color: var(--accent); background: #f8f0e6; }
.dropzone-box span { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.dropzone-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  min-height: 0;
  padding: 0;
}
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.error-list {
  margin: 0;
  padding: 12px 14px 12px 28px;
  border-radius: 11px;
  border: 1px solid #dfc0b9;
  background: #fcf2ef;
  color: #813b32;
  max-height: 220px;
  overflow-y: auto;
  font-size: 13px;
  display: grid;
  gap: 4px;
}
.fechamentos-wrap { margin-top: 14px; }
.fechamentos-list { max-height: 280px; overflow-y: auto; }

@media (max-width: 620px) {
  .turno-grid { grid-template-columns: minmax(0, 1fr); }
  .subtabs { width: 100%; }
  .subtab { flex: 1; text-align: center; }
}

/* --- Fase 2: Comandas / PDV, Produtos / Estoque e Formas de Pagamento --- */
.subtabs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

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

.comanda-card {
  padding: 16px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 10px;
  align-content: space-between;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.comanda-card:hover {
  border-color: #c8ad98;
  box-shadow: 0 6px 18px -12px rgba(66, 42, 20, 0.35);
}
.comanda-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.comanda-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}
.comanda-card-cliente {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.comanda-card-meta {
  display: grid;
  gap: 3px;
  font-size: 12.5px;
  color: var(--muted);
}
.comanda-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.comanda-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

/* PDV Drawer */
.drawer-panel.drawer-pdv { width: min(100%, 640px); }
.pdv-stack { display: grid; gap: 16px; }
.pdv-section {
  padding: 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 12px;
}
.pdv-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.pdv-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0;
}

.pdv-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.pdv-kpis .kpi-card { padding: 10px 11px; }
.pdv-kpis .kpi-value { font-size: 17px; font-weight: 700; }
.pdv-kpis .kpi-total { border-color: #d6b69d; background: #fff6ed; }
.pdv-kpis .kpi-total .kpi-value { color: var(--accent); }

.pdv-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.pdv-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.pdv-item-info { min-width: 0; display: grid; gap: 3px; }
.pdv-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.pdv-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.pdv-item-valor {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.pdv-prod-busca-lista {
  display: grid;
  gap: 6px;
  max-height: 195px;
  overflow-y: auto;
  padding: 2px;
}
.pdv-prod-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.pdv-prod-opt:hover { border-color: #b89783; background: #f8f0e6; }
.pdv-prod-opt.selected {
  border-color: var(--accent);
  background: #fff5ec;
  box-shadow: 0 0 0 1px var(--accent);
}
.pdv-prod-opt strong { display: block; font-size: 13.5px; }
.pdv-prod-opt small { display: block; color: var(--muted); font-size: 12px; }
.pdv-prod-opt-right { text-align: right; flex: none; }

.estoque-aviso-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2b89a;
  background: #fdf0e4;
  color: #7c3c16;
  font-size: 13px;
}
.estoque-aviso-box .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.pdv-pgto-list { display: grid; gap: 10px; }
.pdv-pgto-row {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  display: grid;
  gap: 10px;
}
.pdv-pgto-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.pdv-pgto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(110px, .9fr);
  gap: 10px;
}
.pdv-pgto-cartao {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 84px minmax(0, 1fr);
  gap: 8px;
}
.pdv-pgto-row input, .pdv-pgto-row select { min-height: 38px; padding: 6px 9px; font-size: 13px; }

.pdv-balanco {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 13.5px;
  font-weight: 650;
}
.pdv-balanco[data-estado="ok"] {
  background: #eaf4ec;
  border-color: #b7d7be;
  color: #215733;
}
.pdv-balanco[data-estado="falta"] {
  background: #fdf0e4;
  border-color: #e3c09d;
  color: #7c4015;
}
.pdv-balanco[data-estado="troco"] {
  background: #f8ebe8;
  border-color: #dfb7ad;
  color: #813b32;
}

.pdv-auditoria {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbf7f0;
}
.pdv-auditoria summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--accent);
}
.pdv-auditoria-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.pdv-auditoria-list li {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12.5px;
  display: grid;
  gap: 2px;
}
.pdv-auditoria-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11.5px;
}

.barcode-result {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 10px;
}

/* Produtos & Estoque */
.estoque-alerta-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #fbefec;
  border: 1px solid #dfc0b9;
  color: #813b32;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.estoque-alerta-banner .ico { width: 19px; height: 19px; flex: none; }
.estoque-baixo-row td { background: #fff7f5; }
.estoque-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mov-delta-pos { color: #245c38; font-weight: 700; }
.mov-delta-neg { color: #8a382d; font-weight: 700; }
.conf-input { max-width: 120px; min-height: 36px; padding: 6px 9px; }
.conf-diff-pos { color: #245c38; font-weight: 700; }
.conf-diff-neg { color: #8a382d; font-weight: 700; }
.conf-diff-zero { color: var(--muted); }

/* Formas de Pagamento & Bandeiras */
.bandeiras-list { display: grid; gap: 10px; margin-bottom: 16px; }
.bandeira-card {
  padding: 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fbf7f0;
  display: grid;
  gap: 10px;
}
.bandeira-card input, .bandeira-card select { min-height: 36px; padding: 6px 8px; font-size: 13px; }
.bandeira-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1.3fr) repeat(2, minmax(75px, .7fr)) minmax(110px, .9fr);
  gap: 8px;
}

/* Comprovante de Impressão (oculto na tela, visível apenas em @media print) */
#print-comprovante { display: none; }

@media (max-width: 760px) {
  .pdv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pdv-pgto-grid, .pdv-pgto-cartao, .bandeira-grid { grid-template-columns: minmax(0, 1fr); }
  .conf-input { max-width: none; }
}

@media print {
  @page { margin: 8mm; }
  html, body {
    background: #fff !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body > *:not(#print-comprovante) {
    display: none !important;
  }
  #print-comprovante {
    display: block !important;
    width: 100%;
    max-width: 80mm;
    margin: 0 auto;
    padding: 4mm 2mm;
    font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
    font-size: 11.5px;
    line-height: 1.45;
    color: #000;
    background: #fff;
  }
  .recibo-header {
    text-align: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #000;
  }
  .recibo-header h1 {
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 2px;
  }
  .recibo-header p { margin: 0; font-size: 10.5px; }
  .recibo-meta {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed #000;
  }
  .recibo-meta p { margin: 2px 0; }
  .recibo-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
  }
  .recibo-table th, .recibo-table td {
    padding: 3px 0;
    border: 0;
    font-size: 11px;
    text-align: left;
    vertical-align: top;
  }
  .recibo-table th {
    border-bottom: 1px dashed #000;
    color: #000;
    font-weight: 700;
  }
  .recibo-table .num { text-align: right; white-space: nowrap; padding-left: 6px; }
  .recibo-totais {
    padding: 8px 0;
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    margin-bottom: 8px;
  }
  .recibo-linha {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 2px 0;
  }
  .recibo-linha.total {
    font-size: 13px;
    font-weight: 700;
    margin-top: 5px;
    padding-top: 4px;
    border-top: 1px solid #000;
  }
  .recibo-pgtos {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #000;
  }
  .recibo-pgtos h2 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 4px;
  }
  .recibo-footer {
    text-align: center;
    font-size: 10.5px;
    margin-top: 8px;
  }
}

/* Assistente de Gestão */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.gestao-assistente {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.gestao-conversas,
.gestao-chat-card { padding: 18px; }
.gestao-conversas { position: sticky; top: 84px; display: grid; gap: 14px; }
.gestao-conversas-head,
.gestao-chat-intro,
.gestao-proposta header,
.gestao-form-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.gestao-conversas-head h2,
.gestao-chat-intro h2,
.gestao-propostas-head h2,
.gestao-proposta h3 { margin: 0; }
.gestao-conversas-lista { display: grid; gap: 7px; }
.gestao-conversa {
  width: 100%;
  min-height: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbf7f0;
  color: var(--ink);
  text-align: left;
  display: grid;
  gap: 3px;
}
.gestao-conversa strong { font-size: 13.5px; }
.gestao-conversa span { color: var(--muted); font-size: 11.5px; }
.gestao-conversa:hover,
.gestao-conversa.is-active { border-color: var(--accent); background: #fff7ef; }
.gestao-conversa.is-active { box-shadow: inset 3px 0 var(--accent); }
.gestao-chat-card { min-width: 0; display: grid; gap: 15px; }
.gestao-chat-intro { justify-content: flex-start; }
.gestao-chat-intro p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.gestao-sugestoes { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 3px; }
.gestao-sugestoes .button { flex: none; }
.gestao-chat {
  min-height: 255px;
  max-height: 45vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f1e8;
}
.gestao-vazio { margin: auto; max-width: 390px; text-align: center; color: var(--muted); }
.gestao-vazio strong { color: var(--ink); }
.gestao-vazio p { margin: 4px 0 0; }
.gestao-mensagem { max-width: min(82%, 650px); display: grid; gap: 4px; }
.gestao-mensagem > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.gestao-mensagem p {
  margin: 0;
  padding: 10px 13px;
  border-radius: 4px 13px 13px 13px;
  border: 1px solid var(--line);
  background: var(--paper);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.gestao-mensagem.is-user { align-self: flex-end; }
.gestao-mensagem.is-user > span { text-align: right; }
.gestao-mensagem.is-user p { background: var(--accent); color: #fff8ef; border-color: var(--accent); border-radius: 13px 4px 13px 13px; }
.gestao-propostas { display: grid; gap: 10px; }
.gestao-propostas-head { padding: 3px 0; }
.gestao-proposta {
  padding: 15px;
  border: 1px solid #d8c7b8;
  border-radius: 14px;
  background: #fffaf4;
  display: grid;
  gap: 11px;
}
.gestao-proposta.is-destructive { border-color: #d9aaa0; background: #fff8f6; }
.gestao-proposta header { align-items: center; }
.gestao-proposta h3 { margin-top: 3px; font-size: 15px; }
.gestao-proposta-tipo,
.gestao-proposta-expira { color: var(--muted); font-size: 11.5px; text-transform: capitalize; }
.gestao-proposta-expira { margin: -5px 0 0; text-transform: none; }
.gestao-proposta-comparacao { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.gestao-proposta-dados { padding: 10px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); }
.gestao-proposta-dados h4 { margin: 0 0 7px; font-size: 12px; color: var(--muted); }
.gestao-proposta-dados dl { margin: 0; display: grid; gap: 6px; }
.gestao-proposta-dados dl > div { display: grid; grid-template-columns: minmax(88px, .7fr) minmax(0, 1.3fr); gap: 8px; }
.gestao-proposta-dados dt { font-size: 11.5px; color: var(--muted); }
.gestao-proposta-dados dd { margin: 0; font-size: 12.5px; overflow-wrap: anywhere; }
.gestao-proposta-erro { margin: 0; padding: 9px 10px; border-radius: 9px; background: #f7e7e3; color: #813b32; font-size: 12.5px; }
.gestao-proposta-acoes { display: flex; flex-wrap: wrap; gap: 7px; }
.gestao-form { display: grid; gap: 9px; }
.gestao-form textarea { min-height: 78px; resize: vertical; }
.gestao-form-footer { align-items: center; }
.gestao-form-footer .hint[data-error="true"] { color: #813b32; }

@media (max-width: 860px) {
  .gestao-assistente { grid-template-columns: minmax(0, 1fr); }
  .gestao-conversas { position: static; }
  .gestao-conversas-lista { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
}

@media (max-width: 620px) {
  .gestao-conversas,
  .gestao-chat-card { padding: 14px; }
  .gestao-proposta-comparacao { grid-template-columns: minmax(0, 1fr); }
  .gestao-mensagem { max-width: 92%; }
  .gestao-form-footer { align-items: stretch; flex-direction: column; }
  .gestao-form-footer .button { width: 100%; justify-content: center; }
}
