@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ===================== DESIGN TOKENS ===================== */
:root{
  --bg: #F6F7F5;
  --surface: #FFFFFF;
  --surface-2: #FBFBFA;
  --ink: #16241D;
  --muted: #5B6B62;
  --muted-2: #8A968F;
  --border: #E3E7E1;
  --sidebar-bg: #10231C;
  --sidebar-ink: #CFE0D6;
  --sidebar-ink-dim: #7E9A8B;
  --accent: #1E8F6F;
  --accent-ink: #0E6B51;
  --accent-soft: #E4F3EC;
  --warn: #C98A2A;
  --warn-soft: #FBF0DD;
  --danger: #B4483D;
  --danger-soft: #FBE8E5;
  --gray-soft: #EEF0ED;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16,35,28,.06);
  --shadow-md: 0 6px 20px rgba(16,35,28,.08);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:var(--font-body); font-size:14px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ font-family:var(--font-display); margin:0; color:var(--ink); }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; font-size:14px; }
table{ border-collapse:collapse; width:100%; }
.icon{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; } }

/* ===================== LOGIN ===================== */
.login-screen{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at 20% 20%, #163229 0%, #10231C 55%, #0B1712 100%);
  padding:24px;
}
.login-card{
  background:var(--surface); border-radius:var(--radius-lg); padding:36px 32px;
  width:100%; max-width:380px; box-shadow:var(--shadow-md);
}
.login-brand{ display:flex; align-items:center; gap:12px; margin-bottom:24px; }
.login-mark{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:10px; background:var(--accent);
  color:#fff; font-family:var(--font-display); font-weight:700; font-size:13px; letter-spacing:.5px;
}
.login-brand h1{ font-size:17px; margin:0; }
.login-brand p{ margin:2px 0 0; font-size:12px; color:var(--muted); }
#loginForm label{ display:block; font-size:12px; color:var(--muted); font-weight:600; margin-bottom:14px; }
#loginForm input{
  display:block; width:100%; margin-top:6px; padding:10px 12px;
  border:1px solid var(--border); border-radius:var(--radius); background:var(--surface-2);
}
.form-error{
  background:var(--danger-soft); color:var(--danger); padding:8px 10px;
  border-radius:8px; font-size:12.5px; margin-bottom:14px;
}

