/* ═══════════════════════════════════════════════════════════
   LCbank — Sistema de Comissões | Design System
   Paleta: Navy #030945 | Âmbar #FFA100 | Outfit font
   ══════════════════════════════════════════════════════════ */

:root {
  --sidebar-bg: #030945;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(255,255,255,0.15);
  --sidebar-text: rgba(255,255,255,0.6);
  --sidebar-text-active: #fff;
  --sidebar-width: 240px;

  --primary: #030945;
  --primary-dark: #020730;
  --primary-light: #e8eaf6;
  --accent: #FFA100;
  --accent-light: #fff8e6;

  --success: #059669;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --violet: #6366f1;
  --violet-light: #f5f3ff;

  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e7eb;
  --border-2: #d1d5db;

  --text: #111827;
  --text-2: #6b7280;
  --text-3: #9ca3af;

  --topbar-h: 60px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.15);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.35);

  --font: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; }

/* ═══ SCROLLBAR ══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

/* ═══ LOGIN ══════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #030945 0%, #051a6e 55%, #030945 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 48px 40px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  display: flex; align-items: center; gap: 16px; margin-bottom: 40px;
}
.login-logo {
  width: 52px; height: 52px; background: var(--primary);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -1px;
}
.login-brand h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.login-brand span { font-size: 13px; color: var(--text-2); }
.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-form .btn-block { margin-top: 8px; padding: 14px; font-size: 15px; }

/* ═══ LAYOUT ══════════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; }

/* ═══ SIDEBAR ════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo {
  width: 38px; height: 38px; background: rgba(255,255,255,0.12);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sidebar-name { display: block; font-size: 16px; font-weight: 700; color: #fff; }
.sidebar-subtitle { font-size: 11px; color: var(--sidebar-text); }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
  padding: 12px 12px 6px; margin-top: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500;
  color: var(--sidebar-text); transition: all .15s; margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-hover); color: rgba(255,255,255,0.9); }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-text-active); font-weight: 600; }
.nav-item svg { flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-details > span:first-child {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: rgba(255,255,255,0.45); text-transform: capitalize; }
.user-role-diretor {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  background: #FFA100; color: #030945; padding: 2px 8px;
  border-radius: 999px; text-transform: uppercase; display: inline-block;
}
.btn-logout {
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: 6px; color: rgba(255,255,255,0.35); display: flex; align-items: center;
  justify-content: center; transition: all .15s; flex-shrink: 0;
}
.btn-logout:hover { background: rgba(255,255,255,0.08); color: #ef4444; }

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

/* ═══ TOPBAR ═════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle {
  width: 36px; height: 36px; border: none; background: transparent;
  border-radius: var(--radius); display: none; align-items: center; justify-content: center;
  color: var(--text-2); transition: background .15s;
}
.sidebar-toggle:hover { background: var(--bg); }
#page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.select-sm {
  height: 34px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  font-size: 13px;
}

/* ═══ PAGE CONTENT ═══════════════════════════════════════ */
.page-content { flex: 1; padding: 24px; overflow-y: auto; }

/* ═══ CARDS ══════════════════════════════════════════════ */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.kpi-card.blue::before { background: var(--info); }
.kpi-card.green::before { background: var(--success); }
.kpi-card.amber::before { background: var(--accent); }
.kpi-card.red::before { background: var(--danger); }
.kpi-card.navy::before { background: var(--primary); }
.kpi-card.violet::before { background: var(--violet); }
.kpi-label { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text); margin: 8px 0 4px; line-height: 1; }
.kpi-value.sm { font-size: 21px; }
.kpi-sub { font-size: 12px; color: var(--text-3); }
.kpi-icon {
  position: absolute; right: 16px; top: 16px;
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; opacity: .12;
}
.kpi-card.blue .kpi-icon { background: var(--info); }
.kpi-card.green .kpi-icon { background: var(--success); }
.kpi-card.amber .kpi-icon { background: var(--accent); }

