/* ============================================================
   PURITY UI THEME - NexusERP
   Inspirado no Purity UI Dashboard
   ============================================================ */

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

:root {
  --teal:        #4FD1C5;
  --teal-dark:   #38B2AC;
  --teal-light:  #E6FFFA;
  --navy:        #1A202C;
  --navy-card:   #1e2a3a;
  --text-1:      #2D3748;
  --text-2:      #4A5568;
  --text-3:      #718096;
  --text-4:      #A0AEC0;
  --border:      #E2E8F0;
  --bg:          #F8F9FA;
  --white:       #FFFFFF;
  --success:     #48BB78;
  --danger:      #FC8181;
  --warning:     #F6AD55;
  --info:        #63B3ED;
  --sidebar-w:   250px;
  --radius:      12px;
  --shadow:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:   0 10px 40px rgba(0,0,0,.12);
  --transition:  .2s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #4FD1C5, #38B2AC);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: .9rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.3px;
  text-transform: uppercase;
  font-size: .75rem;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-4);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--teal-light);
  color: var(--teal-dark);
}

.nav-item.active {
  background: linear-gradient(135deg, #4FD1C5, #38B2AC);
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(79,209,197,.35);
}

.nav-item .nav-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  background: rgba(79,209,197,.1);
  flex-shrink: 0;
  transition: all var(--transition);
}

.nav-item.active .nav-icon {
  background: rgba(255,255,255,.2);
}

.sidebar-help {
  margin: 16px 12px;
  background: linear-gradient(135deg, #4FD1C5 0%, #38B2AC 100%);
  border-radius: 14px;
  padding: 20px 16px;
  color: white;
  position: relative;
  overflow: hidden;
}

.sidebar-help::before {
  content: '';
  position: absolute;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  top: -30px; right: -20px;
}

.sidebar-help-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  font-size: 1rem;
}

.sidebar-help h4 { font-size: .88rem; font-weight: 700; margin-bottom: 4px; }
.sidebar-help p  { font-size: .75rem; opacity: .85; margin-bottom: 12px; }

.sidebar-help-btn {
  display: block;
  text-align: center;
  background: white;
  color: var(--teal-dark);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity var(--transition);
}

.sidebar-help-btn:hover { opacity: .9; }

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 12px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #4FD1C5, #38B2AC);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: .8rem; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: .7rem; color: var(--text-3); }

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 60px;
  background: rgba(248,249,250,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  z-index: 90;
}

.topbar-breadcrumb {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar-breadcrumb .crumb {
  font-size: .72rem;
  color: var(--text-3);
}

.topbar-breadcrumb .crumb a {
  color: var(--text-3);
  text-decoration: none;
}

.topbar-breadcrumb .page-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  height: 36px;
  width: 220px;
}

.topbar-search input {
  border: none;
  outline: none;
  font-size: .83rem;
  background: transparent;
  color: var(--text-1);
  width: 100%;
}

