/* ============================================================
   ProvNet Financeiro — CSS Principal
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --color-primary: #0d6efd;
  --color-success: #198754;
  --color-danger:  #dc3545;
  --color-warning: #ffc107;
  --color-purple:  #6f42c1;
  --sidebar-bg:    #1a1d23;
  --sidebar-text:  #adb5bd;
  --sidebar-hover: #2c3040;
  --sidebar-active:#0d6efd;
}

/* ---- Reset / Base ---- */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 1.5rem; color: var(--color-primary); }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 6px;
  margin: 1px 8px;
  transition: background .15s, color .15s;
  font-size: 13.5px;
}
.nav-item:hover  { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--color-primary); color: #fff; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.nav-section {
  padding: 14px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-info { display: flex; align-items: center; gap: 10px; color: #fff; }
.user-info i { font-size: 28px; color: var(--sidebar-text); }

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin .25s ease;
}

.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sidebar-toggle { padding: 4px 8px; color: #666; }

.page-content { padding-top: 12px; }

/* Sidebar collapsed */
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main-content { margin-left: 0; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-card {
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 110px;
}
.kpi-card::before {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.kpi-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: .85;
}
.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .85;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.kpi-blue   { background: linear-gradient(135deg, #0d6efd, #3d8bfe); }
.kpi-green  { background: linear-gradient(135deg, #198754, #28a745); }
.kpi-red    { background: linear-gradient(135deg, #dc3545, #e04b5c); }
.kpi-purple { background: linear-gradient(135deg, #6f42c1, #9068d0); }

/* ============================================================
   CARDS GERAIS
   ============================================================ */
.card { border: 1px solid rgba(0,0,0,.08); border-radius: 10px; }
.card-header { background: #fff; border-bottom: 1px solid rgba(0,0,0,.08); padding: 12px 16px; }
.card-header.bg-primary  { background: #0d6efd !important; }
.card-header.bg-success  { background: #198754 !important; }
.card-header.bg-danger   { background: #dc3545 !important; }

/* ============================================================
   TABELAS
   ============================================================ */
.table { font-size: 13.5px; }
.table th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.table-hover tbody tr:hover { background: rgba(13,110,253,.04); }

/* ============================================================
   BADGES SOFT
   ============================================================ */
.bg-success-soft { background: rgba(25,135,84,.12) !important; }
.bg-danger-soft  { background: rgba(220,53,69,.12)  !important; }

/* ============================================================
   PDV — Preview Comprovante
   ============================================================ */
.preview-receipt {
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  background: linear-gradient(135deg, #1a1d23 0%, #0d1117 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px; height: 70px;
  background: var(--color-primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  font-size: 2rem;
  color: #fff;
}

/* ============================================================
   PAGINAÇÃO
   ============================================================ */
.pagination { flex-wrap: wrap; gap: 2px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .sidebar.show { transform: translateX(0); }
  .kpi-value { font-size: 1.2rem; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.fw-600 { font-weight: 600 !important; }
.text-sm { font-size: 12px !important; }
.border-dashed { border-style: dashed !important; }
