:root {
    --brand: #123c69;
    --accent: #0f766e;
    --accent-strong: #0b5f58;
    --bg: #eef5f3;
    --surface: #ffffff;
    --surface-soft: #f7faf9;
    --ink: #111827;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
    --info: #2563eb;
    --sidebar: #082f2c;
    --sidebar-2: #0d3f3b;
    --shadow: 0 22px 60px rgba(8, 47, 44, .12);
    --shadow-soft: 0 10px 26px rgba(15, 23, 42, .07);
    --radius: 16px;
    --radius-sm: 10px;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
}

* { box-sizing: border-box; }

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, .13), transparent 34rem),
        linear-gradient(180deg, #f7fbfa 0, var(--bg) 42rem),
        var(--bg);
    line-height: 1.45;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }

button,
a.button-like,
.topbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(15, 118, 110, .24);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

button:hover,
a.button-like:hover,
.topbar-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 118, 110, .30);
}

button.secondary,
a.button-like.secondary {
    background: #eef2f7;
    color: #123c69;
    box-shadow: none;
}

button.danger,
a.button-like.danger {
    background: var(--danger);
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 118, 110, .46);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .10);
}

label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 720;
}

code {
    background: #eef2f7;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px 6px;
}

.app-shell {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 18rem),
        linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
    color: #fff;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand {
    display: grid;
    gap: 14px;
    padding: 2px 8px 8px;
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.96);
    color: var(--accent-strong) !important;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(0,0,0,.16);
}

.brand-top strong {
    display: block;
    color: #fff;
    font-size: 19px;
    line-height: 1.1;
}

.brand-top span {
    display: block;
    color: rgba(255,255,255,.72);
    font-size: 12px;
    font-weight: 720;
    margin-top: 3px;
}

.company-chip {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.05)),
        rgba(255,255,255,.06);
}

.company-chip span {
    color: rgba(255,255,255,.58);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 850;
}

.company-chip strong {
    color: #fff;
    font-size: 15px;
    line-height: 1.2;
}

.brand-label,
.sidebar-section-title,
.tab-group-label,
.eyebrow {
    letter-spacing: 0;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
}

.sidebar nav {
    display: grid;
    gap: 10px;
}

.sidebar-section {
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(255,255,255,.045);
}

.sidebar-section-title {
    color: rgba(255,255,255,.58);
    padding: 0 4px 4px;
}

.sidebar a,
.logout-form button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    border-radius: 13px;
    padding: 9px 11px;
    text-decoration: none;
    background: transparent;
    color: rgba(255,255,255,.84);
    text-align: left;
    box-shadow: none;
    font-weight: 680;
}

.sidebar a.active,
.sidebar a:hover,
.logout-form button:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
    transform: none;
}

.sidebar a.active {
    background: linear-gradient(135deg, rgba(15,118,110,.96), rgba(18,60,105,.78));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 10px 24px rgba(0,0,0,.16);
}

.logout-form {
    margin-top: auto;
    padding-top: 16px;
}

.content {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 78px;
    padding: 18px 36px;
    background: rgba(255,255,255,.90);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    backdrop-filter: blur(18px);
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
    letter-spacing: 0;
}

.topbar p {
    margin: 5px 0 0;
    color: var(--muted);
}

.topbar-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

.topbar-meta span + span::before {
    content: "/";
    margin-right: 10px;
    color: #94a3b8;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 420px;
}

.global-search {
    width: min(420px, 40vw);
}

.global-search input {
    min-height: 44px;
    border-radius: 999px;
    padding-left: 18px;
    background: #fff;
    border-color: rgba(207, 224, 220, .95);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 20px rgba(15, 23, 42, .04);
}

.notification-pill,
.user-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    border-radius: 999px;
    padding: 8px 13px;
    background: #eef6f4;
    color: #0b3a36;
    text-decoration: none;
    font-size: 13px;
    font-weight: 760;
    white-space: nowrap;
}

.user-pill {
    background: #123c69;
    color: #fff;
}

.page-section {
    width: min(100%, 1520px);
    padding: 36px;
}

.section-head {
    max-width: 820px;
    margin-bottom: 24px;
}

.section-head h2 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.15;
}

.section-head h3,
.admin-card h3 {
    margin: 0 0 8px;
}

.section-head p,
.muted {
    margin: 0;
    color: var(--muted);
}

.compact-head {
    margin-bottom: 14px;
}

h3 {
    margin: 28px 0 12px;
    font-size: 18px;
}

.control-hero,
.entity-hero,
.workday-panel,
.admin-card,
.login-card {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(207, 224, 220, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.control-hero,
.entity-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(239, 250, 247, .94)),
        var(--surface);
    border-color: rgba(15, 118, 110, .18);
}

