/* =====================================================
   RESET
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* =====================================================
   TEMA — claro (padrão)
   ===================================================== */
:root {
  --primary:        #e85d04;
  --primary-dark:   #c44d00;
  --primary-light:  #fff0e6;
  --primary-rgb:    232, 93, 4;

  --bg:             #f0f2f5;
  --bg-2:           #e4e8ed;
  --surface:        #ffffff;
  --surface-2:      #f8f9fb;
  --surface-3:      #f0f2f5;
  --border:         #e2e5ea;
  --border-strong:  #c9cdd4;

  --text:           #0f1117;
  --text-2:         #3d4350;
  --text-muted:     #6b7280;
  --text-disabled:  #9ca3af;

  --success:        #059669;
  --success-bg:     #d1fae5;
  --success-text:   #065f46;
  --warning:        #d97706;
  --warning-bg:     #fef3c7;
  --warning-text:   #92400e;
  --danger:         #dc2626;
  --danger-bg:      #fee2e2;
  --danger-text:    #991b1b;
  --info:           #2563eb;
  --info-bg:        #dbeafe;
  --info-text:      #1e40af;

  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,.08), 0 10px 10px -5px rgba(0,0,0,.03);

  --transition: .15s ease;
  --transition-slow: .3s ease;

  --topbar-h: 60px;
  --sidebar-w: 240px;
}

/* =====================================================
   TEMA ESCURO
   ===================================================== */
[data-theme="dark"] {
  --bg:             #0d0f14;
  --bg-2:           #151820;
  --surface:        #1a1d26;
  --surface-2:      #20232f;
  --surface-3:      #272b38;
  --border:         #2d3244;
  --border-strong:  #3d4357;

  --text:           #f1f3f9;
  --text-2:         #c8cdd8;
  --text-muted:     #7c8498;
  --text-disabled:  #4a5068;

  --success-bg:     #052e16;
  --success-text:   #4ade80;
  --warning-bg:     #2d1a00;
  --warning-text:   #fbbf24;
  --danger-bg:      #2d0a0a;
  --danger-text:    #f87171;
  --info-bg:        #0c1a3d;
  --info-text:      #60a5fa;
  --primary-light:  #2d1500;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.3);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow:     0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -1px rgba(0,0,0,.3);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,.5), 0 4px 6px -2px rgba(0,0,0,.3);
}

/* =====================================================
   BASE
   ===================================================== */
body {
  font-family: 'Inter', 'SF Pro Display', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   TOPBAR
   ===================================================== */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(var(--surface-rgb, 255,255,255), .92);
}
[data-theme="dark"] .topbar {
  background: rgba(26, 29, 38, .92);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -.02em;
}
.topbar-brand .brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), .35);
}

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .75rem .35rem .5rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--surface-3); }
.topbar-user .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topbar-user .user-name { font-size: .82rem; font-weight: 500; }
.topbar-user .user-perfil {
  font-size: .7rem;
  color: var(--text-muted);
  line-height: 1;
}

/* =====================================================
   BOTÃO TEMA
   ===================================================== */
.theme-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background var(--transition);
  color: var(--text-muted);
}
.theme-btn:hover { background: var(--surface-3); color: var(--text); }

/* =====================================================
   LAYOUT
   ===================================================== */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* =====================================================
   BOTÕES
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn:active:not(:disabled) { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), .35);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), .45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-strong); }

.btn-success  { background: linear-gradient(135deg, #059669, #047857); color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.3); }
.btn-success:hover:not(:disabled)  { box-shadow: 0 4px 12px rgba(5,150,105,.4); transform: translateY(-1px); }

.btn-danger   { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.3); }
.btn-danger:hover:not(:disabled)   { box-shadow: 0 4px 12px rgba(220,38,38,.4); transform: translateY(-1px); }

.btn-warning  { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; box-shadow: 0 2px 8px rgba(217,119,6,.3); }
.btn-warning:hover:not(:disabled)  { box-shadow: 0 4px 12px rgba(217,119,6,.4); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.btn-sm  { padding: .38rem .85rem; font-size: .78rem; border-radius: var(--radius-xs); }
.btn-lg  { padding: .75rem 1.75rem; font-size: .95rem; border-radius: var(--radius); }
.btn-xl  { padding: 1rem 2rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn-icon { padding: .45rem; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { padding: .32rem; }

/* =====================================================
   FORMULÁRIOS
   ===================================================== */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.form-control {
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  width: 100%;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15);
  background: var(--surface);
}
.form-control::placeholder { color: var(--text-disabled); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2.2rem; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-slow), border-color var(--transition-slow);
  overflow: hidden;
}
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); transition: all var(--transition); }

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--surface);
}
.card-body   { padding: 1.25rem; }
.card-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: .25rem;
}
.stat-card-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-card-valor { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat-card-sub   { font-size: .75rem; color: var(--text-muted); }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-no-dot::before { display: none; }

.badge-success  { background: var(--success-bg);  color: var(--success-text); }
.badge-warning  { background: var(--warning-bg);  color: var(--warning-text); }
.badge-danger   { background: var(--danger-bg);   color: var(--danger-text); }
.badge-info     { background: var(--info-bg);     color: var(--info-text); }
.badge-neutral  { background: var(--surface-3);   color: var(--text-muted); }
.badge-primary  { background: var(--primary-light); color: var(--primary-dark); }

/* =====================================================
   ALERTAS
   ===================================================== */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success-text); border-color: #a7f3d0; }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: #fde68a; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border-color: #fca5a5; }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border-color: #93c5fd; }

