:root{
    --bg:#f6f8fb;
    --panel:#fff;
    --ink:#102033;
    --muted:#64748b;
    --brand:#0d5c8c;
    --brand2:#0ea5a3;
    --accent:#f6a623;
    --line:#e5edf5;
    --ok:#0b8f5a;
    --bad:#c0392b;
    --warn:#b7791f;
    --shadow:0 14px 40px rgba(15,23,42,.07);
}

*{box-sizing:border-box}

body{
    margin:0;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial,sans-serif;
    background:var(--bg);
    color:var(--ink);
}

a{text-decoration:none;color:inherit}

.sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:268px;
    background:#071929;
    color:#e6eef7;
    padding:18px 16px;
    overflow:auto;
}

.brand{
    display:flex;
    gap:12px;
    align-items:center;
    margin-bottom:24px;
    padding:4px 6px;
}

.brand span{
    display:block;
    color:#8fa7bd;
    font-size:12px;
    margin-top:2px;
}

.logo{
    width:44px;
    height:44px;
    border-radius:16px;
    background:linear-gradient(135deg,var(--brand),var(--accent));
    display:grid;
    place-items:center;
    font-weight:900;
    color:white;
}

.nav-modern a{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-radius:13px;
    margin:2px 0;
    color:#dbeafe;
    font-weight:650;
    font-size:14px;
}

.nav-modern a:hover{
    background:#11324e;
    color:#fff;
}

.nav-label{
    font-size:11px;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:#7e9ab3;
    margin:18px 10px 7px;
}

.main{margin-left:268px}

.topbar{
    height:68px;
    background:rgba(255,255,255,.9);
    backdrop-filter:blur(12px);
    border-bottom:1px solid var(--line);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 24px;
    position:sticky;
    top:0;
    z-index:4;
}

.topbar span{color:var(--muted)}

.top-actions{
    display:flex;
    align-items:center;
    gap:10px;
}

.user-pill{
    background:#f1f5f9;
    border:1px solid var(--line);
    border-radius:999px;
    padding:8px 11px;
    font-size:13px;
}

.hamb{
    display:none;
    background:#eef5fb;
    color:var(--ink);
    border:1px solid var(--line);
    border-radius:12px;
    padding:8px 11px;
}

.content{padding:24px}

.grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
}

.grid.two{grid-template-columns:repeat(2,1fr)}

.card{
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:22px;
    padding:20px;
    box-shadow:var(--shadow);
    margin-bottom:16px;
}

.stat h2{
    margin:5px 0 0;
    font-size:30px;
}

.stat span,.muted{color:var(--muted)}

.btn,button,input[type=submit]{
    background:linear-gradient(135deg,var(--brand),#0f749c);
    color:#fff;
    border:0;
    border-radius:13px;
    padding:10px 14px;
    font-weight:800;
    cursor:pointer;
    display:inline-block;
    box-shadow:0 6px 14px rgba(13,92,140,.15);
}

.btn.secondary,button.secondary{
    background:#eef5fb;
    color:#102033;
    box-shadow:none;
    border:1px solid var(--line);
}

.btn.warn{background:var(--warn)}
.btn.bad{background:var(--bad)}
.btn.small{padding:7px 10px;font-size:13px}

input,select,textarea{
    width:100%;
    padding:12px 13px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    color:var(--ink);
    font-size:14px;
}

input:focus,select:focus,textarea:focus{
    outline:2px solid rgba(13,92,140,.15);
    border-color:#8ec5e4;
}

label{
    font-weight:800;
    font-size:13px;
    margin:10px 0 6px;
    display:block;
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:12px;
}

table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    background:#fff;
    border-radius:18px;
    overflow:hidden;
    border:1px solid var(--line);
}

th,td{
    padding:12px;
    border-bottom:1px solid var(--line);
    text-align:left;
    vertical-align:top;
}

tr:last-child td{border-bottom:0}

th{
    background:#f8fafc;
    font-size:12px;
    color:#475569;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.badge{
    padding:5px 9px;
    border-radius:999px;
    background:#edf2f7;
    font-size:12px;
    font-weight:800;
}

.ok{color:var(--ok)}
.bad{color:var(--bad)}

.alert{
    padding:12px 14px;
    border-radius:15px;
    margin-bottom:16px;
    background:#eefbf5;
}

.alert.bad{background:#fff1f0}

.poster{
    max-width:100%;
    border-radius:18px;
    border:1px solid var(--line);
    object-fit:contain;
}

.poster-thumb{
    width:82px;
    height:70px;
    object-fit:contain;
    border-radius:12px;
    background:#f7fafc;
    border:1px solid var(--line);
}

iframe.map{
    width:100%;
    height:260px;
    border:0;
    border-radius:18px;
}

.public-wrap{
    max-width:900px;
    margin:35px auto;
    padding:18px;
}

.center{text-align:center}
.qr{width:260px;height:260px}
.print-only{display:none}

.dashboard-hero{
    background:linear-gradient(135deg,#0d5c8c,#14a3a3);
    color:#fff;
    border-radius:24px;
    padding:24px 28px;
    margin-bottom:18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    box-shadow:0 18px 42px rgba(13,92,140,.16);
}

.dashboard-hero h1{
    margin:0;
    font-size:28px;
    letter-spacing:-.03em;
}

.dashboard-hero p{
    margin:6px 0 0;
    color:rgba(255,255,255,.86);
}

.dashboard-hero .btn{
    background:#fff;
    color:#0d5c8c;
    box-shadow:none;
}

.metric-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
    margin-bottom:18px;
}

.metric-card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:20px;
    padding:16px 18px;
    box-shadow:0 8px 28px rgba(17,24,39,.035);
}

