/* ============================================================
   ERP Cyber & Casa de Jogos — Global Stylesheet
   Dark Premium UI with Glassmorphism
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables — Dark (default) ── */
:root {
  --bg-primary:    #0B0F19;
  --bg-secondary:  #111827;
  --bg-card:       rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.8);
  --bg-input:      rgba(15, 23, 42, 0.6);

  --accent-1:   #6366f1;
  --accent-2:   #8b5cf6;
  --accent-3:   #06b6d4;
  --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6);

  --success:  #10b981;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --info:     #06b6d4;

  --text-primary:   #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted:     #6b7280;

  --border:       rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --sidebar-w: 260px;
  --header-h:  64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,.4);
  --shadow-md:  0 8px 24px rgba(0,0,0,.5);
  --shadow-lg:  0 16px 48px rgba(0,0,0,.6);
  --shadow-glow: 0 0 30px rgba(99,102,241,.25);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── CSS Variables — Light Mode ── */
[data-theme="light"] {
  --bg-primary:    #F1F5F9;
  --bg-secondary:  #FFFFFF;
  --bg-card:       rgba(255, 255, 255, 0.95);
  --bg-card-hover: rgba(241, 245, 249, 0.98);
  --bg-input:      rgba(248, 250, 252, 0.95);

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  --border:       rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.16);

  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 8px 24px rgba(0,0,0,.12);
  --shadow-lg:  0 16px 48px rgba(0,0,0,.16);
  --shadow-glow: 0 0 30px rgba(99,102,241,.15);
}

/* ── Theme toggle button ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--accent-1);
  color: #fff;
  border-color: var(--accent-1);
  transform: rotate(15deg);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent-1); text-decoration: none; }
a:hover { color: var(--accent-2); }
ul, ol { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #EFF3F8; }
::-webkit-scrollbar-thumb { background: rgba(37,99,235,.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-1); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(139,92,246,.12) 0%, transparent 60%),
              var(--bg-primary);
  padding: 1rem;
}
.login-box {
  width: 100%;
  max-width: 420px;
  background: rgba(13, 18, 38, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.5s ease;
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .icon-wrap {
  width: 72px; height: 72px;
  background: var(--accent-grad);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 32px rgba(99,102,241,.4);
}
.login-logo h1 { font-size: 1.4rem; font-weight: 700; }
.login-logo p  { color: var(--text-secondary); font-size: .85rem; }

/* ============================================================
   LAYOUT — SIDEBAR + MAIN
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--cor-sidebar, var(--bg-secondary));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
}
.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: var(--accent-grad);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.sidebar-brand .brand-text { font-weight: 700; font-size: .9rem; line-height: 1.2; color: var(--cor-sidebar-texto, var(--text-primary)); }
.sidebar-brand .brand-text span { display: block; color: var(--text-secondary); font-size: .75rem; font-weight: 400; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-section-title {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .75rem 1.5rem .25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  color: var(--cor-sidebar-texto, var(--text-secondary));
  font-size: .83rem;
  font-weight: 500;
  border-radius: 0;
  position: relative;
  transition: var(--transition);
}
.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,.05);
}
.nav-item.active {
  color: #fff;
  background: var(--cor-menu-ativo, rgba(99,102,241,.2));
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--accent-grad);
  border-radius: 0 3px 3px 0;
}
.nav-item i { width: 20px; text-align: center; font-size: 1rem; }

.nav-group .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  color: var(--cor-sidebar-texto, var(--text-secondary));
  font-size: .83rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.nav-group .nav-group-toggle:hover { color: var(--text-primary); background: rgba(255,255,255,.05); }
.nav-group .nav-group-toggle .chevron {
  margin-left: auto;
  font-size: .7rem;
  transition: transform .25s;
}
.nav-group.open .chevron { transform: rotate(90deg); }
.nav-sub { display: none; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { padding-left: 3.5rem; font-size: .8rem; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  background: var(--accent-grad);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cor-sidebar-texto, var(--text-primary)); }
.sidebar-user .user-role { color: var(--text-secondary); font-size: .72rem; }
.sidebar-user .logout-btn {
  color: var(--text-muted);
  font-size: 1rem;
  transition: color .2s;
  background: none;
  border: none;
  padding: .25rem;
}
.sidebar-user .logout-btn:hover { color: var(--danger); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  height: var(--header-h);
  background: var(--cor-cabecalho, rgba(13,18,38,.95));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}
.header-title { font-weight: 700; font-size: 1.1rem; flex: 1; }
.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-btn {
  width: 38px; height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: var(--transition);
}
.header-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.header-time { color: var(--text-secondary); font-size: .8rem; font-weight: 500; }

/* Page content */
.page-content { padding: 1.5rem; flex: 1; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h2 { font-size: 1.3rem; font-weight: 700; }
.page-header .breadcrumb { color: var(--text-secondary); font-size: .8rem; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-weight: 700; font-size: .95rem; }
.card-body { padding: 1.5rem; }

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: .06;
  transform: translate(20px, -20px);
}
.stat-card.accent-indigo::before { background: var(--accent-1); }
.stat-card.accent-violet::before { background: var(--accent-2); }
.stat-card.accent-cyan::before   { background: var(--accent-3); }
.stat-card.accent-green::before  { background: var(--success); }
.stat-card.accent-yellow::before { background: var(--warning); }
.stat-card.accent-red::before    { background: var(--danger); }

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.stat-icon.bg-indigo { background: rgba(99,102,241,.15); color: var(--accent-1); }
.stat-icon.bg-violet { background: rgba(139,92,246,.15); color: var(--accent-2); }
.stat-icon.bg-cyan   { background: rgba(6,182,212,.15); color: var(--accent-3); }
.stat-icon.bg-green  { background: rgba(16,185,129,.15); color: var(--success); }
.stat-icon.bg-yellow { background: rgba(245,158,11,.15); color: var(--warning); }
.stat-icon.bg-red    { background: rgba(239,68,68,.15); color: var(--danger); }

