:root {
    --simrw-primary: #4db2ff;
    --simrw-primary-dark: #238ed9;
    --simrw-bg: #f5f8fb;
    --simrw-text: #1d2939;
    --simrw-muted: #667085;
    --simrw-border: #e4e7ec;
    --sidebar-width: 260px;
}

html, body {
    min-height: 100%;
}

body {
    background: var(--simrw-bg);
    color: var(--simrw-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-decoration: none; }

.btn-primary {
    --bs-btn-bg: var(--simrw-primary);
    --bs-btn-border-color: var(--simrw-primary);
    --bs-btn-hover-bg: var(--simrw-primary-dark);
    --bs-btn-hover-border-color: var(--simrw-primary-dark);
}

.form-control,
.form-select {
    min-height: 46px;
    border-radius: 12px;
    border-color: var(--simrw-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--simrw-primary);
    box-shadow: 0 0 0 .2rem rgba(77,178,255,.18);
}

.card {
    border: 1px solid var(--simrw-border);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(16,24,40,.04);
}

.auth-card {
    max-width: 460px;
    margin: 0 auto;
}

.auth-logo {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--simrw-primary), #8ad1ff);
    color: white;
    font-size: 28px;
    font-weight: 800;
}

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

.sidebar {
    width: var(--sidebar-width) !important;
    background: #ffffff;
    border-right: 1px solid var(--simrw-border);
    padding: 18px;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 6px 24px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--simrw-primary);
    color: #fff;
    font-weight: 800;
}

