/* =====================================================
   BrokerApp — Main Stylesheet
   Adapted from PropManager design system
   Fonts: DM Serif Display + DM Sans
   ===================================================== */

:root {
    --bg: #F7F5F0;
    --surface: #FFFFFF;
    --surface2: #F0EDE6;
    --border: #E2DDD4;
    --text: #1A1714;
    --text-muted: #6B6560;
    --text-light: #9E9891;

    --sidebar-bg: #1A1714;
    --sidebar-text: #C8C3BB;
    --sidebar-active: #F7F5F0;
    --sidebar-accent: #C9A84C;

    --accent: #C9A84C;
    --accent-light: #E7D7A6;
    --accent-dark: #b8943a;

    --success: #2D7A4F;
    --success-light: #E6F4ED;
    --danger: #C0392B;
    --danger-light: #FDECEA;
    --warning: #D4870A;
    --warning-light: #FEF3DC;
    --info: #2563EB;
    --info-light: #EFF6FF;
    --purple: #7C3AED;
    --purple-light: #EDE9FE;

    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);

    --sidebar-w: 260px;
    --topbar-h: 60px;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }

/* ================= LOGIN ================= */
.login-page { min-height: 100vh; display: flex; }
.login-split { display: flex; width: 100%; min-height: 100vh; }
.login-left {
    width: 45%; background: var(--sidebar-bg);
    display: flex; flex-direction: column; justify-content: center;
    padding: 60px; position: relative; overflow: hidden;
}
.login-left::before {
    content: ''; position: absolute; top: -100px; right: -100px;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(200,150,60,0.15) 0%, transparent 70%);
}
.login-brand .brand-icon { font-size: 48px; color: var(--accent); display: block; margin-bottom: 20px; }
.login-brand h1 { font-family: var(--font-serif); font-size: 42px; color: #fff; margin-bottom: 16px; letter-spacing: -1px; }
.login-brand p { color: var(--sidebar-text); font-size: 16px; font-weight: 300; max-width: 320px; line-height: 1.7; }
.login-stats { display: flex; gap: 32px; margin-top: 60px; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-serif); font-size: 32px; color: var(--accent); }
.stat-label { color: var(--sidebar-text); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.login-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.tab-switch { display: flex; background: var(--surface2); border-radius: var(--radius); padding: 4px; margin-bottom: 32px; }
.tab-btn { flex: 1; padding: 10px; border: none; background: transparent; border-radius: calc(var(--radius) - 2px); font-family: var(--font-sans); font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content h2 { font-family: var(--font-serif); font-size: 26px; margin-bottom: 6px; }
.form-subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }

/* ================= FORMS ================= */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-family: var(--font-sans); font-size: 14px; color: var(--text); background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s; outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,150,60,0.12); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ================= BUTTONS ================= */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; background: var(--text); color: #fff; border: none; border-radius: var(--radius); font-family: var(--font-sans); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-primary.full { width: 100%; }
.btn-arrow { transition: transform 0.2s; }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }
.btn-secondary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: transparent; color: var(--text); border: 1.5px solid var(--border); border-radius: var(--radius); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--danger-light); color: var(--danger); border: 1px solid rgba(192,57,43,0.2); border-radius: var(--radius); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--success-light); color: var(--success); border: 1px solid rgba(45,122,79,0.2); border-radius: var(--radius); font-family: var(--font-sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }
.btn-accent { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--accent-light); color: var(--accent-dark); border: 1px solid rgba(200,150,60,0.3); border-radius: var(--radius); font-family: var(--font-sans); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-accent:hover { background: var(--accent); color: #fff; }

/* ================= ALERTS ================= */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px; }
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(192,57,43,0.2); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(45,122,79,0.2); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(212,135,10,0.2); }
.alert-info { background: var(--info-light); color: var(--info); border: 1px solid rgba(37,99,235,0.2); }
.hidden { display: none !important; }