.topbar-search input::placeholder { color: var(--text-4); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn {
  width: 36px; height: 36px;
  border: none;
  background: var(--white);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}

.topbar-btn:hover { background: var(--teal-light); border-color: var(--teal); color: var(--teal-dark); }

.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.avatar { border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; background: linear-gradient(135deg,#4FD1C5,#38B2AC); display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:700;color:white; }

/* ── MAIN CONTENT ───────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  padding: 24px 28px;
}

.page-content { max-width: 1400px; }

/* ── STAT CARDS ─────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #4FD1C5, #38B2AC);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(79,209,197,.3);
}

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 2px; }
.stat-value { font-size: 1.3rem; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }
.stat-change { font-size: .72rem; font-weight: 600; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── CARDS ──────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  padding: 18px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--navy);
}

.card-subtitle {
  font-size: .75rem;
  color: var(--teal);
  font-weight: 600;
  margin-top: 2px;
}

.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

/* ── TABLES ─────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-4);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--teal-light); }

tbody td {
  padding: 12px 16px;
  color: var(--text-2);
  vertical-align: middle;
}

.td-main { font-weight: 600; color: var(--navy); }
.td-sub  { font-size: .75rem; color: var(--text-3); margin-top: 1px; }

/* Avatar na tabela */
.table-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-avatar img {
  width: 36px; height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.table-avatar-placeholder {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4FD1C5, #38B2AC);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: white;
  flex-shrink: 0;
}

/* Progress bars */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  width: 120px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4FD1C5, #38B2AC);
  border-radius: 99px;
  transition: width .5s ease;
}

/* ── BADGES ─────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.badge-success  { background: #C6F6D5; color: #276749; }
.badge-danger   { background: #FED7D7; color: #9B2C2C; }
.badge-warning  { background: #FEFCBF; color: #744210; }
.badge-info     { background: #BEE3F8; color: #2A4365; }
.badge-secondary{ background: #EDF2F7; color: #4A5568; }
.badge-online   { background: #C6F6D5; color: #276749; }
.badge-offline  { background: #EDF2F7; color: #718096; }

/* ── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: .83rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #4FD1C5, #38B2AC);
  color: white;
  box-shadow: 0 4px 15px rgba(79,209,197,.35);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(79,209,197,.45); }

.btn-secondary {
  background: var(--white);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-light); }

.btn-danger {
  background: var(--white);
  color: #E53E3E;
  border: 1px solid #FED7D7;
  font-size: .75rem;
  padding: 5px 12px;
}

.btn-danger:hover { background: #FFF5F5; }

.btn-sm { padding: 5px 12px; font-size: .76rem; border-radius: 8px; }
.btn-xs { padding: 3px 10px; font-size: .72rem; border-radius: 6px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 10px; }
.w-full { width: 100%; justify-content: center; }

/* ── FORMS ──────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: .76rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-label.required::after { content: ' *'; color: var(--danger); }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .85rem;
  color: var(--text-1);
  background: var(--white);
  transition: all var(--transition);
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(79,209,197,.15);
}

.form-control::placeholder { color: var(--text-4); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-control-sm { padding: 7px 12px; font-size: .8rem; border-radius: 8px; }

.form-row { display: flex; gap: 16px; }
.form-row.cols-2 > * { flex: 1; }
.form-row.cols-3 > * { flex: 1; }

/* ── GRID ───────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── ALERTS ─────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-success { background: #F0FFF4; color: #276749; border-color: #C6F6D5; }
.alert-error   { background: #FFF5F5; color: #9B2C2C; border-color: #FED7D7; }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.alert-info    { background: #EBF8FF; color: #2A4365; border-color: #BEE3F8; }
.alert-close   { background: none; border: none; cursor: pointer; opacity: .6; font-size: 1.1rem; padding: 0; flex-shrink: 0; }

/* ── PAGE HEADER ────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.page-subtitle { font-size: .8rem; color: var(--text-3); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── DROPDOWN ───────────────────────────────── */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 6px;
  z-index: 200;
  display: none;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .84rem;
  color: var(--text-2);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.dropdown-item:hover { background: var(--teal-light); color: var(--teal-dark); }
.dropdown-item.danger { color: #E53E3E; }
.dropdown-item.danger:hover { background: #FFF5F5; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── TRANSACTION LIST (Billing) ─────────────── */
.tx-list { display: flex; flex-direction: column; gap: 0; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.tx-item:last-child { border-bottom: none; }
.tx-item:hover { background: var(--teal-light); }

.tx-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

.tx-icon.in  { background: #C6F6D5; }
.tx-icon.out { background: #FED7D7; }
.tx-icon.pending { background: #EDF2F7; }

.tx-info { flex: 1; }
.tx-name { font-size: .85rem; font-weight: 600; color: var(--navy); }
.tx-date { font-size: .73rem; color: var(--text-3); }

.tx-amount { font-size: .9rem; font-weight: 700; }
.tx-amount.in { color: #38A169; }
.tx-amount.out { color: #E53E3E; }
.tx-amount.pending { color: var(--text-3); }

.tx-group-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-4);
  padding: 10px 16px 6px;
}

/* ── CREDIT CARD ────────────────────────────── */
.credit-card {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
  border-radius: 16px;
  padding: 24px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 160px;
}

.credit-card::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  top: -60px; right: -40px;
}

.credit-card::after {
  content: '';
  position: absolute;
  width: 150px; height: 150px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
  bottom: -40px; left: -30px;
}

.card-brand { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; opacity: .7; margin-bottom: 20px; }
.card-number { font-size: 1.3rem; font-weight: 700; letter-spacing: .1em; margin-bottom: 16px; font-family: monospace; }
.card-meta { display: flex; gap: 24px; font-size: .72rem; }
.card-meta-label { opacity: .6; font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; }
.card-meta-value { font-weight: 600; }
.card-chip {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

/* ── INVOICE LIST ───────────────────────────── */
.invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .84rem;
}

.invoice-item:last-child { border-bottom: none; }

.invoice-date { color: var(--navy); font-weight: 600; }
.invoice-ref  { font-size: .72rem; color: var(--text-3); margin-top: 1px; }
.invoice-amount { font-weight: 700; color: var(--navy); }
.invoice-pdf  { font-size: .72rem; color: var(--text-3); margin-left: 8px; cursor: pointer; }
.invoice-pdf:hover { color: var(--teal-dark); }

/* ── BILLING INFO ───────────────────────────── */
.billing-info-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.billing-info-item:last-child { border-bottom: none; }

.billing-info-name { font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.billing-info-detail { font-size: .78rem; color: var(--text-3); line-height: 1.6; }
.billing-info-detail strong { color: var(--text-2); }

.billing-info-actions { display: flex; gap: 8px; flex-shrink: 0; }
.billing-del { color: #E53E3E; font-size: .76rem; font-weight: 600; cursor: pointer; text-decoration: none; display:flex;align-items:center;gap:4px; }
.billing-del:hover { color: #C53030; }
.billing-edit { color: var(--text-3); font-size: .76rem; font-weight: 600; cursor: pointer; text-decoration: none; display:flex;align-items:center;gap:4px; }
.billing-edit:hover { color: var(--navy); }

/* ── PAYMENT METHOD CARDS ───────────────────── */
.payment-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  transition: all var(--transition);
}

.payment-card:hover { border-color: var(--teal); }

.payment-brand {
  width: 42px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700;
}

.payment-brand.mc   { background: linear-gradient(135deg,#EB001B,#F79E1B); color: white; }
.payment-brand.visa { background: #1A1F71; color: white; }

/* ── EMPTY STATE ────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3   { font-size: 1rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-state p    { font-size: .84rem; margin-bottom: 20px; }

/* ── PAGINATOR ──────────────────────────────── */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 16px 0; }

.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--white);
  transition: all var(--transition);
}

.page-link:hover, .page-link.active {
  background: linear-gradient(135deg, #4FD1C5, #38B2AC);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(79,209,197,.3);
}

/* ── UTILITIES ──────────────────────────────── */
.mb-0 { margin-bottom: 0 !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mt-8  { margin-top: 8px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-24 { margin-top: 24px !important; }
.p-20  { padding: 20px !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.text-muted   { color: var(--text-3) !important; }
.text-primary { color: var(--teal-dark) !important; }
.text-success { color: #38A169 !important; }
.text-danger  { color: #E53E3E !important; }
.text-warning { color: #D69E2E !important; }
.text-center  { text-align: center !important; }
.text-sm      { font-size: .8rem !important; }
.text-xs      { font-size: .72rem !important; }
.d-flex       { display: flex !important; }
.align-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-8  { gap: 8px !important; }
.gap-16 { gap: 16px !important; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); width: 250px; }
  .sidebar.open { transform: translateX(0); --sidebar-w: 250px; }
  .topbar { left: 0; }
  .main-wrap { margin-left: 0; padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  #mobile-menu-btn { display: flex !important; }
}

/* ── SCROLLBAR ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #A0AEC0; }

/* ── CHART CONTAINERS ───────────────────────── */
.chart-container { position: relative; }

/* ── DARK CARD (usado no dashboard) ─────────── */
.card-dark {
  background: var(--navy-card);
  border-radius: var(--radius);
  border: none;
  color: white;
  overflow: hidden;
}

.card-dark .card-header { border-bottom-color: rgba(255,255,255,.1); }
.card-dark .card-title  { color: white; }

/* ── MODALS ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,32,44,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modalIn .2s cubic-bezier(.34,1.56,.64,1);
}

.modal-lg { max-width: 680px; }
.modal-xl { max-width: 900px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.modal-close {
  width: 30px; height: 30px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: #FED7D7; color: #E53E3E; }

.modal form,
.modal .modal-body { padding: 20px 24px; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 16px 16px;
}

.btn-success {
  background: linear-gradient(135deg, #48BB78, #38A169);
  color: white;
  box-shadow: 0 4px 15px rgba(72,187,120,.3);
}

.btn-success:hover { box-shadow: 0 6px 20px rgba(72,187,120,.4); }

/* ── AUTOCOMPLETE ────────────────────────────── */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 4px;
}

.ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  font-size: .84rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--teal-light); }
.ac-item strong { color: var(--navy); font-weight: 600; }
.ac-item span { color: var(--teal-dark); font-weight: 700; font-size: .82rem; }
.ac-item small { color: var(--text-3); font-size: .72rem; }
