:root {
    --es-red: #e40146;
    --es-blue: #014e66;
    --es-blue-dark: #002733;
    --es-green: #01a48b;
    --es-cyan: #80cef5;
    --es-orange: #eb7221;
    --surface: #ffffff;
    --surface-soft: #f6f8fa;
    --surface-quiet: #f0f5f8;
    --border: #dfe5ea;
    --border-strong: #c7d1d9;
    --text: #0e2630;
    --text-muted: #58707c;
    --shadow: 0 18px 45px rgba(1, 47, 64, 0.09);
    --radius: 8px;
    --sidebar-width: 274px;
    --detail-width: 412px;
    font-family: Inter, "Source Sans Pro", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(1, 78, 102, 0.035), transparent 340px),
        var(--surface-soft);
    font-size: 14px;
    line-height: 1.45;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--es-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid rgba(128, 206, 245, 0.9);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex: 0 0 auto;
}

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

.sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px 18px;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 24px rgba(0, 39, 51, 0.035);
    overflow-y: auto;
}

.brand {
    display: grid;
    grid-template-columns: 128px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 58px;
}

.brand img {
    width: 128px;
    height: auto;
    display: block;
}

.brand div {
    min-width: 0;
    border-left: 1px solid var(--border);
    padding-left: 12px;
}

.brand strong {
    display: block;
    color: var(--es-red);
    font-size: 16px;
    line-height: 1.1;
}

.brand span {
    display: block;
    margin-top: 3px;
    color: var(--es-blue-dark);
    font-weight: 700;
}

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

.nav-heading {
    margin: 18px 8px 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.nav-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #27424e;
    font-weight: 650;
    font-size: 13px;
}

.nav-item:hover {
    background: #f2f6f8;
    text-decoration: none;
}

.nav-item span {
    min-width: 26px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #edf2f6;
    color: #31515d;
    text-align: center;
    font-size: 12px;
}

.nav-item--active {
    background: #fff0f4;
    color: var(--es-red);
    box-shadow: inset 4px 0 0 var(--es-red);
}

.collapse-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    margin-top: auto;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    color: #304854;
    background: transparent;
    font-weight: 700;
}

.collapse-button:hover {
    background: #eef4f7;
}

.main {
    min-width: 0;
    padding: 22px clamp(18px, 2.4vw, 34px) 40px;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(210px, 300px) minmax(280px, 1fr) auto;
    align-items: center;
    gap: 20px;
    min-height: 64px;
}

.menu-button {
    display: none;
}

.product-title h1 {
    margin: 0;
    color: var(--es-blue-dark);
    font-size: 24px;
    line-height: 1.08;
}

.product-title p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 650;
}

.search {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(12, 48, 60, 0.04);
}

.search input {
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.search kbd {
    min-width: 38px;
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    background: #f9fbfc;
    font-size: 12px;
    text-align: center;
}

.top-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.icon-button,
.text-button,
.outline-button,
.danger-button,
.filters button,
.panel-header button,
.lane button {
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-weight: 750;
}

.icon-button {
    position: relative;
    width: 36px;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.menu-button {
    display: none;
}

.text-button,
.outline-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
}

.text-button {
    border-color: transparent;
}

.text-button:hover,
.icon-button:hover,
.outline-button:hover,
.filters button:hover,
.panel-header button:hover,
.lane button:hover {
    background: #edf4f7;
}

.danger-button {
    border-color: var(--es-red);
    background: var(--es-red);
    color: white;
}

.danger-button:hover {
    background: #c8003d;
}

.badge-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 999px;
    background: var(--es-red);
    color: white;
    font-size: 10px;
    font-weight: 800;
}

.profile {
    display: grid;
    grid-template-columns: 38px auto;
    align-items: center;
    gap: 10px;
    min-width: 172px;
}

.profile > span,
.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    background: linear-gradient(135deg, var(--es-blue), var(--es-green));
    font-weight: 850;
}

.profile strong,
.profile small {
    display: block;
}

.profile strong {
    font-size: 13px;
}

.profile small {
    color: var(--text-muted);
    font-size: 12px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 16px;
}

.filters button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    background: #f9fbfc;
    color: #243c47;
    font-size: 13px;
}