.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: .75rem; color: var(--text-secondary); font-weight: 500; }
.stat-change { font-size: .72rem; font-weight: 600; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .4rem;
  letter-spacing: .01em;
}
.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: .6rem .9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: .87rem;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
}
.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: rgba(99,102,241,.05);
}
.form-control::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-select option { background: var(--bg-secondary); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .83rem;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.5); }
.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn-success {
  background: rgba(16,185,129,.15);
  border-color: rgba(16,185,129,.3);
  color: var(--success);
}
.btn-success:hover { background: rgba(16,185,129,.25); }
.btn-danger {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.3);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-warning {
  background: rgba(245,158,11,.15);
  border-color: rgba(245,158,11,.3);
  color: var(--warning);
}
.btn-warning:hover { background: rgba(245,158,11,.25); }
.btn-info {
  background: rgba(6,182,212,.15);
  border-color: rgba(6,182,212,.3);
  color: var(--info);
}
.btn-info:hover { background: rgba(6,182,212,.25); }
.btn-sm { padding: .35rem .8rem; font-size: .78rem; }
.btn-lg { padding: .8rem 2rem; font-size: .95rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-secondary);
}
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--bg-card-hover); }
.table tbody tr:hover td { color: var(--text-primary); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: rgba(16,185,129,.15); color: var(--success); }
.badge-danger  { background: rgba(239,68,68,.15);  color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-info    { background: rgba(6,182,212,.15);  color: var(--info); }
.badge-muted   { background: rgba(148,163,184,.1); color: var(--text-muted); }
.badge-primary { background: rgba(99,102,241,.15); color: var(--accent-1); }
.badge-violet  { background: rgba(139,92,246,.15); color: var(--accent-2); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.show { display: flex; }
.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}
.modal-box.modal-lg { max-width: 800px; }
.modal-box.modal-xl { max-width: 1000px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 700; font-size: 1rem; }
.modal-close {
  width: 30px; height: 30px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   ALERTS / TOASTS
   ============================================================ */
.alert {
  padding: .85rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.2); color: var(--success); }
.alert-danger  { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.2);  color: var(--danger); }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.2); color: var(--warning); }
.alert-info    { background: rgba(6,182,212,.1);  border: 1px solid rgba(6,182,212,.2);  color: var(--info); }

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .85rem 1.2rem;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  animation: slideInRight .3s ease;
}
.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error   { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }
.toast.toast-info    { border-left: 4px solid var(--info); }