.metric-card span{
    display:block;
    color:var(--muted);
    font-size:13px;
    margin-bottom:6px;
}

.metric-card strong{
    font-size:26px;
    letter-spacing:-.03em;
    color:#0b2545;
}

.graph-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
}

.graph-card{
    padding:16px;
    margin-bottom:14px;
}

.graph-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:8px;
}

.graph-head h3{
    font-size:15px;
    margin:0;
    color:#0b2545;
}

.chart-box{
    height:185px;
    position:relative;
}

.chart-box.short{height:165px}

.prediction-row{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    margin:10px 0 5px;
}

.score{
    font-weight:900;
    color:var(--brand);
    font-size:18px;
}

.progress{
    height:7px;
    background:#eef3f7;
    border-radius:999px;
    overflow:hidden;
}

.progress span{
    display:block;
    height:100%;
    background:linear-gradient(90deg,var(--brand),var(--accent));
    border-radius:999px;
}

.ai-answer{
    margin-top:18px;
    padding:18px;
    border-radius:18px;
    background:#eefbf5;
    border:1px solid #c6f6d5;
}

.toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.danger-zone{
    border-color:#fecaca;
    background:#fff7f7;
}

.role-chip{
    display:inline-block;
    border-radius:999px;
    background:#eef5fb;
    padding:5px 9px;
    font-weight:800;
    font-size:12px;
}

.status-active{background:#dcfce7;color:#166534}
.status-inactive{background:#fee2e2;color:#991b1b}

/* =========================
   FEBC MODERN LOGIN ONLY
   Scoped to body.login-page only
========================= */

body.login-page{
    margin:0;
    min-height:100vh;
    background:
        radial-gradient(circle at 16% 20%, rgba(207,31,82,.13), transparent 28%),
        radial-gradient(circle at 86% 16%, rgba(0,91,116,.18), transparent 30%),
        linear-gradient(135deg,#f7fbfd 0%,#eef5f8 100%);
    display:flex;
    align-items:center;
    justify-content:center;
    font-family:Inter,Arial,sans-serif;
}

body.login-page .login-shell{
    width:100%;
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

body.login-page .login-card-modern{
    width:100%;
    max-width:440px;
    background:#fff;
    border-radius:28px;
    padding:38px 36px 34px;
    border:1px solid #e3edf2;
    box-shadow:0 28px 80px rgba(0,60,85,.16);
}

body.login-page .login-card-modern::before{
    content:"";
    display:block;
    width:70px;
    height:5px;
    border-radius:999px;
    background:linear-gradient(90deg,#cf1f52,#005b74);
    margin:0 auto 24px;
}

body.login-page .login-logo-modern{
    width:185px;
    max-width:100%;
    height:auto;
    display:block;
    margin:0 auto 22px;
    object-fit:contain;
}

body.login-page .login-card-modern h1{
    text-align:center;
    font-size:27px;
    line-height:1.2;
    color:#004f68;
    margin:0 0 30px;
    font-weight:850;
    letter-spacing:-.03em;
}

body.login-page .login-form label{
    display:block;
    font-size:14px;
    font-weight:800;
    color:#123244;
    margin:16px 0 7px;
}

body.login-page .login-form input[type=email],
body.login-page .login-form input[type=password],
body.login-page .login-form input[type=text]{
    width:100%;
    height:54px;
    border-radius:16px;
    border:1px solid #dce8ee;
    background:#f8fbfd;
    padding:0 16px;
    font-size:15px;
    color:#102033;
    box-sizing:border-box;
}

body.login-page .login-form input:focus{
    outline:none;
    background:#fff;
    border-color:#005b74;
    box-shadow:0 0 0 4px rgba(0,91,116,.12);
}

body.login-page .login-form button{
    width:100%;
    height:54px;
    margin-top:26px;
    border:0;
    border-radius:16px;
    background:linear-gradient(135deg,#005b74,#0a8fa3);
    color:#fff;
    font-size:16px;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 16px 30px rgba(0,91,116,.24);
}

body.login-page .login-form button:hover{
    transform:translateY(-1px);
    box-shadow:0 20px 38px rgba(0,91,116,.30);
}

body.login-page .alert.bad{
    background:#fff1f4;
    color:#b42345;
    border:1px solid #ffd1dc;
    border-radius:14px;
    padding:13px 15px;
    margin-bottom:20px;
    font-size:14px;
}

body.login-page .show-password-row{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:10px;
    color:#475569;
    font-size:14px;
}

body.login-page .show-password-row input{
    width:auto;
    height:auto;
}

@media(max-width:1200px){
    .graph-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:850px){
    .sidebar{
        transform:translateX(-100%);
        transition:.2s;
    }

    .open .sidebar{transform:none}
    .main{margin-left:0}
    .hamb{display:block}
    .grid,.grid.two,.form-grid,.metric-grid,.graph-grid{grid-template-columns:1fr}
    .content{padding:14px}
    .dashboard-hero{align-items:flex-start;flex-direction:column}
    .chart-box,.chart-box.short{height:210px}
    .top-actions .user-pill{display:none}
    .topbar{padding:0 12px}
}

@media(max-width:520px){
    body.login-page .login-card-modern{
        padding:30px 24px;
        border-radius:24px;
    }

    body.login-page .login-logo-modern{
        width:150px;
    }

    body.login-page .login-card-modern h1{
        font-size:24px;
    }
}

@media print{
    .sidebar,.topbar,.no-print,.btn,button{display:none!important}
    .main{margin:0}
    .content{padding:0}
    .card{box-shadow:none;border:0}
    .print-only{display:block}
    body{background:#fff}
    table{font-size:12px}
}