.filters .ghost-filter {
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 0;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-card {
    min-height: 142px;
    padding: 16px 18px 12px;
    border-right: 1px solid var(--border);
}

.metric-card:last-child {
    border-right: 0;
}

.metric-card p,
.metric-card small {
    margin: 0;
}

.metric-card p {
    color: #243b47;
    font-size: 13px;
    font-weight: 750;
}

.metric-card div {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 12px 0 4px;
}

.metric-card strong {
    color: var(--metric-color, var(--es-blue));
    font-size: 31px;
    line-height: 1;
}

.metric-card span {
    color: #23424e;
    font-size: 16px;
    font-weight: 800;
}

.metric-card small {
    color: var(--text-muted);
    font-size: 12px;
}

.metric-card svg {
    width: 100%;
    height: 28px;
    margin-top: 11px;
}

.metric-card polyline {
    fill: none;
    stroke: var(--metric-color, var(--es-blue));
    stroke-width: 2;
}

.metric-card--danger { --metric-color: var(--es-red); }
.metric-card--warning { --metric-color: var(--es-orange); }
.metric-card--info { --metric-color: #075eb5; }
.metric-card--success { --metric-color: #188a4d; }
.metric-card--neutral { --metric-color: #465866; }

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--detail-width);
    gap: 14px;
    align-items: start;
}

.panel,
.detail-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-header,
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2,
.detail-body h2,
.lane h3,
.signals h2 {
    margin: 0;
    color: var(--es-blue-dark);
}

.panel-header h2 {
    font-size: 16px;
}

.panel-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header span,
.tabs span,
.lane h3 span,
.signals strong {
    display: inline-grid;
    place-items: center;
    min-width: 25px;
    height: 22px;
    border-radius: 999px;
    background: #eef3f6;
    color: #314d59;
    font-size: 12px;
    font-weight: 800;
}

.panel-actions {
    display: inline-flex;
    gap: 6px;
}

.table-wrap {
    display: none;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

th,
td {
    padding: 10px 11px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f5f7f9;
    color: #314b58;
    font-size: 12px;
    font-weight: 850;
}

td {
    color: #243d49;
    font-size: 13px;
}

th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3),
th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8),
th:nth-child(9),
td:nth-child(9) {
    white-space: nowrap;
}

td:nth-child(4) {
    min-width: 150px;
}

td:nth-child(5),
td:nth-child(6) {
    min-width: 180px;
}

td strong,
td small {
    display: block;
}

td small {
    color: var(--text-muted);
    margin-top: 2px;
}

tbody tr {
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

tbody tr:hover,
tbody tr.is-selected {
    background: #fff8fa;
}

tbody tr.is-selected {
    box-shadow: inset 3px 0 0 var(--es-red);
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--es-red);
}

.priority,
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 76px;
    min-height: 25px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.priority .icon {
    width: 14px;
    height: 14px;
}

.priority--danger,
.text-danger {
    color: var(--es-red);
}

.priority--warning,
.text-warning {
    color: var(--es-orange);
}

.priority--success,
.text-success {
    color: #13824a;
}

.status--danger {
    color: var(--es-red);
    background: #ffe5ec;
}

.status--info {
    color: #0b5799;
    background: #e7f1ff;
}

.status--neutral {
    color: #405662;
    background: #eef2f5;
}

.status--success {
    color: #147748;
    background: #e3f6ec;
}

.panel-link {
    display: inline-flex;
    margin: 14px 16px 16px;
    font-weight: 800;
    font-size: 13px;
}

.detail-panel {
    position: sticky;
    top: 18px;
    overflow: hidden;
}

.detail-header p {
    margin: 0;
    color: #1e3b47;
    font-size: 15px;
    font-weight: 800;
}

.detail-body {
    padding: 14px 18px 18px;
}

.detail-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.detail-body h2 {
    font-size: 17px;
}

.detail-body > p {
    margin: 4px 0 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.tabs button {
    min-height: 42px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #385260;
    font-size: 12px;
    font-weight: 850;
}

.tabs button.is-active {
    border-color: var(--es-red);
    color: var(--es-red);
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
}

.detail-list dt {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
    color: #233d49;
    font-size: 13px;
}

.sla-bar {
    display: inline-flex;
    width: 110px;
    height: 5px;
    margin-right: 10px;
    border-radius: 99px;
    background: #e3e8ec;
    vertical-align: middle;
}

.sla-bar i {
    display: block;
    border-radius: inherit;
    background: var(--es-red);
}

.pill-warning {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    color: #9a4a00;
    background: #ffe2c5;
    font-size: 12px;
    font-weight: 850;
}

.detail-section {
    margin-top: 18px;
}

.detail-section h3 {
    margin: 0 0 8px;
    color: #1c3642;
    font-size: 13px;
}

.detail-section p {
    margin: 0;
    color: #3e5662;
    font-size: 13px;
}

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

.action-stack button,
.note-form button,
.triage-strip button {
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fbfc;
    color: var(--es-blue-dark);
    font-size: 12px;
    font-weight: 850;
}

.action-stack button:hover,
.note-form button:hover,
.triage-strip button:hover {
    background: #eef5f7;
}

.note-form {
    display: grid;
    gap: 8px;
}

.note-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 78px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    background: #fbfcfd;
    font: inherit;
}

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

.activity li {
    position: relative;
    padding-left: 22px;
}

.activity li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 6px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
}

