:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface2: #f2f3fc;
    --surface3: #e4eaf3;
    --border: #e0e6f0;
    --border2: #ccd6e8;
    --navy: #0b1f3a;
    --navy2: #162d52;
    --accent: #0057ff;
    --accent-light: rgba(0,87,255,0.08);
    --accent-hover: #0046cc;
    --green: #00b87a;
    --green-light: rgba(0,184,122,0.1);
    --red: #e53e5a;
    --red-light: rgba(229,62,90,0.1);
    --yellow: #f59e0b;
    --yellow-light: rgba(245,158,11,0.1);
    --orange: #f97316;
    --text: #0b1f3a;
    --text2: #3a4f6e;
    --muted: #7a90b0;
    --font-head:"Outfit", sans-serif;
    --font-body:"Outfit", sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(11,31,58,0.06), 0 4px 12px rgba(11,31,58,0.04);
    --shadow-md: 0 4px 16px rgba(11,31,58,0.10), 0 1px 4px rgba(11,31,58,0.06);
  }
 
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { background: var(--bg); color: var(--text); font-family: var(--font-body);font-size:17px; min-height: 100vh; -webkit-font-smoothing: antialiased; }

  /* ── LUCIDE ICONS via inline SVG helper ── */
  .ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .ico svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .ico-lg svg { width: 20px; height: 20px; }
  .ico-sm svg { width: 14px; height: 14px; }

  /* ── AUTH ── */
  #auth-screen {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0b1f3a 0%, #1a3a6e 50%, #0b2d5c 100%);
    position: relative; overflow: hidden;
  }
  #auth-screen::before {
    content: ''; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }
  .auth-box {
    background: var(--surface); border-radius: 20px; padding: 48px;
    width: 420px; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.24); position: relative;
  }
  .auth-logo-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
  .auth-logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent), #3b82f6); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
  .auth-logo-icon svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .auth-logo { font-family: var(--font-head); font-size: 26px; font-weight: 800; color: var(--navy); letter-spacing: -0.5px; }
  .auth-logo span { color: var(--accent); }
  .auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }
  .auth-tabs { display: flex; gap: 0; margin-bottom: 28px; background: var(--surface2); border-radius: var(--radius-sm); padding: 4px; border: 1px solid var(--border); }
  .auth-tab { flex: 1; padding: 10px; border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; font-family: var(--font-body); font-size: 14px; font-weight: 500; transition: all .2s; }
  .auth-tab.active { background: var(--surface); color: var(--navy); font-weight: 600; box-shadow: var(--shadow); }
  .auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
  .auth-form label { font-size: 12px; font-weight: 600; color: var(--text2); letter-spacing: .3px; display: block; margin-bottom: 4px; }
  .auth-form input, .auth-form select {
    background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
    color: var(--text); font-family: var(--font-body); font-size: 14px; outline: none; transition: all .2s; width: 100%;
  }
  .auth-form input:focus, .auth-form select:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(0,87,255,0.1); }
  .btn-primary {
    background: linear-gradient(135deg, var(--accent), #3b82f6); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 13px; font-family: var(--font-head); font-weight: 700;
    font-size: 14px; cursor: pointer; transition: all .2s; letter-spacing: .2px;
    box-shadow: 0 4px 12px rgba(0,87,255,0.3);
  }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,87,255,0.4); }
  .btn-primary:active { transform: translateY(0); }
  .auth-err { color: var(--red); font-size: 16px; display: none; padding:16px 12px; background: var(--red-light); border-radius: 6px; }

  /* ── LAYOUT ── */
  #app { display: none; min-height: 100vh; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px;
    background:#ffff; display: flex; flex-direction: column; z-index: 100;
    box-shadow: 4px 0 24px rgba(11,31,58,0.15);
  }
  .sidebar-logo {
    padding: 22px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px;
  }
  .sidebar-logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent), #3b82f6); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .sidebar-logo-icon svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sidebar-logo-text { font-family: var(--font-head); font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
  .sidebar-logo-text span { color: #5b9dff; }
  .sidebar-user {
    padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px;
  }
  .sidebar-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #3b82f6);
    display: flex; align-items: center; justify-content: center; font-family: var(--font-head);
    font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
  }
  .sidebar-user-info { overflow: hidden; }
  .sidebar-user-name { font-size: 13px; font-weight: 600; color: #e8eef8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-user-role { font-size: 11px; color: #7a90b0; margin-top: 1px; }
  .sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
  .nav-section { padding: 14px 20px 6px; font-size: 10px; letter-spacing: 1.4px; color:#1a1a1a; font-weight: 600; text-transform: uppercase; }
  .nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 20px; cursor: pointer; margin: 1px 8px;
    color:var(--muted); font-size: 13.5px; font-weight: 500; transition: all .15s; border-radius: 9px;
  }
  .nav-item:hover { color: #0046cc; background: rgba(255,255,255,0.07); }
  .nav-item.active { color: #fff; background: linear-gradient(135deg, var(--accent), #3b82f6);  }
  .nav-item .nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .nav-item .nav-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.08); }
  .btn-logout {
    width: 100%; background:transparent; border: 1px solid var(--muted);
    color: var(--muted); padding: 10px 14px; border-radius: 9px; cursor: pointer;
    font-family: var(--font-body); font-size: 13px; transition: all .2s; display: flex; align-items: center; gap: 8px;
  }
  .btn-logout:hover { color: #ff7b8a; border-color: rgba(229,62,90,0.4); background: rgba(229,62,90,0.08); }
  .btn-logout svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .main { margin-left: 280px; padding: 28px 32px;padding-top:0px; min-height: 100vh; background: var(--bg);position: relative; }
  .page { display: none; }
  .page.active { display: block; }
  .page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;box-shadow: var(--shadow);border-radius:var(--radius) }
  .page-header-left {}
  .page-title { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -.3px; }
  .page-sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; font-weight: 400; }

  /* ── CARDS & STATS ── */
  body .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 2fr)) !important; gap: 14px; margin-bottom: 24px; }
  .stat-card {
    background: var(--surface);  border-radius: var(--radius);
    padding: 20px !important; position: relative; overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s;
  }
  .stat-card:hover { box-shadow: var(--shadow-md); }
  .stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
  .stat-icon-wrap { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .stat-icon-wrap svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .si-blue { background: var(--accent-light); color: var(--accent); }
  .si-green { background: var(--green-light); color: var(--green); }
  .si-red { background: var(--red-light); color: var(--red); }
  .si-yellow { background: var(--yellow-light); color: var(--yellow); }
  .si-navy { background: rgba(11,31,58,0.08); color: var(--navy); }
  .stat-label { font-size: 11.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
  .stat-value { font-family: var(--font-head); font-size: 26px; font-weight: 800; color: var(--navy); }

  /* ── PIPELINE ── */
  .pipeline-kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px;flex-direction: column; }
  .pipeline-col {
    flex: 0 0 236px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  }
  .pipeline-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .pipeline-col-title { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 6px; }
  .pipeline-col-title svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .pipeline-col-count { background: var(--surface2); color: var(--muted); border-radius: 20px; padding: 2px 9px; font-size: 11px; font-weight: 600; }
  .pipeline-card {
    background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 12px;
    margin-bottom: 8px; cursor: pointer; transition: all .15s;
  }
  .pipeline-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,87,255,0.1); transform: translateY(-1px); background: #fff; }
  .pipeline-card-company { font-size: 12.5px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
  .pipeline-card-val { font-size: 12px; color: var(--green); font-weight: 700; }
  .pipeline-card-date { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
  .pipeline-card-date svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .col-bar { height: 3px; border-radius: 2px; margin-bottom: 12px; }

  /* ── TABLE ── */
  .table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
  .table-header { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
  .table-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--navy); }
  .table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .btn-add {
    background: linear-gradient(135deg, var(--accent), #3b82f6); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 8px 14px; font-family: var(--font-body); font-size: 13px;
    font-weight: 600; cursor: pointer; transition: all .2s; display: flex; align-items: center; gap: 6px;
    box-shadow: 0 2px 8px rgba(0,87,255,0.25);
  }
  .btn-add:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,87,255,0.35); }
  .btn-add svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
  .btn-export {
    background: var(--surface); border: 1.5px solid var(--border); color: var(--text2); border-radius: var(--radius-sm);
    padding: 8px 12px; font-family: var(--font-body); font-size: 13px; cursor: pointer; transition: all .2s;
    display: flex; align-items: center; gap: 6px; font-weight: 500;
  }
  .btn-export:hover { border-color: var(--green); color: var(--green); background: var(--green-light); }
  .btn-export svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .search-wrap { position: relative; display: flex; align-items: center; }
  .search-wrap svg { position: absolute; left: 10px; width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
  .search-input {
    background: var(--surface2); border: 1.5px solid var(--border); color: var(--text); border-radius: var(--radius-sm);
    padding: 8px 12px 8px 32px; font-family: var(--font-body); font-size: 13px; outline: none; width: 200px; transition: all .2s;
  }
  .search-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(0,87,255,0.08); }
  .data-table { width: 100%; border-collapse: collapse; }
  .data-table th { padding: 10px 16px; text-align: left; font-size: 11px; letter-spacing: .7px; color: var(--muted); font-weight: 600; text-transform: uppercase; border-bottom: 1px solid var(--border); background: #fafbfd; }
  .data-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text2); }
  .data-table td strong { color: var(--navy); font-weight: 600; }
  .data-table tr:last-child td { border-bottom: none; }
  .data-table tr:hover td { background: #f8faff; }
  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
  .badge svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
  .badge-green { background: var(--green-light); color: var(--green); }
  .badge-red { background: var(--red-light); color: var(--red); }
  .badge-yellow { background: var(--yellow-light); color: var(--yellow); }
  .badge-blue { background: var(--accent-light); color: var(--accent); }
  .badge-navy { background: rgba(11,31,58,0.08); color: var(--navy); }
  .badge-gray { background: var(--surface2); color: var(--muted); }
  .link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12.5px; font-weight: 600; font-family: var(--font-body); display: inline-flex; align-items: center; gap: 4px; transition: color .15s; }
  .link-btn:hover { color: var(--accent-hover); }
  .link-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

 
  .modal-title { font-family: var(--font-head); font-size: 19px; font-weight: 800; color: var(--navy); margin-bottom: 22px; }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .form-grid.single { grid-template-columns: 1fr; }
  .form-group { display: flex; flex-direction: column; gap: 5px; }
  .form-group.span2 { grid-column: span 2; }
  .form-label { font-size: 11.5px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; }
  .form-input, .form-select, .form-textarea {
    background: var(--surface2); border: 1.5px solid var(--border); color: var(--text);
    border-radius: var(--radius-sm); padding: 10px 13px; font-family: var(--font-body); font-size: 13.5px; outline: none; transition: all .2s;
  }
  .form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(0,87,255,0.08); }
  .form-textarea { resize: vertical; min-height: 80px; }
  .modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
  .btn-cancel { background: var(--surface2); border: 1.5px solid var(--border); color: var(--text2); border-radius: var(--radius-sm); padding: 10px 20px; cursor: pointer; font-family: var(--font-body); font-size: 13.5px; font-weight: 500; transition: all .2s; }
  .btn-cancel:hover { border-color: var(--border2); color: var(--navy); background: var(--surface3); }

  /* ── CHART AREA ── */
  .charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
  .chart-card { background: var(--surface);  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
  .chart-title { font-family: var(--font-head); font-size: 13.5px; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
  canvas { max-width: 100%; }

  /* ── FUNNEL ── */
  .funnel { display: flex; flex-direction: column; gap: 10px; }
  .funnel-row { display: flex; align-items: center; gap: 12px; }
  .funnel-bar-wrap { flex: 1; background: var(--surface2); border-radius: 6px; overflow: hidden; height: 32px; }
  .funnel-bar { height: 100%; border-radius: 6px; display: flex; align-items: center; padding-left: 12px; font-size: 12px; font-weight: 700; transition: width .8s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .funnel-label { font-size: 12.5px; font-weight: 600; width: 90px; text-align: right; color: var(--text2); }
  .funnel-conv { font-size: 11px; color: var(--green); width: 60px; text-align: right; font-weight: 600; }

  /* ── COMERCIAL AREA ── */
  .comercial-panel {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%);
    border-radius: 16px; padding: 28px; margin-bottom: 20px;
  }
  .comercial-panel-title { font-family: var(--font-head); font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 3px; }
  .comercial-panel-sub { color: rgba(255,255,255,0.5); font-size: 13px; }
  .cost-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
  .cost-card { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 16px; text-align: center; backdrop-filter: blur(4px); }
  .cost-card-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
  .cost-card-value { font-family: var(--font-head); font-size: 20px; font-weight: 800; color: #fff; }
  .cost-card-value.positive { color: #5eecc0; }
  .cost-card-value.negative { color: #ff8fa0; }

  /* ── MONTHLY BARS ── */
  .month-bars { display: flex; align-items: flex-end; gap: 10px; height: 110px; padding-top: 10px; }
  .month-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; }
  .month-bar-val { font-size: 10px; color: var(--muted); font-weight: 600; }
  .month-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 3px; background: linear-gradient(180deg, var(--accent), #3b82f6); transition: height .6s ease; }
  .month-bar-label { font-size: 10px; color: var(--muted); font-weight: 500; }

  /* ── ALERTS ── */
  .alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
  .alert svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .alert-info { background: var(--accent-light); border: 1px solid rgba(0,87,255,0.2); color: var(--accent); }
  .alert-success { background: var(--green-light); border: 1px solid rgba(0,184,122,0.25); color: var(--green); }

  /* ── RESPONSIVE ── */
  .table-wrap { overflow-x: auto; }
  @media (max-width: 900px) {
    .sidebar { width: 64px; }
    .sidebar-logo-text, .sidebar-user-info, .nav-item span:not(.nav-icon), .nav-section, .btn-logout span { display: none; }
    .sidebar-user { justify-content: center; }
    .nav-item { justify-content: center; padding: 10px; }
    .main { margin-left: 64px; padding: 16px; }
    .charts-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .cost-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.span2 { grid-column: span 1; }
  }

  /* ── TOAST ── */
  #toast {
    position: fixed; bottom: 24px; right: 24px; background: var(--navy);
    border-radius: 12px; padding: 12px 18px; font-size: 13.5px; z-index: 9999; color: #fff;
    transform: translateY(80px); opacity: 0; transition: all .3s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none; display: flex; align-items: center; gap: 8px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(11,31,58,0.25);
  }
  #toast.show { transform: translateY(0); opacity: 1; }
  #toast.success { background: var(--green); }
  #toast.error { background: var(--red); }
  #toast svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

  /* ── DETAIL PANEL ── */
  .detail-panel {
    position: fixed; right: 0; top: 0; bottom: 0; width: 400px; background: var(--surface);
    border-left: 1px solid var(--border); z-index: 200; transform: translateX(100%); transition: transform .3s cubic-bezier(0.4,0,0.2,1);
    padding: 24px; overflow-y: auto; box-shadow: -8px 0 32px rgba(11,31,58,0.1);
  }
  .detail-panel.open { transform: translateX(0); }
  .detail-close { background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 7px 13px; cursor: pointer; font-family: var(--font-body); color: var(--text2); font-size: 13px; margin-bottom: 20px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; transition: all .15s; }
  .detail-close:hover { border-color: var(--accent); color: var(--accent); }
  .detail-close svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
  .detail-company { font-family: var(--font-head); font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
  .detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 12px; }
  .detail-key { color: var(--muted); font-weight: 500; flex-shrink: 0; }
  .detail-val { font-weight: 600; color: var(--text); text-align: right; }

  /* ── IMPORT SPECIFICS ── */
  #drop-zone { transition: all .2s; }
  #drop-zone:hover { border-color: var(--accent) !important; background: var(--accent-light) !important; }

  select option { background: #fff; color: var(--text); }
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: var(--surface2); }
  ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

  /* ── AUTH REDESIGN OVERRIDES ── */
  #auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    background: #ffffff;
    position: relative;
    overflow: hidden;
  }
  #auth-screen::before { display: none; }
  .auth-layout { display: grid; grid-template-columns: 1fr 1fr; width: 100%; min-height: 100vh; }
  .auth-visual {
    position: relative;
    min-height: 100vh;
    background-image:url('https://images.pexels.com/photos/7550303/pexels-photo-7550303.jpeg');
    background-size: cover;
    background-position: center;
    min-width:60%;
  }

 .auth-visual .over-area{
     position: absolute;
     left:0px;
     bottom:50px;
     width:100%; 
     min-height:200px;
     padding:50px 100px;
     display:flex; 
     justify-content: center; 
     align-items: center;
   }

  .auth-visual .over-area .over-box {
     width:100%;
     height:100%;
     min-height:200px;
     border-radius:10px;
     background-color: rgba(255, 255, 255,0.2);
     backdrop-filter:blur(10px);  
     border:1px solid rgba(255,255,255,0.2);     
     justify-content: center;
     display: flex; 
     flex-direction: column;
     text-align: center; 
     padding:20px;
     color:#ffff;
  }

  .auth-visual .over-area .over-box .avatars{
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-visual .over-area .over-box .avatar-item{
    width:60px;
    height:60px;
    border-radius:100%;
    overflow: hidden;
    margin-right:-15px;    
    border:3px solid #0164FF;
    background-color:  #0164FF;
    color:#ffff;
    font-size:18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight:bold;
  }

  .auth-visual .over-area .over-box .avatar-item img{
        width:100%;
        height:100%;
        object-fit: cover;
    }

  .auth-visual .over-area .over-box h5{
    font-size:25px;
    margin:15px 0px;
  }

  .auth-visual .over-area .over-box p{
     color:#ebebeb;
  }

  .auth-panel {
    min-height: 100vh;
    background: #f2f3fc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
  }
  .auth-box {
    background: var(--surface);
    border-radius: 10px;
    padding: 34px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 20px 48px rgba(11,31,58,0.10);
    border: 1px solid rgba(11,31,58,0.06);
    position: relative;
  }
  .auth-sub { margin-bottom: 26px; }
  .auth-hint {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--surface2);
    color: var(--muted);
    font-size: 12px;
    text-align: left;
    border: 1px solid var(--border);
  }
  .users-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .btn-secondary {
    background: var(--surface2);
    border: 1.5px solid var(--border);
    color: var(--text2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 12.5px;
    cursor: pointer;
    transition: all .2s;
    font-weight: 600;
  }
  .btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
  .btn-danger {
    background: rgba(229,62,90,0.08);
    border: 1.5px solid rgba(229,62,90,0.22);
    color: var(--red);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 12.5px;
    cursor: pointer;
    transition: all .2s;
    font-weight: 600;
  }
  .btn-danger:hover { background: rgba(229,62,90,0.14); border-color: rgba(229,62,90,0.34); }
  @media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-panel { padding: 24px 16px; }
    .auth-box { max-width: 420px; }
  }

  /* ── APP MODE SWITCHER ── */
  #app { padding-top: 0px; }
  .top-navbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 300;
    height: 78px; background: rgba(255,255,255,0.92); backdrop-filter: blur(14px);
     box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 28px;
  }
  .top-navbar-brand { display: flex; align-items: center; gap: 12px; }
  .top-navbar-title { font-family: var(--font-head); font-size: 18px; font-weight: 800; color: var(--navy); }
  .top-navbar-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .mode-switch { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 8px; box-shadow: var(--shadow); }
  .mode-btn {
    display: flex; align-items: center; gap: 10px; border: none; background: transparent; cursor: pointer;
    padding: 10px 14px; border-radius: 14px; color: var(--text2); transition: all .2s; font-family: var(--font-body);
  }
  .mode-btn:hover { background: var(--surface2); color: var(--navy); }
  .mode-btn.active { background: var(--surface2); color: var(--navy); box-shadow: inset 0 0 0 1px var(--border); }
  .mode-icon {
    width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
    box-shadow: 0 10px 24px rgba(11,31,58,0.12);
  }
  .mode-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mode-icon.crm { background: linear-gradient(135deg, #0057ff, #3b82f6); }
  .mode-icon.blog { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
  .mode-icon.calc { background: linear-gradient(135deg, #00b87a, #10b981); }
  .mode-copy { text-align: left; }
  .mode-copy strong { display: block; font-size: 13px; font-weight: 700; }
  .mode-copy span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
  .top-navbar-user { display: flex; align-items: center; gap: 10px; }
  .top-navbar-user .user-meta { text-align: right; }
  .top-navbar-user .user-meta strong { display:block; font-size: 13px; }
  .top-navbar-user .user-meta span { display:block; font-size: 11px; color: var(--muted); }
  .top-navbar-user .user-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--accent)); color: #fff;
    display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 800;
  }

    .top-navbar-user .user-avatar img{
       width:40px;
       height:40px;
       object-fit: cover;
       border-radius:100%;
       object-fit: cover;
    }
  .app-mode-panel { display: none; min-height: calc(100vh - 78px); }
  .app-mode-panel.active { display: block; }
  .app-mode-panel .page-shell { padding: 28px 32px; }
  .blog-mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
  .blog-hero { background: linear-gradient(135deg, #f4f7ff, #ffffff); border: 1px solid #e2eaff; border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
  .blog-hero h2 { font-family: var(--font-head); font-size: 28px; color: #0d1b3e; margin-bottom: 8px; }
  .blog-hero p { color: #6b7fa3; font-size: 14px; max-width: 760px; line-height: 1.6; }
  .blog-mini-card { background: #fff; border: 1px solid #e2eaff; border-radius: 18px; padding: 20px; box-shadow: 0 1px 4px rgba(1,100,255,0.07); }
  .blog-mini-kicker { display: inline-flex; padding: 6px 10px; border-radius: 999px; background: #eef3ff; color: #0164FF; font-size: 11px; font-weight: 700; margin-bottom: 14px; }
  .blog-mini-card h3 { font-size: 16px; margin-bottom: 8px; color: #0d1b3e; }
  .blog-mini-card p { color: #6b7fa3; font-size: 13px; line-height: 1.6; }
  .blog-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
  .blog-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 12px; font-weight: 700; border: 1px solid #e2eaff; background: #fff; color: #0d1b3e; text-decoration: none; }
  .blog-btn.primary { background: #0164FF; color: #fff; border-color: #0164FF; }
  .blog-table-lite { margin-top: 22px; background: #fff; border: 1px solid #e2eaff; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 4px rgba(1,100,255,0.07); }
  .blog-table-lite table { width: 100%; border-collapse: collapse; }
  .blog-table-lite th, .blog-table-lite td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #edf2ff; font-size: 13px; }
  .blog-table-lite th { background: #f9fbff; color: #6b7fa3; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
  .blog-table-lite tr:last-child td { border-bottom: none; }
  .calc-frame-wrap { background: #fff; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); min-height: calc(100vh - 170px); }
  .calc-frame { width: 100%; height: calc(100vh - 170px); border: none; background: #fff; }
  .crm-dashboard-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
  .crm-dashboard-grid4 .chart-card { margin-bottom: 0; }
  .layout-hidden { display: none !important; }
  @media (max-width: 1280px) { .crm-dashboard-grid4, .blog-mode-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
  @media (max-width: 980px) {
    #app { padding-top: 138px; }
    .top-navbar { height: auto; flex-direction: column; align-items: stretch; padding: 16px; }
    .mode-switch { width: 100%; overflow-x: auto; }
    .top-navbar-user { justify-content: space-between; }
    .app-mode-panel .page-shell { padding: 20px 16px; }
    .calc-frame { height: calc(100vh - 280px); }
  }
  @media (max-width: 720px) { .crm-dashboard-grid4, .blog-mode-grid { grid-template-columns: 1fr; } .mode-copy span { display:none; } }


  body .page{
    padding-top:100px; 
  }


  body .page-blog-content{
    padding:20px;
    border-radius:10px;
    background-color:#ffff;
    box-shadow: var(--shadow);
  }


  body  .dropdown-toggle-actions{
    font-size:20px;
    padding:0px !important;
    color:#6b7fa3;
    margin-left:10px;
    outline: none !important;
    border: none !important;
  }

  body .dropdown-toggle::after{
    transform: scale(0.6);
  }

  body .action-dropdown  li a{
    display: flex; 
   align-items: center;
   padding:8px 5px;
   padding-left:10px;
  }

  body .action-dropdown .icon{
      margin-right:5px;
          display: flex; 
   align-items: center;
   justify-content: center;
  }

  body .d-flex.charts-ana{
     gap:20px;
  }

  body .card-chart-lead{
     min-width:380px;
  }

  body .d-flex.charts-ana .chart-card{
    max-height:300px;
  }

  body #page-minha-area .nav-link.active {
    color:#ffff !important;
  }


  body #_leads-oc-panel{
    z-index:100000 !important;
  }

 body .pk-card-thumb{
   border:8px solid #ffff;
   min-height:150px;
   border-radius:15px;
   border-bottom:0px !important;
}

body .pk-col-body{
  background-color: #fdfdfd !important;
}

body .badge.badge-cat{
  color:#0046cc;
}
body .badge.badge-published{
  color:green ;
}


 