/* ===================== BUTTONS ===================== */
.btn{
  border:1px solid transparent; border-radius:8px; padding:9px 14px;
  font-size:13.5px; font-weight:600; transition:background .15s, border-color .15s;
}
.btn-primary{ background:var(--accent); color:#fff; }
.btn-primary:hover{ background:var(--accent-ink); }
.btn-outline{ background:var(--surface); border-color:var(--border); color:var(--ink); }
.btn-outline:hover{ border-color:var(--accent); color:var(--accent-ink); }
.btn-ghost{ background:transparent; color:var(--sidebar-ink-dim); border:1px solid rgba(255,255,255,.12); }
.btn-ghost:hover{ color:#fff; border-color:rgba(255,255,255,.3); }
.btn-danger{ background:var(--danger-soft); color:var(--danger); }
.btn-block{ width:100%; }
.btn-icon{ background:none; border:none; font-size:16px; color:var(--muted); }
.btn-sm{ padding:6px 10px; font-size:12.5px; }

/* ===================== APP SHELL ===================== */
.app-shell{ display:flex; min-height:100vh; }
.app-shell[hidden]{ display:none !important; }
.sidebar{
  width:220px; flex-shrink:0; background:var(--sidebar-bg); color:var(--sidebar-ink);
  display:flex; flex-direction:column; padding:18px 12px; position:sticky; top:0; height:100vh;
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; padding:6px 8px 22px; }
.brand-text{ font-family:var(--font-display); font-weight:600; color:#fff; font-size:15px; }
.sidebar-nav{ display:flex; flex-direction:column; gap:2px; flex:1; overflow-y:auto; }
.sidebar-nav a{
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px;
  font-size:13.5px; font-weight:500; color:var(--sidebar-ink-dim); transition:background .15s, color .15s;
}
.sidebar-nav a:hover{ background:rgba(255,255,255,.06); color:#fff; }
.sidebar-nav a.active{ background:var(--accent); color:#fff; }
.sidebar-footer{ border-top:1px solid rgba(255,255,255,.1); padding-top:12px; margin-top:12px; }
.user-badge{ font-size:12px; color:var(--sidebar-ink-dim); padding:0 8px 10px; }

.main-col{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 26px; border-bottom:1px solid var(--border); background:var(--surface);
  position:sticky; top:0; z-index:5;
}
.topbar-title{ font-family:var(--font-display); font-size:19px; font-weight:600; }
.topbar-actions{ display:flex; gap:10px; align-items:center; }
.select-product{ padding:8px 10px; border-radius:8px; border:1px solid var(--border); background:var(--surface-2); }
.page-content{ padding:24px 26px 60px; flex:1; }

/* ===================== CARDS / GRID ===================== */
.grid{ display:grid; gap:16px; }
.grid-4{ grid-template-columns:repeat(4,1fr); }
.grid-3{ grid-template-columns:repeat(3,1fr); }
.grid-2{ grid-template-columns:repeat(2,1fr); }
@media (max-width:1100px){ .grid-4{ grid-template-columns:repeat(2,1fr);} .grid-3{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:640px){ .grid-4,.grid-3,.grid-2{ grid-template-columns:1fr; } }

.card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:18px; box-shadow:var(--shadow-sm);
}
.card-title{ font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px; }
.card-value{ font-family:var(--font-display); font-size:24px; font-weight:700; }
.card-sub{ font-size:12px; color:var(--muted-2); margin-top:4px; }
.card-accent{ border-left:3px solid var(--accent); }

.section-head{ display:flex; align-items:center; justify-content:space-between; margin:26px 0 12px; }
.section-head h3{ font-size:15px; }
.section-head:first-child{ margin-top:0; }

.panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow-sm); }
.panel-scroll{ overflow-x:auto; }

/* ===================== TABLES ===================== */
table.data{ font-size:13px; }
table.data th{
  text-align:left; padding:10px 14px; background:var(--surface-2); color:var(--muted);
  font-size:11px; text-transform:uppercase; letter-spacing:.04em; font-weight:600;
  border-bottom:1px solid var(--border); white-space:nowrap;
}
table.data td{ padding:10px 14px; border-bottom:1px solid var(--border); white-space:nowrap; font-variant-numeric:tabular-nums; }
table.data tr:last-child td{ border-bottom:none; }
table.data tr:hover td{ background:var(--surface-2); }

/* ===================== STATUS PILLS (signature) ===================== */
.pill{ display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:11.5px; font-weight:700; letter-spacing:.02em; }
.pill::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.pill-scale{ background:var(--accent-soft); color:var(--accent-ink); }
.pill-monitor{ background:var(--warn-soft); color:var(--warn); }
.pill-pause{ background:var(--danger-soft); color:var(--danger); }
.pill-na{ background:var(--gray-soft); color:var(--muted); }

/* ===================== FORMS / FILTERS ===================== */
.filter-bar{ display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin-bottom:16px; }
.filter-bar label{ font-size:11.5px; color:var(--muted); font-weight:600; display:block; margin-bottom:4px; }
.filter-bar input, .filter-bar select{ padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--surface); }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-grid label{ font-size:12px; color:var(--muted); font-weight:600; display:block; }
.form-grid input, .form-grid select, .form-grid textarea{
  width:100%; margin-top:5px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--surface-2);
}
.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:16px; }
.tab{ padding:9px 14px; font-size:13px; font-weight:600; color:var(--muted); border-bottom:2px solid transparent; }
.tab.active{ color:var(--accent-ink); border-color:var(--accent); }

/* ===================== MODAL ===================== */
.modal-overlay{
  position:fixed; inset:0; background:rgba(16,35,28,.45); display:flex;
  align-items:center; justify-content:center; z-index:50; padding:20px;
}
.modal{ background:var(--surface); border-radius:var(--radius-lg); padding:22px; width:100%; max-width:480px; max-height:86vh; overflow-y:auto; box-shadow:var(--shadow-md); }
.modal h3{ margin-bottom:16px; font-size:16px; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }

/* ===================== CHAT ===================== */
.chat-fab{
  position:fixed; bottom:24px; right:24px; width:52px; height:52px; border-radius:50%;
  background:var(--accent); color:#fff; border:none; box-shadow:var(--shadow-md);
  display:flex; align-items:center; justify-content:center; z-index:40;
}
.chat-panel{
  position:fixed; bottom:90px; right:24px; width:340px; max-height:460px; background:var(--surface);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md); display:flex; flex-direction:column; z-index:41; border:1px solid var(--border);
}
.chat-header{ padding:12px 14px; border-bottom:1px solid var(--border); font-weight:700; display:flex; justify-content:space-between; align-items:center; font-size:13.5px; }
.chat-messages{ flex:1; overflow-y:auto; padding:12px 14px; display:flex; flex-direction:column; gap:10px; font-size:13px; }
.chat-msg{ padding:8px 11px; border-radius:10px; max-width:88%; white-space:pre-wrap; }
.chat-msg.user{ background:var(--accent-soft); color:var(--accent-ink); align-self:flex-end; }
.chat-msg.bot{ background:var(--surface-2); border:1px solid var(--border); align-self:flex-start; }
.chat-form{ display:flex; gap:8px; padding:10px; border-top:1px solid var(--border); }
.chat-form input{ flex:1; padding:8px 10px; border:1px solid var(--border); border-radius:8px; }