/* ================= APP LAYOUT ================= */
.app-body { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform 0.3s ease; overflow-y: auto; }
.sidebar-header { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header .brand-icon { font-size: 20px; color: var(--accent); }
.brand-name { font-family: var(--font-serif); color: #fff; font-size: 18px; flex: 1; }
.sidebar-close { display: none; background: none; border: none; color: var(--sidebar-text); cursor: pointer; font-size: 18px; }
.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.3); padding: 16px 8px 6px; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; font-weight: 400; transition: all 0.15s; margin-bottom: 2px; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(200,150,60,0.15); color: var(--accent); font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar { width: 36px; height: 36px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 14px; flex-shrink: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 500; display: block; }
.user-role { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.role-super_admin { background: rgba(200,150,60,0.3); color: var(--accent); }
.role-admin { background: rgba(139,92,246,0.2); color: #A78BFA; }
.role-broker { background: rgba(37,99,235,0.2); color: #60A5FA; }
.btn-logout { display: block; text-align: center; padding: 8px; background: rgba(255,255,255,0.06); color: var(--sidebar-text); border-radius: var(--radius); text-decoration: none; font-size: 12px; transition: all 0.2s; cursor: pointer; border: none; width: 100%; font-family: var(--font-sans); }
.btn-logout:hover { background: var(--danger); color: #fff; }

/* MAIN CONTENT */
.main-content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.top-bar { 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; }
.menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
.top-bar-right { display: flex; align-items: center; gap: 16px; }
.top-date { color: var(--text-muted); font-size: 13px; }

/* SECTIONS */
.section { display: none; padding: 28px; }
.section.active { display: block; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.page-header h1 { font-family: var(--font-serif); font-size: 30px; letter-spacing: -0.5px; line-height: 1.2; }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.card-title { font-family: var(--font-serif); font-size: 18px; margin-bottom: 4px; }
.card-subtitle { color: var(--text-muted); font-size: 12px; margin-bottom: 20px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--border); }
.stat-card.accent::before { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }
.stat-card.purple::before { background: var(--purple); }
.stat-card-icon { font-size: 24px; margin-bottom: 12px; }
.stat-card-value { font-family: var(--font-serif); font-size: 32px; line-height: 1; margin-bottom: 4px; }
.stat-card-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* TABLES */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th { text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--bg); }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.badge-nuevo       { background: var(--info-light); color: var(--info); }
.badge-contactado  { background: var(--accent-light); color: var(--accent-dark); }
.badge-seguimiento { background: var(--warning-light); color: var(--warning); }
.badge-calificado  { background: var(--purple-light); color: var(--purple); }
.badge-cerrado     { background: var(--success-light); color: var(--success); }
.badge-perdido     { background: var(--danger-light); color: var(--danger); }
.badge-pendiente   { background: var(--warning-light); color: var(--warning); }
.badge-aprobado    { background: var(--success-light); color: var(--success); }
.badge-activo      { background: var(--success-light); color: var(--success); }
.badge-inactivo    { background: var(--danger-light); color: var(--danger); }
.badge-super_admin { background: rgba(200,150,60,0.15); color: var(--accent-dark); }
.badge-admin       { background: var(--purple-light); color: var(--purple); }
.badge-broker      { background: var(--info-light); color: var(--info); }
.badge-dealer      { background: #EFF6FF; color: #1D4ED8; }
.role-dealer       { background: rgba(29,78,216,0.2); color: #60A5FA; }
.badge-otd-aprobado { background: #ECFDF5; color: #065F46; }
.badge-en-dealer   { background: #EFF6FF; color: #1D4ED8; }
.badge-en-cotizacion { background: #FEF3C7; color: #92400E; }

/* PIPELINE KANBAN */
.pipeline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.pipeline-col { background: var(--surface2); border-radius: var(--radius); padding: 12px; min-height: 100px; }
.pipeline-col-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.pipeline-count { background: var(--border); color: var(--text-muted); border-radius: 10px; padding: 0 6px; font-size: 10px; }
.pipeline-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.pipeline-item:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.pipeline-item-name { font-weight: 600; margin-bottom: 2px; }
.pipeline-item-meta { font-size: 11px; color: var(--text-muted); }

/* CADENA TRAZABILIDAD */
.cadena-trace { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.cadena-node { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.cadena-arrow { color: var(--text-muted); font-size: 14px; }

/* GRID */
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.content-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.col-span-2 { grid-column: span 2; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; top: 16px; right: 16px; background: var(--surface2); border: none; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; color: var(--text-muted); transition: all 0.2s; }
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-title { font-family: var(--font-serif); font-size: 22px; margin-bottom: 6px; }
.modal-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }

/* TOAST */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 14px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; z-index: 300; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease; max-width: 320px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* MISC */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state h3 { font-family: var(--font-serif); font-size: 20px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 300px; margin: 0 auto 20px; }
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.hint-text { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 16px; }
.hint-text a { color: var(--accent); text-decoration: none; font-weight: 600; }
.notif-badge { background: var(--danger); color: #fff; border-radius: 10px; font-size: 10px; font-weight: 700; padding: 1px 6px; }

@media (max-width: 900px) {
    .login-left { display: none; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .menu-toggle { display: block; }
    .main-content { margin-left: 0; }
    .content-grid, .content-grid-3 { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .section { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 24px; }
}

/* ═══ CALCULADORA OTD ═══════════════════════════════════════════ */
.calc-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.calc-label { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; display:block; margin-bottom:4px; }
.calc-input { width:100%; font-size:13px; padding:8px 10px; border-radius:var(--radius); border:1.5px solid var(--border); background:var(--surface); color:var(--text); font-family:var(--font-sans); transition:border-color .2s; outline:none; }
.calc-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(200,150,60,.12); }
.calc-select { width:100%; font-size:13px; padding:8px 10px; border-radius:var(--radius); border:1.5px solid var(--border); background:var(--surface); color:var(--text); font-family:var(--font-sans); cursor:pointer; outline:none; }
.calc-group { margin-bottom:12px; }
.calc-group:last-child { margin-bottom:0; }
.otd-header { background:var(--sidebar-bg); border-radius:var(--radius-lg); padding:16px 20px; border:1px solid rgba(200,150,60,.3); margin-bottom:12px; }
.otd-lbl { font-size:9px; color:rgba(200,150,60,.7); letter-spacing:.1em; text-transform:uppercase; margin-bottom:2px; }
.otd-big { font-size:32px; font-weight:700; color:var(--accent); letter-spacing:-.5px; }
.otd-sub { font-size:11px; color:#666; margin-top:2px; }
.otd-pills { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:12px; }
.otd-pill { background:var(--surface2); border-radius:var(--radius); padding:10px 12px; }
.otd-pill-lbl { font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:2px; }
.otd-pill-val { font-size:15px; font-weight:700; color:var(--text); }
.bk-row { display:flex; justify-content:space-between; align-items:flex-start; padding:6px 0; }
.bk-border { border-bottom:1px solid var(--border); }
.bk-label { font-size:13px; color:var(--text); }
.bk-note { font-size:10px; color:var(--text-muted); margin-top:1px; }
.bk-val { font-size:13px; font-weight:600; color:var(--text); }
.bk-total { display:flex; justify-content:space-between; padding:8px 0 0; border-top:2px solid var(--border); margin-top:4px; font-size:14px; font-weight:700; color:var(--accent); }
.btn-scan { background:var(--accent-light); color:var(--accent-dark); border:1px solid rgba(200,150,60,.3); padding:5px 12px; border-radius:var(--radius); font-size:11px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:4px; transition:all .2s; font-family:var(--font-sans); }
.btn-scan:hover { background:var(--accent); color:#fff; }
.btn-wa { background:#25D366; color:#fff; border:none; padding:10px 20px; border-radius:var(--radius); font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:6px; font-family:var(--font-sans); transition:all .2s; }
.btn-wa:hover { background:#128C7E; }
/* Broker home panel */
.bk-metrics { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:20px; }
.bk-metric { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px 20px; }
.bk-metric-lbl { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px; }
.bk-metric-val { font-size:28px; font-weight:700; font-family:var(--font-serif); }
.bk-metric-val.gold { color:var(--accent); }
.bk-metric-val.red  { color:var(--danger); }
.bk-metric-val.green{ color:var(--success); }
.bk-metric-sub { font-size:11px; color:var(--text-muted); margin-top:2px; }
.accion-list { display:flex; flex-direction:column; gap:8px; }
.accion-item { display:flex; align-items:center; gap:10px; padding:10px 12px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.accion-dot { width:8px; height:8px; border-radius:50%; background:var(--danger); flex-shrink:0; }
.accion-name { font-size:13px; font-weight:600; flex:1; }
.accion-sub { font-size:11px; color:var(--text-muted); }
.pipeline-tag { display:inline-flex; align-items:center; padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600; margin:2px; }
@media(max-width:900px) {
    .calc-grid { grid-template-columns:1fr; }
    .bk-metrics { grid-template-columns:1fr 1fr; }
    .otd-pills { grid-template-columns:1fr; }
}

/* ═══ DEALER PANEL RESPONSIVE ══════════════════════════════════ */
.dl-card { display:flex; flex-wrap:wrap; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow); }
.dl-card-body { padding:16px 20px; flex:1; min-width:260px; }
.dl-card-actions { background:var(--bg); padding:16px; display:flex; flex-direction:column; gap:8px; justify-content:center; border-left:1px solid var(--border); min-width:130px; }

/* Make stats responsive for dealer */
@media(max-width:600px) {
    .dl-card-actions { border-left:none; border-top:1px solid var(--border); width:100%; flex-direction:row; flex-wrap:wrap; }
    .dl-card-actions select { flex:1; min-width:140px; }
    .stats-grid { grid-template-columns:1fr 1fr !important; }
}
@media(max-width:400px) {
    .stats-grid { grid-template-columns:1fr !important; }
}

/* ═══ DEALER FULL WIDTH LAYOUT ══════════════════════════════════ */
.role-dealer-body .main-content { margin-left: var(--sidebar-w); }
.role-dealer-body #sec-dl-home { display:block !important; }
.role-dealer-body #dl-stats-grid { 
    display: grid !important; 
    grid-template-columns: repeat(4,1fr) !important; 
    gap: 16px;
}
@media(max-width:900px) {
    .role-dealer-body #dl-stats-grid { grid-template-columns: repeat(2,1fr) !important; }
}
@media(max-width:500px) {
    .role-dealer-body #dl-stats-grid { grid-template-columns: 1fr !important; }
}