/* ═══ FORMS ══════════════════════════════════════════════ */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.field-group input, .field-group select, .field-group textarea {
  height: 38px; padding: 9px 12px; border: 1px solid var(--border-2);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s; width: 100%; font-size: 13px;
}
.field-group textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(3,9,69,0.1);
}
.field-group input.error { border-color: var(--danger); }
.field-group input[readonly] { background: var(--surface-2); cursor: not-allowed; color: var(--text-2); }
.field-group .field-hint { font-size: 11px; color: var(--text-3); }
.field-group .field-error { font-size: 11px; color: var(--danger); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-3 { grid-column: span 3; }
.form-section { margin-bottom: 24px; }
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ═══ BUTTONS ════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 18px; border: none; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; transition: all .15s; white-space: nowrap;
  cursor: pointer;
}
.btn svg { flex-shrink: 0; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #1a1000; }
.btn-warning:hover { background: #d97706; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ═══ TABLE ══════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg); }
th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--bg); }
.table-actions { display: flex; align-items: center; gap: 6px; }

/* ═══ BADGES ══════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-blue { background: var(--info-light); color: #1d4ed8; }
.badge-green { background: var(--success-light); color: #065f46; }
.badge-red { background: var(--danger-light); color: #991b1b; }
.badge-amber { background: var(--warning-light); color: #92400e; }
.badge-gray { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.badge-navy { background: #e8eaf6; color: var(--primary); }
.badge-violet { background: var(--violet-light); color: #4c1d95; }
.badge-diretor { background: #FFA100; color: #030945; }
.badge-juridica { background: #ede9fe; color: #5b21b6; }

/* ═══ ALERTS ═════════════════════════════════════════════ */
.alert {
  padding: 12px 16px; border-radius: var(--radius); font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: var(--info-light); color: #1d4ed8; border: 1px solid #93c5fd; }

/* ═══ MODAL ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 620px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal.modal-lg { max-width: 900px; }
.modal.modal-xl { max-width: 1100px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: var(--radius); font-size: 20px; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; line-height: 1;
}
.modal-close:hover { background: var(--bg); color: var(--danger); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}

/* ═══ TOAST ══════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 280px; max-width: 400px; padding: 14px 16px;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px; animation: slideIn .2s ease;
  font-size: 13px; font-weight: 500;
}
.toast-success { background: var(--primary); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #1a1000; }
.toast-info { background: var(--info); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(110%); opacity: 0; } }

/* ═══ PAGE SECTIONS ══════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-header-left h2 { font-size: 22px; font-weight: 800; color: var(--text); }
.page-header-left p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--surface); padding: 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); margin-bottom: 20px;
}
.filter-bar .field-group { min-width: 160px; flex: 1; }
.filter-bar .field-group label { font-size: 11px; }
.filter-bar .field-group input, .filter-bar .field-group select {
  height: 34px; font-size: 13px;
}

/* ═══ CHART CONTAINERS ═══════════════════════════════════ */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; margin-bottom: 24px; }
.chart-container { position: relative; height: 260px; }
.chart-container canvas { width: 100% !important; }

/* ═══ TABLES TOOLBAR ═════════════════════════════════════ */
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.table-toolbar-left { display: flex; align-items: center; gap: 10px; }
.table-toolbar input[type=text] {
  height: 34px; padding: 0 12px; border: 1px solid var(--border-2);
  border-radius: var(--radius); width: 240px; font-size: 13px;
}
.table-toolbar input[type=text]:focus { outline: none; border-color: var(--primary); }

/* ═══ STATUS DOTS ════════════════════════════════════════ */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--success); }
.dot-red { background: var(--danger); }
.dot-amber { background: var(--warning); }
.dot-blue { background: var(--info); }
.dot-gray { background: var(--text-3); }

/* ═══ PROGRESS BAR ══════════════════════════════════════ */
.progress { background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; transition: width .4s ease; }
.progress-bar.blue { background: var(--info); }
.progress-bar.green { background: var(--success); }
.progress-bar.amber { background: var(--warning); }
.progress-bar.red { background: var(--danger); }
.progress-bar.navy { background: var(--primary); }

