:root {
    --efw-red: #c8102e;
    --efw-red-dark: #9f0d25;
    --ink: #172033;
    --muted: #64748b;
    --line: #d8dee8;
    --surface: #ffffff;
    --page: #f4f6f8;
    --blue: #1f5f99;
    --green: #198754;
    --amber: #b7791f;
}

body {
    background: var(--page);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

.app-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 8px rgba(23, 32, 51, 0.05);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 34px;
    padding: 0 8px;
    border-radius: 4px;
    background: var(--efw-red);
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
}

.brand-text {
    font-weight: 700;
    color: var(--ink);
}

.nav-link {
    color: #334155;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--efw-red);
}

.btn-primary {
    --bs-btn-bg: var(--efw-red);
    --bs-btn-border-color: var(--efw-red);
    --bs-btn-hover-bg: var(--efw-red-dark);
    --bs-btn-hover-border-color: var(--efw-red-dark);
}

.app-main {
    min-height: calc(100vh - 62px);
}

.flash-stack {
    max-width: 980px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.page-heading h1,
.narrow-panel h1 {
    font-size: clamp(1.7rem, 2vw, 2.4rem);
    font-weight: 800;
    margin: 0;
}

.eyebrow {
    color: var(--efw-red);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.heading-meta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--muted);
    font-weight: 600;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.menu-tile {
    display: flex;
    flex-direction: column;
    min-height: 190px;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.menu-tile:hover {
    border-color: #b9c2cf;
    box-shadow: 0 14px 30px rgba(23, 32, 51, 0.09);
    color: var(--ink);
    transform: translateY(-2px);
}

.tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    color: #fff;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.tile-icon.red { background: var(--efw-red); }
.tile-icon.blue { background: var(--blue); }
.tile-icon.green { background: var(--green); }
.tile-icon.amber { background: var(--amber); }

.tile-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: .45rem;
}

.tile-copy {
    color: var(--muted);
}

.auth-page {
    min-height: calc(100vh - 142px);
    display: grid;
    place-items: center;
    padding: 1.5rem 0;
}

.auth-page-full {
    min-height: calc(100vh - 3rem);
}

.auth-panel,
.narrow-panel,
.work-surface,
.table-shell {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(23, 32, 51, 0.08);
}

.auth-panel {
    width: min(440px, 100%);
    padding: 2rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.auth-brand h1 {
    font-size: 1.55rem;
    margin: 0;
    font-weight: 800;
}

.auth-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--efw-red);
    font-weight: 700;
    text-decoration: none;
}

.narrow-panel {
    width: min(520px, 100%);
    padding: 1.5rem;
}

.work-surface {
    padding: 2rem;
}

.empty-state {
    max-width: 560px;
    color: var(--muted);
}

.empty-state i {
    color: var(--efw-red);
    font-size: 2rem;
}

.empty-state h2 {
    color: var(--ink);
    font-size: 1.4rem;
    margin-top: .75rem;
}

.table-shell {
    overflow: auto;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .78rem;
    font-weight: 800;
}

.status-pill.active {
    background: #e8f7ef;
    color: #166534;
}

.status-pill.inactive {
    background: #fff1f2;
    color: #be123c;
}

.permission-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: #f8fafc;
}

@media (max-width: 700px) {
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand-text {
        max-width: 210px;
        white-space: normal;
        line-height: 1.15;
    }
}
