:root {
    --navy-950: #091829;
    --navy-900: #0f2942;
    --navy-800: #163a5f;
    --blue-600: #1d4ed8;
    --blue-700: #1e40af;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-900: #0f172a;
    --green-700: #15803d;
    --green-100: #dcfce7;
    --amber-700: #b45309;
    --amber-100: #fef3c7;
    --red-700: #b91c1c;
    --red-100: #fee2e2;
    --purple-700: #6d28d9;
    --purple-100: #ede9fe;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--slate-100);
    color: var(--slate-900);
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--navy-950);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 20;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    padding: 1.35rem 1.25rem;
    background: var(--navy-900);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.45rem;
}

.brand h1 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.brand p {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.nav-menu {
    padding: 0.85rem 0.65rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 0.62rem 0.8rem;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0.2rem;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.nav-item.active {
    background: var(--blue-600);
    color: #fff;
    font-weight: 600;
}

.nav-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.74rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.76rem;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
}

/* Main workspace */
.main-wrap {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    padding: 0.9rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title h2 {
    font-size: 1.15rem;
    color: var(--navy-900);
}

.topbar-title span {
    font-size: 0.8rem;
    color: var(--slate-500);
}

.topbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.content {
    padding: 1.5rem 1.75rem 3rem;
    max-width: 1400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    border-radius: 6px;
    font-size: 0.83rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--blue-600);
    color: #fff;
}

.btn-primary:hover {
    background: var(--blue-700);
}

.btn-outline {
    background: #fff;
    border-color: var(--slate-300);
    color: var(--slate-700);
}

.btn-outline:hover {
    background: var(--slate-50);
}

.btn-success {
    background: var(--green-700);
    color: #fff;
}

/* KPI Grid & Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-left: 4px solid var(--blue-600);
    border-radius: 8px;
    padding: 1.1rem 1.2rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.kpi-card.green { border-left-color: var(--green-700); }
.kpi-card.amber { border-left-color: var(--amber-700); }
.kpi-card.red   { border-left-color: var(--red-700); }

.kpi-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--slate-500);
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--navy-900);
    margin: 0.25rem 0;
}

.kpi-sub {
    font-size: 0.8rem;
    color: var(--slate-500);
}

.card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.card h3 {
    font-size: 1.02rem;
    color: var(--navy-900);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--slate-200);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.25rem;
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filters-bar input,
.filters-bar select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--slate-300);
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    color: var(--slate-900);
}

.filters-bar input {
    flex: 1;
    min-width: 220px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

th, td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--slate-200);
    vertical-align: top;
}

th {
    background: var(--navy-900);
    color: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

tr:nth-child(even) td {
    background: var(--slate-50);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-red    { background: var(--red-100); color: var(--red-700); }
.badge-amber  { background: var(--amber-100); color: var(--amber-700); }
.badge-green  { background: var(--green-100); color: var(--green-700); }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-purple { background: var(--purple-100); color: var(--purple-700); }
.badge-slate  { background: var(--slate-200); color: var(--slate-700); }

code.inline {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.78rem;
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    color: var(--navy-900);
}

/* Progress bar */
.progress-row {
    margin-bottom: 0.85rem;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.progress-track {
    height: 9px;
    background: var(--slate-200);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--blue-600);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.progress-fill.green { background: var(--green-700); }

/* Architecture diagram boxes */
.arch-diagram {
    display: grid;
    grid-template-columns: 1fr auto 1.3fr;
    gap: 1rem;
    align-items: stretch;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 1.15rem;
    margin-bottom: 1rem;
}

.arch-zone {
    border: 2px solid var(--slate-300);
    border-radius: 8px;
    padding: 0.9rem;
    background: #fff;
}

.arch-zone.aws {
    border-color: #2563eb;
}

.arch-zone h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--navy-900);
    margin-bottom: 0.65rem;
}

.subnet-box {
    border: 1px dashed var(--slate-300);
    border-radius: 6px;
    padding: 0.65rem;
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
}

.subnet-box.pub { background: #eff6ff; border-color: #60a5fa; }
.subnet-box.priv { background: #f0fdf4; border-color: #4ade80; }
.subnet-box.warn { background: #fef2f2; border-color: #f87171; }

.arch-arrow {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: var(--blue-600);
    font-size: 0.8rem;
    text-align: center;
    padding: 0 0.4rem;
}

select.inline-select {
    padding: 0.25rem 0.45rem;
    font-size: 0.76rem;
    border-radius: 4px;
    border: 1px solid var(--slate-300);
}

.notice-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--blue-600);
    padding: 0.85rem 1rem;
    border-radius: 6px;
    font-size: 0.84rem;
    color: #1e3a8a;
    margin-bottom: 1.2rem;
}

@media (max-width: 960px) {
    .sidebar { position: static; width: 100%; }
    body { flex-direction: column; }
    .main-wrap { margin-left: 0; }
    .arch-diagram { grid-template-columns: 1fr; }
}
