
:root{
    --bg:#f5f7fb;
    --panel:#ffffff;
    --text:#172033;
    --muted:#667085;
    --border:#e4e7ec;
    --primary:#1f4b99;
    --primary-dark:#16396f;
    --sidebar:#111827;
    --sidebar-soft:#1f2937;
    --ok:#14804a;
    --warn:#b54708;
    --danger:#b42318;
    --shadow:0 10px 30px rgba(16,24,40,.08);
}
*{box-sizing:border-box}
body{
    margin:0;
    font-family:Arial,Helvetica,sans-serif;
    background:var(--bg);
    color:var(--text);
}
a{color:inherit}
h1,h2,h3,p{margin-top:0}
input,textarea,button{font:inherit}
input,textarea{
    width:100%;
    border:1px solid var(--border);
    border-radius:8px;
    padding:11px 12px;
    margin-top:6px;
    background:#fff;
}
label{
    display:block;
    font-size:14px;
    font-weight:600;
    margin-bottom:16px;
}
button{border:0;cursor:pointer}
.muted{color:var(--muted);font-weight:400}
.card{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:12px;
    padding:22px;
    box-shadow:var(--shadow);
    margin-bottom:20px;
}
.card-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:14px;
}
.btn{
    display:inline-block;
    text-decoration:none;
    border-radius:8px;
    padding:10px 14px;
    background:#eef2f6;
    color:#24324a;
    font-weight:700;
}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-dark)}
.btn-secondary{background:#eef2f6;color:#344054}
.btn-warning{background:#fff3e6;color:#9a4b00}
.btn-large{padding:12px 18px;width:100%}
.btn-small{padding:7px 10px;font-size:13px}
.alert{padding:13px 15px;border-radius:8px;margin:0 0 18px}
.alert-error{background:#fff1f0;color:var(--danger);border:1px solid #ffd1cc}
.alert-success{background:#ecfdf3;color:var(--ok);border:1px solid #abefc6}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.app-shell{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:100vh}
.sidebar{
    background:var(--sidebar);
    color:#fff;
    padding:22px 16px;
    display:flex;
    flex-direction:column;
}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:6px 8px 28px}
.sidebar-brand strong{display:block;font-size:15px}
.sidebar-brand span{display:block;font-size:12px;color:#98a2b3;margin-top:3px}
.brand-mark{
    width:42px;height:42px;border-radius:10px;
    display:grid;place-items:center;
    background:#fff;color:var(--sidebar);
    font-weight:900;letter-spacing:-1px;
}
.brand-mark.large{width:62px;height:62px;font-size:22px;margin:0 auto 14px}
.nav-link{
    display:block;
    text-decoration:none;
    color:#cbd5e1;
    padding:11px 12px;
    border-radius:8px;
    margin-bottom:6px;
    font-weight:700;
}
.nav-link:hover,.nav-link.active{background:var(--sidebar-soft);color:#fff}
.sidebar-footer{
    margin-top:auto;
    border-top:1px solid #344054;
    padding:18px 8px 4px;
    display:flex;
    justify-content:space-between;
    gap:10px;
    font-size:13px;
}
.sidebar-footer a{color:#cbd5e1}
.main{padding:30px;min-width:0}
.page-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    margin-bottom:24px;
}
.page-header h1{margin-bottom:6px}
.page-header p{color:var(--muted);margin-bottom:0}
.stats-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:18px;
    margin-bottom:20px;
}
.stat-card{
    background:#fff;
    border:1px solid var(--border);
    box-shadow:var(--shadow);
    border-radius:12px;
    padding:20px;
}
.stat-card span{display:block;color:var(--muted);font-size:14px}
.stat-card strong{display:block;font-size:34px;margin-top:10px}
.status-list{display:grid;gap:12px}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:8px}
.dot.ok{background:var(--ok)}
.dot.pending{background:#f79009}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:760px}
th,td{
    text-align:left;
    padding:12px 10px;
    border-bottom:1px solid var(--border);
    vertical-align:top;
}
th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
td{font-size:14px}
.action-row{display:flex;gap:6px;flex-wrap:wrap}
.badge{
    display:inline-block;
    padding:5px 8px;
    border-radius:999px;
    font-size:11px;
    font-weight:800;
}
.badge-draft{background:#eef4ff;color:#1849a9}
.badge-hold{background:#fff3e6;color:#9a4b00}
.badge-approved{background:#ecfdf3;color:#067647}
.badge-sent{background:#f2f4f7;color:#344054}
.health-list{display:grid;gap:2px}
.health-row{
    display:grid;
    grid-template-columns:1fr 1fr 90px;
    gap:14px;
    align-items:center;
    padding:12px 0;
    border-bottom:1px solid var(--border);
}
.health-pill{
    justify-self:end;
    padding:5px 9px;
    border-radius:999px;
    font-size:11px;
    font-weight:900;
}
.health-ok{background:#ecfdf3;color:#067647}
.health-bad{background:#fff1f0;color:#b42318}
.login-page,.install-page{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:30px;
}
.login-shell{width:min(430px,100%);text-align:center}
.login-card{text-align:left}
.login-shell h1{margin-bottom:3px}
.install-shell{width:min(900px,100%)}
.brand-block{display:flex;gap:14px;align-items:center;margin-bottom:22px}
.brand-block h1{margin-bottom:4px}
.brand-block p{color:var(--muted);margin-bottom:0}
.install-card h2,.settings-form h2{margin-top:8px;padding-top:8px;border-top:1px solid var(--border)}
.install-card h2:first-child,.settings-form h2:first-of-type{border-top:0;margin-top:0;padding-top:0}
.install-note{font-size:13px;color:var(--muted);padding:0 4px 20px}
@media (max-width:900px){
    .app-shell{grid-template-columns:1fr}
    .sidebar{position:static}
    .stats-grid,.grid-2{grid-template-columns:1fr}
    .main{padding:20px}
    .page-header{flex-direction:column}
}
