:root{
  --navy:#10243e;
  --navy-deep:#0a1830;
  --slate:#3c5374;
  --paper:#f3f5f8;
  --line:#dde3ec;
  --ink:#152437;
  --muted:#6b7d96;
  --teal:#1f9d8f;
  --amber:#e3a13a;
  --rose:#d1556b;
  --grid:'IBM Plex Mono', monospace;
  --serif:'Source Serif Pro', Georgia, serif;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family:'Inter','Segoe UI',sans-serif;
  background:var(--paper);
  color:var(--ink);
  font-size:14px;
}
a{color:inherit;}

/* TOP NAV */
.topbar{
  background:var(--navy);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 24px;
  height:58px;
  position:sticky; top:0; z-index:50;
}
.brand{
  font-family:var(--serif);
  font-size:20px;
  letter-spacing:0.5px;
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}
.brand .mark{
  width:28px;height:28px;border-radius:6px;
  background:linear-gradient(135deg,var(--teal),#0a1830);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--grid); font-weight:700; font-size:13px;
}
.nav-tabs{display:flex; gap:4px; height:100%; flex-wrap:wrap;}
.nav-tabs a{
  color:#b9c6dc;
  text-decoration:none;
  padding:0 16px;
  display:flex;align-items:center;
  font-size:13px;
  font-weight:500;
  border-bottom:3px solid transparent;
  transition:.15s;
}
.nav-tabs a.active{color:#fff; border-bottom-color:var(--teal); background:rgba(255,255,255,0.04);}
.nav-tabs a:hover{color:#fff;}
.user-chip{
  display:flex; align-items:center; gap:10px;
  font-size:12.5px;
  white-space:nowrap;
}
.user-chip .role-pill{
  background:var(--teal); color:#06231f;
  padding:3px 10px; border-radius:20px;
  font-weight:700; font-size:11px; letter-spacing:0.4px;
  text-transform:uppercase;
}
.avatar{
  width:32px;height:32px;border-radius:50%;
  background:var(--slate); color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-weight:700; font-size:13px;
}

/* LAYOUT */
.layout{display:flex; min-height:calc(100vh - 58px);}
.sidebar{
  width:230px;
  background:#fff;
  border-right:1px solid var(--line);
  padding:20px 14px;
  flex-shrink:0;
}
.sidebar h4{
  font-size:11px; letter-spacing:1.2px; text-transform:uppercase;
  color:var(--muted); margin:18px 6px 8px; font-weight:700;
}
.sidebar h4:first-child{margin-top:0;}
.sidebar .filter-block{margin-bottom:6px;}
.sidebar select, .sidebar input{
  width:100%; padding:8px 10px; border:1px solid var(--line);
  border-radius:6px; font-size:13px; background:#fafbfc; color:var(--ink);
}
.sidebar .seg{
  display:flex; border:1px solid var(--line); border-radius:6px; overflow:hidden;
}
.sidebar .seg a{
  flex:1; border:none; background:#fff; padding:7px 0;
  font-size:12px; font-weight:600; color:var(--muted); cursor:pointer;
  text-align:center; text-decoration:none;
}
.sidebar .seg a.active{background:var(--navy); color:#fff;}
.sidebar .btn-apply{
  display:block; width:100%; text-align:center; padding:9px 0; margin-top:6px;
  background:var(--navy); color:#fff; border-radius:6px; text-decoration:none;
  font-size:13px; font-weight:600; border:none; cursor:pointer;
}
.sidebar .btn-clear{
  display:block; width:100%; text-align:center; padding:8px 0; margin-top:6px;
  background:#fff; color:var(--muted); border-radius:6px; text-decoration:none;
  font-size:12px; font-weight:600; border:1px solid var(--line);
}

.main{flex:1; padding:24px 28px; overflow-x:auto;}
.page-head{
  display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:18px;
  flex-wrap:wrap; gap:10px;
}
.page-head h1{
  font-family:var(--serif); font-size:26px; font-weight:600; color:var(--navy-deep);
}
.page-head .sub{color:var(--muted); font-size:13px; margin-top:4px;}
.scope-tag{
  font-family:var(--grid); font-size:11px; background:#fff; border:1px solid var(--line);
  padding:6px 12px; border-radius:6px; color:var(--slate); white-space:nowrap;
}

/* FUNNEL STRIP */
.funnel{
  display:grid; grid-template-columns:repeat(7,1fr); gap:10px; margin-bottom:22px;
}
@media(max-width:1100px){ .funnel{grid-template-columns:repeat(4,1fr);} }
.funnel .card{
  background:#fff; border:1px solid var(--line); border-radius:8px; padding:14px 14px 12px;
  border-top:3px solid var(--slate);
}
.funnel .card .num{font-family:var(--serif); font-size:28px; font-weight:700; color:var(--navy-deep);}
.funnel .card .lbl{font-size:11.5px; color:var(--muted); margin-top:4px; font-weight:600; text-transform:uppercase; letter-spacing:.4px;}
.funnel .card.calls{border-top-color:var(--slate);}
.funnel .card.not_contacted{border-top-color:#9aa7bd;}
.funnel .card.pipeline{border-top-color:var(--amber);}
.funnel .card.confirmed{border-top-color:var(--teal);}
.funnel .card.waiting{border-top-color:#7c5cbf;}
.funnel .card.installed{border-top-color:#2e8b57;}
.funnel .card.rejected{border-top-color:var(--rose);}

/* GRID PANELS */
.grid-2{display:grid; grid-template-columns:1.4fr 1fr; gap:18px; margin-bottom:20px;}
@media(max-width:1000px){ .grid-2{grid-template-columns:1fr;} }
.panel{
  background:#fff; border:1px solid var(--line); border-radius:10px; padding:18px;
}
.panel h3{
  font-size:14px; font-weight:700; margin-bottom:14px; color:var(--navy-deep);
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:6px;
}
.panel h3 .tag{font-size:11px; color:var(--muted); font-weight:500; font-family:var(--grid);}

/* Table */
table{width:100%; border-collapse:collapse; font-size:12.5px;}
th{
  text-align:left; padding:9px 10px; background:#f7f9fc; color:var(--muted);
  font-weight:700; text-transform:uppercase; font-size:10.5px; letter-spacing:.5px;
  border-bottom:1px solid var(--line);
}
td{padding:9px 10px; border-bottom:1px solid #eef1f5; color:var(--ink);}
tr:hover td{background:#fafbfd;}
td.num, th.num{text-align:right; font-family:var(--grid);}
.pos{color:var(--teal); font-weight:700;}
.neg{color:var(--rose); font-weight:700;}
.status-dot{display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px;}
.status-dot.good{background:var(--teal);}
.status-dot.mid{background:var(--amber);}
.status-dot.low{background:var(--rose);}

/* Geo grid */
.geo-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:10px;}
.geo-card{
  border:1px solid var(--line); border-radius:8px; padding:12px;
  display:flex; justify-content:space-between; align-items:center;
}
.geo-card .place{font-weight:700; font-size:13px;}
.geo-card .place .state{display:block; font-size:11px; color:var(--muted); font-weight:500;}
.geo-card .val{font-family:var(--serif); font-size:18px; font-weight:700; color:var(--navy-deep); text-align:right;}
.geo-card .meta{font-size:11px; color:var(--muted); text-align:right;}

/* HR specific */
.hr-summary{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px;}
@media(max-width:900px){ .hr-summary{grid-template-columns:repeat(2,1fr);} }
.hr-summary .card{background:#fff; border:1px solid var(--line); border-radius:10px; padding:16px;}
.hr-summary .card .num{font-family:var(--serif); font-size:24px; font-weight:700; color:var(--navy-deep);}
.hr-summary .card .lbl{font-size:12px; color:var(--muted); margin-top:4px;}

.badge{
  font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:10px;
  text-transform:uppercase; display:inline-block;
}
.badge.approved, .badge.installed, .badge.active, .badge.paid{background:#e3f5f1; color:var(--teal);}
.badge.pending, .badge.draft, .badge.waiting_install, .badge.in_pipeline{background:#fcf1de; color:var(--amber);}
.badge.rejected, .badge.terminated, .badge.hold{background:#fbe9ec; color:var(--rose);}
.badge.confirmed{background:#e6f0ff; color:#2a5fc1;}
.badge.not_contacted, .badge.new{background:#eef1f5; color:var(--muted);}

.footnote{font-size:11px; color:var(--muted); margin-top:24px; line-height:1.7;}
.footnote b{color:var(--ink);}

/* LOGIN PAGE */
.login-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--navy-deep), var(--navy));
}
.login-card{
  background:#fff; border-radius:14px; padding:36px 34px; width:380px;
  box-shadow:0 20px 60px rgba(0,0,0,0.25);
}
.login-card .brand{color:var(--navy-deep); justify-content:center; margin-bottom:6px; font-size:24px;}
.login-card .tagline{text-align:center; color:var(--muted); font-size:12.5px; margin-bottom:24px;}
.login-card label{display:block; font-size:12px; font-weight:700; color:var(--slate); margin-bottom:6px; text-transform:uppercase; letter-spacing:.4px;}
.login-card input{
  width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:8px;
  font-size:14px; margin-bottom:16px; background:#fafbfc;
}
.login-card input:focus{outline:2px solid var(--teal); border-color:var(--teal);}
.login-card button{
  width:100%; padding:12px 0; background:var(--navy); color:#fff; border:none;
  border-radius:8px; font-size:14px; font-weight:700; cursor:pointer; letter-spacing:.3px;
}
.login-card button:hover{background:var(--navy-deep);}
.login-error{
  background:#fbe9ec; color:var(--rose); padding:10px 12px; border-radius:8px;
  font-size:12.5px; margin-bottom:16px; font-weight:600;
}
.login-demo{margin-top:20px; font-size:11.5px; color:var(--muted); border-top:1px solid var(--line); padding-top:14px; line-height:1.8;}
.login-demo b{color:var(--ink); font-family:var(--grid);}

/* Forms (leave request etc) */
.form-row{display:flex; gap:12px; flex-wrap:wrap; margin-bottom:14px;}
.form-row .field{flex:1; min-width:160px;}
.field label{display:block; font-size:11.5px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:5px;}
.field input, .field select, .field textarea{
  width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:6px; font-size:13px; background:#fafbfc;
}
.btn-primary{
  background:var(--navy); color:#fff; border:none; padding:10px 22px; border-radius:6px;
  font-size:13px; font-weight:700; cursor:pointer;
}
.btn-primary:hover{background:var(--navy-deep);}
.msg-success{background:#e3f5f1; color:var(--teal); padding:10px 14px; border-radius:8px; font-size:12.5px; font-weight:600; margin-bottom:14px;}
.msg-error{background:#fbe9ec; color:var(--rose); padding:10px 14px; border-radius:8px; font-size:12.5px; font-weight:600; margin-bottom:14px;}