.sidebar-brand small {
    display: block;
    color: var(--simrw-muted);
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav .nav-link {
    color: #344054;
    border-radius: 12px;
    padding: 11px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar-nav .nav-link:hover {
    background: #eef8ff;
    color: #1178bc;
}

.sidebar-nav .nav-link.disabled {
    color: #98a2b3;
    cursor: not-allowed;
}

.sidebar-label {
    margin: 18px 12px 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #98a2b3;
}

.app-main {
    min-width: 0;
}

.topbar {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--simrw-border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eaf6ff;
    color: #167fbd;
    font-weight: 700;
}

.stat-card {
    padding: 18px;
    background: #fff;
}

.stat-label {
    color: var(--simrw-muted);
    font-size: 14px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 6px;
}

.table thead th {
    font-size: 13px;
    color: #475467;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.badge-soft {
    background: #eef8ff;
    color: #126a9b;
}

@media (min-width: 992px) {
    .app-shell {
        display: grid;
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
    }

    .topbar {
        padding: 0 28px;
    }
}

@media (max-width: 575.98px) {
    .card {
        border-radius: 14px;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* SIMRW v0.9 — Reports */
.report-tabs .nav-link{white-space:nowrap;border-radius:12px}
.report-bar-row{display:grid;grid-template-columns:minmax(95px,160px) 1fr 52px;gap:10px;align-items:center;margin:12px 0;font-size:13px}
.report-bar{height:10px;border-radius:999px;background:#edf2f7;overflow:hidden}
.report-bar>span{display:block;height:100%;min-width:2px;border-radius:999px;background:linear-gradient(90deg,var(--simrw-primary),var(--simrw-primary-dark))}
.report-trend-grid{display:grid;gap:15px}
.report-trend-row{display:grid;grid-template-columns:64px 1fr 1fr 110px;gap:12px;align-items:center}
.report-kv{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:12px 0;border-bottom:1px solid var(--simrw-border)}
.report-kv:last-child{border-bottom:0}
.report-finance-big{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.report-finance-big>div{padding:16px;border:1px solid var(--simrw-border);border-radius:14px;background:#fafcff}
.report-finance-big span{display:block;color:var(--simrw-muted);font-size:13px;margin-bottom:5px}
.report-finance-big strong{font-size:18px}
@media(max-width:767.98px){.report-trend-row{grid-template-columns:52px 1fr;}.report-trend-row>div:nth-child(3),.report-trend-row>div:nth-child(4){grid-column:2}.report-finance-big{grid-template-columns:1fr}.report-bar-row{grid-template-columns:95px 1fr 38px}}


/* SIMRW v1.1 — PWA & Mobile UX */
:root{--bottom-nav-height:72px;--safe-bottom:env(safe-area-inset-bottom,0px)}
.skip-link{position:fixed;left:12px;top:-80px;z-index:3000;background:#101828;color:#fff;padding:10px 14px;border-radius:10px}.skip-link:focus{top:12px;color:#fff}
.connection-status{position:fixed;z-index:2200;top:10px;left:50%;transform:translateX(-50%);max-width:calc(100% - 28px);padding:9px 14px;border-radius:999px;background:#101828;color:#fff;font-size:13px;box-shadow:0 8px 24px rgba(16,24,40,.18)}
.pwa-install-card{position:fixed;right:18px;bottom:18px;z-index:1900;width:min(390px,calc(100% - 32px));display:flex;justify-content:space-between;align-items:center;gap:14px;background:#fff;border:1px solid var(--simrw-border);border-radius:16px;padding:13px 14px;box-shadow:0 18px 45px rgba(16,24,40,.16)}
.pwa-install-card small{display:block;color:var(--simrw-muted);margin-top:2px}
.mobile-page-header{display:flex;justify-content:space-between;align-items:flex-end;gap:14px}.eyebrow{display:block;color:#167fbd;font-size:12px;text-transform:uppercase;letter-spacing:.07em;font-weight:800;margin-bottom:5px}
.service-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.service-tile{display:flex;min-width:0;flex-direction:column;gap:6px;padding:17px;background:#fff;border:1px solid var(--simrw-border);border-radius:16px;color:var(--simrw-text);box-shadow:0 4px 16px rgba(16,24,40,.035)}.service-tile:hover{color:var(--simrw-text);border-color:#b9ddf7;transform:translateY(-1px)}.service-tile small{color:var(--simrw-muted);line-height:1.4}.service-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#eef8ff;font-size:20px;margin-bottom:3px}
.profile-avatar{width:56px;height:56px;display:grid;place-items:center;border-radius:18px;background:#eaf6ff;color:#167fbd;font-size:22px;font-weight:800}
.list-card{overflow:hidden;background:#fff;border:1px solid var(--simrw-border);border-radius:16px}.list-card>a,.list-card>button{width:100%;border:0;background:#fff;color:var(--simrw-text);text-align:left;display:grid;grid-template-columns:34px 1fr 20px;gap:10px;align-items:center;padding:15px 17px;border-bottom:1px solid var(--simrw-border)}.list-card>a:last-child,.list-card>button:last-child{border-bottom:0}.list-card>a:hover,.list-card>button:hover{background:#f9fbfc}.list-card small{display:block;color:var(--simrw-muted);font-size:12px;margin-top:2px}.list-card b{font-size:22px;color:#98a2b3;font-weight:400}
.citizen-bottom-nav{display:none}
.table-responsive{border-radius:12px;-webkit-overflow-scrolling:touch}.btn-group{flex-wrap:wrap}.form-label{font-weight:600;color:#344054}.alert{border-radius:14px}.pagination{flex-wrap:wrap;gap:3px}.pagination .page-link{border-radius:9px;min-width:38px;text-align:center}.empty-state{padding:34px 18px;text-align:center;color:var(--simrw-muted)}
body.is-loading .app-main{cursor:progress}.form-loading [type=submit]{pointer-events:none;opacity:.75}.form-loading [type=submit]::after{content:' …'}
@media(max-width:991.98px){.sidebar{max-width:86vw}.sidebar-nav{padding-bottom:28px}.topbar{height:62px}.topbar .btn{min-height:42px}.admin-app main{padding-bottom:28px!important}}
@media(max-width:767.98px){
  .citizen-app main{padding-bottom:calc(var(--bottom-nav-height) + var(--safe-bottom) + 26px)!important}.citizen-app .topbar{padding:0 12px}.citizen-app .topbar>[data-bs-target="#sidebar"]{display:none!important}
  .citizen-bottom-nav{position:fixed;z-index:1800;left:0;right:0;bottom:0;display:grid;grid-template-columns:repeat(5,1fr);height:calc(var(--bottom-nav-height) + var(--safe-bottom));padding:6px 6px calc(6px + var(--safe-bottom));background:rgba(255,255,255,.98);border-top:1px solid var(--simrw-border);box-shadow:0 -8px 26px rgba(16,24,40,.07);backdrop-filter:blur(12px)}
  .citizen-bottom-link{min-width:0;color:#667085;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:12px;font-size:11px;font-weight:700}.citizen-bottom-link.active{color:#167fbd;background:#eef8ff}.citizen-bottom-icon{font-size:20px;line-height:1}.citizen-bottom-link:hover{color:#167fbd}
  .pwa-install-card{left:16px;right:16px;bottom:calc(var(--bottom-nav-height) + var(--safe-bottom) + 10px);width:auto}.mobile-page-header{align-items:flex-start}.service-grid{grid-template-columns:1fr 1fr}.service-tile{padding:15px}.card-body.p-4{padding:18px!important}
  h1.h3{font-size:1.45rem}.table{font-size:13px}.table>:not(caption)>*>*{padding:.65rem .55rem}.stat-card{padding:15px}.stat-label{font-size:12px}.stat-value{font-size:22px}
}
@media(max-width:389.98px){.service-grid{grid-template-columns:1fr}.citizen-bottom-link{font-size:10px}.citizen-bottom-icon{font-size:18px}.pwa-install-card{flex-direction:column;align-items:stretch}}
@media(display-mode:standalone){.pwa-install-card{display:none!important}.topbar{padding-top:env(safe-area-inset-top,0px);height:calc(62px + env(safe-area-inset-top,0px))}}

.mobile-brand{display:flex;align-items:center;gap:8px;color:var(--simrw-text)}.mobile-brand span{width:32px;height:32px;border-radius:10px;background:var(--simrw-primary);color:#fff;display:grid;place-items:center;font-weight:800}.mobile-brand strong{font-size:15px}

.sidebar-nav .nav-link.active{background:#eef8ff;color:#1178bc;font-weight:700}
