/* Dhrubo ISP — application stylesheet
   Same visual language as the approved dashboard/link mockups:
   navy sidebar, white content, blue/teal accents, soft status badges. */

:root{
  --navy:#0c1533; --navy-2:#101c40; --navy-hover:#182852;
  --accent:#3b6cf6; --accent-2:#14b8a6;
  --text:#1f2533; --muted:#6b7280;
  --bg:#f3f5fa; --card:#ffffff; --border:#e6e9f0;
  --green:#16a34a; --green-bg:#e3f8e9;
  --red:#dc2626; --red-bg:#fde8e8;
  --orange:#ea580c; --orange-bg:#fff1e2;
  --yellow:#ca8a04; --yellow-bg:#fef8dc;
  --blue:#2563eb; --blue-bg:#e6efff;
  --purple:#7c3aed; --purple-bg:#f0e9fe;
  --teal:#0d9488; --teal-bg:#dffaf5;
  --gray:#6b7280; --gray-bg:#eef0f4;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  background:var(--bg); color:var(--text); font-size:14px;
}
a{color:var(--accent); text-decoration:none;}
a:hover{text-decoration:underline;}

.app-shell{display:flex; min-height:100vh;}

/* ---------- SIDEBAR ---------- */
.sidebar{
  width:246px; flex:0 0 246px;
  background:linear-gradient(180deg,var(--navy) 0%, var(--navy-2) 100%);
  color:#c9d2ea; display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.brand{display:flex; align-items:center; gap:10px; padding:18px; border-bottom:1px solid rgba(255,255,255,.08);}
.brand-badge{
  width:34px; height:34px; border-radius:9px;
  background:linear-gradient(135deg,#3b6cf6,#14b8a6);
  display:flex; align-items:center; justify-content:center;
  font-weight:800; color:#fff; font-size:15px; flex:0 0 34px;
}
.brand-name{font-size:15.5px; font-weight:700; color:#fff; line-height:1.15;}
.brand-tag{font-size:10px; color:#8b98bf;}
.nav{padding:10px;}
.nav-section-label{font-size:10px; text-transform:uppercase; letter-spacing:.7px; color:#5d6a95; padding:14px 12px 6px; font-weight:700;}
.nav-item{
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:8px; margin-bottom:2px;
  color:#aab4d4; font-size:13px; font-weight:500; cursor:pointer; position:relative;
}
.nav-item:hover{background:var(--navy-hover); color:#fff;}
.nav-item.active{background:rgba(59,108,246,.2); color:#fff;}
.nav-item.active::before{content:""; position:absolute; left:-10px; top:6px; bottom:6px; width:3px; background:var(--accent); border-radius:2px;}
.nav-item .ic{width:16px; text-align:center; flex:0 0 16px;}
.nav-badge{margin-left:auto; background:var(--red); color:#fff; font-size:10px; font-weight:700; border-radius:20px; padding:1px 6px;}
.sidebar-footer{margin:10px; padding:12px; border-radius:10px; background:linear-gradient(135deg,#132048,#0c1533); border:1px solid rgba(255,255,255,.08); font-size:11px; color:#8b98bf;}

/* ---------- MAIN ---------- */
.main{flex:1; display:flex; flex-direction:column; min-width:0;}
.topbar{
  height:58px; background:#fff; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:16px; padding:0 22px; position:sticky; top:0; z-index:20;
}
.search-box{flex:1; max-width:480px; display:flex; align-items:center; gap:8px; background:#f2f4f9; border:1px solid var(--border); border-radius:20px; padding:7px 14px;}
.search-box input{border:0; background:transparent; outline:none; flex:1; font-size:13px;}
.topbar-right{margin-left:auto; display:flex; align-items:center; gap:16px;}
.user-chip{display:flex; align-items:center; gap:8px; position:relative;}
.avatar{width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,#3b6cf6,#7c3aed); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12px;}
.content{padding:20px 24px 40px;}

.page-head{display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:10px;}
.page-title{font-size:20px; font-weight:800; margin:0 0 2px;}
.page-sub{font-size:12.5px; color:var(--muted); margin:0;}

.btn{border:none; border-radius:8px; padding:8px 14px; font-size:12.8px; font-weight:700; display:inline-flex; align-items:center; gap:6px; cursor:pointer; text-decoration:none;}
.btn:hover{text-decoration:none; filter:brightness(0.95);}
.btn-primary{background:var(--accent); color:#fff;}
.btn-teal{background:var(--accent-2); color:#fff;}
.btn-outline{background:#fff; color:var(--text); border:1px solid var(--border);}
.btn-danger{background:var(--red); color:#fff;}
.btn-sm{padding:5px 10px; font-size:11.5px;}
.btn-row{display:flex; gap:8px; flex-wrap:wrap;}

.kpi-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; margin-bottom:16px;}
.kpi{background:var(--card); border:1px solid var(--border); border-radius:12px; padding:14px;}
.kpi-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;}
.kpi-ic{width:32px; height:32px; border-radius:9px; display:flex; align-items:center; justify-content:center;}
.kpi-val{font-size:19px; font-weight:800;}
.kpi-lbl{font-size:11px; color:var(--muted); font-weight:600;}

.panel{background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px 18px; margin-bottom:16px;}
.panel-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
.panel-title{font-size:13.5px; font-weight:800; display:flex; align-items:center; gap:8px;}
.panel-title .bar{width:4px; height:14px; background:var(--accent); border-radius:2px; display:inline-block;}

table{width:100%; border-collapse:collapse;}
thead th{text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); font-weight:700; padding:10px; border-bottom:1px solid var(--border); background:#fafbfd; white-space:nowrap;}
tbody td{padding:10px; border-bottom:1px solid #f0f2f7; font-size:12.6px; vertical-align:middle;}
tbody tr:hover{background:#fafbff;}
.table-wrap{overflow-x:auto;}
.mono-link{font-weight:700; color:var(--accent);}

.badge{display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:20px; font-size:10.6px; font-weight:700; white-space:nowrap;}
.badge-dot{width:6px; height:6px; border-radius:50%;}
.b-success{background:var(--green-bg); color:var(--green);}
.b-danger{background:var(--red-bg); color:var(--red);}
.b-warning{background:var(--orange-bg); color:var(--orange);}
.b-info{background:var(--blue-bg); color:var(--blue);}
.b-secondary{background:var(--gray-bg); color:var(--gray);}

.form-label{font-size:12.3px; font-weight:700; margin-bottom:4px; display:block;}
.form-control, select.form-control, textarea.form-control{
  width:100%; border:1px solid var(--border); border-radius:8px; padding:8px 11px; font-size:13px;
  font-family:inherit; background:#fff; color:var(--text);
}
.form-control:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(59,108,246,.12);}
.form-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-bottom:14px;}
.form-group{margin-bottom:14px;}
.form-error{color:var(--red); font-size:11.5px; margin-top:4px;}
.form-hint{color:var(--muted); font-size:11px; margin-top:4px;}

.alert{padding:12px 16px; border-radius:10px; font-size:13px; margin-bottom:16px; border:1px solid transparent;}
.alert-success{background:var(--green-bg); color:#166534; border-color:#bbf0cd;}
.alert-danger{background:var(--red-bg); color:#991b1b; border-color:#fbc7c7;}
.alert-warning{background:var(--orange-bg); color:#9a3412; border-color:#fdd9ae;}
.alert-info{background:var(--blue-bg); color:#1e3a8a; border-color:#bfd6ff;}

.tabs-wrap{display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap;}
.tabs-col{width:190px; flex:0 0 190px; background:var(--card); border:1px solid var(--border); border-radius:12px; padding:10px; height:fit-content;}
.tab-item{padding:9px 12px; border-radius:8px; font-size:12.4px; font-weight:600; margin-bottom:2px; cursor:pointer; display:block; color:var(--text);}
.tab-item.active{background:var(--accent); color:#fff;}
.tab-item:not(.active):hover{background:#f3f5fa;}
.tab-panel{display:none;}
.tab-panel.active{display:block;}

.grid-2{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
.grid-3{display:grid; grid-template-columns:repeat(3,1fr); gap:14px;}
@media (max-width: 900px){ .grid-2, .grid-3{grid-template-columns:1fr;} }

.info-row{display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px dashed #eef0f5; font-size:12.6px; gap:10px;}
.info-row .k{color:var(--muted);}
.info-row .v{font-weight:700; text-align:right;}

.progress-track{height:8px; border-radius:6px; background:#eef1f7; overflow:hidden;}
.progress-fill{height:100%; border-radius:6px;}

.timeline{position:relative; padding-left:18px;}
.timeline::before{content:""; position:absolute; left:4px; top:4px; bottom:4px; width:2px; background:#eef0f5;}
.t-item{position:relative; padding-bottom:14px;}
.t-item::before{content:""; position:absolute; left:-18px; top:3px; width:9px; height:9px; border-radius:50%; background:var(--accent); border:2px solid #fff; box-shadow:0 0 0 2px var(--accent);}
.t-time{font-size:10.5px; color:var(--muted);}
.t-text{font-size:12.4px; font-weight:600; margin-top:1px;}

.pagination{display:flex; gap:6px; margin-top:14px;}
.pagination a, .pagination span{padding:6px 11px; border-radius:6px; border:1px solid var(--border); font-size:12px; color:var(--text);}
.pagination .active{background:var(--accent); color:#fff; border-color:var(--accent);}

.empty-state{text-align:center; padding:40px 20px; color:var(--muted);}

.login-shell{min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#0c1533,#16234f 60%,#123a4a);}
.login-card{width:380px; background:#fff; border-radius:16px; padding:32px 28px; box-shadow:0 20px 60px rgba(0,0,0,.3);}
.login-logo{display:flex; align-items:center; gap:10px; margin-bottom:22px;}

.filters{display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap;}
.filters select, .filters input{border:1px solid var(--border); border-radius:8px; padding:8px 10px; font-size:12.3px;}
.filters .grow{flex:1; min-width:200px;}

.pos{color:var(--green); font-weight:700;}
.neg{color:var(--red); font-weight:700;}

.checklist-item{display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px dashed #eef0f5; font-size:12.8px;}
.checklist-item input{width:16px; height:16px;}

@media (max-width: 860px){
  .sidebar{position:fixed; left:-260px; z-index:50; transition:left .2s;}
  .sidebar.open{left:0;}
  .kpi-row{grid-template-columns:repeat(2,1fr);}
}
