/* ============================================================
   NexERP Design System — Electro Tech
   Inspired by AdminLTE · Professional · Impressive
   Brand: Orange #F05A00 · Blue #1E90FF · Yellow #FFD000
   ============================================================ */

/* ── GOOGLE FONT (Nunito — clean & modern like AdminLTE) ── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700;800&display=swap');

/* ── CSS VARIABLES ─────────────────────────────────────── */
:root {
  /* Brand */
  --orange:        #F05A00;
  --orange-dark:   #C84A00;
  --orange-light:  #FFF3EB;
  --blue:          #1E90FF;
  --blue-dark:     #0070DD;
  --blue-light:    #EBF5FF;
  --yellow:        #FFD000;
  --yellow-dark:   #D4A900;

  /* System */
  --primary:       #F05A00;
  --primary-dark:  #C84A00;
  --primary-light: #FFF3EB;

  /* Status */
  --success:       #28A745;
  --success-light: #D4EDDA;
  --danger:        #DC3545;
  --danger-light:  #F8D7DA;
  --warning:       #FFC107;
  --warning-light: #FFF3CD;
  --info:          #17A2B8;
  --info-light:    #D1ECF1;

  /* Sidebar — dark professional navy */
  --sb-bg:         #1B2033;
  --sb-bg-hover:   #252B40;
  --sb-bg-active:  rgba(240,90,0,0.15);
  --sb-border:     rgba(255,255,255,0.06);
  --sb-text:       #9BA3B8;
  --sb-text-hover: #FFFFFF;
  --sb-width:      260px;
  --sb-collapsed:  68px;

  /* Surface */
  --bg:            #F4F6F9;
  --card:          #FFFFFF;
  --border:        #DEE2E6;
  --text:          #212529;
  --text-muted:    #6C757D;
  --text-secondary:#495057;

  /* Topbar */
  --topbar-h:      57px;
  --topbar-bg:     #FFFFFF;

  /* Shadows */
  --shadow-xs:     0 0 1px rgba(0,0,0,0.05);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.14);
  --shadow-card:   0 0 1px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.07);

  /* Radius */
  --radius:        8px;
  --radius-sm:     6px;
  --radius-lg:     12px;

  --transition:    all 0.2s ease;

  /* Aliases — used across views */
  --accent:        #F05A00;
  --bg-white:      #FFFFFF;
  --bg-page:       #F4F6F9;
  --text-dark:     #212529;
  --green:         #28A745;
  --red:           #DC3545;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.5;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ── LAYOUT WRAPPER ─────────────────────────────────────── */
#erp-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
#sidebar {
  width: var(--sb-width);
  min-width: var(--sb-width);
  background: var(--sb-bg);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1),
              min-width 0.28s cubic-bezier(0.4,0,0.2,1);
  z-index: 1030;
  box-shadow: 4px 0 10px rgba(0,0,0,0.15);
}
#sidebar.collapsed {
  width: var(--sb-collapsed);
  min-width: var(--sb-collapsed);
}

/* ── Brand / Logo ── */
.sb-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}
.sb-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--yellow) 100%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(240,90,0,0.4);
}
.sb-logo-text {
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.sb-logo-sub {
  color: var(--yellow);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ── User Panel ── */
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 10px 10px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}
.sb-user:hover { background: rgba(255,255,255,0.07); }
.sb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(240,90,0,0.35);
}
.sb-user-name { color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.sb-user-role {
  color: var(--yellow);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  opacity: 0.85;
}

/* ── Nav scroll area ── */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0 20px;
}
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.sb-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Section labels ── */
.sb-menu { list-style: none; padding: 0; margin: 0; }
.sb-section {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(155,163,184,0.45);
  padding: 14px 20px 4px;
  white-space: nowrap;
  overflow: hidden;
}

