:root {
    --rp-bg:#f5f7fb;
    --rp-surface:#ffffff;
    --rp-soft:#f8fafc;
    --rp-ink:#162033;
    --rp-muted:#6d7788;
    --rp-line:#dfe6ef;
    --rp-brand:#1a73e8;
    --rp-brand-2:#1557b0;
    --rp-green:#0f9f6e;
    --rp-amber:#c47a17;
    --rp-red:#d23f31;
    --rp-violet:#7659d6;
    --rp-cyan:#0891b2;
    --rp-shadow:0 18px 42px rgba(25,39,64,.08);
}

* { box-sizing:border-box; }
html { min-height:100%; background:var(--rp-bg); }
body {
    margin:0;
    min-height:100%;
    font-family:"Segoe UI", "Helvetica Neue", Arial, ui-sans-serif, system-ui, sans-serif;
    color:var(--rp-ink);
    background:
        radial-gradient(circle at top left, rgba(26,115,232,.08), transparent 36rem),
        linear-gradient(180deg, #f9fbff 0%, var(--rp-bg) 38%);
    font-size:14px;
    line-height:1.45;
    letter-spacing:0;
}

a { color:inherit; }
button, input, select, textarea { font:inherit; }

.app-shell { min-height:100vh; display:grid; grid-template-columns:272px minmax(0,1fr); }
.app-sidebar {
    position:sticky;
    top:0;
    height:100vh;
    padding:18px 14px;
    color:#dce6f7;
    background:#0d1422;
    border-right:1px solid rgba(255,255,255,.08);
}
.app-brand {
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px 8px 18px;
    color:#fff;
    text-decoration:none;
}
.app-logo {
    width:40px;
    height:40px;
    display:grid;
    place-items:center;
    border-radius:10px;
    background:linear-gradient(135deg, var(--rp-brand), #6ea8ff);
    box-shadow:0 12px 24px rgba(26,115,232,.28);
    font-weight:700;
}
.app-brand-title { display:block; font-size:17px; font-weight:650; letter-spacing:0; }
.app-brand-subtitle { display:block; margin-top:2px; color:#9fb0c8; font-size:12px; font-weight:400; }
.app-nav { display:grid; gap:4px; padding:4px; }
.app-nav a {
    display:flex;
    align-items:center;
    gap:10px;
    min-height:40px;
    padding:10px 11px;
    border-radius:8px;
    color:#b8c5d8;
    text-decoration:none;
    font-weight:500;
    transition:background .16s ease, color .16s ease, transform .16s ease;
}
.app-nav a:hover { background:rgba(255,255,255,.07); color:#fff; transform:translateX(1px); }
.app-nav a.active { background:#e8f1ff; color:#123b74; }
.app-icon {
    width:18px;
    height:18px;
    flex:0 0 auto;
    stroke:currentColor;
    stroke-width:1.9;
    fill:none;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.app-main { min-width:0; padding:26px 28px 44px; }
.app-topbar {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:18px;
    margin-bottom:22px;
}
.eyebrow {
    color:var(--rp-brand);
    font-size:12px;
    font-weight:650;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.page-title {
    margin:6px 0 0;
    font-size:34px;
    line-height:1.08;
    letter-spacing:0;
    font-weight:650;
}
.page-subtitle {
    margin:9px 0 0;
    max-width:780px;
    color:var(--rp-muted);
    font-size:15px;
    line-height:1.5;
}
.top-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.btn, .control {
    min-height:40px;
    border:1px solid var(--rp-line);
    border-radius:8px;
    background:#fff;
    color:var(--rp-ink);
    padding:9px 13px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    text-decoration:none;
    font-weight:550;
    cursor:pointer;
}
.btn.primary { background:var(--rp-brand); border-color:var(--rp-brand); color:#fff; box-shadow:0 12px 26px rgba(26,115,232,.18); }
.btn.dark { background:#162033; border-color:#162033; color:#fff; }

.grid { display:grid; gap:16px; }
.card {
    background:rgba(255,255,255,.92);
    border:1px solid var(--rp-line);
    border-radius:10px;
    box-shadow:var(--rp-shadow);
}
.dashboard-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); margin-bottom:16px; }
.metric-card {
    position:relative;
    min-height:142px;
    padding:18px;
    overflow:hidden;
    color:#fff;
    border:0;
}
.metric-card::after {
    content:"";
    position:absolute;
    right:-42px;
    top:-48px;
    width:132px;
    height:132px;
    border-radius:999px;
    background:rgba(255,255,255,.18);
}
.metric-card:nth-child(1) { background:linear-gradient(135deg, #1a73e8, #1557b0); }
.metric-card:nth-child(2) { background:linear-gradient(135deg, #0891b2, #0e7490); }
.metric-card:nth-child(3) { background:linear-gradient(135deg, #0f9f6e, #047857); }
.metric-card:nth-child(4) { background:linear-gradient(135deg, #c47a17, #9a5b0b); }
.metric-label { color:rgba(255,255,255,.78); font-size:12px; text-transform:uppercase; letter-spacing:.07em; font-weight:600; }
.metric-value { margin-top:10px; font-size:32px; line-height:1; font-weight:650; letter-spacing:0; }
.metric-trend { margin-top:10px; color:rgba(255,255,255,.82); font-weight:500; font-size:13px; }

.dashboard-layout { grid-template-columns:minmax(0,1.42fr) minmax(340px,.58fr); align-items:start; }
.section-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:18px 18px 0; }
.section-head h2 { margin:0; font-size:19px; font-weight:650; letter-spacing:0; }
.section-head p { margin:5px 0 0; color:var(--rp-muted); font-size:13px; line-height:1.45; }
.status-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:18px; }
.state { border:1px solid var(--rp-line); border-radius:9px; padding:12px; background:var(--rp-soft); }
.state strong { display:flex; justify-content:space-between; gap:10px; font-weight:600; }
.meter { height:8px; border-radius:999px; background:#e8edf4; overflow:hidden; margin-top:10px; }
.meter span { display:block; height:100%; border-radius:inherit; }
.table-wrap { padding:0 18px 18px; overflow-x:auto; }
table { width:100%; border-collapse:collapse; min-width:760px; }
th, td { padding:13px 10px; border-bottom:1px solid var(--rp-line); text-align:left; font-size:14px; vertical-align:middle; }
th { color:var(--rp-muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; background:#fbfcfe; font-weight:650; }
td strong { font-weight:600; }
.pill { display:inline-flex; border-radius:999px; padding:5px 9px; background:#eef5ff; color:#174ea6; font-size:12px; font-weight:600; white-space:nowrap; }
.side-panel { padding:18px; display:grid; gap:14px; }
.panel-block { border:1px solid var(--rp-line); border-radius:9px; padding:13px; background:var(--rp-soft); }
.panel-block strong { display:block; font-size:15px; font-weight:600; }
.quick-links { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.availability { display:grid; gap:9px; }
.light { display:flex; justify-content:space-between; gap:10px; align-items:center; border:1px solid var(--rp-line); border-radius:8px; padding:10px; background:#fff; font-size:13px; }
.lamp { width:10px; height:10px; border-radius:50%; display:inline-block; margin-right:8px; }
.lamp.green { background:var(--rp-green); }
.lamp.amber { background:var(--rp-amber); }
.lamp.red { background:var(--rp-red); }
.pipeline { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.pipe { border:1px solid var(--rp-line); border-radius:8px; padding:10px; background:#fff; min-height:70px; }
.pipe strong { font-size:22px; font-weight:650; }
.pipe span { color:var(--rp-muted); font-size:12px; display:block; margin-top:4px; }
.module-grid { grid-template-columns:repeat(4,minmax(0,1fr)); margin-top:16px; }
.module { min-height:160px; padding:16px; display:flex; flex-direction:column; justify-content:space-between; }
.module h3 { margin:0; font-size:16px; font-weight:650; letter-spacing:0; }
.module p { color:var(--rp-muted); font-size:13px; line-height:1.45; margin:9px 0 14px; }
.progress { height:7px; background:#e7edf5; border-radius:999px; overflow:hidden; }
.progress span { display:block; height:100%; background:var(--rp-brand); }

@media (max-width:1120px) {
    .app-shell { grid-template-columns:1fr; }
    .app-sidebar { position:static; height:auto; }
    .app-nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .dashboard-metrics, .module-grid, .dashboard-layout { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .status-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
    .app-main { padding:18px 14px 30px; }
    .app-topbar { flex-direction:column; }
    .top-actions { justify-content:flex-start; }
    .page-title { font-size:27px; }
    .dashboard-metrics, .module-grid, .dashboard-layout, .status-grid, .pipeline, .quick-links { grid-template-columns:1fr; }
    .app-nav { grid-template-columns:1fr; }
}
