@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

/*
 * SYSTEM 1 visual theme
 * Keeps the Inventory Hub workflows/permissions intact while matching the
 * softer navy + teal UI language of SYSTEM 1.
 */
:root {
    --sys1-navy: #0b1923;
    --sys1-navy-2: #122732;
    --sys1-navy-3: #162d38;
    --sys1-teal: #11a99a;
    --sys1-teal-dark: #087c74;
    --sys1-teal-soft: #dff5f2;
    --sys1-orange: #f3a329;
    --sys1-paper: #f3f6f8;
    --sys1-card: #ffffff;
    --sys1-text: #17252e;
    --sys1-muted: #697982;
    --sys1-line: #dce5e8;
    --sys1-line-strong: #bfcdd2;
    --sys1-red: #e85858;
    --sys1-blue: #4a83d8;
    --sys1-violet: #8769d9;
    --sys1-green: #29ad80;
    --sys1-shadow: 0 12px 35px rgba(13, 35, 45, 0.07);
    --sys1-shadow-small: 0 5px 16px rgba(13, 35, 45, 0.08);
    --sys1-radius: 16px;
    --sys1-radius-sm: 10px;

    /* Remap original application tokens. */
    --ink-950: var(--sys1-navy);
    --ink-900: var(--sys1-navy);
    --ink-800: var(--sys1-navy-2);
    --ink-700: #334750;
    --paper: var(--sys1-paper);
    --paper-deep: #e8eef0;
    --surface: var(--sys1-card);
    --surface-cool: #f7fafb;
    --text: var(--sys1-text);
    --muted: var(--sys1-muted);
    --line: var(--sys1-line);
    --line-strong: var(--sys1-line-strong);
    --cyan: var(--sys1-teal);
    --cyan-dark: var(--sys1-teal-dark);
    --amber: var(--sys1-orange);
    --amber-dark: #b27313;
    --green: var(--sys1-green);
    --red: var(--sys1-red);
    --blue: var(--sys1-blue);
    --shadow: var(--sys1-shadow);
    --shadow-small: var(--sys1-shadow-small);
    --radius: var(--sys1-radius);
    --mono: "DM Sans", Inter, "Segoe UI", Arial, sans-serif;
    --sans: "DM Sans", Inter, "Segoe UI", Arial, sans-serif;

    --ops-ink: var(--sys1-navy);
    --ops-ink-raised: var(--sys1-navy-2);
    --ops-canvas: var(--sys1-paper);
    --ops-surface: var(--sys1-card);
    --ops-surface-subtle: #f7fafb;
    --ops-text: var(--sys1-text);
    --ops-muted: var(--sys1-muted);
    --ops-line: var(--sys1-line);
    --ops-line-strong: var(--sys1-line-strong);
    --ops-accent: var(--sys1-teal);
    --ops-accent-dark: var(--sys1-teal-dark);
    --ops-accent-soft: var(--sys1-teal-soft);
    --ops-warning: var(--sys1-orange);
    --ops-warning-soft: #fff0d6;
    --ops-danger: var(--sys1-red);
    --ops-danger-soft: #fee8ea;
    --ops-success: var(--sys1-green);
    --ops-success-soft: #def5ea;
    --ops-info: var(--sys1-blue);
    --ops-info-soft: #e4edfb;
    --ops-focus: var(--sys1-teal-dark);
    --ops-radius: var(--sys1-radius-sm);
    --ops-shadow: var(--sys1-shadow);
    --ops-shadow-small: var(--sys1-shadow-small);
    --ops-sidebar-expanded: 258px;
    --ops-sidebar-collapsed: 78px;
    --ops-font-sans: "DM Sans", Inter, "Segoe UI", Arial, sans-serif;
    --ops-font-mono: "DM Sans", Inter, "Segoe UI", Arial, sans-serif;
}

html,
body {
    background: var(--sys1-paper);
}