/* =====================================================
   TABELAS
   ===================================================== */
.table-wrapper { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th {
  padding: .7rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface-2); }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(.98);
  transition: transform var(--transition);
  border: 1px solid var(--border);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-body    { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer  { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* =====================================================
   TOAST
   ===================================================== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: .8rem 1.15rem;
  border-radius: var(--radius);
  font-size: .86rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn .25s cubic-bezier(.34,1.56,.64,1);
  max-width: 320px;
  pointer-events: all;
  border: 1px solid rgba(255,255,255,.08);
}
.toast.success { background: #065f46; color: #d1fae5; }
.toast.error   { background: #991b1b; color: #fee2e2; }
.toast.warning { background: #92400e; color: #fef3c7; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* =====================================================
   SPINNER
   ===================================================== */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner-dark {
  border-color: var(--border);
  border-top-color: var(--primary);
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   ESCOLHA DE PERFIL (tela de login)
   ===================================================== */
.perfil-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}
.perfil-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  background: var(--surface);
}
.perfil-card:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.perfil-card.selecionado { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.15); }
.perfil-card .perfil-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.perfil-card .perfil-nome { font-size: .88rem; font-weight: 600; color: var(--text); }

/* =====================================================
   MESA CARDS
   ===================================================== */
.mesa-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.mesa-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  transition: background var(--transition);
}
.mesa-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mesa-card.livre::before       { background: var(--success); }
.mesa-card.ocupada::before     { background: var(--warning); }
.mesa-card.aguardando_fechamento::before { background: var(--danger); }
.mesa-card.livre     { border-color: #a7f3d0; }
.mesa-card.ocupada   { border-color: #fde68a; }
.mesa-card.aguardando_fechamento { border-color: #fca5a5; }

/* =====================================================
   PROGRESS BAR
   ===================================================== */
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width .4s ease; }

/* =====================================================
   TABS
   ===================================================== */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; }
.tab-btn {
  flex: 1; padding: .7rem .75rem;
  background: none; border: none;
  font-size: .84rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.ativo  { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel      { display: none; }
.tab-panel.ativo{ display: block; }

/* =====================================================
   FOTO UPLOAD
   ===================================================== */
.foto-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface-2);
}
.foto-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.foto-upload-area.tem-foto { border-style: solid; border-color: var(--primary); }
.foto-upload-preview { width:100%; max-height:160px; object-fit:cover; border-radius:var(--radius-sm); margin-bottom:.5rem; display:none; }
.foto-upload-icon  { font-size: 2rem; display: block; margin-bottom: .5rem; }
.foto-upload-label { font-size: .82rem; color: var(--text-muted); }

/* =====================================================
   UTILITÁRIOS
   ===================================================== */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.flex-1         { flex: 1; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.gap-1          { gap: .5rem; }
.gap-2          { gap: 1rem; }
.gap-3          { gap: 1.5rem; }
.text-muted     { color: var(--text-muted) !important; }
.text-sm        { font-size: .82rem; }
.text-xs        { font-size: .72rem; }
.text-lg        { font-size: 1.05rem; }
.text-xl        { font-size: 1.25rem; }
.font-bold      { font-weight: 700; }
.font-semibold  { font-weight: 600; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-primary   { color: var(--primary); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-0  { padding: 0 !important; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.divider-text {
  text-align: center; font-size: .75rem; color: var(--text-muted);
  position: relative; margin: 1.25rem 0;
}
.divider-text::before, .divider-text::after {
  content: ''; position: absolute; top: 50%; width: 44%; height: 1px; background: var(--border);
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: .5; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: .35rem; }

/* =====================================================
   SIDEBAR MOBILE OVERLAY
   ===================================================== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: all var(--transition);
}

/* =====================================================
   RESPONSIVO — breakpoints estilo Bootstrap
   ===================================================== */

/* md: ≤ 991px */
@media (max-width: 991px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hide-md { display: none !important; }
}

/* sm: ≤ 767px */
@media (max-width: 767px) {
  :root { --topbar-h: 56px; }
  .main-content { padding: .75rem; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none !important; }
  .hide-mobile { display: none !important; }
  .card-body { padding: .85rem; }
  .card-header { padding: .85rem 1rem; }
  .card-footer { padding: .65rem 1rem; }

  /* Topbar compacta */
  .topbar { padding: 0 .85rem; }
  .topbar-brand .brand-text { display: none; }
  .topbar-user .user-name,
  .topbar-user .user-perfil { display: none; }
  .topbar-user { padding: .3rem; }
  .topbar-actions .btn-ghost.btn-sm { padding: .35rem .6rem; font-size: .75rem; }

  /* Modal — bottom sheet */
  .modal {
    max-width: 100%; width: 100%;
    margin: 0;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
  }
  .modal-overlay { align-items: flex-end; padding: 0; }

  /* Hamburger visível */
  .hamburger { display: flex; }

  /* Botões maiores para toque */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .btn-lg { min-height: 48px; padding: .75rem 1.5rem; }
  .btn-xl { min-height: 52px; }

  /* Form controls maiores */
  .form-control { padding: .7rem .9rem; font-size: 16px; } /* 16px evita zoom no iOS */

  /* Tables scroll */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Stat grid 2 colunas */
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-card-valor { font-size: 1.35rem; }
}

/* xs: ≤ 479px */
@media (max-width: 479px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.15rem; }
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* Telas muito pequenas */
@media (max-width: 360px) {
  .main-content { padding: .6rem; }
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