/* ═══ WEEKLY GOAL SECTION ════════════════════════════════ */
.goal-section { margin-bottom: 24px; }
.goal-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.goal-row:last-child { border-bottom: none; }
.goal-seller { min-width: 140px; }
.goal-seller-name { font-size: 13px; font-weight: 600; color: var(--text); }
.goal-seller-week { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.goal-bar-wrap { flex: 1; }
.goal-bar-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-2); margin-bottom: 5px;
}
.goal-values { min-width: 180px; text-align: right; }
.goal-pct {
  font-size: 18px; font-weight: 800; line-height: 1;
}
.goal-pct.met { color: var(--success); }
.goal-pct.not-met { color: var(--danger); }
.goal-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.goal-chip {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  letter-spacing: 0.04em; margin-left: 8px; vertical-align: middle;
}
.goal-chip.met { background: var(--success-light); color: #065f46; }
.goal-chip.not-met { background: var(--danger-light); color: #991b1b; }

/* ═══ PAGINATION ═════════════════════════════════════════ */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; justify-content: center; }
.pagination button {
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination-info { font-size: 12px; color: var(--text-3); padding: 0 8px; }

/* ═══ EMPTY STATE ════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--text-2); text-align: center;
}
.empty-state svg { opacity: .3; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 13px; color: var(--text-2); }

/* ═══ RANKING ════════════════════════════════════════════ */
.ranking-list { display: flex; flex-direction: column; gap: 12px; }
.ranking-item { display: flex; align-items: center; gap: 12px; }
.ranking-pos {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--text-2); flex-shrink: 0;
}
.ranking-pos.top-1 { background: #fffbeb; color: #92400e; }
.ranking-pos.top-2 { background: #f1f5f9; color: #334155; }
.ranking-pos.top-3 { background: #fce7f3; color: #9d174d; }
.ranking-info { flex: 1; min-width: 0; }
.ranking-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-sub { font-size: 11px; color: var(--text-3); }
.ranking-value { font-size: 14px; font-weight: 700; color: var(--text); text-align: right; white-space: nowrap; }

/* ═══ TABS ═══════════════════════════════════════════════ */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; background: transparent; border: none;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .15s;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══ LOADING ════════════════════════════════════════════ */
.loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 40px; color: var(--text-2); font-size: 14px;
}
.spinner {
  width: 20px; height: 20px; border: 2.5px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ COMMISSION CALC ════════════════════════════════════ */
.calc-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border); gap: 16px;
}
.calc-item:last-child { border-bottom: none; }
.calc-item-info { flex: 1; }
.calc-item-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.calc-item-desc { font-size: 12px; color: var(--text-2); }
.calc-item-value { font-size: 16px; font-weight: 800; color: var(--success); white-space: nowrap; }
.calc-item-value.negative { color: var(--danger); }
.calc-total {
  background: linear-gradient(135deg, #030945, #0a1a7a);
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  color: #fff; margin-top: 16px;
}
.calc-total-label { font-size: 14px; font-weight: 600; opacity: .85; }
.calc-total-value { font-size: 24px; font-weight: 800; }

/* ═══ PROPOSAL STATUS ════════════════════════════════════ */
.status-cadastrada { color: var(--text-3); }
.status-validada { color: var(--success); }
.status-reprovada { color: var(--danger); }
.status-cancelada { color: var(--text-3); text-decoration: line-through; }
.status-pendente { color: var(--warning); }

/* ═══ RESPONSIVE ═════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-2, .form-grid .col-3 { grid-column: span 1; }
}
@media (max-width: 480px) {
  .page-content { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius) var(--radius) 0 0; align-self: flex-end; }
  input, select { font-size: 16px; }
  .btn { min-height: 40px; }
}

/* ═══ PRINT ══════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .page-actions, .filter-bar, .table-actions, .btn { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { padding: 0; }
}