.activity time,
.activity span,
.activity small {
    display: block;
}

.activity time {
    color: var(--text-muted);
    font-size: 12px;
}

.activity span {
    color: #233d49;
    font-weight: 750;
}

.activity small {
    color: var(--text-muted);
}

.detail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #fbfcfd;
}

.lower-grid {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.workload {
    min-height: 324px;
}

.workload-row {
    padding: 12px 16px;
}

.workload-row div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #28434f;
    font-size: 13px;
}

progress {
    width: 100%;
    height: 8px;
    appearance: none;
}

progress::-webkit-progress-bar {
    border-radius: 99px;
    background: #e8eef2;
}

progress::-webkit-progress-value {
    border-radius: 99px;
    background: var(--bar-color, var(--es-blue));
}

progress::-moz-progress-bar {
    border-radius: 99px;
    background: var(--bar-color, var(--es-blue));
}

.progress--danger { --bar-color: var(--es-red); }
.progress--warning { --bar-color: var(--es-orange); }
.progress--success { --bar-color: #169354; }

.status-board {
    min-width: 0;
}

.lanes {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    min-height: 270px;
    overflow-x: auto;
}

.lane {
    padding: 14px 12px;
    border-right: 1px solid var(--border);
}

.lane:last-child {
    border-right: 0;
}

.lane h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.mini-card {
    display: grid;
    gap: 5px;
    padding: 10px;
    margin-bottom: 9px;
    border: 1px solid #e8edf1;
    border-radius: 6px;
    background: #fbfcfd;
}

.mini-card small {
    color: var(--text-muted);
    font-size: 11px;
}

.mini-card strong {
    color: #223c48;
    font-size: 12px;
}

.mini-card div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.mini-card span {
    padding: 2px 6px;
    border-radius: 4px;
    background: #eef4f7;
    color: #38515d;
    font-size: 11px;
    font-weight: 750;
}

.mini-card time {
    color: var(--es-red);
    font-size: 11px;
}

.lane button {
    width: 100%;
    margin-top: 2px;
    background: transparent;
    color: var(--es-blue);
    font-size: 12px;
}

.district-panel {
    min-width: 0;
}

.mobile-workbench {
    margin-bottom: 14px;
}

.mobile-section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 10px;
}

.mobile-section-title h2 {
    margin: 0;
    color: var(--es-blue-dark);
    font-size: 16px;
}

.mobile-section-title p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 650;
}

.triage-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 10px;
}