/* ============================================================
   PDV SPECIFIC
   ============================================================ */
.pdv-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1rem;
  height: calc(100vh - var(--header-h) - 3rem);
}
.pdv-left { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }
.pdv-right { display: flex; flex-direction: column; gap: 0; }
.pdv-cart {
  flex: 1;
  overflow-y: auto;
}
.pdv-cart-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.pdv-cart-item:hover { background: var(--bg-card-hover); }
.pdv-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .5rem;
}
.pdv-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .85rem .75rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.pdv-product-card:hover {
  border-color: var(--accent-1);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99,102,241,.2);
}
.pdv-product-card .pname { font-weight: 600; font-size: .8rem; margin-top: .4rem; }
.pdv-product-card .pprice { color: var(--accent-1); font-weight: 700; font-size: .85rem; }

/* ============================================================
   CYBER / JOGOS PANELS
   ============================================================ */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.station-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}
.station-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.station-card.disponivel { border-color: rgba(16,185,129,.25); }
.station-card.ocupado    { border-color: rgba(99,102,241,.4); }
.station-card.manutencao { border-color: rgba(245,158,11,.3); }
.station-card.reservado  { border-color: rgba(6,182,212,.3); }

.station-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: .4rem;
}
.status-disponivel { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-ocupado    { background: var(--accent-1); box-shadow: 0 0 6px var(--accent-1); animation: pulse 2s infinite; }
.status-manutencao { background: var(--warning); }
.status-reservado  { background: var(--info); }

.station-timer {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  color: var(--accent-1);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; gap: .25rem; }
.tab-btn {
  padding: .6rem 1.2rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-1); border-bottom-color: var(--accent-1); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   PROGRESS / LOADER
   ============================================================ */
.loader {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: auto;
}
.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent-grad);
  transition: width .4s;
}

/* ============================================================
   SEARCH & FILTERS
   ============================================================ */