/* ===================== TOAST ===================== */
.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  background:var(--ink); color:#fff; padding:10px 18px; border-radius:8px; font-size:13px; z-index:60;
}

/* ===================== TOTAL ROW ===================== */
.data tfoot tr.total-row td{ font-weight:700; border-top:2px solid var(--ink); background:var(--surface-2); border-bottom:none; }
.data tfoot tr.total-row td strong{ font-weight:700; }

/* ===================== MISC ===================== */
.empty-state{ text-align:center; padding:40px 20px; color:var(--muted); }
.muted{ color:var(--muted); }
.text-right{ text-align:right; }
.mt-16{ margin-top:16px; }
.chart-box{ height:280px; }
.badge-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }

@media (max-width:900px){
  .sidebar{ width:76px; }
  .brand-text, .sidebar-nav a span, .sidebar-nav a{ font-size:0; }
  .sidebar-nav a .icon{ margin:0 auto; }
  .sidebar-nav a{ justify-content:center; }
  .user-badge{ display:none; }
}

.modal-overlay[hidden]{ display:none !important; }
.chat-panel[hidden]{ display:none !important; }
/* ===================== LP ANALYSIS CARDS ===================== */
.lp-card-header{ display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.lp-card-header strong{ font-size:14px; }
.lp-card-stats{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.lp-stat{ display:flex; flex-direction:column; gap:2px; }
.lp-stat-label{ font-size:10.5px; color:var(--muted-2); text-transform:uppercase; letter-spacing:.03em; font-weight:600; }
.lp-stat-value{ font-family:var(--font-display); font-size:17px; font-weight:700; }
.lp-card-chart{ height:50px; margin-top:4px; }

.toast[hidden]{ display:none !important; }

/* ===================== QUKIS DASHBOARD PARAMETER STYLES ===================== */
.page-head{ display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:20px; }
.page-head h1{ margin:0; font-size:22px; }
.page-head .sub{ margin-top:4px; }
.head-art{ display:flex; align-items:center; gap:10px; }
.doc-btn{ display:flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:7px 12px; font-size:12.5px; color:var(--muted); cursor:pointer; }
.doc-btn svg{ width:18px; height:18px; stroke:currentColor; }
.filter-panel{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px 16px; margin-bottom:16px; }
.filter-row{ display:flex; gap:12px; flex-wrap:wrap; align-items:end; }
.filter-row .field{ min-width:100px; }
.filter-row .field label{ font-size:11px; color:var(--muted); font-weight:600; display:block; margin-bottom:4px; }
.filter-row input, .filter-row select{ padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--surface); width:100%; box-sizing:border-box; }
.toolbar{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px 16px; margin-bottom:16px; position:relative; }
.toolbar-row{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.cols-panel{ background:var(--surface); border:1px solid var(--border); border-radius:12px; position:absolute; right:16px; top:60px; z-index:5; padding:14px; min-width:210px; box-shadow:0 8px 24px rgba(0,0,0,.12); }
.cols-panel label{ display:flex; gap:8px; align-items:center; margin:6px 0; font-size:13px; cursor:pointer; }
.cols-panel label.muted-col{ color:var(--muted); }
.table-wrap{ border:1px solid var(--border); border-radius:12px; overflow:hidden; }
.report-table{ width:100%; border-collapse:collapse; font-size:13px; }
.report-table th{ text-align:left; padding:10px 12px; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); border-bottom:1px solid var(--border); white-space:nowrap; cursor:help; }
.report-table td{ padding:10px 12px; border-bottom:1px solid var(--border); white-space:nowrap; }
.report-table tr.total{ font-weight:700; border-top:2px solid var(--ink); background:var(--surface-2); }
.report-table tr.total td{ border-bottom:none; }
.report-table .pct{ font-size:11px; color:var(--muted-2); margin-left:6px; }
.currency{ font-variant-numeric:tabular-nums; }
.empty{ text-align:center; padding:60px 20px; color:var(--muted); }
.empty svg{ width:36px; height:36px; stroke:currentColor; margin-bottom:10px; }
.empty-title{ font-size:14px; font-weight:600; margin-bottom:4px; }
.pill-count{ background:var(--accent-soft); color:var(--accent-ink); font-size:11px; padding:2px 10px; border-radius:999px; font-weight:600; }
.loading{ text-align:center; padding:40px; color:var(--muted); }

/* ===================== CEP TRACKER SPACING ===================== */
#trkCards{ margin-bottom:20px; }
#trkCards .card{ padding:16px 18px; }