.triage-strip article {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.triage-strip strong {
    color: var(--es-red);
    font-size: 24px;
    line-height: 1;
}

.triage-strip span {
    display: block;
    color: var(--es-blue-dark);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.triage-strip small {
    color: var(--text-muted);
}

.mobile-task-list {
    display: grid;
}

.mobile-task-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.mobile-task-card.is-selected {
    box-shadow: inset 3px 0 0 var(--es-red);
    background: #fff8fa;
}

.mobile-task-card > div,
.mobile-task-card footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

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

.mobile-task-card h3 {
    color: var(--es-blue-dark);
    font-size: 15px;
}

.mobile-task-card p {
    color: var(--text-muted);
}

.source-label {
    color: var(--es-blue);
    font-size: 12px;
    font-weight: 850;
}

.process-radar {
    min-width: 0;
}

.process-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.process-list article {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.process-list article:nth-child(even) {
    border-right: 0;
}

.process-list h3 {
    margin: 0 0 10px;
    color: var(--es-blue-dark);
    font-size: 14px;
}

.process-list dl {
    display: grid;
    gap: 7px;
    margin: 0;
}

.process-list div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 8px;
}

.process-list dt,
.process-list dd {
    margin: 0;
    font-size: 12px;
}

.process-list dt {
    color: var(--text-muted);
    font-weight: 850;
}

.process-list dd {
    color: #25424f;
}

.district-panel .panel-header button {
    padding: 0 10px;
}

.map-card {
    position: relative;
    height: 218px;
    margin: 14px;
    overflow: hidden;
    border: 1px solid #dce5ec;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(128, 206, 245, 0.42), transparent 42%),
        linear-gradient(35deg, rgba(1, 164, 139, 0.16), transparent 55%),
        #eef4f6;
}

.map-card::before,
.map-card::after {
    content: "";
    position: absolute;
    inset: 26px -20px auto;
    height: 1px;
    background: rgba(1, 78, 102, 0.14);
    box-shadow: 0 42px 0 rgba(1, 78, 102, 0.14), 0 84px 0 rgba(1, 78, 102, 0.14), 0 126px 0 rgba(1, 78, 102, 0.14);
    transform: rotate(-16deg);
}

.map-card::after {
    transform: rotate(28deg);
}

.map-shape {
    position: absolute;
    border: 2px solid rgba(1, 78, 102, 0.12);
    border-radius: 44% 56% 52% 48%;
    opacity: 0.75;
}

.map-shape--one {
    inset: 28px 86px 70px 38px;
    background: rgba(228, 1, 70, 0.12);
}

.map-shape--two {
    inset: 90px 36px 24px 112px;
    background: rgba(1, 164, 139, 0.14);
}

.map-shape--three {
    inset: 30px 26px 112px 150px;
    background: rgba(128, 206, 245, 0.35);
}

.map-pin {
    position: absolute;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    background: var(--es-red);
    box-shadow: 0 4px 12px rgba(0, 39, 51, 0.2);
    font-size: 11px;
    font-weight: 850;
}

.pin-one { left: 74px; top: 70px; }
.pin-two { right: 78px; top: 114px; background: var(--es-green); }
.pin-three { right: 48px; top: 46px; background: #2980bf; }

.map-label {
    position: absolute;
    left: 50%;
    top: 51%;
    transform: translate(-50%, -50%);
    color: rgba(0, 39, 51, 0.34);
    font-size: 20px;
    font-weight: 850;
}

.district-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
    margin: 0 14px 14px;
    padding: 0;
    list-style: none;
}

.district-list li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    color: #38515d;
    font-size: 12px;
}

.legend {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8fa0aa;
}

.legend--danger { background: var(--es-red); }
.legend--warning { background: var(--es-orange); }
.legend--info { background: #2980bf; }
.legend--success { background: var(--es-green); }

.signals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    gap: 14px;
    margin-top: 14px;
}

.signals article {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

.signals strong {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    color: var(--es-red);
    font-size: 22px;
}

.signals h2 {
    font-size: 15px;
}

.signals p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.mobile-preview {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 25;
    pointer-events: none;
}

.phone {
    width: 220px;
    height: 410px;
    border: 10px solid #17222a;
    border-radius: 34px;
    overflow: hidden;
    background: white;
    box-shadow: 0 24px 60px rgba(0, 39, 51, 0.3);
}

.phone header {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
}

.phone button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
}

.phone header strong {
    color: var(--es-blue-dark);
    font-size: 12px;
    line-height: 1.05;
}

.phone header strong span {
    display: block;
    color: var(--es-red);
}

.phone .avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
}

.phone section {
    height: 292px;
    padding: 12px 10px;
    overflow: hidden;
}

.phone h2 {
    margin: 0 0 10px;
    color: var(--es-blue-dark);
    font-size: 13px;
}