/* ── Nav Items ── */
.sb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  margin: 1px 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  position: relative;
  border: none;
  background: none;
  width: calc(100% - 16px);
}
.sb-item:hover {
  background: var(--sb-bg-hover);
  color: var(--sb-text-hover);
  text-decoration: none;
}
.sb-item.active {
  background: var(--sb-bg-active);
  color: var(--orange);
}
.sb-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 22px;
  background: linear-gradient(180deg, var(--orange), var(--yellow));
  border-radius: 0 4px 4px 0;
}
.sb-item i {
  width: 20px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.sb-item:hover i, .sb-item.active i { opacity: 1; }
.sb-item .sb-label { flex: 1; }
.sb-item .sb-arrow {
  font-size: 9px;
  transition: transform 0.25s;
  opacity: 0.5;
}
.sb-item[aria-expanded="true"] .sb-arrow { transform: rotate(90deg); opacity: 1; }

/* ── Submenu ── */
.sb-submenu { list-style: none; padding: 2px 0; margin: 0; }
.sb-submenu .sb-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 45px;
  color: var(--sb-text);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  margin: 1px 8px;
  transition: all 0.18s ease;
  white-space: nowrap;
  position: relative;
}
.sb-submenu .sb-sub-item::before {
  content: '';
  position: absolute;
  left: 30px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}
.sb-submenu .sb-sub-item:hover {
  background: var(--sb-bg-hover);
  color: var(--sb-text-hover);
  text-decoration: none;
}
.sb-submenu .sb-sub-item:hover::before { opacity: 0.8; }
.sb-submenu .sb-sub-item.active {
  color: var(--orange);
  background: rgba(240,90,0,0.10);
  font-weight: 700;
}
.sb-submenu .sb-sub-item.active::before { opacity: 1; }

/* ── Collapsed sidebar ── */
#sidebar.collapsed .sb-logo-text,
#sidebar.collapsed .sb-logo-sub,
#sidebar.collapsed .sb-user-name,
#sidebar.collapsed .sb-user-role,
#sidebar.collapsed .sb-section,
#sidebar.collapsed .sb-label,
#sidebar.collapsed .sb-arrow,
#sidebar.collapsed .sb-submenu { display: none !important; }
#sidebar.collapsed .sb-item { justify-content: center; padding: 11px; margin: 2px 10px; }
#sidebar.collapsed .sb-user { justify-content: center; }
#sidebar.collapsed .sb-item i { width: auto; }
#sidebar.collapsed .sb-item.active::before { height: 28px; }

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════ */
#main-content {
  margin-left: var(--sb-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: auto;
  transition: margin-left 0.28s cubic-bezier(0.4,0,0.2,1);
}
#main-content.expanded { margin-left: var(--sb-collapsed); }

/* ══════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════ */
#topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

#sidebar-toggle {
  width: 34px; height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  transition: var(--transition);
}
#sidebar-toggle:hover {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  box-shadow: 0 2px 8px rgba(240,90,0,0.35);
}

.breadcrumb-nav {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.breadcrumb-nav a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.breadcrumb-nav a:hover { color: var(--orange); }
.breadcrumb-nav .bc-sep { opacity: 0.4; font-size: 12px; }
.breadcrumb-nav .bc-current { color: var(--orange); font-weight: 700; }

.topbar-icon-btn {
  width: 34px; height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); font-size: 14px;
  transition: var(--transition); position: relative; text-decoration: none;
}
.topbar-icon-btn:hover {
  background: var(--orange-light);
  color: var(--orange);
  border-color: var(--orange);
}
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--danger); color: #fff;
  font-size: 8.5px; font-weight: 800;
  border-radius: 8px; padding: 1px 4px;
  min-width: 16px; text-align: center;
  border: 2px solid #fff;
  line-height: 13px;
}

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 5px 12px;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-user:hover { border-color: var(--orange); background: var(--orange-light); }
.topbar-user-avatar {
  width: 27px; height: 27px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  box-shadow: 0 2px 6px rgba(240,90,0,0.3);
}

.date-filters { display: flex; gap: 6px; }
.filter-select {
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 12px; color: var(--text); background: var(--bg);
  outline: none; cursor: pointer; font-weight: 600;
}
.filter-select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,90,0,0.12); }

/* ══════════════════════════════════════════════════════════
   PAGE CONTENT
══════════════════════════════════════════════════════════ */
#page-content {
  flex: 1;
  padding: 22px 24px;
  animation: fadeInPage 0.22s ease;
}
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 {
  font-size: 21px; font-weight: 800; color: var(--text);
  letter-spacing: -0.4px; margin: 0; line-height: 1.2;
}
.page-header .page-subtitle {
  color: var(--text-muted); font-size: 12px; margin-top: 3px; font-weight: 500;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.08) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  padding: 20px;
  margin-bottom: 18px;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md) !important; }
