/* =====================================================================
   Vilarcom Tickets — CSS compilado (sem build Node)
   Preserva a identidade visual original: preto, branco e vermelho.
   Tokens de cor em oklch, iguais ao src/styles.css do projeto React.
   ===================================================================== */

:root {
  --radius: 0.625rem;
  --background: oklch(0.995 0 0);
  --foreground: oklch(0.16 0.01 260);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.16 0.01 260);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.16 0.01 260);
  --primary: oklch(0.18 0.01 260);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.965 0.005 260);
  --secondary-foreground: oklch(0.18 0.01 260);
  --muted: oklch(0.965 0.005 260);
  --muted-foreground: oklch(0.5 0.02 260);
  --accent: oklch(0.965 0.005 260);
  --accent-foreground: oklch(0.18 0.01 260);
  --destructive: oklch(0.62 0.24 27);
  --destructive-foreground: oklch(0.99 0 0);
  --border: oklch(0.92 0.005 260);
  --input: oklch(0.92 0.005 260);
  --ring: oklch(0.62 0.24 27);
  --brand: oklch(0.62 0.24 27);
  --brand-foreground: oklch(0.99 0 0);

  --sidebar: oklch(0.16 0.01 260);
  --sidebar-foreground: oklch(0.93 0.005 260);
  --sidebar-primary: oklch(0.62 0.24 27);
  --sidebar-primary-foreground: oklch(0.99 0 0);
  --sidebar-accent: oklch(0.22 0.01 260);
  --sidebar-accent-foreground: oklch(0.99 0 0);
  --sidebar-border: oklch(0.25 0.01 260);
  --sidebar-ring: oklch(0.62 0.24 27);
}

* { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Utilitárias ---------- */
.container { max-width: 1200px; margin: 0 auto; }
.muted { color: var(--muted-foreground); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-2xl { font-size: 1.5rem; }
.text-xl { font-size: 1.25rem; }
.text-base { font-size: 1rem; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: .05em; }
.tracking-widest { letter-spacing: .15em; }
.tracking-tight { letter-spacing: -.01em; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1 1 0%; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.gcol-2 { grid-column: span 2 / span 2; }

.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; }
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.p-3 { padding: .75rem; } .p-4 { padding: 1rem; } .p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; } .p-8 { padding: 2rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.pt-2 { padding-top: .5rem; } .pt-4 { padding-top: 1rem; }
.max-w-sm { max-width: 24rem; } .max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; } .max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; } .max-w-5xl { max-width: 64rem; } .max-w-6xl { max-width: 72rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ---------- Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-pad { padding: 1rem; }
.card-header { padding: 1rem 1rem .5rem; }
.card-title { font-size: 1rem; font-weight: 600; }
.card-content { padding: 1rem; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-size: .875rem; font-weight: 500; line-height: 1;
  padding: .55rem .9rem; border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent; cursor: pointer; transition: background .15s, opacity .15s;
  background: var(--primary); color: var(--primary-foreground);
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .35rem .6rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.2rem; font-size: 1rem; }
.btn-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-outline:hover { background: var(--accent); opacity: 1; }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); opacity: 1; }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-danger { background: var(--destructive); color: var(--destructive-foreground); }
.btn-block { width: 100%; }

/* ---------- Formulários ---------- */
label.field-label, .field-label {
  display: block; font-size: .8rem; font-weight: 500; margin-bottom: .3rem;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], textarea, select {
  width: 100%; font-size: .875rem; font-family: inherit;
  padding: .5rem .65rem; border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input); background: var(--card); color: var(--foreground);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid transparent; outline-offset: 2px;
  border-color: var(--ring); box-shadow: 0 0 0 2px oklch(0.62 0.24 27 / .25);
}
textarea { resize: vertical; }
input[type=color] { width: 3.5rem; height: 2.25rem; padding: 2px; border: 1px solid var(--border); border-radius: 6px; }

/* ---------- Tabelas ---------- */
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead.thead-muted { background: oklch(0.965 0.005 260 / .6); text-align: left; }
thead.thead-muted th { padding: .75rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); }
tbody td { padding: .75rem; }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:hover { background: oklch(0.965 0.005 260 / .5); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }

/* ---------- Badge de status ---------- */
.status-badge {
  display: inline-flex; align-items: center; gap: .375rem;
  border-radius: 999px; padding: .1rem .625rem; font-size: .75rem; font-weight: 500;
}
.status-dot { height: .375rem; width: .375rem; border-radius: 999px; }

.pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .1rem .5rem; font-size: .75rem;
}
.pill-active { background: #dcfce7; color: #166534; }
.pill-inactive { background: var(--muted); color: var(--muted-foreground); }

/* ---------- Chips / filtros ---------- */
.chip {
  border-radius: 999px; padding: .25rem .75rem; border: 1px solid var(--border);
  background: transparent; font-size: .75rem; cursor: pointer;
}
.chip:hover { background: var(--accent); }
.chip-active { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* ---------- Sidebar / shell ---------- */
.shell { min-height: 100vh; display: flex; width: 100%; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar); color: var(--sidebar-foreground);
  display: flex; flex-direction: column; min-height: 100vh;
}
.sidebar-header { padding: 1rem .75rem; }
.sidebar-group-label {
  padding: .5rem .75rem; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .05em; color: oklch(0.93 0.005 260 / .5);
}
.sidebar-menu { display: flex; flex-direction: column; gap: 2px; padding: 0 .5rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .6rem; border-radius: calc(var(--radius) - 2px);
  color: var(--sidebar-foreground); font-size: .875rem;
}
.sidebar-link:hover { background: var(--sidebar-accent); }
.sidebar-link.active { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
.sidebar-footer { margin-top: auto; padding: .75rem; border-top: 1px solid var(--sidebar-border); }
.sidebar-user { font-size: .75rem; color: oklch(0.93 0.005 260 / .7); margin-bottom: .4rem; }
.sidebar-logout {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  background: transparent; border: 0; color: var(--sidebar-foreground);
  padding: .45rem .5rem; border-radius: 6px; cursor: pointer; font-size: .875rem;
}
.sidebar-logout:hover { background: var(--sidebar-accent); }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 3.5rem; display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid var(--border); padding: 0 1rem; background: var(--background);
}
.topbar .menu-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: .3rem; }
.content { flex: 1; padding: 1.5rem; overflow: auto; }

.icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.icon-sm { width: .875rem; height: .875rem; }

/* Barra de progresso (dashboard cliente) */
.progress { height: .5rem; width: 100%; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; }

/* Alertas */
.alert {
  border-radius: calc(var(--radius) - 2px); padding: .5rem .75rem; font-size: .875rem;
  border: 1px solid; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.alert-danger { border-color: oklch(0.62 0.24 27 / .4); background: oklch(0.62 0.24 27 / .08); }
.alert-brand { border-color: oklch(0.62 0.24 27 / .4); background: oklch(0.62 0.24 27 / .08); }

/* Flash toasts */
.flash-wrap { position: fixed; top: 1rem; right: 1rem; z-index: 50; display: flex; flex-direction: column; gap: .5rem; max-width: 22rem; }
.flash {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .7rem .9rem; font-size: .875rem; box-shadow: 0 8px 24px oklch(0 0 0 / .12);
}
.flash-success { border-left: 3px solid #22c55e; }
.flash-error { border-left: 3px solid var(--destructive); }

/* Nota interna destacada (amarelo) */
.note-internal { background: oklch(0.97 0.06 95 / .5); border-color: oklch(0.8 0.12 95 / .4); }

/* Área de upload tracejada */
.dropzone { border: 1px dashed var(--border); border-radius: calc(var(--radius) - 2px); padding: 1rem; font-size: .875rem; }

.divide-y > * + * { border-top: 1px solid var(--border); }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded { border-radius: calc(var(--radius) - 2px); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-lg { border-radius: var(--radius); }
.rounded-full { border-radius: 999px; }
.overflow-hidden { overflow: hidden; }
.hover-accent:hover { background: var(--accent); }

/* Abas */
.tabs-list { display: inline-flex; gap: 2px; background: var(--muted); padding: 3px; border-radius: calc(var(--radius) - 2px); }
.tab-btn { border: 0; background: transparent; padding: .35rem .75rem; border-radius: calc(var(--radius) - 4px); font-size: .8rem; cursor: pointer; color: var(--muted-foreground); }
.tab-btn.active { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px oklch(0 0 0 / .08); }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: oklch(0 0 0 / .45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); width: 100%; max-width: 32rem; max-height: 90vh; overflow: auto; padding: 1.25rem; box-shadow: 0 20px 50px oklch(0 0 0 / .25); }
.modal-lg { max-width: 42rem; }
.modal-title { font-size: 1.05rem; font-weight: 600; margin-bottom: .75rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

/* Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }

/* Responsivido */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(1, minmax(0,1fr)); }
  .md-grid-2 { grid-template-columns: 1fr; }
  .lg-grid-3 { grid-template-columns: 1fr; }
  .gcol-2 { grid-column: auto; }
  .sidebar { position: fixed; z-index: 45; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .topbar .menu-toggle { display: inline-flex; }
  .content { padding: 1rem; }
}
@media (min-width: 901px) {
  .md-grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lg-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .lg-col-2 { grid-column: span 2 / span 2; }
  .auth-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

.auth-grid { display: grid; min-height: 100vh; }
.auth-panel { background: var(--sidebar); color: var(--sidebar-foreground); padding: 2.5rem; flex-direction: column; justify-content: space-between; display: none; }
@media (min-width: 901px) { .auth-panel { display: flex; } }
.auth-form-col { display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
