:root {
    color-scheme: light;
    --ink: #111827;
    --muted: #667085;
    --line: rgba(17, 24, 39, 0.12);
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --brand: #0f766e;
    --brand-dark: #134e4a;
    --accent: #f97316;
    --danger: #dc2626;
    --ok: #047857;
    --shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(20, 184, 166, 0.16), transparent 32%),
        linear-gradient(135deg, #f8fafc 0%, #eef6f4 45%, #fff7ed 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
    gap: 32px;
    align-items: center;
    padding: 48px;
}

.brand-panel,
.login-card,
.request-panel,
.metric-grid article,
.ticket-list,
.ops-panel,
.hero-status {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px);
}

.brand-panel {
    min-height: 620px;
    border-radius: 8px;
    padding: 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.brand-panel::after {
    content: "";
    position: absolute;
    inset: auto -10% -22% 36%;
    height: 280px;
    background: linear-gradient(100deg, rgba(15, 118, 110, 0.18), rgba(249, 115, 22, 0.18));
    transform: skewY(-8deg);
}

.brand-mark,
.logo span {
    display: grid;
    place-items: center;
    background: #102a2a;
    color: white;
    font-weight: 800;
}

.brand-mark {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    font-size: 28px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

.brand-panel h1,
.portal-hero h1,
.dashboard-head h1 {
    max-width: 780px;
    margin-bottom: 18px;
    font-size: clamp(44px, 7vw, 86px);
    line-height: 0.96;
    letter-spacing: 0;
}

.lead,
.portal-hero p {
    max-width: 680px;
    color: #334155;
    font-size: 18px;
    line-height: 1.65;
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    position: relative;
    z-index: 1;
}

.signal-grid div {
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
}

.signal-grid strong {
    display: block;
    font-size: 28px;
}

.signal-grid span,
.hint,
.ticket-row small,
.ops-item span {
    color: var(--muted);
}

.login-card {
    border-radius: 8px;
    padding: 34px;
}

.login-card h2 {
    font-size: 30px;
}

.form-stack,
.ticket-form {
    display: grid;
    gap: 16px;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 13px 14px;
    color: var(--ink);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

.ajax-combo {
    position: relative;
}

.combo-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.combo-option {
    width: 100%;
    display: block;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: white;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
}

.combo-option:hover {
    background: #f0fdfa;
}

.combo-option strong,
.combo-option small {
    display: block;
}

.combo-option small {
    margin-top: 4px;
    color: var(--muted);
}

.combo-option.is-muted {
    color: var(--muted);
    cursor: default;
}

.primary-btn,
.ghost-btn {
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    font-weight: 800;
    cursor: pointer;
}

.primary-btn {
    background: #102a2a;
    color: white;
}

.primary-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.ghost-btn {
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.alert,
.result {
    border-radius: 8px;
    padding: 12px 14px;
}

.alert,
.result.error {
    background: rgba(220, 38, 38, 0.1);
    color: #991b1b;
}

.result.success {
    background: rgba(4, 120, 87, 0.1);
    color: #065f46;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.86);
    backdrop-filter: blur(22px);
}

.sla-top-alerts {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sla-top-alert {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 900;
}

.sla-top-alert strong {
    font-size: 15px;
}

.sla-top-alert--warning {
    color: #c2410c;
    border-color: rgba(234, 88, 12, 0.28);
    background: rgba(255, 237, 213, 0.8);
}

.sla-top-alert--breached {
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.28);
    background: rgba(254, 226, 226, 0.84);
}

.sla-ticket-id {
    color: var(--brand-dark);
    font-weight: 800;
}

.sla-ticket-id--warning {
    color: #c2410c;
    font-weight: 900;
}

.sla-ticket-id--breached {
    color: #b91c1c;
    font-weight: 1000;
}

.side-summary--sla-warning {
    border-color: rgba(234, 88, 12, 0.38);
    background: #fff7ed;
}

.side-summary--sla-warning strong,
.side-summary--sla-warning small {
    color: #c2410c;
}

.side-summary--sla-breached {
    border-color: rgba(220, 38, 38, 0.42);
    background: #fef2f2;
}

.side-summary--sla-breached strong,
.side-summary--sla-breached small {
    color: #b91c1c;
}

.child-ticket-create,
.related-ticket-panel {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.child-ticket-create summary {
    cursor: pointer;
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 900;
}

.child-ticket-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(240, 253, 250, 0.6);
}

.ticket-detail-layout > .child-ticket-create {
    grid-column: 1 / -1;
}

.related-ticket-list {
    display: grid;
    gap: 7px;
}

.related-ticket {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.68);
}

.related-ticket span,
.related-ticket small {
    color: var(--muted);
    font-size: 12px;
}

.module-nav {
    position: sticky;
    top: 65px;
    z-index: 9;
    display: flex;
    gap: 8px;
    overflow: visible;
    flex-wrap: wrap;
    padding: 10px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.82);
    backdrop-filter: blur(18px);
}

.module-item {
    flex: 0 0 auto;
    position: relative;
}

.module-toggle {
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.module-toggle::after {
    content: "⌄";
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
}

.module-item.active > .module-toggle,
.module-item.open > .module-toggle,
.module-toggle:hover,
.module-toggle:focus-visible {
    background: #dff7f1;
    color: var(--brand-dark);
}

.module-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    display: none;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
    z-index: 100;
}

.module-menu[hidden] {
    display: none !important;
}

.module-menu.wide {
    min-width: 260px;
    columns: 2;
}

.module-item.open .module-menu {
    display: grid;
    gap: 3px;
}

.module-menu.wide {
    display: none;
}

.module-item.open .module-menu.wide {
    display: block;
}

.module-menu a {
    display: block;
    break-inside: avoid;
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.module-menu a:hover {
    background: #f0fdfa;
    color: var(--brand-dark);
}

.identity-hover {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--brand-dark);
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.identity-hover:hover,
.identity-hover:focus-visible {
    text-decoration: underline;
}

.shortinfo-popover {
    position: absolute;
    z-index: 30;
    width: min(320px, calc(100vw - 32px));
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.shortinfo-popover strong {
    color: var(--ink);
    font-size: 15px;
}

body.mobile-shell {
    font-size: 14px;
    background: #f4f8f7;
    background-image: none;
}

body.mobile-shell .topbar {
    position: static;
    padding: 10px 14px;
    gap: 10px;
    backdrop-filter: none;
}

body.mobile-shell .topbar nav {
    width: 100%;
    justify-content: space-between;
}

body.mobile-shell .topbar nav a {
    padding: 8px 6px;
    font-size: 12px;
}

body.mobile-shell .user-chip {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
}

body.mobile-shell .sla-top-alerts {
    width: 100%;
    justify-content: flex-end;
}

body.mobile-shell .module-nav {
    position: static;
    padding: 7px 10px;
    gap: 4px;
    backdrop-filter: none;
}

body.mobile-shell .module-toggle {
    min-height: 42px;
    padding: 8px 10px;
}

body.mobile-shell .module-menu {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    max-height: none;
    overflow: visible;
}

body.mobile-shell .portal,
body.mobile-shell .dashboard,
body.mobile-shell .console-page,
body.mobile-shell .record-page,
body.mobile-shell .admin-page {
    width: calc(100% - 20px);
    padding: 18px 0 34px;
}

body.mobile-shell .dashboard-head,
body.mobile-shell .portal-hero {
    padding: 18px 0 14px;
}

body.mobile-shell .dashboard-head h1,
body.mobile-shell .portal-hero h1 {
    font-size: 28px;
    line-height: 1.08;
}

body.mobile-shell .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.mobile-shell .metric-card {
    padding: 13px;
    box-shadow: none;
    backdrop-filter: none;
}

body.mobile-shell .metric-grid strong {
    margin: 8px 0 4px;
    font-size: 30px;
}

body.mobile-shell .workbench {
    display: block;
    margin-top: 8px;
}

body.mobile-shell .ops-panel {
    display: none;
}

body.mobile-shell .ticket-list,
body.mobile-shell .ticket-main-panel,
body.mobile-shell .ticket-side-panel,
body.mobile-shell .record-tabs,
body.mobile-shell .task-card,
body.mobile-shell .data-table-wrap {
    box-shadow: none;
}

body.mobile-shell .ticket-list,
body.mobile-shell .ticket-main-panel,
body.mobile-shell .ticket-side-panel,
body.mobile-shell .record-tabs {
    padding: 12px;
}

body.mobile-shell .search-grid {
    grid-template-columns: 1fr;
}

body.mobile-shell input,
body.mobile-shell select,
body.mobile-shell textarea,
body.mobile-shell button,
body.mobile-shell .ghost-link {
    min-height: 42px;
}

body.mobile-shell .brand-panel,
body.mobile-shell .login-card,
body.mobile-shell .request-panel,
body.mobile-shell .metric-grid article,
body.mobile-shell .ticket-list,
body.mobile-shell .ops-panel,
body.mobile-shell .hero-status,
body.mobile-shell .ticket-main-panel,
body.mobile-shell .ticket-side-panel,
body.mobile-shell .record-tabs,
body.mobile-shell .task-card,
body.mobile-shell .data-table-wrap,
body.mobile-shell .admin-card {
    backdrop-filter: none;
    box-shadow: none;
}

body.mobile-shell .data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.mobile-shell .data-table {
    min-width: 620px;
}

body.mobile-shell .ticket-table {
    min-width: 0;
}

body.mobile-shell .ticket-table thead {
    display: none;
}

body.mobile-shell .ticket-table,
body.mobile-shell .ticket-table tbody,
body.mobile-shell .ticket-table tr,
body.mobile-shell .ticket-table td {
    display: block;
    width: 100%;
}

body.mobile-shell .ticket-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

body.mobile-shell .ticket-table td {
    padding: 3px 0;
    border: 0;
}

body.mobile-shell .ticket-table td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 86px;
    margin-right: 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

body.mobile-shell .ticket-table td:first-child::before {
    display: none;
}

body.mobile-shell .ticket-table td:first-child {
    padding-bottom: 5px;
}

body.mobile-shell .ticket-table tr[hidden] {
    display: none !important;
}

body.mobile-shell .task-workbench,
body.mobile-shell .task-card,
body.mobile-shell .record-section,
body.mobile-shell .search-panel {
    margin-top: 10px;
}

.shortinfo-popover span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.logo,
.topbar nav,
.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo span {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.topbar nav a {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
}

.topbar nav a.active {
    background: #dff7f1;
    color: var(--brand-dark);
}

.user-chip {
    color: var(--muted);
    font-size: 14px;
}

.user-chip a {
    color: var(--brand-dark);
    font-weight: 800;
}

.role-switch select {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

.portal,
.dashboard,
.console-page,
.record-page,
.admin-page {
    width: min(1440px, calc(100% - 48px));
    margin: 0 auto;
    padding: 36px 0 64px;
}

.portal-hero,
.dashboard-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    padding: 34px 0 24px;
}

.hero-status {
    width: 260px;
    border-radius: 8px;
    padding: 22px;
}

.hero-status span,
.hero-status small {
    display: block;
    color: var(--muted);
}

.hero-status strong {
    display: block;
    margin: 10px 0 4px;
    font-size: 24px;
}

.category-grid,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.category-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.72);
    text-align: left;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.category-card:hover,
.category-card.selected {
    transform: translateY(-3px);
    border-color: rgba(15, 118, 110, 0.5);
    background: white;
}

.card-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #102a2a;
    color: white;
    font-size: 13px;
    font-weight: 900;
}

.category-card strong {
    font-size: 22px;
}

.category-card small {
    flex: 1;
    color: var(--muted);
    line-height: 1.5;
}

.category-card em {
    font-style: normal;
    color: var(--accent);
    font-weight: 900;
}

.request-panel {
    margin-top: 22px;
    border-radius: 8px;
    padding: 28px;
}

.history-panel {
    margin-top: 22px;
}

.data-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 900;
    background: rgba(248, 250, 252, 0.92);
}

.data-table td strong,
.data-table td small {
    display: block;
}

.data-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.ticket-summary-row {
    cursor: pointer;
}

.ticket-summary-row:hover {
    background: rgba(240, 253, 250, 0.72);
}

.ticket-summary-row.open {
    background: rgba(240, 253, 250, 0.9);
}

.ticket-detail-row td {
    background: rgba(248, 250, 252, 0.92);
}

.ticket-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ticket-detail-grid div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.ticket-detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ticket-last-message {
    margin-top: 10px;
    padding: 12px;
    border-radius: 8px;
    background: white;
    color: #334155;
    line-height: 1.5;
}

.empty-cell {
    color: var(--muted);
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

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

.metric-grid article,
.metric-card {
    border-radius: 8px;
    padding: 22px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow);
    backdrop-filter: blur(28px);
    transition: transform 140ms ease;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-grid span {
    color: var(--muted);
    font-weight: 700;
}

.metric-grid strong {
    display: block;
    margin: 12px 0 6px;
    font-size: 42px;
}

.metric-grid small {
    color: var(--brand-dark);
    font-weight: 800;
}

.workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    margin-top: 18px;
}

.ticket-list,
.ops-panel {
    border-radius: 8px;
    padding: 20px;
}

.ticket-detail-layout .task-workbench {
    grid-column: 1 / -1;
    grid-row: 2;
}

.ticket-detail-layout .ticket-side-panel {
    grid-column: 2;
    grid-row: 1;
}

.task-workbench {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.task-list {
    display: grid;
    gap: 10px;
}

.task-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.task-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-card h3 {
    margin: 0;
    font-size: 16px;
}

.task-card header small,
.task-meta {
    color: var(--muted);
    font-size: 12px;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.task-history {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 12px;
}

.task-history div {
    padding: 8px 10px;
    border-left: 3px solid #99f6e4;
    background: #f8fafc;
}

.task-history small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.task-details {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.task-details summary {
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 900;
}

.task-details form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.task-signature-pad {
    width: 100%;
    height: 150px;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    background: #fff;
    touch-action: none;
}

.shipping-item-list {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #475569;
    font-size: 12px;
}

.shipping-status-draft { background: #f1f5f9; color: #475569; }
.shipping-status-received_from_user { background: #dcfce7; color: #166534; }
.shipping-status-issued_for_shipping { background: #dbeafe; color: #1d4ed8; }
.shipping-status-received_at_destination { background: #ccfbf1; color: #0f766e; }
.shipping-status-closed { background: #e2e8f0; color: #334155; }
.shipping-status-cancelled { background: #fee2e2; color: #991b1b; }

.section-title,
.ticket-row,
.ops-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-title {
    margin-bottom: 14px;
}

.ajax-search-form {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.search-primary {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.search-primary label,
.search-grid label {
    display: grid;
    gap: 5px;
}

.search-primary label span,
.search-grid label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.search-advanced {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.search-advanced summary {
    cursor: pointer;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 900;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.search-result-count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.section-title h2,
.ops-panel h2 {
    margin: 0;
}

.ticket-row {
    min-height: 72px;
    border-top: 1px solid var(--line);
}

.triage-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.triage-form select {
    width: auto;
    min-width: 132px;
    min-height: 36px;
    padding: 6px 10px;
}

.triage-result {
    align-self: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.triage-result.success {
    color: var(--ok);
}

.triage-result.error {
    color: var(--danger);
}

.ticket-row strong,
.ticket-row small {
    display: block;
}

.priority,
.status {
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
}

.priority {
    background: #ffedd5;
    color: #9a3412;
}

.priority.p1 {
    background: #fee2e2;
    color: #991b1b;
}

.priority.p2 {
    background: #fef3c7;
    color: #92400e;
}

.priority.triage {
    background: #e5e7eb;
    color: #374151;
}

.status {
    background: #e0f2fe;
    color: #075985;
}

.ops-panel {
    display: grid;
    align-content: start;
    gap: 16px;
}

.ops-item {
    min-height: 70px;
    border-top: 1px solid var(--line);
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 28px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.58);
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: white;
    font-weight: 800;
}

.record-shell {
    display: grid;
    gap: 14px;
}

.record-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.record-header h1 {
    margin: 6px 0 0;
    font-size: 24px;
    line-height: 1.22;
    letter-spacing: 0;
}

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

.record-kicker {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.record-kicker a {
    color: var(--brand-dark);
}

.record-progress {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
}

.record-progress span {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--muted);
    background: #f8fafc;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.record-progress span.active {
    background: #0f766e;
    color: white;
}

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

.ticket-main-panel,
.ticket-side-panel,
.record-tabs,
.activity-feed article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.ticket-main-panel,
.ticket-side-panel,
.record-tabs {
    padding: 16px;
}

.record-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.record-section-title h2,
.ticket-side-panel h2 {
    margin: 0;
    font-size: 16px;
}

.record-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}

.record-fields div {
    min-height: 58px;
    display: grid;
    gap: 3px;
    align-content: center;
    padding: 9px 11px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(248, 250, 252, 0.72);
}

.record-fields div:nth-child(2n) {
    border-right: 0;
}

.record-fields span,
.side-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.record-fields strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
}

.record-warning {
    margin-bottom: 14px;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 800;
}

.ticket-description {
    min-height: 120px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: white;
    line-height: 1.55;
}

.side-summary {
    display: grid;
    gap: 3px;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.side-summary strong {
    font-size: 18px;
}

.side-summary small {
    color: var(--brand-dark);
    font-weight: 900;
}

.ticket-action-form {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.ticket-action-form select,
.ticket-action-form textarea,
.ticket-action-form button {
    width: 100%;
}

.location-admin-form {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.admin-data-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
}

.admin-resource-list,
.admin-editor {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    padding: 14px;
}

.admin-resource-list {
    display: grid;
    align-content: start;
    gap: 6px;
}

.admin-resource-list a {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
}

.admin-resource-list a.active,
.admin-resource-list a:hover {
    background: #dff7f1;
    color: var(--brand-dark);
}

.admin-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-crud-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #344054;
    font-weight: 800;
}

.checkbox-line input {
    width: auto;
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.compact-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.danger-btn {
    color: var(--danger);
}

.activity-feed {
    display: grid;
    gap: 10px;
}

.tabbar {
    display: flex;
    gap: 4px;
    margin: -4px -4px 14px;
    border-bottom: 1px solid var(--line);
}

.tabbar button {
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 10px 14px;
    color: var(--muted);
    font-weight: 900;
    cursor: default;
}

.tabbar button.active {
    color: var(--brand-dark);
    border-bottom-color: var(--brand);
}

.activity-feed article {
    padding: 14px;
}

.activity-feed small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.activity-feed p {
    margin: 10px 0 0;
}

@media (max-width: 1100px) {
    .login-layout,
    .workbench,
    .ticket-detail-layout,
    .admin-data-layout,
    .portal-hero,
    .dashboard-head {
        grid-template-columns: 1fr;
    }

    .portal-hero,
    .dashboard-head {
        display: grid;
        align-items: start;
    }

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

    .hero-status {
        width: 100%;
    }

    .record-header {
        display: grid;
    }

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

    .ticket-detail-layout .task-workbench,
    .ticket-detail-layout .ticket-side-panel {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 720px) {
    .login-layout {
        padding: 18px;
    }

    .brand-panel {
        min-height: auto;
        padding: 28px;
    }

    .signal-grid,
    .category-grid,
    .metric-grid,
    .form-row,
    .admin-fields,
    .record-fields,
    .ticket-detail-grid {
        grid-template-columns: 1fr;
    }

    .ticket-detail-layout .task-workbench,
    .ticket-detail-layout .ticket-side-panel {
        grid-column: 1;
        grid-row: auto;
    }

    .record-fields div {
        border-right: 0;
    }

    .record-header h1 {
        font-size: 20px;
    }

    .record-actions {
        align-items: stretch;
    }

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

    .module-nav {
        padding: 8px 14px;
        overflow: visible;
    }

    .module-menu,
    .module-menu.wide {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: auto;
        min-width: 0;
        width: min(300px, calc(100vw - 28px));
        columns: 1;
    }

    .search-primary,
    .search-grid {
        grid-template-columns: 1fr;
    }

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

    .portal,
    .dashboard,
    .console-page,
    .record-page,
    .admin-page {
        width: min(100% - 28px, 1440px);
    }

    .brand-panel h1,
    .portal-hero h1,
    .dashboard-head h1 {
        font-size: 42px;
    }
}