.control-hero h2,
.entity-hero strong {
    display: block;
    margin: 4px 0 8px;
    font-size: 36px;
    line-height: 1.05;
}

.control-hero p,
.entity-hero p {
    margin: 0;
    color: var(--muted);
}

.eyebrow,
.control-hero .eyebrow,
.entity-hero .eyebrow {
    color: var(--muted);
}

.hero-actions,
.button-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.workday-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
    gap: 18px;
    margin-bottom: 18px;
}

.workday-panel {
    padding: 24px;
    border-top: 4px solid rgba(15, 118, 110, .38);
}

.attention-panel {
    border-top-color: rgba(180, 83, 9, .48);
}

.panel-head {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
}

.panel-head span {
    color: var(--muted);
    font-size: 13px;
}

.panel-head strong {
    font-size: 21px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid article {
    min-height: 112px;
    background: var(--surface);
    border: 1px solid rgba(207, 224, 220, .88);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.executive-metrics article {
    min-height: 126px;
    background: linear-gradient(180deg, #fff, #f7fbfa);
    border-color: rgba(15, 118, 110, .18);
}

.metric-grid span,
.module-row small {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.metric-grid strong {
    display: block;
    margin-top: 10px;
    font-size: 29px;
    line-height: 1.1;
}

.executive-metrics strong {
    font-size: 36px;
    color: #0b3a36;
}

.priority-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.priority-list li {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(207, 224, 220, .92);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #f9fbfa);
}

.priority-list strong {
    font-size: 28px;
    color: var(--brand);
}

.attention-panel .priority-list strong {
    color: var(--warning);
}

.priority-list span {
    color: #334155;
}

.flow-board,
.record-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.record-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-step,
.record-card,
.action-card,
.filter-card {
    background: var(--surface);
    border: 1px solid rgba(207, 224, 220, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.flow-step {
    display: grid;
    gap: 12px;
    min-height: 220px;
    padding: 22px;
}

.flow-step > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--brand);
    font-weight: 850;
}

.flow-step strong {
    font-size: 21px;
}

.flow-step p {
    margin: 0;
    color: var(--muted);
}

.flow-step a {
    align-self: end;
    color: var(--brand);
    font-weight: 780;
    text-decoration: none;
}

.flow-number {
    font-size: 42px;
    line-height: 1;
    font-weight: 850;
}

.pipeline-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.pipeline-step {
    display: grid;
    gap: 4px;
    min-height: 84px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}

.pipeline-step.active,
.pipeline-step:hover {
    border-color: rgba(18, 60, 105, .34);
    background: #f8fbff;
}

.pipeline-step strong {
    font-size: 25px;
}

.pipeline-step span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 720;
}

.action-card {
    display: grid;
    grid-template-columns: minmax(260px, .45fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding: 22px;
    margin-bottom: 22px;
}

.action-card h3 {
    margin-top: 0;
}

.action-card p {
    color: var(--muted);
    margin-bottom: 0;
}

.quick-create-grid,
.details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.quick-create-grid button {
    align-self: end;
}

details.span-2 {
    grid-column: 1 / -1;
}

details > summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 780;
    margin-bottom: 12px;
}

.filter-card {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(160px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    padding: 16px;
    margin-bottom: 20px;
}

.record-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.record-card:hover,
.route-card:hover,
.flow-step:hover {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, .28);
    box-shadow: var(--shadow);
}

.route-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.route-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid rgba(207, 224, 220, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.route-card.green {
    border-top: 4px solid var(--success);
}

.route-card.yellow {
    border-top: 4px solid var(--warning);
}

.route-card.red {
    border-top: 4px solid var(--danger);
}

.route-card h3 {
    margin: 0;
    font-size: 22px;
}

.route-card p {
    margin: 0;
    color: var(--muted);
}

.assign-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.record-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-card-head a {
    color: var(--brand);
    font-weight: 780;
    text-decoration: none;
}

.record-card h3 {
    margin: 0;
    font-size: 21px;
}

.record-card p {
    min-height: 22px;
    margin: 0;
    color: var(--muted);
}

.record-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mini-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.mini-meta div {
    display: grid;
    gap: 2px;
    padding: 10px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.mini-meta dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.mini-meta dd {
    margin: 0;
    color: var(--ink);
    font-weight: 760;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-lower {
    margin-top: 20px;
}

.admin-card {
    padding: 22px;
    margin-top: 18px;
}

.tabs {
    display: flex;
    gap: 8px;
    padding: 18px 32px 0;
    flex-wrap: wrap;
}

.tabs a,
.finance-tabs a,
.section-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 13px;
    background: #fff;
    color: #334155;
    font-weight: 720;
}

.tabs a.active,
.tabs a:hover,
.finance-tabs a.active,
.finance-tabs a:hover,
.section-nav a:hover {
    border-color: rgba(18, 60, 105, .32);
    color: var(--brand);
    background: #f8fafc;
}

.flow-tabs,
.grouped-tabs,
.finance-tabs,
.section-nav {
    align-items: center;
}

.flow-tabs .tab-group-label,
.tab-group .tab-group-label {
    color: var(--muted);
    margin-right: 4px;
}

.grouped-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    justify-content: start;
    gap: 14px;
}

.tab-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.finance-tabs,
.section-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0;
    margin: 0 0 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 980px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-soft);
}

.form-grid button {
    width: fit-content;
    align-self: end;
}

.full-width,
.span-2 {
    grid-column: 1 / -1;
}

.inline-form {
    display: flex;
    gap: 10px;
    max-width: 580px;
    align-items: end;
}

.inline-form.wide {
    max-width: 960px;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0 24px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fbfdff;
}

td a {
    color: var(--brand);
    font-weight: 720;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.status-pill,
.badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 780;
    white-space: nowrap;
}

.status-pill.warning {
    border-color: rgba(180, 83, 9, .28);
    background: #fffbeb;
    color: var(--warning);
}

.alert {
    border: 1px solid rgba(185, 28, 28, .22);
    background: #fff5f5;
    color: var(--danger);
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.alert.success {
    border-color: rgba(21, 128, 61, .24);
    background: #f0fdf4;
    color: var(--success);
}

.empty-state {
    padding: 18px;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
}

.checkbox-grid,
.permission-grid,
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.permission-grid,
.checkbox-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--surface-soft);
}

.checkbox-grid label,
.permission-grid label,
.checkbox-group label,
label input[type="checkbox"] {
    font-weight: 520;
}

.checkbox-grid label,
.permission-grid label,
.checkbox-group label {
    display: flex;
    gap: 8px;
    align-items: center;
}

.checkbox-grid input,
.permission-grid input,
.checkbox-group input,
label input[type="checkbox"] {
    width: auto;
}

.permission-group {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface);
}