.search-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.input-search-wrap {
  position: relative;
  flex: 1;
}
.input-search-wrap .search-icon {
  position: absolute;
  left: .8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
  pointer-events: none;
}
.input-search-wrap .form-control { padding-left: 2.4rem; }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.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; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: .8rem; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info    { color: var(--info); }
.text-accent  { color: var(--accent-1); }
.fw-bold { font-weight: 700; }
.fw-semi { font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: .3; }
.empty-state p { font-size: .9rem; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-fade-in { animation: fadeInUp .4s ease; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar, .app-header, .no-print { display: none !important; }
  .main-content { margin: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { border: 1px solid #ccc !important; background: #fff !important; }
  .table td, .table th { color: #000 !important; border-color: #ccc !important; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .pdv-layout { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   LIGHT MODE — OVERRIDES COMPLETOS
   ============================================================ */
[data-theme="light"] body {
  background: #F1F5F9;
  color: #0F172A;
}

/* Sidebar */
[data-theme="light"] .sidebar {
  background: #1E3A5F;
  border-right-color: rgba(0,0,0,.1);
}
[data-theme="light"] .sidebar-brand {
  border-bottom-color: rgba(255,255,255,.1);
}
[data-theme="light"] .sidebar-brand .brand-text {
  color: #fff;
}
[data-theme="light"] .sidebar-brand .brand-text span {
  color: rgba(255,255,255,.6);
}
[data-theme="light"] .nav-item {
  color: rgba(255,255,255,.7);
}
[data-theme="light"] .nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
[data-theme="light"] .nav-item.active {
  color: #fff;
  background: rgba(255,255,255,.18);
}
[data-theme="light"] .nav-section-title {
  color: rgba(255,255,255,.4);
}
[data-theme="light"] .nav-group .nav-group-toggle {
  color: rgba(255,255,255,.7);
}
[data-theme="light"] .nav-group .nav-group-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}
[data-theme="light"] .sidebar-footer {
  border-top-color: rgba(255,255,255,.1);
}
[data-theme="light"] .sidebar-user .user-name { color: #fff; }
[data-theme="light"] .sidebar-user .user-role { color: rgba(255,255,255,.6); }
[data-theme="light"] .sidebar-user .logout-btn { color: rgba(255,255,255,.5); }
[data-theme="light"] .sidebar-user .logout-btn:hover { color: #fca5a5; }

/* Header */
[data-theme="light"] .app-header {
  background: rgba(255,255,255,.95);
  border-bottom-color: rgba(0,0,0,.08);
}
[data-theme="light"] .header-title { color: #0F172A; }
[data-theme="light"] .header-btn {
  background: #F1F5F9;
  border-color: rgba(0,0,0,.1);
  color: #475569;
}
[data-theme="light"] .header-btn:hover { color: #0F172A; }

/* Cards */
[data-theme="light"] .card {
  background: #FFFFFF;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
[data-theme="light"] .card:hover {
  border-color: rgba(0,0,0,.15);
}
[data-theme="light"] .card-header {
  border-bottom-color: rgba(0,0,0,.07);
}
[data-theme="light"] .stat-card {
  background: #FFFFFF;
  border-color: rgba(0,0,0,.08);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* Formulários */
[data-theme="light"] .form-control,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}
[data-theme="light"] .form-control:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
  background: #fff;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
[data-theme="light"] .form-control::placeholder,
[data-theme="light"] .form-textarea::placeholder {
  color: #94A3B8;
}
[data-theme="light"] .form-select option {
  background: #fff;
  color: #0F172A;
}

/* Tabela */
[data-theme="light"] .table th {
  color: #475569;
  border-bottom-color: #E2E8F0;
  background: #F8FAFC;
}
[data-theme="light"] .table td {
  color: #334155;
  border-bottom-color: #F1F5F9;
}
[data-theme="light"] .table tbody tr:hover {
  background: #F8FAFC;
}
[data-theme="light"] .table tbody tr:hover td { color: #0F172A; }

/* Botões */
[data-theme="light"] .btn-secondary {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #334155;
}
[data-theme="light"] .btn-secondary:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
}

/* Modais */
[data-theme="light"] .modal-backdrop { background: rgba(15,23,42,.5); }
[data-theme="light"] .modal-box {
  background: #FFFFFF;
  border-color: rgba(0,0,0,.1);
}
[data-theme="light"] .modal-header { border-bottom-color: #E2E8F0; }
[data-theme="light"] .modal-footer { border-top-color: #E2E8F0; }

/* Alertas */
[data-theme="light"] .alert {
  border-color: rgba(0,0,0,.08);
}
[data-theme="light"] .alert-info    { background: rgba(6,182,212,.08); }
[data-theme="light"] .alert-success { background: rgba(16,185,129,.08); }
[data-theme="light"] .alert-warning { background: rgba(245,158,11,.08); }
[data-theme="light"] .alert-danger  { background: rgba(239,68,68,.08); }

/* Nav hover no modo claro */
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-group .nav-group-toggle:hover {
  background: rgba(255,255,255,.15);
}

/* Login box */
[data-theme="light"] .login-page {
  background: linear-gradient(135deg, #E0E7FF 0%, #F1F5F9 50%, #EDE9FE 100%);
}
[data-theme="light"] .login-box {
  background: rgba(255,255,255,.97);
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
}

/* Scrollbar */
[data-theme="light"] ::-webkit-scrollbar-track { background: #F1F5F9; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(99,102,241,.3); }

/* Toast */
[data-theme="light"] .toast {
  background: #FFFFFF;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}

/* PDV */
[data-theme="light"] .pdv-right,
[data-theme="light"] .pdv-left .card {
  background: #FFFFFF;
  border-color: rgba(0,0,0,.08);
}

/* Toasts + breadcrumb */
[data-theme="light"] .breadcrumb { color: #64748B; }
[data-theme="light"] .header-time { color: #64748B; }

/* Ícone do toggle de tema */
[data-theme="light"] .theme-toggle {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #475569;
}

/* ============================================================
   LIGHT MODE — LAYOUT PRINCIPAL E PÁGINAS LEGADAS
   ============================================================ */

/* Fundo principal da página */
html[data-theme="light"],
html[data-theme="light"] body {
  background-color: #F1F5F9 !important;
  color: #0F172A !important;
}

/* Área de conteúdo principal */
html[data-theme="light"] .page-content,
html[data-theme="light"] main {
  background-color: #F1F5F9;
}

/* Layout wrapper */
html[data-theme="light"] .app-layout,
html[data-theme="light"] .main-content {
  background-color: #F1F5F9;
}

/* Cards e painéis nas páginas legadas */
html[data-theme="light"] .card,
html[data-theme="light"] .modal-box,
html[data-theme="light"] .stat-card {
  background: #FFFFFF !important;
  border-color: rgba(0,0,0,.08) !important;
  color: #0F172A;
}

/* Cabeçalho das cards */
html[data-theme="light"] .card-header {
  background: #FAFAFA;
  border-bottom-color: rgba(0,0,0,.07) !important;
}

/* Títulos */
html[data-theme="light"] .card-title,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4 {
  color: #0F172A;
}

/* Textos secundários */
html[data-theme="light"] .text-muted,
html[data-theme="light"] .stat-label,
html[data-theme="light"] .breadcrumb {
  color: #64748B !important;
}

/* Tabelas */
html[data-theme="light"] .table-wrapper {
  background: #FFFFFF;
  border-radius: 12px;
}
html[data-theme="light"] .table thead tr {
  background: #F8FAFC;
}
html[data-theme="light"] .table th {
  color: #475569 !important;
  border-bottom-color: #E2E8F0 !important;
  background: #F8FAFC !important;
}
html[data-theme="light"] .table td {
  color: #334155 !important;
  border-bottom-color: #F1F5F9 !important;
}
html[data-theme="light"] .table tbody tr:hover {
  background: #F8FAFC !important;
}
html[data-theme="light"] .table tbody tr:hover td {
  color: #0F172A !important;
}

/* Formulários */
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] .form-textarea {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}
html[data-theme="light"] .form-label {
  color: #475569 !important;
}
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus {
  background: #fff !important;
}
html[data-theme="light"] .form-select option {
  background: #fff;
  color: #0F172A;
}

/* Botões secundários */
html[data-theme="light"] .btn-secondary {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #334155 !important;
}
html[data-theme="light"] .btn-secondary:hover {
  background: #E2E8F0 !important;
}

/* Modais */
html[data-theme="light"] .modal-backdrop {
  background: rgba(15,23,42,.5) !important;
}
html[data-theme="light"] .modal-header {
  border-bottom-color: #E2E8F0 !important;
}
html[data-theme="light"] .modal-footer {
  border-top-color: #E2E8F0 !important;
  background: #FAFAFA;
}

/* Badges */
html[data-theme="light"] .badge-muted {
  background: rgba(100,116,139,.1);
  color: #475569;
}

/* Page header */
html[data-theme="light"] .page-header h2 {
  color: #0F172A !important;
}

/* Alertas */
html[data-theme="light"] .alert {
  border-width: 1px;
}
html[data-theme="light"] .alert-info {
  background: rgba(6,182,212,.06) !important;
  color: #0e7490;
}
html[data-theme="light"] .alert-success {
  background: rgba(16,185,129,.06) !important;
  color: #065f46;
}
html[data-theme="light"] .alert-warning {
  background: rgba(245,158,11,.06) !important;
  color: #92400e;
}
html[data-theme="light"] .alert-danger {
  background: rgba(239,68,68,.06) !important;
  color: #991b1b;
}

/* Stat values */
html[data-theme="light"] .stat-value {
  color: #0F172A !important;
}

/* Empty states */
html[data-theme="light"] .empty-state p {
  color: #64748B;
}

/* Bordas gerais */
html[data-theme="light"] .border {
  border-color: #E2E8F0 !important;
}

/* Scrollbar no modo claro */
html[data-theme="light"] ::-webkit-scrollbar-track { background: #F1F5F9; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(99,102,241,.25); }

/* Nav items no sidebar (modo claro — sidebar é sempre escuro) */
html[data-theme="light"] #sidebar {
  background: #1e293b;
}
