:root {
    --navy: #0f2437;
    --navy-light: #18364f;
    --blue: #1976d2;
    --blue-dark: #125aa0;
    --bg: #f4f7fa;
    --card: #ffffff;
    --border: #d9e1e8;
    --text: #1f2933;
    --muted: #6b7280;
    --good-bg: #dff0d8;
    --good-text: #2e7d32;
    --warning-bg: #fff3cd;
    --warning-text: #8a6d00;
    --danger-bg: #f8d7da;
    --danger-text: #b00020;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    display: grid;
    grid-template-columns: 245px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--navy);
    color: white;
    padding: 18px;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 30px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--blue);
    display: grid;
    place-items: center;
    font-weight: bold;
}

.brand small {
    display: block;
    color: #b9c7d3;
    font-size: 11px;
}

.brand-subtitle {
    margin-top: 2px;
}

.breadcrumbs {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
}

.breadcrumbs a {
    color: var(--muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.page-actions a {
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
}

.page-actions a:hover {
    background: #eef3f8;
    text-decoration: none;
}

.project-ribbon {
    background: #ffffff;
    border: 1px solid var(--border);
    border-left: 5px solid var(--blue);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.project-ribbon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.project-ribbon small {
    display: block;
    color: var(--muted);
    margin-bottom: 3px;
}

.project-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.project-nav a {
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
}

.project-nav a:hover {
    background: #eef3f8;
    text-decoration: none;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav a {
    color: #e8eef5;
    padding: 10px 12px;
    border-radius: 6px;
}

.nav a:hover {
    background: var(--navy-light);
    text-decoration: none;
}

.nav-group {
    position: relative;
}

.nav-parent {
    color: #e8eef5;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: default;
    font-size: 14px;
}

.nav-parent:hover {
    background: var(--navy-light);
}

.nav-submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 210px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(15, 36, 55, 0.18);
    z-index: 50;
}

.nav-group:hover .nav-submenu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-submenu a {
    color: var(--text);
    padding: 9px 10px;
    border-radius: 6px;
}

.nav-submenu a:hover {
    background: #eef3f8;
    text-decoration: none;
}

.main {
    min-width: 0;
}

.topbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
}

.topbar p {
    margin: 4px 0 0 0;
    color: var(--muted);
}

.content {
    padding: 24px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.metric-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.metric-card small {
    color: var(--muted);
}

.metric-card h2 {
    margin: 6px 0 0 0;
    font-size: 26px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
}

.table th {
    background: #eef3f8;
    text-align: left;
    color: #334155;
    font-weight: 600;
}

.table th,
.table td {
    padding: 9px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.table tr:last-child td {
    border-bottom: none;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}

.btn-primary {
    background: var(--blue);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-dark);
    text-decoration: none;
}

.btn-secondary {
    background: #edf2f7;
    color: #1f2933;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 11px;
    white-space: nowrap;
}

.badge.good {
    background: var(--good-bg);
    color: var(--good-text);
}

.badge.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge.neutral {
    background: #e5e7eb;
    color: #374151;
}

.form-grid {
    display: grid;
    grid-template-columns: 200px 360px;
    gap: 10px;
    align-items: center;
}

input,
select,
textarea {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px;
    font-size: 13px;
}

textarea {
    resize: vertical;
}

.module-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.module-links a {
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 13px;
}

.module-links a:hover {
    background: #eef3f8;
    text-decoration: none;
}

.user-menu {
    display: flex;
    gap: 12px;
    align-items: center;
    text-align: right;
}

.user-menu small {
    display: block;
    color: var(--muted);
}

/* add this when logo is imported
.brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
}
*/

@media (max-width: 1000px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        background: var(--navy);
        color: white;
        padding: 18px;
        overflow: visible;
        position: sticky;
        top: 0;
        height: 100vh;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}