.permission-group legend {
    padding: 0 8px;
    font-weight: 800;
}

.permission-group .permission-grid {
    border: 0;
    padding: 0;
    background: transparent;
}

.module-list {
    display: grid;
    gap: 10px;
    max-width: 860px;
    margin-bottom: 16px;
}

.module-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.module-row input {
    width: auto;
    margin-top: 3px;
}

.module-row span {
    display: grid;
    gap: 4px;
}

.integration-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.integration-card {
    display: grid;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.integration-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.integration-card h3,
.integration-card p {
    margin: 0;
}

.integration-summary {
    display: grid;
    gap: 8px;
    margin: 0;
}

.integration-summary div {
    display: grid;
    gap: 2px;
}

.integration-summary dt {
    color: var(--muted);
    font-size: 13px;
}

.integration-summary dd {
    margin: 0;
    font-weight: 760;
}

.setup-guide {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.setup-guide summary,
.admin-card summary {
    cursor: pointer;
    font-weight: 780;
}

.capacity-card.green,
.capacity-green {
    border-color: rgba(21, 128, 61, .25);
    background: #f0fdf4;
    color: var(--success);
}

.capacity-card.yellow,
.capacity-yellow {
    border-color: rgba(180, 83, 9, .25);
    background: #fffbeb;
    color: var(--warning);
}

.capacity-card.red,
.capacity-red {
    border-color: rgba(185, 28, 28, .25);
    background: #fff5f5;
    color: var(--danger);
}

.pagination {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.pagination a {
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    font-weight: 720;
}

.guest-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.guest-panel {
    width: min(440px, 100%);
}

.login-card {
    padding: 30px;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.report-section {
    margin-top: 24px;
}

.report-section h3 {
    margin: 0 0 12px;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions,
    .global-search {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
    }

    .metric-grid,
    .metric-grid.compact,
    .workday-grid,
    .two-column,
    .integration-grid,
    .flow-board,
    .record-grid,
    .route-board,
    .pipeline-strip,
    .action-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-radius: 0 0 24px 24px;
    }

    .sidebar nav {
        grid-template-columns: 1fr;
    }

    .topbar {
        position: static;
        padding: 20px;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .page-section {
        padding: 20px;
    }

    .control-hero,
    .entity-hero,
    .inline-form,
    .inline-form.wide,
    .filter-bar {
        display: grid;
    }

    .metric-grid,
    .metric-grid.compact,
    .workday-grid,
    .two-column,
    .form-grid,
    .flow-board,
    .record-grid,
    .route-board,
    .pipeline-strip,
    .action-card,
    .quick-create-grid,
    .details-grid,
    .filter-card,
    .assign-form,
    .mini-meta,
    .permission-grid,
    .checkbox-group,
    .checkbox-grid,
    .integration-grid,
    .grouped-tabs {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .button-row {
        justify-content: start;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