body {
    color: var(--sys1-text);
    background-image: none;
    font-family: "DM Sans", Inter, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
.sidebar-brand strong,
.ops-metric-card strong,
.stat-card strong,
.metric-card strong {
    font-family: "Manrope", "DM Sans", sans-serif;
}

:focus-visible {
    outline: 3px solid rgba(17, 169, 154, 0.28);
    outline-offset: 2px;
}

/* ===== App shell / sidebar ===== */
.app-layout {
    grid-template-columns: 258px minmax(0, 1fr);
    background: var(--sys1-paper);
}

.sidebar {
    padding: 20px 14px 14px;
    color: #dce9ed;
    border-right: 0;
    background: linear-gradient(180deg, #0b1923, #0d202b 60%, #09151d);
    box-shadow: 6px 0 24px rgba(10, 26, 34, 0.09);
}

.sidebar::before {
    display: none !important;
    content: none !important;
}

.sidebar-brand {
    min-height: 60px;
    gap: 11px;
    padding: 0 7px 17px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    padding: 4px;
    border: 0;
    border-radius: 11px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 6px 16px rgba(17, 169, 154, 0.16);
}

.sidebar-brand strong {
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
}

.sidebar-brand small {
    margin-top: 2px;
    color: #8098a4;
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
}

.sidebar-collapse-toggle {
    min-height: 34px;
    margin: 10px 4px 7px;
    padding: 6px 10px;
    color: #86a0aa;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-collapse-toggle:hover {
    color: #ffffff;
    border-color: rgba(17, 169, 154, 0.38);
    background: rgba(17, 169, 154, 0.10);
}

.sidebar-user {
    margin: 5px 3px 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
}

.sidebar-user strong {
    color: #ffffff;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
}

.sidebar-user small {
    margin-top: 2px;
    color: #8098a4;
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    text-transform: none;
}

.user-avatar {
    width: 34px;
    height: 34px;
    color: var(--sys1-teal-dark);
    border: 0;
    border-radius: 10px;
    background: linear-gradient(145deg, #d9f3ef, #a7ded7);
    font-family: "Manrope", sans-serif;
}

.sidebar-quick-actions {
    gap: 6px;
    margin: 4px 3px 9px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}

.sidebar-quick-heading {
    color: #6f8994;
    font-family: "DM Sans", sans-serif;
    font-size: 9px;
    letter-spacing: 0.08em;
}

.sidebar-quick-heading small {
    color: #58717c;
    font-size: 8px;
}

.sidebar-quick-link {
    min-height: 36px;
    padding: 5px 8px;
    color: #aebfc6;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
    font-size: 11px;
    font-weight: 600;
}

.sidebar-quick-link:hover,
.sidebar-quick-link:focus-visible {
    color: #ffffff;
    border-color: rgba(17, 169, 154, 0.35);
    background: rgba(17, 169, 154, 0.13);
}

.sidebar-nav {
    padding-right: 2px;
    scrollbar-width: thin;
}

.nav-group {
    margin-top: 4px;
}

.nav-group-toggle {
    min-height: 31px;
    padding: 7px 10px 5px;
    color: #607a86;
    border-radius: 8px;
    font-family: "DM Sans", sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.nav-group-toggle:hover,
.nav-group-toggle:focus-visible,
.nav-group.contains-active > .nav-group-toggle {
    color: #7d98a3;
    background: rgba(255, 255, 255, 0.025);
}

.nav-group.contains-active > .nav-group-toggle .nav-group-icon,
.nav-group-icon {
    color: #698590;
    background: transparent;
}

.nav-group-meta [data-nav-count] {
    color: #607a86;
    background: rgba(255, 255, 255, 0.035);
}

.side-link {
    min-height: 39px;
    gap: 10px;
    margin: 2px 0;
    padding: 6px 10px;
    color: #9fb2bb;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.side-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.045);
}

.side-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(17, 169, 154, 0.24), rgba(17, 169, 154, 0.08));
    box-shadow: inset 3px 0 var(--sys1-teal);
}

.side-icon,
.sidebar-quick-link .side-icon {
    width: 27px;
    height: 27px;
    color: #74909a;
    border-radius: 8px;
    background: transparent;
}

.side-link.active .side-icon {
    color: #40d6c7;
    background: rgba(17, 169, 154, 0.08);
}

.sidebar-footer {
    padding-top: 9px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-session-state {
    padding: 0 8px 8px;
    color: #718d98;
    font-family: "DM Sans", sans-serif;
    font-size: 9px;
    letter-spacing: 0.05em;
    text-transform: none;
}

.sidebar-session-state i {
    background: #27cc8a;
    box-shadow: 0 0 0 3px rgba(39, 204, 138, 0.12);
}

.sidebar-logout {
    min-height: 39px;
    padding: 6px 10px;
    color: #f18a8a;
    border: 1px solid rgba(232, 88, 88, 0.12);
    border-radius: 10px;
    background: rgba(232, 88, 88, 0.055);
    font-size: 12px;
    font-weight: 600;
}

.sidebar-logout:hover {
    color: #ffffff;
    border-color: rgba(232, 88, 88, 0.32);
    background: rgba(232, 88, 88, 0.14);
}

.sidebar-tooltip {
    border: 1px solid rgba(17, 169, 154, 0.36);
    border-radius: 9px;
    background: var(--sys1-navy-2);
    box-shadow: var(--sys1-shadow-small);
}

/* ===== Sticky top bar ===== */
.page-header {
    min-height: 76px;
    padding: 12px 30px;
    border-bottom: 1px solid rgba(220, 229, 232, 0.86);
    background: rgba(255, 255, 255, 0.90);
    box-shadow: none;
    backdrop-filter: blur(14px);
}

.page-header::after {
    display: none !important;
}

.header-title-block {
    min-width: 190px;
}

.page-header .eyebrow {
    display: none;
}

.ops-breadcrumbs {
    margin-bottom: 2px;
    color: var(--sys1-muted);
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
}

.ops-breadcrumbs strong {
    color: #334750;
}

.page-header h1 {
    margin: 0;
    color: var(--sys1-text);
    font-size: 18px;
    font-weight: 800;
}

.header-tools {
    gap: 8px;
}

.header-search {
    width: clamp(230px, 28vw, 410px);
}

.header-search input {
    min-height: 40px;
    padding: 8px 70px 8px 37px;
    color: var(--sys1-text);
    border: 1px solid var(--sys1-line);
    border-radius: 11px;
    background: #ffffff;
    font-size: 12px;
}

.header-search input::placeholder {
    color: #94a1a7;
}

.header-search input:focus {
    border-color: #8acbc5;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(17, 169, 154, 0.10);
}

.header-search kbd {
    color: #87969d;
    border-color: var(--sys1-line);
    border-radius: 6px;
    background: #f7f9fa;
    font-family: "DM Sans", sans-serif;
}

.notification-pill {
    width: 39px;
    height: 39px;
    color: #65767e;
    border: 1px solid var(--sys1-line);
    border-radius: 11px;
    background: #ffffff;
}

.notification-pill:hover {
    color: var(--sys1-teal-dark);
    border-color: #a9c9c6;
    background: #ffffff;
}

.notification-pill b {
    background: var(--sys1-red);
}

.profile-pill {
    min-width: 0;
    gap: 9px;
    padding: 4px 7px 4px 11px;
    border: 0;
    border-left: 1px solid var(--sys1-line);
    border-radius: 0;
    background: transparent;
}

.profile-avatar {
    width: 34px;
    height: 34px;
    color: var(--sys1-teal-dark);
    border-radius: 10px;
    background: linear-gradient(145deg, #d9f3ef, #a7ded7);
    font-family: "Manrope", sans-serif;
}

.profile-pill strong {
    max-width: 150px;
    font-family: "Manrope", sans-serif;
    font-size: 11px;
}

.profile-pill small {
    color: var(--sys1-muted);
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
}

.mobile-menu-toggle {
    border-color: var(--sys1-line);
    border-radius: 10px;
    background: #ffffff;
}

/* ===== Main content ===== */
.page-content,
.ops-page {
    width: min(1680px, 100%);
    margin-right: auto;
    margin-left: auto;
}

.page-content {
    padding: 25px 30px 50px;
}

.eyebrow,
.ops-page .eyebrow {
    color: var(--sys1-teal-dark);
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.eyebrow::before {
    display: none;
}

/* Replace the old dark industrial hero with SYSTEM 1's light page-intro language. */
.dashboard-hero,
.monitoring-top-card,
.ops-workspace-intro,
.ops-page-intro {
    color: var(--sys1-text);
    border: 1px solid var(--sys1-line);
    border-radius: var(--sys1-radius);
    background: linear-gradient(145deg, #ffffff, #f8fcfb);
    box-shadow: var(--sys1-shadow);
}

.dashboard-hero,
.monitoring-top-card {
    min-height: 0;
    padding: 22px 24px;
}

.dashboard-hero::before,
.dashboard-hero::after,
.monitoring-top-card::before,
.monitoring-top-card::after {
    display: none;
    content: none;
}

.dashboard-hero h2,
.monitoring-top-card h2,
.ops-workspace-copy h2,
.ops-page-intro h1 {
    color: var(--sys1-text);
    font-family: "Manrope", sans-serif;
}

.dashboard-hero h2 {
    margin: 4px 0 6px;
    font-size: clamp(23px, 3vw, 31px);
}

.monitoring-top-card h2 {
    margin: 4px 0 5px;
    font-size: 18px;
}

.dashboard-hero p,
.monitoring-top-card p,
.ops-workspace-copy p,
.ops-page-intro p {
    color: var(--sys1-muted);
}

.monitoring-top-card .eyebrow.light,
.dashboard-hero .eyebrow.light,
.ops-workspace-copy .eyebrow {
    color: var(--sys1-teal-dark) !important;
}

.ops-workspace-intro {
    min-height: 0;
    align-items: center;
    padding: 22px 24px;
}

.ops-workspace-copy h2 {
    margin: 3px 0 5px;
    font-size: clamp(22px, 2.7vw, 30px);
}

.ops-workspace-copy p {
    line-height: 1.55;
}

.ops-workspace-actions .btn.secondary {
    color: #334750;
    border-color: var(--sys1-line);
    background: #ffffff;
}

.ops-page-intro {
    padding: 20px 22px;
}

/* Cards */
.stat-card,
.metric-card,
.content-card,
.filter-card,
.form-card,
.card,
.ops-section,
.ops-metric-card,
.live-card,
.report-card,
.recommendation-card,
.notification-card,
.ops-document-summary,
.ops-results-section,
.ops-filter-bar,
.ops-filter-drawer,
.ops-table-shell {
    border-color: var(--sys1-line);
    border-radius: var(--sys1-radius);
    background: #ffffff;
    box-shadow: var(--sys1-shadow);
}

.content-card,
.form-card,
.filter-card,
.ops-section,
.ops-results-section,
.ops-filter-bar,
.ops-filter-drawer,
.ops-document-summary {
    overflow: hidden;
}

.stat-card,
.metric-card,
.ops-metric-card {
    border: 1px solid var(--sys1-line);
    box-shadow: 0 3px 12px rgba(12, 34, 44, 0.025);
}

.stat-card::after,
.ops-metric-card::before {
    display: none;
    content: none;
}

.stat-icon {
    width: 42px;
    height: 42px;
    color: var(--sys1-teal-dark);
    border: 0;
    border-radius: 12px;
    background: #dff5f2;
}

.stat-card:nth-child(3) .stat-icon {
    color: #b43843;
    background: #fee6e8;
}

.stat-card:nth-child(4) .stat-icon {
    color: #ca7e0d;
    background: #fff0d6;
}

.stat-card span,
.stat-card small,
.metric-card small,
.ops-metric-card > span,
.ops-metric-card small {
    color: var(--sys1-muted);
    font-family: "DM Sans", sans-serif;
    text-transform: none;
}

.stat-card strong,
.metric-card strong,
.ops-metric-card strong {
    color: var(--sys1-text);
}

.ops-metric-card:hover,
.report-card:hover,
.content-card:hover {
    border-color: #c5d5d8;
}

.ops-site-strip a,
.ops-queue-grid a {
    border-color: var(--sys1-line);
    border-radius: 12px;
    background: #f8fafb;
}

.ops-site-strip a:hover,
.ops-queue-grid a:hover {
    border-color: #9dcbc7;
    background: #f2faf9;
}

.ops-site-strip span,
.ops-queue-grid span {
    color: var(--sys1-teal-dark);
    font-family: "DM Sans", sans-serif;
}

/* ===== Buttons ===== */
.btn,
.table-action,
button.btn,
a.btn {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--sys1-line);
    border-radius: 10px;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: none;
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.btn:hover,
.table-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(20, 43, 52, 0.08);
}

.btn:active,
.table-action:active {
    transform: translateY(0);
}

.btn.primary,
.table-action,
.ops-page .btn.primary {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--sys1-teal), #078f86);
    box-shadow: 0 6px 16px rgba(17, 169, 154, 0.16);
}

.btn.primary:hover,
.table-action:hover {
    color: #ffffff;
    border-color: transparent;
}

.btn.secondary {
    color: #334750;
    border-color: var(--sys1-line);
    background: #ffffff;
}

.btn.glass,
.btn.glass.subtle {
    color: var(--sys1-teal-dark);
    border-color: #b7d8d5;
    background: #f2faf9;
}

.btn.danger,
.table-action.danger {
    color: #ffffff;
    border-color: transparent;
    background: var(--sys1-red);
}

.btn.compact,
.table-action {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 11px;
}

/* ===== Forms and filters ===== */
label {
    color: #3d4d55;
}

input,
select,
textarea,
.form-control {
    color: var(--sys1-text);
    border-color: var(--sys1-line);
    border-radius: 10px;
    background: #ffffff;
    font-family: "DM Sans", sans-serif;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
    border-color: #79c8c1;
    box-shadow: 0 0 0 3px rgba(17, 169, 154, 0.10);
    outline: 0;
}

.filter-card {
    gap: 12px;
    padding: 15px;
}

.filter-card label,
.report-toolbar label,
.filters label,
.form-grid label,
.form-stack label,
.login-form label {
    font-size: 12px;
    font-weight: 600;
}

.filter-card .filter-count {
    color: var(--sys1-muted);
    border-color: var(--sys1-line);
    border-radius: 999px;
    background: #f5f8f9;
    font-family: "DM Sans", sans-serif;
}

.search-box {
    border-color: var(--sys1-line);
    border-radius: 10px;
    background: #ffffff;
}

/* ===== Tables ===== */
.table-wrap,
.ops-table-shell,
.ops-table-shell .table-wrap {
    border: 1px solid var(--sys1-line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: none;
}

.content-card > .table-wrap,
.ops-table-shell > .table-wrap {
    border: 0;
    border-radius: 0;
}

table,
table.data,
.modern-table,
.ops-table {
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
}

.modern-table th,
.ops-table th,
table.data th,
th {
    padding: 11px 12px;
    color: #718188;
    border-bottom: 1px solid var(--sys1-line);
    background: #f5f8f9;
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.modern-table td,
.ops-table td,
table.data td,
td {
    padding: 11px 12px;
    border-bottom-color: #edf1f2;
}

.modern-table tbody tr:nth-child(even),
.ops-table tbody tr:nth-child(even) {
    background: transparent;
}

.modern-table tbody tr:hover,
.ops-table tbody tr:hover,
table.data tbody tr:hover {
    background: #fbfdfd;
}

.modern-table td small,
.ops-table td small,
td small {
    color: #87959b;
}

/* ===== Status badges ===== */
.workflow-badge,
.status-badge,
.badge,
.pill,
.tag {
    min-height: 22px;
    padding: 4px 8px;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: capitalize;
}

.workflow-badge.completed,
.workflow-badge.approved,
.workflow-badge.received,
.workflow-badge.active,
.status-badge.success,
.status-badge.active {
    color: #167d5e;
    background: #def5ea;
}

.workflow-badge.for_procurement,
.workflow-badge.pending,
.workflow-badge.submitted,
.workflow-badge.under_review,
.status-badge.warning {
    color: #a6640a;
    background: #fff0da;
}

.workflow-badge.rejected,
.workflow-badge.cancelled,
.workflow-badge.damaged,
.status-badge.danger {
    color: #b43843;
    background: #fee6e8;
}

/* ===== Secondary modules ===== */
.recommendation-card,
.notification-card {
    border-left-width: 4px;
}

.notification-card {
    border-left-color: var(--sys1-teal);
}

.ai-hero {
    border-radius: 20px;
    background: radial-gradient(circle at 10% 10%, rgba(182, 142, 255, 0.36), transparent 25%), linear-gradient(135deg, #20264c, #172234 58%, #153c42);
    box-shadow: 0 14px 35px rgba(24, 34, 63, 0.16);
}

.empty-state {
    border-color: #c7d7dc;
    border-radius: 16px;
    background: #ffffff;
}

.alert,
.alert.success,
.alert.danger,
.alert.warning,
.alert.info {
    border-radius: 11px;
    box-shadow: none;
}

.alert.success { border: 1px solid #b9e6d5; background: #e0f5ec; color: #176c55; }
.alert.danger { border: 1px solid #f5c2c6; background: #fee8e9; color: #9f303b; }
.alert.warning { border: 1px solid #eed4a6; background: #fff3dc; color: #8a5a13; }
.alert.info { border: 1px solid #bddfe0; background: #e5f4f3; color: #33717d; }

/* ===== Login page (mirrors SYSTEM 1) ===== */
.login-body {
    display: block;
    min-height: 100vh;
    padding: 0;
    color: var(--sys1-text);
    background: var(--sys1-navy);
}

.login-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
}

.login-brand-showcase {
    position: relative;
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: clamp(48px, 8vw, 120px);
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 20% 20%, rgba(17, 169, 154, 0.18), transparent 28%),
        radial-gradient(circle at 80% 75%, rgba(243, 163, 41, 0.12), transparent 25%),
        linear-gradient(145deg, #081720, #0d2630);
}

.login-brand-showcase::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 32px 32px;
}

.login-brand-showcase > * {
    position: relative;
    z-index: 1;
}

.login-brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: #ffffff;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--sys1-teal), #087d76);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 6px 16px rgba(17, 169, 154, 0.24);
    font-family: "Manrope", sans-serif;
    font-size: 27px;
    font-weight: 800;
}

.login-brand-showcase .eyebrow {
    margin-top: 22px;
    color: #72cfc6 !important;
}

.login-brand-showcase h1 {
    max-width: 720px;
    margin: 0 0 20px;
    color: #ffffff;
    font-size: clamp(2.2rem, 4vw, 4.2rem);
    line-height: 1.08;
}

.login-brand-showcase h1 span {
    color: #4fd7ca;
}

.login-brand-showcase .login-copy {
    max-width: 590px;
    margin: 0;
    padding: 0;
    color: #aac0c9;
    border: 0;
    font-size: 1.02rem;
    line-height: 1.65;
}

.login-signals {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.login-signals span {
    padding: 9px 11px;
    color: #9fb6bf;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    font-size: 11px;
}

.login-signals b {
    color: #ffffff;
}

.login-panel {
    position: static;
    display: grid;
    min-width: 0;
    place-items: center;
    padding: 30px;
    color: var(--sys1-text);
    border: 0;
    border-radius: 0;
    background: #eef3f4;
    box-shadow: none;
}

.login-panel::before {
    display: none;
    content: none;
}

.login-card {
    width: min(410px, 100%);
    padding: 32px;
    color: var(--sys1-text);
    border: 1px solid var(--sys1-line);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 25px 70px rgba(4, 19, 26, 0.16);
}

.login-card .login-brand {
    display: none;
}

.login-card h2 {
    margin: 4px 0 4px;
    color: var(--sys1-text);
    font-size: 24px;
}

.login-card > .login-copy {
    margin: 0 0 22px;
    padding: 0;
    color: var(--sys1-muted);
    border: 0;
    font-size: 13px;
}

.login-form {
    gap: 15px;
    margin: 20px 0 0;
}

.login-form label {
    display: grid;
    gap: 6px;
    color: #334750;
}

.login-form input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
}

.login-submit {
    min-height: 46px;
    margin-top: 2px;
}

.login-help {
    display: block;
    margin-top: 18px;
    padding-top: 16px;
    color: #8c9a9f;
    border-top: 1px solid var(--sys1-line);
    font-family: "DM Sans", sans-serif;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
}

.login-mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-mobile-brand .login-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 20px;
}

.login-mobile-brand strong {
    font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .ops-metric-grid,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .login-brand-showcase {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
    }

    .login-mobile-brand {
        display: flex;
    }
}

@media (max-width: 860px) {
    .app-layout {
        display: block;
    }

    .page-header {
        padding: 13px 16px;
    }

    .page-content {
        padding: 20px 16px 40px;
    }
}

@media (max-width: 640px) {
    .page-header h1 {
        font-size: 17px;
    }

    .dashboard-hero,
    .monitoring-top-card,
    .ops-workspace-intro,
    .ops-page-intro {
        padding: 18px;
        border-radius: 14px;
    }

    .login-panel {
        padding: 15px;
    }

    .login-card {
        padding: 24px;
    }

    .ops-metric-grid,
    .stats-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: #ffffff;
    }

    .content-card,
    .form-card,
    .ops-section,
    .ops-table-shell {
        box-shadow: none;
    }
}

/* ===== Readability + soft teal card refresh =====
 * Requested follow-up: slightly larger sidebar text and lighter teal card accents.
 */
:root {
    --sys1-teal-wash: #f2fbfa;
    --sys1-teal-wash-strong: #e8f7f5;
    --sys1-teal-border: #cbe9e5;
    --sys1-teal-border-strong: #acdcd6;
}

/* Sidebar: improve legibility without making the navigation bulky. */
.sidebar-brand strong {
    font-size: 16px;
}

.sidebar-brand small {
    font-size: 11px;
}

.sidebar-user strong {
    font-size: 13px;
}

.sidebar-user small {
    font-size: 11px;
}

.sidebar-quick-heading {
    font-size: 10px;
}

.sidebar-quick-heading small {
    font-size: 9px;
}

.sidebar-quick-link {
    min-height: 38px;
    font-size: 12.5px;
}

.nav-group-toggle {
    min-height: 33px;
    font-size: 10px;
}

.side-link {
    min-height: 42px;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 13.5px;
    line-height: 1.25;
}

.sidebar-logout {
    min-height: 42px;
    font-size: 13px;
}

.sidebar-session-state {
    font-size: 10px;
}

/* Cards: keep content easy to read while carrying SYSTEM 1's teal identity. */
.stat-card,
.metric-card,
.ops-metric-card {
    border-color: var(--sys1-teal-border);
    background: linear-gradient(145deg, #ffffff 4%, var(--sys1-teal-wash) 100%);
}

.content-card,
.form-card,
.filter-card,
.card,
.ops-section,
.live-card,
.report-card,
.recommendation-card,
.notification-card,
.ops-document-summary,
.ops-results-section,
.ops-filter-bar,
.ops-filter-drawer {
    border-color: #d5eae7;
    background: linear-gradient(145deg, #ffffff 0%, #fbfefe 58%, var(--sys1-teal-wash) 100%);
}

/* Give card headings a gentle teal cue rather than a dark colored block. */
.content-card > header,
.form-card > header,
.card > header,
.ops-section > header,
.report-card > header,
.live-card > header,
.ops-results-section > header,
.content-card .card-header,
.form-card .card-header,
.card .card-header,
.ops-section .section-header {
    border-bottom-color: #dbeeea;
    background: rgba(223, 245, 242, 0.42);
}

/* Light teal metric icons/accents remain readable against the tinted cards. */
.stat-icon {
    background: #d9f3ef;
}

.ops-site-strip a,
.ops-queue-grid a {
    border-color: var(--sys1-teal-border);
    background: #f4fbfa;
}

.ops-site-strip a:hover,
.ops-queue-grid a:hover {
    border-color: var(--sys1-teal-border-strong);
    background: #eaf8f6;
}

/* Filters should feel grouped with the teal card family while inputs stay white. */
.filter-card,
.ops-filter-bar,
.ops-filter-drawer {
    background: #f5fbfa;
}

/* Preserve table clarity: teal-tinted shell/header, white data area. */
.table-wrap,
.ops-table-shell,
.ops-table-shell .table-wrap {
    border-color: #d5eae7;
}

.modern-table th,
.ops-table th,
table.data th,
th {
    border-bottom-color: #d8ebe8;
    background: #edf8f6;
}

.modern-table tbody tr:hover,
.ops-table tbody tr:hover,
table.data tbody tr:hover {
    background: #f3fbfa;
}

/* Make the light page intro consistent with the card refresh. */
.dashboard-hero,
.monitoring-top-card,
.ops-workspace-intro,
.ops-page-intro {
    border-color: var(--sys1-teal-border);
    background: linear-gradient(145deg, #ffffff, #eef9f7);
}


/* ===== Sidebar white text + chart polish =====
 * Follow-up visual refinement: plain white sidebar copy with teal used only as an accent.
 */
.sidebar-brand strong,
.sidebar-brand small,
.sidebar-user strong,
.sidebar-user small,
.sidebar-quick-heading,
.sidebar-quick-heading small,
.sidebar-quick-link,
.nav-group-toggle,
.nav-group-toggle:hover,
.nav-group-toggle:focus-visible,
.nav-group.contains-active > .nav-group-toggle,
.nav-group-meta [data-nav-count],
.side-link,
.side-link:hover,
.side-link.active,
.sidebar-session-state,
.sidebar-collapse-toggle,
.sidebar-mobile-header,
.sidebar-footer .side-label {
    color: #ffffff;
}

/* Keep icons/markers as the teal accent while all readable labels stay white. */
.nav-group-icon,
.nav-group.contains-active > .nav-group-toggle .nav-group-icon,
.side-icon,
.sidebar-quick-link .side-icon {
    color: #7be2d8;
}

.side-link.active .side-icon {
    color: #9df0e8;
}

.sidebar-quick-heading small,
.sidebar-user small,
.sidebar-session-state {
    opacity: .78;
}

.nav-group-meta [data-nav-count] {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.07);
}

/* Charts: softer teal presentation that matches the cards and removes the old cream/industrial look. */
.live-card.diagram-card,
.diagram-card,
.ops-live-dashboard .live-card:not(.ai-pulse-card) {
    border-color: #c6e5e1;
    background: linear-gradient(145deg, #ffffff 0%, #f5fcfb 58%, #eaf8f6 100%);
    box-shadow: 0 8px 24px rgba(17, 111, 120, 0.07);
}

.live-card.diagram-card:hover,
.diagram-card:hover {
    border-color: #9fd8d1;
    box-shadow: 0 10px 28px rgba(17, 111, 120, 0.10);
}

.live-card-head {
    margin-bottom: 14px;
    padding-bottom: 11px;
    border-bottom: 1px solid #d9eeeb;
}

.live-card-head .eyebrow {
    color: #118f84;
}

.live-card-head h2 {
    color: #173b43;
}

.chart-canvas {
    padding: 8px;
    border: 1px solid #cbe7e3;
    border-radius: 14px;
    background: linear-gradient(145deg, #fbfefe, #edf9f7);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 3px 12px rgba(17,111,120,.04);
}

.chart-clickable:hover {
    transform: translateY(-1px);
    border-color: #94d5ce;
    box-shadow: 0 8px 20px rgba(17,111,120,.10);
}

.ops-chart-empty {
    border: 1px dashed #b7ddd8;
    border-radius: 12px;
    background: #f1faf8;
    color: #54747a;
}

/* ===== Light teal table refinement =====
 * Gives all operational/report tables a clearer SYSTEM 1-style hierarchy while
 * preserving white data surfaces and the existing responsive behavior.
 */
.table-wrap,
.ops-table-shell,
.ops-table-shell .table-wrap {
    border-color: #cbe5e1;
    background: #ffffff;
    box-shadow: 0 5px 18px rgba(20, 91, 96, 0.045);
}

.modern-table,
.ops-table,
table.data {
    color: #30464b;
    background: #ffffff;
}

.modern-table thead th,
.ops-table thead th,
table.data thead th {
    padding: 12px 13px;
    color: #245f5a;
    border-bottom: 1px solid #b8ddd8;
    border-right: 1px solid rgba(168, 213, 207, 0.42);
    background: linear-gradient(180deg, #e9f8f6 0%, #def3f0 100%);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.modern-table thead th:last-child,
.ops-table thead th:last-child,
table.data thead th:last-child {
    border-right: 0;
}

.modern-table tbody td,
.ops-table tbody td,
table.data tbody td {
    padding: 12px 13px;
    color: #35494e;
    border-bottom: 1px solid #e5f0ee;
    background: transparent;
}

.modern-table tbody tr:nth-child(even),
.ops-table tbody tr:nth-child(even),
table.data tbody tr:nth-child(even) {
    background: #fbfefd;
}

.modern-table tbody tr:nth-child(odd),
.ops-table tbody tr:nth-child(odd),
table.data tbody tr:nth-child(odd) {
    background: #ffffff;
}

.modern-table tbody tr:hover,
.ops-table tbody tr:hover,
table.data tbody tr:hover {
    background: #eef9f7;
    box-shadow: inset 3px 0 0 #69c9bd;
}

.modern-table tbody tr:last-child td,
.ops-table tbody tr:last-child td,
table.data tbody tr:last-child td {
    border-bottom: 0;
}

.modern-table td b,
.ops-table td b,
table.data td b {
    color: #183e43;
}

.modern-table td small,
.ops-table td small,
table.data td small {
    color: #789095;
}

/* Sorting indicators were previously tuned for dark headers. */
.modern-table .sortable-heading::after,
.ops-table .sortable-heading::after,
table.data .sortable-heading::after,
.sortable-heading::after {
    color: #75afa8;
}

.modern-table .sortable-heading[data-sort-direction="asc"]::after,
.modern-table .sortable-heading[data-sort-direction="desc"]::after,
.ops-table .sortable-heading[data-sort-direction="asc"]::after,
.ops-table .sortable-heading[data-sort-direction="desc"]::after,
table.data .sortable-heading[data-sort-direction="asc"]::after,
table.data .sortable-heading[data-sort-direction="desc"]::after,
.sortable-heading[data-sort-direction="asc"]::after,
.sortable-heading[data-sort-direction="desc"]::after {
    color: #0d8b80;
}

/* Table pagination / sorting footer belongs to the same light teal component. */
.ops-pagination,
.smart-table-controls {
    color: #607b7f;
    border-top-color: #d5ebe7;
    background: #f3fbfa;
}

.ops-pagination button,
.ops-pagination a,
.smart-table-controls button,
.smart-table-controls a,
.smart-table-controls select {
    border-color: #c5e2de;
    background: #ffffff;
}

/* Inputs placed inside editable line-item tables stay crisp against teal rows. */
.modern-table input,
.modern-table select,
.modern-table textarea,
.ops-table input,
.ops-table select,
.ops-table textarea,
table.data input,
table.data select,
table.data textarea {
    border-color: #cfe5e1;
    background: #ffffff;
}

.modern-table input:focus,
.modern-table select:focus,
.modern-table textarea:focus,
.ops-table input:focus,
.ops-table select:focus,
.ops-table textarea:focus,
table.data input:focus,
table.data select:focus,
table.data textarea:focus {
    border-color: #67c7bc;
    box-shadow: 0 0 0 3px rgba(63, 184, 172, 0.12);
}

/* AI Summary readability fix: the legacy AI card forced white text while the
   SYSTEM 1 refresh uses light surfaces. Keep the card light teal and all copy readable. */
.ai-pulse-card,
.ops-live-dashboard .ai-pulse-card {
    color: #28484f;
    border-color: #bfe2dd;
    background: linear-gradient(145deg, #ffffff 0%, #f2fbf9 52%, #dff5f2 100%);
    box-shadow: 0 8px 24px rgba(17, 111, 120, 0.08);
}

.ai-pulse-card .live-card-head {
    border-bottom-color: #cfe9e5;
    background: transparent;
}

.ai-pulse-card .live-card-head h2,
.ops-live-dashboard .ai-pulse-card h2,
.ai-pulse-card h2 {
    color: #173b43;
}

.ai-pulse-card p,
.ops-live-dashboard .ai-pulse-card p,
.ai-pulse-card p b,
.ai-pulse-card p strong {
    color: #35555c;
}

.ai-pulse-card .eyebrow,
.ai-pulse-card .live-card-head .eyebrow {
    color: #0b6f68;
}

.ai-pulse-card .pulse-number strong {
    color: #0f716c;
}

.ai-pulse-card .pulse-number span {
    color: #557178;
}

.ai-pulse-card .ai-mini-feed span {
    color: #22545b;
    border-color: #9dcec7;
    background: #d9f0ed;
}

.ops-ai-briefing .ops-text-link,
.ai-pulse-card .ops-text-link {
    color: #08665f;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.ops-ai-briefing .ops-text-link:hover,
.ops-ai-briefing .ops-text-link:focus-visible {
    color: #064d48;
}

/* ===== Light-surface contrast audit =====
 * SYSTEM 1 converts several legacy dark operational panels to light teal/white
 * surfaces. Keep all document-summary copy readable after that conversion.
 */
.ops-document-summary {
    color: #31484e;
    border-color: #c8e3df;
    background: linear-gradient(145deg, #ffffff 0%, #f8fcfb 60%, #edf8f6 100%);
}

.ops-document-summary .ops-document-identity > .eyebrow,
.ops-document-summary .eyebrow.light {
    color: #0a6c66 !important;
}

.ops-document-summary .ops-document-identity h2 {
    color: #173b43;
}

.ops-document-summary .ops-document-identity p {
    color: #547078;
}

.ops-document-summary .ops-document-meta {
    border-color: #c9e1de;
    background: #c9e1de;
}

.ops-document-summary .ops-document-meta > div {
    background: rgba(255, 255, 255, 0.92);
}

.ops-document-summary .ops-document-meta dt {
    color: #557178;
}

.ops-document-summary .ops-document-meta dd {
    color: #203f45;
}

/* Contrast guard for legacy dark hero content that is rendered on the
   light SYSTEM 1 hero surfaces. Existing component-specific colors still win. */
.dashboard-hero,
.monitoring-top-card,
.ops-workspace-intro,
.ops-page-intro {
    color: var(--sys1-text);
}

.dashboard-hero small,
.monitoring-top-card small,
.ops-workspace-intro small,
.ops-page-intro small {
    color: #547078;
}
