:root {
    --brand: #c8102e;
    --brand-dark: #970c22;
    --brand-soft: #fff0f3;
    --ink: #17202a;
    --muted: #667085;
    --line: #e4e7ec;
    --surface: #ffffff;
    --canvas: #f4f6f8;
    --success: #16865c;
    --warning: #d97706;
    --danger: #c62828;
    --info: #2563eb;
    --sidebar-width: 238px;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(23, 32, 42, 0.08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }

img, svg { max-width: 100%; }

[hidden] { display: none !important; }

html { min-width: 320px; background: var(--canvas); }

body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }

button, input, select { font: inherit; }

a { color: inherit; }

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

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    color: #fff;
    background: linear-gradient(180deg, #c8102e 0%, #9d0d24 70%, #79081a 100%);
    box-shadow: 8px 0 24px rgba(83, 6, 22, 0.12);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px;
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 13px;
    font-size: 22px;
    font-weight: 900;
    font-style: italic;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .04em; }
.brand small { margin-top: 2px; color: rgba(255,255,255,.7); font-size: 11px; }

.nav-links { display: grid; gap: 8px; margin-top: 44px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(255,255,255,.78);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nav-link:hover { color: #fff; background: rgba(255,255,255,.12); transform: translateX(2px); }
.nav-link.active { color: var(--brand); background: #fff; box-shadow: 0 8px 20px rgba(85,5,20,.2); }
.nav-link svg { width: 21px; height: 21px; fill: currentColor; }

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 12px 8px;
    color: rgba(255,255,255,.68);
    font-size: 11px;
}

.sidebar-dot { width: 7px; height: 7px; border-radius: 50%; background: #7bf1bd; box-shadow: 0 0 0 4px rgba(123,241,189,.13); }

.app-main { min-height: 100vh; margin-left: var(--sidebar-width); padding: 28px clamp(20px, 3vw, 48px) 48px; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.page-header > * { min-width: 0; }

.page-header h1, .section-heading h2 { margin: 0; letter-spacing: -.035em; }
.page-header h1 { font-size: clamp(28px, 3vw, 42px); line-height: 1.1; }
.page-description { max-width: 680px; margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 7px 16px rgba(200,16,46,.22); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { border-color: var(--line); color: var(--ink); background: var(--surface); }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.button-disabled { cursor: not-allowed; opacity: .48; box-shadow: none; }
.button-disabled:hover { transform: none; }

.notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    color: #92400e;
    background: #fff7ed;
    font-size: 13px;
    line-height: 1.5;
}

.notice strong { display: block; }

@media (max-width: 820px) {
    :root { --sidebar-width: 0px; }
    .app-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        padding: 12px 16px;
        flex-direction: row;
        align-items: center;
    }
    .brand { min-height: 42px; padding: 0; }
    .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
    .brand small, .sidebar-footer { display: none; }
    .nav-links { display: flex; gap: 6px; margin: 0 0 0 auto; }
    .nav-link { min-height: 38px; padding: 8px 10px; }
    .nav-link svg { width: 18px; height: 18px; }
    .app-main { margin-left: 0; padding: 22px 16px 36px; }
}

@media (max-width: 520px) {
    .brand strong { font-size: 13px; }
    .nav-link span { display: none; }
    .page-header { flex-direction: column; }
    .page-description { overflow-wrap: anywhere; }
}