.card-header-custom {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-header-custom h5, .card-header-custom h3 {
  font-size: 14px; font-weight: 700; color: var(--text); margin: 0;
}
.card h5 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px; }

/* ── Card with colored top border ── */
.card-bordered-orange { border-top: 3px solid var(--orange) !important; }
.card-bordered-blue   { border-top: 3px solid var(--blue) !important; }
.card-bordered-green  { border-top: 3px solid var(--success) !important; }

/* ══════════════════════════════════════════════════════════
   KPI CARDS (AdminLTE style — elevated with gradient icon)
══════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  transition: all 0.22s ease;
}
.kpi-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: -16px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.06;
  transition: transform 0.3s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi-card:hover::after { transform: scale(1.3); }

/* Colored top accent line */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kpi-card.blue::before   { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.kpi-card.blue::after    { background: var(--orange); }
.kpi-card.green::before  { background: linear-gradient(90deg, var(--success), #5cb85c); }
.kpi-card.green::after   { background: var(--success); }
.kpi-card.gold::before   { background: linear-gradient(90deg, var(--yellow-dark), var(--yellow)); }
.kpi-card.gold::after    { background: var(--yellow); }
.kpi-card.red::before    { background: linear-gradient(90deg, var(--danger), #f77); }
.kpi-card.red::after     { background: var(--danger); }
.kpi-card.cyan::before   { background: linear-gradient(90deg, var(--blue), #6ec6ff); }
.kpi-card.cyan::after    { background: var(--blue); }
.kpi-card.purple::before { background: linear-gradient(90deg, #7C3AED, #a78bfa); }
.kpi-card.purple::after  { background: #7C3AED; }

.kpi-body { flex: 1; min-width: 0; }
.kpi-value {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -0.6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.1;
}
.kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 600; }
.kpi-change { font-size: 11px; font-weight: 700; margin-top: 6px; }
.kpi-change.up   { color: var(--success); }
.kpi-change.down { color: var(--danger); }

.kpi-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.kpi-card.blue   .kpi-icon { background: linear-gradient(135deg, var(--orange), var(--yellow)); color: #fff; }
.kpi-card.green  .kpi-icon { background: linear-gradient(135deg, #28a745, #5cb85c); color: #fff; }
.kpi-card.gold   .kpi-icon { background: linear-gradient(135deg, var(--yellow-dark), var(--yellow)); color: #fff; }
.kpi-card.red    .kpi-icon { background: linear-gradient(135deg, var(--danger), #f77); color: #fff; }
.kpi-card.cyan   .kpi-icon { background: linear-gradient(135deg, var(--blue), #6ec6ff); color: #fff; }
.kpi-card.purple .kpi-icon { background: linear-gradient(135deg, #7C3AED, #a78bfa); color: #fff; }

/* ══════════════════════════════════════════════════════════
   CHARTS GRID
══════════════════════════════════════════════════════════ */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .charts-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px)  { .bottom-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.table-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap i {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 12px;
}
.search-input-wrap input {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; outline: none; background: var(--card);
  color: var(--text); font-weight: 500;
}
.search-input-wrap input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,90,0,0.10); }

table.table thead th {
  background: #F8F9FA;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--border) !important;
  border-top: none;
  padding: 10px 14px;
  white-space: nowrap;
  vertical-align: middle;
}
table.table tbody td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid #F2F4F6 !important;
  vertical-align: middle;
  color: var(--text-secondary);
}
table.table tbody tr:last-child td { border-bottom: none !important; }
table.table tbody tr:hover td { background: #FAFBFF !important; }
table.table-sm tbody td, table.table-sm thead th { padding: 8px 12px; }

/* Striped variant */
.table-striped tbody tr:nth-child(odd) td { background: #FAFAFA; }

/* ══════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════ */
.badge-nx {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge-nx::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-success { background: #D4EDDA; color: #155724 !important; }
.badge-danger  { background: #F8D7DA; color: #721C24 !important; }
.badge-warning { background: #FFF3CD; color: #856404 !important; }
.badge-info    { background: #D1ECF1; color: #0C5460 !important; }
.badge-primary { background: var(--orange-light); color: var(--orange-dark) !important; }
.badge-muted   { background: #F2F4F6; color: var(--text-muted) !important; border: 1px solid var(--border); }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
  border-radius: var(--radius-sm) !important;
  font-family: 'Nunito', 'Segoe UI', sans-serif !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  transition: all 0.18s ease !important;
  letter-spacing: 0.1px;
}

.btn-primary {
  background: var(--orange) !important;
  color: #fff !important;
  border-color: var(--orange) !important;
  box-shadow: 0 2px 8px rgba(240,90,0,0.30) !important;
}
.btn-primary:hover {
  background: var(--orange-dark) !important;
  border-color: var(--orange-dark) !important;
  box-shadow: 0 4px 14px rgba(240,90,0,0.40) !important;
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) !important; }

.btn-success {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(40,167,69,0.25) !important;
}
.btn-success:hover {
  background: #218838 !important;
  box-shadow: 0 4px 14px rgba(40,167,69,0.35) !important;
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(220,53,69,0.25) !important;
}
.btn-danger:hover { background: #C82333 !important; transform: translateY(-1px); }

.btn-warning {
  background: var(--yellow) !important;
  border-color: var(--yellow-dark) !important;
  color: #1a1a1a !important;
  box-shadow: 0 2px 8px rgba(255,208,0,0.25) !important;
}
.btn-warning:hover { background: var(--yellow-dark) !important; transform: translateY(-1px); }

.btn-info {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(30,144,255,0.25) !important;
}
.btn-info:hover { background: var(--blue-dark) !important; transform: translateY(-1px); }

.btn-outline-secondary {
  border-color: var(--border) !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
}
.btn-outline-secondary:hover {
  background: var(--bg) !important;
  border-color: var(--orange) !important;
  color: var(--orange) !important;
}

/* ══════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════ */
.form-control, .form-select {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-family: 'Nunito', 'Segoe UI', sans-serif !important;
  font-size: 13px !important;
  color: var(--text) !important;
  background: var(--card) !important;
  padding: 8px 12px !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
  font-weight: 500 !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px rgba(240,90,0,0.12) !important;
  outline: none !important;
}
.form-control::placeholder { color: #ADB5BD !important; font-weight: 400 !important; }
.form-label {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--text-secondary) !important;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 5px !important;
}
.form-text { font-size: 11px !important; color: var(--text-muted) !important; }
.input-group-text {
  background: #F8F9FA !important;
  border-color: var(--border) !important;
  font-size: 13px !important;
  color: var(--text-muted) !important;
}

/* Required star */
.text-danger { color: var(--danger) !important; }

/* ══════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════ */
.alert {
  border: none !important;
  border-left: 4px solid transparent !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 12px 16px !important;
}
.alert-success {
  background: var(--success-light) !important;
  color: #155724 !important;
  border-left-color: var(--success) !important;
}
.alert-danger {
  background: var(--danger-light) !important;
  color: #721C24 !important;
  border-left-color: var(--danger) !important;
}
.alert-warning {
  background: var(--warning-light) !important;
  color: #856404 !important;
  border-left-color: var(--warning) !important;
}
.alert-info {
  background: var(--info-light) !important;
  color: #0C5460 !important;
  border-left-color: var(--info) !important;
}

/* ══════════════════════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════════════════════ */
.pagination { gap: 3px; }
.pagination .page-link {
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 12px !important;
  transition: all 0.15s !important;
}
.pagination .page-link:hover {
  background: var(--orange-light) !important;
  border-color: var(--orange) !important;
  color: var(--orange) !important;
}
.pagination .page-item.active .page-link {
  background: var(--orange) !important;
  border-color: var(--orange) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(240,90,0,0.35) !important;
}
.pagination .page-item.disabled .page-link { opacity: 0.5 !important; }

/* ══════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════ */
.modal-content {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 18px 22px !important;
  background: #FAFAFA;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}
.modal-footer {
  border-top: 1px solid var(--border) !important;
  padding: 14px 22px !important;
  background: #FAFAFA;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}
.modal-title { font-size: 16px !important; font-weight: 800 !important; color: var(--text) !important; }
.btn-close:focus { box-shadow: none !important; }

/* Backdrop */
.modal-backdrop.show { opacity: 0.5 !important; backdrop-filter: blur(2px); }

/* ══════════════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════════════ */
.tabs-nx {
  display: flex; gap: 3px;
  background: #F0F2F5;
  border-radius: var(--radius-lg);
  padding: 4px;
  margin-bottom: 18px;
}
.tabs-nx .tab-btn {
  flex: 1; padding: 7px 16px;
  border: none; background: none;
  cursor: pointer; font-family: inherit; font-size: 13px;
  font-weight: 600; color: var(--text-muted);
  border-radius: 8px; transition: all 0.18s ease;
}
.tabs-nx .tab-btn.active {
  background: var(--card);
  color: var(--orange);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════════════════════════
   FILTER TABS  (.ftab / .ftab-period / .btn-filtrar)
   Used in facturas, cotações, proformas, VD and other list pages.
   Views may override with inline <style> — these are the fallback
   globals that guarantee visibility even without per-view styles.
══════════════════════════════════════════════════════════ */

/* Status pills — Todos / Pagas / Pendentes / Canceladas … */
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.ftab {
  display: inline-flex; align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.ftab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.ftab:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Period selector — Hoje / Por Mês / Dia / Intervalo */
.date-filter-bar {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}
.date-filter-bar .ftab-period {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.date-filter-bar .ftab-period.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(240,90,0,0.25);
}
.date-filter-bar .ftab-period:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-white);
}

/* Apply/search button */
.btn-filtrar {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(240,90,0,0.30);
}
.btn-filtrar:hover { opacity: 0.88; box-shadow: 0 4px 10px rgba(240,90,0,0.35); }
.btn-filtrar:active { opacity: 0.75; }

/* ══════════════════════════════════════════════════════════
   STAT ROW
══════════════════════════════════════════════════════════ */
.stat-row { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-item {
  flex: 1; min-width: 110px;
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.stat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-item .sv { font-size: 20px; font-weight: 800; color: var(--text); }
.stat-item .sl { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* ══════════════════════════════════════════════════════════
   PROGRESS BARS
══════════════════════════════════════════════════════════ */
.progress { height: 6px; border-radius: 4px; background: #E9ECEF; overflow: hidden; }
.progress-bar { border-radius: 4px; background: linear-gradient(90deg, var(--orange), var(--yellow)); }

/* ══════════════════════════════════════════════════════════
   TOASTR
══════════════════════════════════════════════════════════ */
.toast-top-right { top: 68px !important; right: 18px !important; }
#toast-container > div {
  border-radius: 10px !important;
  box-shadow: 0 8px 28px rgba(0,0,0,0.18) !important;
  font-size: 13px !important;
  font-family: 'Nunito', sans-serif !important;
  font-weight: 600 !important;
  padding: 12px 18px !important;
  opacity: 1 !important;
}
#toast-container .toast-success { background: var(--success) !important; }
#toast-container .toast-error   { background: var(--danger)  !important; }
#toast-container .toast-warning { background: #F59E0B !important; }
#toast-container .toast-info    { background: var(--blue)    !important; }

/* ══════════════════════════════════════════════════════════
   SELECT2 OVERRIDE
══════════════════════════════════════════════════════════ */
.select2-container--bootstrap-5 .select2-selection {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  min-height: 38px !important;
  font-size: 13px !important;
  font-family: 'Nunito', sans-serif !important;
}
.select2-container--bootstrap-5 .select2-selection--single:focus,
.select2-container--bootstrap-5 .select2-selection--single.select2-selection--focused {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px rgba(240,90,0,0.12) !important;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background: var(--orange) !important;
}

/* ══════════════════════════════════════════════════════════
   DATATABLES OVERRIDE
══════════════════════════════════════════════════════════ */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 5px 10px !important;
  font-size: 12px !important;
  font-family: 'Nunito', sans-serif !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px rgba(240,90,0,0.10) !important;
  outline: none !important;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
}

/* ══════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════ */
.text-primary-nx { color: var(--orange) !important; }
.text-blue       { color: var(--blue) !important; }
.text-green      { color: var(--success) !important; }
.text-red        { color: var(--danger) !important; }
.text-gold       { color: var(--yellow-dark) !important; }
.text-muted-nx   { color: var(--text-muted) !important; }
.fw-700 { font-weight: 700 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-800 { font-weight: 800 !important; }
.font-mono { font-family: 'Courier New', monospace; }
.gap-8  { gap: 8px !important; }
.gap-12 { gap: 12px !important; }
.mb-20  { margin-bottom: 20px !important; }
.mt-20  { margin-top: 20px !important; }

/* Info box style (AdminLTE inspired) */
.info-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  min-height: 80px;
  margin-bottom: 18px;
  border: 1px solid rgba(0,0,0,0.06);
}
.info-box-icon {
  width: 70px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff;
  flex-shrink: 0;
}
.info-box-content { padding: 12px 16px; flex: 1; }
.info-box-text { font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.4px; color: var(--text-muted); }
.info-box-number { font-size: 20px; font-weight: 800; color: var(--text); }

.bg-orange  { background: linear-gradient(135deg, var(--orange), var(--yellow)) !important; }
.bg-blue    { background: linear-gradient(135deg, var(--blue), #6ec6ff) !important; }
.bg-green   { background: linear-gradient(135deg, var(--success), #5cb85c) !important; }
.bg-red     { background: linear-gradient(135deg, var(--danger), #f77) !important; }

/* ══════════════════════════════════════════════════════════
   SWEETALERT2 OVERRIDE
══════════════════════════════════════════════════════════ */
.swal2-popup {
  border-radius: var(--radius-lg) !important;
  font-family: 'Nunito', sans-serif !important;
  padding: 28px !important;
}
.swal2-title { font-weight: 800 !important; font-size: 20px !important; color: var(--text) !important; }
.swal2-html-container { font-size: 14px !important; color: var(--text-muted) !important; }
.swal2-confirm { background: var(--orange) !important; border-radius: var(--radius-sm) !important; font-weight: 700 !important; }
.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(240,90,0,0.3) !important; }
.swal2-cancel { border-radius: var(--radius-sm) !important; font-weight: 700 !important; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
  }
  #main-content { margin-left: 0 !important; }
  #page-content { padding: 16px; }
  .date-filters { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}
@media (max-width: 576px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .stat-row { flex-wrap: wrap; }
  .page-header { flex-direction: column; align-items: flex-start; }
  #page-content { padding: 12px; }
}

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

/* ══════════════════════════════════════════════════════════
   NOTIFICAÇÕES — dropdown do topbar
══════════════════════════════════════════════════════════ */
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 20px;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  border: 2px solid var(--topbar-bg);
  line-height: 1;
}

.notif-dropdown {
  border: 1px solid rgba(0,0,0,0.08) !important;
}

.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--text);
}
.notif-marcar-btn {
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--accent);
  padding: 3px 6px; border-radius: 4px;
  transition: background 0.15s;
}
.notif-marcar-btn:hover { background: var(--orange-light); }

.notif-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 16px;
  border-bottom: 1px solid #F4F6F9;
  text-decoration: none; color: inherit;
  transition: background 0.12s;
  position: relative;
}
.notif-item:hover { background: #FAFBFF; text-decoration: none; color: inherit; }
.notif-item.unread { background: #FFF8F4; }

.notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-msg {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4;
}
.notif-time {
  font-size: 10px; color: #A0ABBB; margin-top: 3px; font-weight: 600;
}
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0; margin-top: 4px; align-self: flex-start;
}

.notif-empty {
  text-align: center; padding: 32px 16px;
  color: var(--text-muted); font-size: 13px;
  line-height: 1.8;
}
.notif-empty i { font-size: 28px; margin-bottom: 6px; display: block; }

/* ══════════════════════════════════════════════════════════
   SCROLLBAR (global)
══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ══════════════════════════════════════════════════════════
   INDEX PAGE — KPI CARDS / TABLE / FILTERS (shared)
══════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width:900px) { .kpi-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width:500px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi-card {
  background: var(--bg-white);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi-bar {
  position: absolute; top:0; left:0; right:0;
  height: 3px; border-radius: 14px 14px 0 0;
}
.kpi-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; margin-bottom: 10px;
}
.kpi-val  { font-size: clamp(12px, 1.35vw, 18px); font-weight: 700; color: var(--text-dark); line-height:1.2; overflow-wrap: anywhere; min-width: 0; }
.kpi-cur  { font-size: 9px; color: var(--text-muted); font-weight:500; margin-top:2px; }
.kpi-lbl  { font-size: 11px; color: var(--text-muted); margin-top:5px; }

.table-card {
  background: var(--bg-white);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow-x: auto;
}
.table-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.table-card-title { font-size:14px; font-weight:600; color:var(--text-dark); }

.export-btns { display:flex; gap:6px; flex-wrap:wrap; }
.exp-btn {
  padding: 5px 12px; border-radius:8px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 11px; font-weight:500;
  color: var(--text-muted); cursor:pointer;
  display: flex; align-items:center; gap:4px;
  transition: all 0.15s; text-decoration:none;
}
.exp-btn:hover { border-color:var(--accent); color:var(--accent); background:#EEF4FF; }

.filter-tabs { display:flex; gap:4px; flex-wrap:wrap; }

.search-wrap { position:relative; }
.search-wrap svg {
  position:absolute; left:10px; top:50%;
  transform:translateY(-50%); pointer-events:none;
}
.search-input {
  padding: 7px 12px 7px 32px;
  border-radius: 8px; border:1px solid var(--border);
  font-size:12px; color:var(--text-dark);
  background:var(--bg-page); outline:none; width:200px;
}
.search-input:focus { border-color:var(--accent); }

.erp-table { width:100%; border-collapse:collapse; }
.erp-table thead tr { background:var(--bg-page); }
.erp-table th {
  font-size:10px; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:0.8px;
  padding:10px 14px; font-weight:600; text-align:left;
  border-bottom:1px solid var(--border); white-space:nowrap;
}
.erp-table td {
  font-size:12px; color:var(--text-dark);
  padding:11px 14px; border-bottom:1px solid #F8F9FF;
  vertical-align:middle;
}
.erp-table tr:last-child td { border-bottom:none; }
.erp-table tbody tr:hover td { background:#FAFBFF; }

.num-link { color:var(--accent); font-weight:600; text-decoration:none; }
.num-link:hover { text-decoration:underline; }

.badge-status {
  display:inline-flex; align-items:center;
  padding:3px 10px; border-radius:20px;
  font-size:10px; font-weight:600;
}
.badge-pago        { background:#E8FBF4; color:#00A97A; }
.badge-pendente    { background:#FFF3E8; color:#D07800; }
.badge-nao-impresso{ background:#EEF4FF; color:#4F8EF7; }
.badge-cancelado   { background:#F0F2F8; color:#6B7A99; }
.badge-parcial     { background:#F3E8FF; color:#7B5EA7; }
.badge-aprovado    { background:#E8FBF4; color:#00A97A; }
.badge-rejeitado   { background:#FFECEC; color:#CC3333; }
.badge-confirmado  { background:#E8FBF4; color:#00A97A; }
.badge-finalizado  { background:#E8F4FF; color:#1E90FF; }
.badge-activo      { background:#E8FBF4; color:#00A97A; }
.badge-inactivo    { background:#FFECEC; color:#CC3333; }

.action-btn {
  width:28px; height:28px; border-radius:7px;
  border:1px solid var(--border); background:var(--bg-white);
  display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer; color:var(--text-muted);
  text-decoration:none; transition:all 0.15s; font-size:11px;
}
.action-btn:hover        { border-color:var(--accent); color:var(--accent); background:#EEF4FF; }
.action-btn.green:hover  { border-color:var(--green);  color:var(--green);  background:#E8FBF4; }
.action-btn.danger:hover { border-color:var(--red);    color:var(--red);    background:#FFECEC; }

.table-footer {
  padding:12px 20px; border-top:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between;
  font-size:11px; color:var(--text-muted);
}
.empty-state { text-align:center; padding:48px 20px; color:var(--text-muted); }
.empty-state i { font-size:36px; opacity:.2; display:block; margin-bottom:10px; }

.filter-inputs { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.filter-input {
  padding:6px 10px; border-radius:8px;
  border:1px solid var(--border); font-size:12px;
  color:var(--text-dark); background:var(--bg-page); outline:none;
}
.filter-input:focus { border-color:var(--accent); }
.periodo-label {
  margin-left:auto; font-size:11px; color:var(--text-muted);
  background:var(--bg-page); border:1px solid var(--border);
  border-radius:20px; padding:4px 12px; white-space:nowrap;
}

/* ══════════════════════════════════════════════════════════
   LAYOUT OVERFLOW FIXES
   Prevent any content from forcing the viewport wider.
   These rules use !important to override inline <style>
   blocks that views define locally (e.g. .table-card).
══════════════════════════════════════════════════════════ */
.table-card  { overflow-x: auto !important; }
.table-responsive { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
#page-content { min-width: 0; }
/* Auto-scroll wrapper injected by JS around Bootstrap .table elements */
.table-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