.phone-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin-bottom: 14px;
}

.phone-metrics article,
.phone-task {
    border: 1px solid #e7edf1;
    border-radius: 6px;
    background: #fbfcfd;
}

.phone-metrics article {
    min-height: 50px;
    padding: 6px 4px;
}

.phone-metrics small {
    display: block;
    color: var(--text-muted);
    font-size: 7px;
    font-weight: 750;
}

.phone-metrics strong {
    display: block;
    color: var(--es-red);
    font-size: 16px;
}

.phone h3 {
    margin: 0 0 8px;
    color: #203945;
    font-size: 12px;
}

.phone h3 span {
    color: var(--text-muted);
}

.phone-task {
    display: grid;
    gap: 2px;
    padding: 7px;
    margin-bottom: 6px;
}

.phone-task small,
.phone-task p {
    margin: 0;
    color: var(--text-muted);
    font-size: 9px;
}

.phone-task strong {
    color: #213b47;
    font-size: 10px;
}

.phone-task div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.phone .status {
    min-width: 52px;
    min-height: 18px;
    font-size: 8px;
}

.phone nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 42px;
    border-top: 1px solid var(--border);
}

.phone nav a {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
}

.phone nav .icon {
    width: 14px;
    height: 14px;
}

.phone nav a.is-active {
    color: var(--es-red);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 50;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    background: var(--es-blue-dark);
    box-shadow: 0 16px 44px rgba(0, 39, 51, 0.24);
    font-weight: 800;
}

.sidebar-collapsed .sidebar {
    width: 80px;
    padding-left: 10px;
    padding-right: 10px;
}

.sidebar-collapsed .app-shell {
    grid-template-columns: 80px minmax(0, 1fr);
}

.sidebar-collapsed .brand {
    grid-template-columns: 44px;
}

.sidebar-collapsed .brand img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    object-position: left center;
}

.sidebar-collapsed .brand div,
.sidebar-collapsed .nav-heading,
.sidebar-collapsed .nav-item span,
.sidebar-collapsed .nav-item,
.sidebar-collapsed .collapse-button {
    overflow: hidden;
}

@media (max-width: 1480px) {
    .mobile-preview {
        display: none;
    }
}

@media (max-width: 1250px) {
    .content-grid,
    .lower-grid {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        position: static;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .metric-card {
        border-bottom: 1px solid var(--border);
    }

    .metric-card:nth-child(2n) {
        border-right: 0;
    }
}

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

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        transform: translateX(-104%);
        transition: transform 0.2s ease;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main {
        padding: 14px;
    }

    .topbar {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
    }

    .menu-button {
        display: inline-grid;
    }

    .search {
        grid-column: 1 / -1;
    }

    .top-actions {
        grid-column: 1 / -1;
        justify-content: space-between;
    }

    .profile {
        min-width: 0;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 13px;
    }

    .product-title h1 {
        font-size: 20px;
    }

    .signals {
        grid-template-columns: 1fr;
    }

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

    .metric-card {
        border-right: 0;
    }

    .metric-card:nth-child(odd) {
        border-right: 1px solid var(--border);
    }

    .filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .filters button {
        flex: 0 0 auto;
    }

    .top-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 36px 36px 40px;
        width: 100%;
        gap: 8px;
    }

    .top-actions .text-button {
        width: auto;
        justify-content: center;
    }

    .top-actions .profile {
        grid-template-columns: 38px;
        min-width: 38px;
        justify-self: end;
    }

    .top-actions .profile div {
        display: none;
    }

    .filters button,
    .outline-button,
    .danger-button {
        width: 100%;
        justify-content: center;
    }

    .tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-list div,
    .signals article {
        grid-template-columns: 1fr;
    }

    .mobile-section-title {
        display: block;
    }

    .triage-strip {
        display: grid;
        grid-template-columns: 1fr;
    }

    .triage-strip article {
        min-width: 0;
    }

    .action-stack {
        grid-template-columns: 1fr;
    }

    .process-list {
        grid-template-columns: 1fr;
    }

    .process-list article {
        border-right: 0;
    }

    .lanes {
        grid-template-columns: repeat(4, 78vw);
    }

    .district-list {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
