:root {
    --red: #a90d18;
    --red-dark: #7e0911;
    --ink: #18202b;
    --muted: #697384;
    --line: #e4e8ee;
    --surface: #ffffff;
    --background: #f3f5f8;
    --sidebar: #171b22;
    --sidebar-width: 268px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }
input[type="checkbox"], input[type="radio"] { width: auto; min-width: auto; }

body {
    min-height: 100vh;
    background: var(--background);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 10% 5%, rgba(169, 13, 24, .3), transparent 32%),
        var(--sidebar);
    box-shadow: 12px 0 36px rgba(15, 23, 42, .08);
}

.sidebar-logo {
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: 13px;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.sidebar-logo img { width: 51px; height: 59px; object-fit: contain; }
.sidebar-logo h2 { font-size: 19px; letter-spacing: -.02em; }
.sidebar-logo span { display: block; margin-top: 3px; color: #aab1bd; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.sidebar a.sidebar-logo { min-height: 92px; gap: 13px; padding: 16px 22px; color: inherit; text-decoration: none; }
.sidebar a.sidebar-logo:hover { background: rgba(255,255,255,.055); }
.sidebar a.sidebar-logo:focus-visible { outline: 3px solid rgba(255,255,255,.75); outline-offset: -3px; }
.sidebar-menu { flex: 1; list-style: none; padding: 22px 13px; }
.sidebar-menu li { margin-bottom: 5px; }
.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    color: #bec5d0;
    border-radius: 9px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: .18s ease;
}
.sidebar a:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar a.active { color: #fff; background: var(--red); box-shadow: 0 7px 20px rgba(169,13,24,.28); }
.nav-icon { width: 21px; text-align: center; font-size: 18px; }
.sidebar-footer { padding: 14px 13px 20px; border-top: 1px solid rgba(255,255,255,.09); }

.app { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    height: 72px;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}
.topbar-start, .user { display: flex; align-items: center; gap: 12px; }
.user { position: relative; }
.user-trigger { display:flex;align-items:center;gap:10px;padding:5px 8px;border:0;border-radius:12px;color:inherit;background:transparent;cursor:pointer; }
.user-trigger:hover,.user-trigger[aria-expanded="true"] { background:#f0f2f5; }
.user-trigger:focus-visible { outline:3px solid color-mix(in srgb,var(--red) 35%,transparent); }
.user-chevron { color:#7a8491;font-size:16px;transition:transform .18s ease; }
.user-trigger[aria-expanded="true"] .user-chevron { transform:rotate(180deg); }
.user-menu { position:absolute;top:48px;right:0;width:240px;padding:8px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 16px 40px rgba(15,23,42,.18); }
.user-menu-heading { display:grid;gap:3px;padding:10px 11px 12px;border-bottom:1px solid var(--line); }
.user-menu-heading small { overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap; }
.user-menu>a { display:block;margin-top:6px;padding:11px;border-radius:9px;color:var(--red);font-weight:800;text-decoration:none; }
.user-menu>a:hover { background:#fff0f1; }
.page-title { font-size: 16px; font-weight: 750; }
.user-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #fff;
    background: var(--red);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}
.user-name { color: #4d5868; font-size: 13px; font-weight: 650; }
.menu-toggle { display: none; border: 0; background: none; font-size: 21px; cursor: pointer; }
.content { width: min(1240px, 100%); min-width: 0; margin: 0 auto; padding: 34px; }

.welcome {
    position: relative;
    display: flex;
    min-height: 205px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    padding: 38px 42px;
    color: #fff;
    background: linear-gradient(120deg, #760a12, #b40e1b 58%, #d03540);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(124, 9, 18, .18);
}
.welcome::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    right: -90px;
    top: -200px;
    border: 55px solid rgba(255,255,255,.07);
    border-radius: 50%;
}
.eyebrow { display: block; margin-bottom: 9px; font-size: 11px; font-weight: 850; letter-spacing: .15em; opacity: .72; }
.welcome h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.04em; }
.welcome p { max-width: 590px; margin-top: 15px; color: rgba(255,255,255,.8); font-size: 15px; line-height: 1.6; }
.status-pill {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    background: rgba(15,20,27,.3);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.status-pill span { width: 7px; height: 7px; background: #6ee7a8; border-radius: 50%; box-shadow: 0 0 0 4px rgba(110,231,168,.13); }
.portal-section { margin-top: 36px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-heading .eyebrow { color: var(--red); opacity: 1; }
.section-heading h2 { font-size: 23px; letter-spacing: -.025em; }
.item-count { color: var(--muted); font-size: 12px; font-weight: 650; }
.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.portal-card {
    display: grid;
    grid-template-columns: 48px 1fr 24px;
    min-height: 104px;
    align-items: center;
    gap: 14px;
    padding: 17px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 13px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(28,37,49,.035);
    transition: .18s ease;
    min-width: 0;
}
.portal-card:hover { transform: translateY(-2px); border-color: #cad0d9; box-shadow: 0 12px 28px rgba(28,37,49,.09); }
.portal-icon { display: grid; width: 48px; height: 48px; place-items: center; color: #596474; background: #f0f2f5; border-radius: 11px; }
.portal-icon svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-card--red .portal-icon { color: #fff; background: var(--red); }
.portal-card--amber .portal-icon { color: #885600; background: #fff0cc; }
.portal-card--blue .portal-icon { color: #17679c; background: #e3f2fc; }
.portal-copy { min-width: 0; }
.portal-copy strong { display: block; overflow-wrap: anywhere; font-size: 14px; line-height: 1.25; }
.portal-copy small { display: block; margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; }
.portal-arrow { color: #a9b0bb; font-size: 18px; transition: .18s; }
.portal-card:hover .portal-arrow { color: var(--red); transform: translateX(2px); }

@media (max-width: 1000px) {
    .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .menu-open .sidebar { transform: translateX(0); }
    .app { margin-left: 0; }
    .menu-toggle { display: block; }
    .topbar { height: 64px; padding: 0 20px; }
    .user-name { display: none; }
    .content { padding: 20px; }
    .welcome { min-height: 215px; align-items: flex-start; flex-direction: column; padding: 30px 26px; }
    .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .content { padding: 14px; }
    .welcome { border-radius: 14px; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
}
