:root {
  --ev-ink: #09111f;
  --ev-ink-2: #111d2e;
  --ev-panel: #ffffff;
  --ev-canvas: #f3f6fa;
  --ev-canvas-2: #eaf0f6;
  --ev-text: #142033;
  --ev-muted: #64748b;
  --ev-border: #dfe7ef;
  --ev-border-strong: #cbd7e3;
  --ev-cyan: #00a8c7;
  --ev-cyan-dark: #087b95;
  --ev-blue: #2563eb;
  --ev-green: #00a878;
  --ev-amber: #e69a16;
  --ev-red: #df4453;
  --ev-radius: 14px;
  --ev-shadow: 0 12px 32px rgba(15, 32, 54, .08);
  --ev-shadow-hover: 0 18px 44px rgba(10, 31, 55, .14);
  --ev-sidebar: 272px;
  --ev-topbar: 72px;
  --tc-primary: var(--ev-cyan);
  --tc-primary-dark: var(--ev-cyan-dark);
  --tc-secondary: var(--ev-green);
  --tc-background: var(--ev-canvas);
  --tc-surface: var(--ev-panel);
  --tc-border: var(--ev-border);
  --tc-text: var(--ev-text);
  --tc-muted: var(--ev-muted);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ev-canvas); }
body {
  margin: 0;
  color: var(--ev-text);
  background:
    radial-gradient(circle at 80% -20%, rgba(0, 168, 199, .09), transparent 34rem),
    linear-gradient(135deg, var(--ev-canvas), #f8fafc 55%, var(--ev-canvas-2));
  font-family: Manrope, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
}
h1, h2, h3, h4, h5, h6, .card-title { color: var(--ev-text); font-family: "Space Grotesk", Manrope, sans-serif; letter-spacing: -.025em; }
a { color: var(--ev-cyan-dark); }
button, input, select, textarea { font: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #e8eef4; }
::-webkit-scrollbar-thumb { border: 2px solid #e8eef4; border-radius: 99px; background: #8da2b7; }
::-webkit-scrollbar-thumb:hover { background: var(--ev-cyan-dark); }

/* Application shell */
.tc-app-shell { display: flex; min-height: 100vh; }
.tc-app-stage { width: calc(100% - var(--ev-sidebar)); min-width: 0; margin-left: var(--ev-sidebar); }
.tc-main-content { min-height: calc(100vh - var(--ev-topbar) - 46px); padding: 14px 16px 20px; }
.tc-app-footer { display: flex; min-height: 46px; padding: 0 18px; align-items: center; justify-content: space-between; color: #7a8899; border-top: 1px solid rgba(203, 215, 227, .8); font-size: 11px; }
.tc-topbar {
  position: sticky; z-index: 1010; top: 0; display: flex; min-height: var(--ev-topbar); padding: 10px 16px;
  align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(210, 221, 232, .9);
  background: rgba(248, 250, 252, .86); box-shadow: 0 8px 24px rgba(31, 47, 67, .04); backdrop-filter: blur(18px);
}
.tc-topbar-left, .tc-topbar-actions { display: flex; align-items: center; gap: 10px; }
.tc-topbar-left > div { display: grid; gap: 2px; }
.tc-topbar-left strong { font-family: "Space Grotesk", sans-serif; font-size: 14px; }
.tc-topbar-kicker { color: var(--ev-muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.tc-nav-trigger, .tc-topbar-button {
  display: inline-flex; min-width: 38px; height: 38px; padding: 0 11px; align-items: center; justify-content: center; gap: 6px;
  color: #4b5e74; border: 1px solid var(--ev-border); border-radius: 11px; background: rgba(255,255,255,.8);
}
.tc-nav-trigger { display: none; padding: 0; }
.tc-topbar-button:hover { color: var(--ev-cyan-dark); border-color: #a5dce5; background: #effbfd; }
.tc-topbar-button i { font-size: 19px; }
.tc-topbar-button span { font-size: 11px; font-weight: 700; }
.tc-topbar-profile { display: flex; padding: 4px 8px 4px 4px; align-items: center; gap: 8px; color: var(--ev-text); border: 1px solid var(--ev-border); border-radius: 12px; background: #fff; }
.tc-topbar-profile > span, .tc-user-initial { display: grid; width: 32px; height: 32px; place-items: center; color: #d9fbff; border-radius: 9px; background: linear-gradient(135deg, #075a70, #00a8c7); font: 700 12px "Space Grotesk"; }
.tc-topbar-profile div { display: grid; line-height: 1.2; }
.tc-topbar-profile strong { max-width: 150px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.tc-topbar-profile small { color: var(--ev-muted); font-size: 9px; }
.tc-sidebar-scrim { display: none; }

/* Premium EV sidebar */
.tc-sidebar {
  position: fixed; z-index: 1040; inset: 0 auto 0 0; display: flex; width: var(--ev-sidebar); padding: 12px;
  flex-direction: column; color: #ccdae8; background:
    radial-gradient(circle at 20% 0, rgba(0, 189, 220, .18), transparent 19rem),
    linear-gradient(180deg, #07111f 0%, #0b1727 55%, #08121f 100%);
  box-shadow: 16px 0 42px rgba(8, 18, 31, .15);
}
.tc-sidebar::before { position: absolute; inset: 0; content: ""; pointer-events: none; opacity: .22; background-image: linear-gradient(rgba(125,211,252,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(125,211,252,.05) 1px, transparent 1px); background-size: 32px 32px; }
.tc-brand { position: relative; z-index: 1; display: flex; min-height: 56px; padding: 5px 6px 10px; align-items: center; border-bottom: 1px solid rgba(148, 183, 211, .13); }
.tc-brand-link { display: flex; min-width: 0; align-items: center; gap: 10px; color: #fff; }
.tc-brand-link:hover { color: #fff; }
.tc-brand-mark { position: relative; display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; color: #07111f; border-radius: 11px; background: linear-gradient(135deg, #72f1ff, #00b5d1 58%, #32d49d); box-shadow: 0 0 0 4px rgba(75, 219, 235, .08), 0 8px 18px rgba(0, 168, 199, .2); }
.tc-brand-mark i { font-size: 23px; }
.tc-brand-copy { display: grid; line-height: 1.12; }
.tc-brand-copy strong { font: 700 16px "Space Grotesk"; letter-spacing: -.02em; }
.tc-brand-copy small { margin-top: 3px; color: #7fa0b9; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.tc-sidebar-close { display: none; width: 34px; height: 34px; margin-left: auto; color: #9cb0c5; border: 0; border-radius: 9px; background: rgba(255,255,255,.06); }
.tc-plant-state { position: relative; z-index: 1; display: grid; margin: 10px 2px 6px; padding: 10px; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px; border: 1px solid rgba(129, 169, 199, .13); border-radius: 11px; background: rgba(255,255,255,.035); }
.tc-state-orb { width: 8px; height: 8px; border-radius: 50%; background: #3cdb9e; box-shadow: 0 0 0 4px rgba(60,219,158,.1), 0 0 12px rgba(60,219,158,.65); }
.tc-plant-state div { display: grid; }
.tc-plant-state strong { color: #dce8f2; font-size: 10px; }
.tc-plant-state small { color: #738ba1; font-size: 8px; }
.tc-state-label { color: #55dca8; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.tc-nav-scroll { position: relative; z-index: 1; min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.tc-nav-scroll::-webkit-scrollbar-track { background: transparent; }
.tc-nav-scroll::-webkit-scrollbar-thumb { border-color: transparent; background: #32465b; }
.tc-sidebar ul { padding: 0; margin: 0; list-style: none; }
.tc-sidebar .menu-header { padding: 14px 10px 5px; color: #557087; font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.tc-sidebar .menu-link { position: relative; display: flex; min-height: 39px; padding: 8px 10px; align-items: center; gap: 9px; color: #9fb3c7; border: 1px solid transparent; border-radius: 10px; font-size: 11px; font-weight: 600; transition: .18s ease; }
.tc-sidebar .menu-link:hover { color: #e6f8fb; border-color: rgba(116, 208, 224, .12); background: rgba(94, 198, 218, .07); transform: translateX(2px); }
.tc-sidebar .menu-icon { width: 19px; margin: 0; flex: 0 0 19px; color: #6f8ca3; font-size: 18px; }
.tc-sidebar .menu-item.active > .menu-link { color: #e9fdff; border-color: rgba(95, 224, 235, .18); background: linear-gradient(90deg, rgba(0, 168, 199, .24), rgba(0, 168, 199, .06)); box-shadow: inset 3px 0 #39d8e9; }
.tc-sidebar .menu-item.active > .menu-link .menu-icon { color: #67e7f2; }
.tc-menu-chevron { margin-left: auto; font-size: 16px; transition: transform .2s ease; }
.tc-sidebar .menu-item.open > .menu-link .tc-menu-chevron { transform: rotate(90deg); }
.tc-sidebar .menu-sub { display: none; position: relative; padding: 3px 0 5px 25px; }
.tc-sidebar .menu-item.open > .menu-sub { display: block; }
.tc-sidebar .menu-sub::before { position: absolute; top: 3px; bottom: 8px; left: 18px; width: 1px; content: ""; background: rgba(112, 157, 184, .18); }
.tc-sidebar .menu-sub .menu-link { min-height: 31px; padding: 5px 9px; font-size: 10px; font-weight: 550; }
.tc-sidebar .menu-sub .menu-item.active > .menu-link { box-shadow: none; }
.tc-sidebar-footer { position: relative; z-index: 1; display: grid; min-height: 54px; padding: 9px 6px 0; grid-template-columns: 32px 1fr 32px; align-items: center; gap: 8px; border-top: 1px solid rgba(148, 183, 211, .13); }
.tc-sidebar-user-copy { display: grid; min-width: 0; line-height: 1.2; }
.tc-sidebar-user-copy strong { overflow: hidden; color: #e1edf7; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tc-sidebar-user-copy small { color: #6f899f; font-size: 8px; }
.tc-sidebar-footer > a { display: grid; width: 32px; height: 32px; place-items: center; color: #829bb0; border-radius: 9px; background: rgba(255,255,255,.045); }

/* Dense page language shared by all sections */
.tc-page, .container-xxl, .container-fluid { max-width: none; }
.tc-page { padding: 0; }
.container-xxl.container-p-y, .container-xxl.flex-grow-1, .container-fluid.container-p-y { padding: 0; }
.content-wrapper { min-height: 0; padding: 0; background: transparent; }
.tc-page-head { display: flex; min-height: 68px; margin: 0 0 10px; padding: 12px 15px; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid rgba(213,224,235,.9); border-radius: var(--ev-radius); background: rgba(255,255,255,.82); box-shadow: 0 10px 28px rgba(23,44,68,.045); backdrop-filter: blur(14px); }
.tc-page-head h1 { margin: 1px 0 2px; font-size: clamp(20px, 2vw, 27px); line-height: 1.1; }
.tc-page-head p { max-width: 760px; margin: 0; color: var(--ev-muted); font-size: 11px; line-height: 1.45; }
.tc-eyebrow { display: block; color: var(--ev-cyan-dark); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.card, .tc-panel, .modal-content, .dropdown-menu, .accordion-item {
  color: var(--ev-text); border: 1px solid var(--ev-border); border-radius: var(--ev-radius);
  background: rgba(255,255,255,.95); box-shadow: var(--ev-shadow);
}
.card { margin-bottom: 10px; }
.card-header, .tc-panel-head { display: flex; min-height: 52px; padding: 11px 14px; align-items: center; justify-content: space-between; gap: 10px; color: var(--ev-text); border-bottom: 1px solid #e9eef3; background: linear-gradient(180deg, #fff, #fbfcfd); }
.card-header h4, .card-header h5, .tc-panel-head h5 { margin: 0; font-size: 14px; }
.card-body { padding: 13px; }
.tc-panel { overflow: hidden; }
.tc-panel > .table-responsive:last-child, .card-datatable { border-radius: 0 0 var(--ev-radius) var(--ev-radius); }
.row.g-4 { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
.row.g-3 { --bs-gutter-x: .65rem; --bs-gutter-y: .65rem; }

/* Forms and wizards */
.form-label, label { margin-bottom: 4px; color: #405169; font-size: 10px; font-weight: 700; }
.form-control, .form-select, .selectize-input, .select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple {
  min-height: 40px; padding: 8px 11px; color: #142033; border: 1px solid var(--ev-border-strong); border-radius: 10px; background-color: #fff; box-shadow: 0 1px 1px rgba(21,38,60,.02);
}
textarea.form-control { min-height: 84px; line-height: 1.45; }
.form-control:focus, .form-select:focus, .selectize-input.focus, .select2-container--focus .select2-selection { border-color: var(--ev-cyan); box-shadow: 0 0 0 3px rgba(0,168,199,.12); }
.form-floating > .form-control, .form-floating > .form-select { min-height: 48px; height: 48px; }
.form-floating > label { padding: .8rem .75rem; }
.input-group-text { min-height: 40px; color: #587087; border-color: var(--ev-border-strong); background: #f4f7fa; }
.form-check { min-height: 18px; }
.form-check-input { border-color: #9fb0c2; }
.form-check-input:checked { border-color: var(--ev-cyan); background-color: var(--ev-cyan); }
.form-text, small.text-muted { color: var(--ev-muted); font-size: 9px; }
.tc-form-section { padding: 12px; border: 1px solid #e4ebf2; border-radius: 12px; background: linear-gradient(180deg,#fff,#fafbfd); }
.tc-form-section + .tc-form-section { margin-top: 10px; }
.invalid-feedback { font-size: 9px; }
.ck-editor__editable[role="textbox"] { min-height: 220px; }

/* Buttons, status and menus */
.btn { min-height: 36px; padding: 7px 12px; border-radius: 9px; font-size: 10px; font-weight: 750; letter-spacing: .005em; box-shadow: none; }
.btn-sm, .btn-group-sm > .btn { min-height: 31px; padding: 5px 9px; }
.btn-lg { min-height: 42px; padding: 9px 15px; }
.btn-primary { color: #fff; border-color: var(--ev-cyan-dark); background: linear-gradient(135deg, #087f99, #00a8c7); box-shadow: 0 7px 16px rgba(0, 137, 165, .18); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(0,137,165,.25); }
.btn-success { border-color: #07855f; background: linear-gradient(135deg,#07855f,#00ae7c); }
.btn-danger { border-color: #c83747; background: linear-gradient(135deg,#c83747,#e75b69); }
.btn-icon { display: inline-grid; width: 34px; min-width: 34px; padding: 0; place-items: center; }
.badge { padding: 5px 8px; border-radius: 99px; font-size: 8px; font-weight: 800; letter-spacing: .04em; }
.dropdown-menu { padding: 6px; }
.dropdown-item { min-height: 34px; padding: 7px 9px; border-radius: 8px; color: #33465b; font-size: 10px; }
.dropdown-item:hover { background: #edf9fb; color: var(--ev-cyan-dark); }
.alert { padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; font-size: 10px; }

/* DataTables: one command row, horizontal data surface */
.table-responsive, .card-datatable, .tc-table-scroll, .dataTables_scrollBody { overflow-x: auto; }
.card-datatable { padding: 0; }
table.table, table.dataTable { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 10px; }
table.dataTable.no-footer { border-bottom: 0; }
table.table thead th, table.dataTable thead th { padding: 10px 11px; color: #dceaf3; border: 0; border-right: 1px solid rgba(255,255,255,.08); background: #10253a; font-size: 8px; font-weight: 800; letter-spacing: .045em; line-height: 1.25; text-transform: uppercase; white-space: nowrap; }
table.table tbody td, table.dataTable tbody td { padding: 9px 11px; color: #26364a; border-top: 0; border-bottom: 1px solid #e9eef3; vertical-align: middle; }
table.dataTable tbody tr:nth-child(even), table.table tbody tr:nth-child(even) { background: #fbfcfd; }
table.dataTable tbody tr:hover, table.table tbody tr:hover { background: #eef9fb; }
.dataTables_wrapper { width: 100%; padding: 0; color: var(--ev-text); }
.tc-dt-toolbar {
  display: flex; width: 100%; min-width: max-content; min-height: 54px; padding: 8px 10px; align-items: center;
  gap: 7px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 1px solid #e5ebf1; background: #fff;
}
.tc-dt-toolbar .dt-buttons { display: flex; margin: 0; align-items: center; gap: 5px; flex-wrap: nowrap; white-space: nowrap; }
.tc-dt-toolbar .dataTables_length { margin-left: auto; white-space: nowrap; }
.tc-dt-toolbar .dataTables_filter { white-space: nowrap; }
.tc-dt-toolbar .dataTables_length label, .tc-dt-toolbar .dataTables_filter label { display: flex; margin: 0; align-items: center; gap: 6px; white-space: nowrap; }
.tc-dt-toolbar select, .tc-dt-toolbar input { width: auto; min-width: 68px; height: 33px; min-height: 33px; margin: 0; padding: 5px 8px; border: 1px solid var(--ev-border-strong); border-radius: 8px; background: #fff; }
.tc-dt-toolbar .dataTables_filter input { width: 190px; }
.dt-buttons .dt-button { min-height: 32px; margin: 0; padding: 6px 9px; color: #355066; border: 1px solid var(--ev-border-strong); border-radius: 8px; background: #f7f9fb; box-shadow: none; font-size: 9px; font-weight: 750; }
.dt-buttons .dt-button:hover { color: #067c94; border-color: #9bdbe6; background: #edfafd; }
.tc-dt-date-range { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.tc-dt-date-range > span { color: var(--ev-muted); font-size: 9px; font-weight: 700; }
.tc-dt-footer { display: flex; min-height: 48px; padding: 7px 10px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e7edf3; background: #fff; }
.dataTables_info { padding: 0; color: var(--ev-muted); font-size: 9px; }
.dataTables_paginate { display: flex; padding: 0; white-space: nowrap; }
.dataTables_wrapper .dataTables_paginate .paginate_button { min-width: 30px; height: 30px; margin: 0 2px; padding: 6px; color: #50677c; border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 9px; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current { color: #fff; border-color: var(--ev-cyan-dark); background: var(--ev-cyan-dark); }
.dataTables_wrapper > .row { margin: 0; }
.dataTables_wrapper > .row > [class*="col-"] { padding: 0; }
.dtr-control::before, table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before { display: none; }
.tc-date-shortcuts { display: flex; margin: 6px 0 10px; gap: 5px; flex-wrap: nowrap; overflow-x: auto; }

/* Existing specialist screens */
.tc-metric-grid, .tc-live-summary { display: grid; margin-bottom: 10px; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.tc-metric, .tc-live-summary article { position: relative; min-height: 86px; padding: 13px; overflow: hidden; border: 1px solid var(--ev-border); border-radius: 13px; background: linear-gradient(145deg,#fff,#f7fafc); box-shadow: 0 8px 22px rgba(21,41,64,.055); }
.tc-live-summary article { display: grid; align-content: center; }
.tc-live-summary article span { color: var(--ev-muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.tc-live-summary article strong { color: #14283d; font: 700 26px "Space Grotesk"; }
.tc-live-summary article i { position: absolute; right: 12px; bottom: 8px; color: rgba(0,143,169,.16); font-size: 38px; }
.tc-pack-flow-grid { display: grid; padding: 12px; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 8px; }
.tc-live-pack { display: flex; min-height: 78px; padding: 11px; align-items: center; gap: 10px; border: 1px solid #e2e9f0; border-left: 3px solid var(--ev-blue); border-radius: 11px; background: #fff; }
.tc-live-pack--success { border-left-color: var(--ev-green); }.tc-live-pack--danger { border-left-color: var(--ev-red); }.tc-live-pack--warning { border-left-color: var(--ev-amber); }.tc-live-pack--info { border-left-color: var(--ev-cyan); }
.tc-live-pack-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; color: var(--ev-cyan-dark); border-radius: 12px; background: #eaf9fb; }
.tc-live-pack-icon i { font-size: 25px; }
.tc-live-pack-copy { display: grid; min-width: 0; }
.tc-live-pack-copy strong { overflow: hidden; color: #15273b; font: 650 12px "Space Grotesk"; text-overflow: ellipsis; white-space: nowrap; }
.tc-live-pack-copy small { color: var(--ev-muted); font-size: 8px; }
.tc-live-status { color: var(--ev-cyan-dark); font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.tc-refresh-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--ev-muted); }
.tc-empty { display: grid; min-height: 130px; padding: 24px; place-items: center; align-content: center; gap: 5px; color: var(--ev-muted); text-align: center; }
.tc-empty > i { color: #9cafc1; font-size: 32px; }.tc-empty strong { color: #33475d; }
.tc-list-item { padding: 10px 12px; border-bottom: 1px solid #ebf0f4; }
.tc-dropzone { border: 1px dashed #9eb8c8; border-radius: 12px; background: #f6fbfc; }
.tc-pack-hero, .tc-report-hero, .tc-dispatch-hero { border-radius: var(--ev-radius); background: radial-gradient(circle at 85% 0,rgba(50,212,157,.16),transparent 18rem),linear-gradient(120deg,#071422,#0d3046 65%,#075066); }
.modal-header { padding: 12px 14px; border-bottom-color: #e8edf2; }.modal-body { padding: 14px; }.modal-footer { padding: 10px 14px; border-top-color: #e8edf2; }

/* Authentication */
.tc-auth-body { min-height: 100vh; background: radial-gradient(circle at 75% 20%,rgba(0,204,223,.2),transparent 27rem),linear-gradient(135deg,#07111e,#0c2337 55%,#073c4c); }
.tc-auth-stage { min-height: 100vh; }
.tc-auth-stage .authentication-wrapper { min-height: 100vh; }
.tc-auth-stage .authentication-bg { margin: 24px; border: 1px solid rgba(255,255,255,.58); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 28px 70px rgba(1,12,24,.32); }
.tc-auth-stage .auth-cover-brand { color: #fff; }.tc-auth-stage h4 { font-size: 24px; }

/* Responsive behavior */
@media (max-width: 1199.98px) {
  .tc-sidebar { transform: translateX(-105%); transition: transform .24s ease; }
  .tc-app-stage { width: 100%; margin-left: 0; }
  .tc-nav-trigger, .tc-sidebar-close { display: inline-grid; place-items: center; }
  body.tc-nav-open { overflow: hidden; }
  body.tc-nav-open .tc-sidebar { transform: translateX(0); }
  body.tc-nav-open .tc-sidebar-scrim { position: fixed; z-index: 1030; inset: 0; display: block; border: 0; background: rgba(2,10,20,.55); backdrop-filter: blur(2px); }
}
@media (max-width: 767.98px) {
  :root { --ev-topbar: 62px; }
  .tc-main-content { padding: 9px; }
  .tc-topbar { padding: 8px 9px; }
  .tc-topbar-left > div, .tc-topbar-button span, .tc-topbar-profile div { display: none; }
  .tc-topbar-actions { gap: 6px; }.tc-topbar-button { width: 38px; padding: 0; }
  .tc-topbar-profile { padding: 3px; }.tc-topbar-profile > span { width: 31px; height: 31px; }
  .tc-page-head { min-height: 62px; padding: 10px 11px; align-items: flex-start; }
  .tc-page-head h1 { font-size: 19px; }.tc-page-head p { font-size: 9px; }
  .tc-page-head > .btn, .tc-page-head > div + * { flex: 0 0 auto; }
  .card-body { padding: 10px; }.card-header, .tc-panel-head { padding: 10px 11px; }
  .tc-metric-grid, .tc-live-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tc-live-summary article { min-height: 74px; padding: 10px; }.tc-live-summary article strong { font-size: 22px; }
  .tc-pack-flow-grid { padding: 9px; grid-template-columns: 1fr; }
  .tc-dt-toolbar { max-width: calc(100vw - 20px); }
  .tc-dt-toolbar .dataTables_filter input { width: 150px; }
  .tc-dt-footer { align-items: flex-start; overflow-x: auto; }
  .tc-app-footer { padding: 0 10px; }.tc-app-footer span:last-child { display: none; }
  .modal-dialog { margin: 8px; }
  .tc-auth-stage .authentication-bg { margin: 10px; border-radius: 17px; }
}
@media (max-width: 420px) {
  .tc-page-head { flex-direction: column; }.tc-page-head > .btn { width: 100%; }
  .tc-metric-grid, .tc-live-summary { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto; transition: none; animation: none; } }
@media print { .tc-sidebar,.tc-topbar,.tc-app-footer,.tc-sidebar-scrim,.dt-buttons,.dataTables_filter,.dataTables_length { display:none; }.tc-app-stage { width:100%; margin:0; }.tc-main-content { padding:0; }.card,.tc-panel { box-shadow:none; } }

/* Production-floor clarity and legacy-template isolation (v2) */
:root {
  --ev-sidebar: 300px;
  --ev-topbar: 76px;
}

body { font-family: Manrope, Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
.tc-app-stage { width: calc(100% - var(--ev-sidebar)); margin-left: var(--ev-sidebar); }
.tc-main-content { padding: 18px 20px 26px; }

.tc-sidebar {
  width: var(--ev-sidebar);
  max-width: var(--ev-sidebar);
  overflow: hidden;
}
.tc-nav-scroll { display: block; width: 100%; overflow-x: hidden; overflow-y: auto; }
.tc-sidebar .menu-inner {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 100%;
  padding: 6px 4px 18px;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
  flex-wrap: nowrap;
}
.tc-sidebar .menu-inner > .menu-header,
.tc-sidebar .menu-inner > .menu-item,
.tc-sidebar .menu-sub > .menu-item { display: flex; width: 100%; max-width: 100%; flex: 0 0 auto; flex-direction: column; }
.tc-sidebar .menu-header { margin: 18px 10px 7px; padding: 0; color: #658098; font-size: 10px; line-height: 1.3; letter-spacing: .15em; }
.tc-sidebar .menu-link { width: 100%; min-height: 46px; margin: 0; padding: 10px 12px; gap: 10px; color: #aec0d1; font-size: 13.5px; line-height: 1.25; }
.tc-sidebar .menu-link > span { display: block; min-width: 0; overflow: hidden; flex: 1 1 auto; text-overflow: ellipsis; white-space: nowrap; }
.tc-sidebar .menu-icon { width: 22px; margin: 0; flex: 0 0 22px; font-size: 21px; }
.tc-sidebar .menu-toggle::after { display: none; content: none; }
.tc-menu-chevron { display: block; margin-left: auto; flex: 0 0 auto; font-size: 18px; }
.tc-sidebar .menu-sub { display: none; width: calc(100% - 12px); margin: 5px 0 8px 12px; padding: 2px 0 2px 13px; flex-direction: column; border-left: 1px solid rgba(123,158,183,.22); }
.tc-sidebar .menu-item.open > .menu-sub { display: flex; }
.tc-sidebar .menu-sub .menu-link { min-height: 38px; padding: 8px 10px; font-size: 12.5px; }
.tc-sidebar-footer { position: static; right: auto; bottom: auto; left: auto; display: grid; min-height: 64px; margin-top: 8px; padding: 10px 6px 0; grid-template-columns: 38px minmax(0,1fr) 36px; border: 0; border-top: 1px solid rgba(148,183,211,.15); border-radius: 0; background: transparent; }
.tc-user-initial { width: 38px; height: 38px; }
.tc-sidebar-user-copy strong { font-size: 12px; }.tc-sidebar-user-copy small { font-size: 10px; }
.tc-brand { min-height: 70px; padding: 8px 7px 13px; }
.tc-brand-mark { width: 44px; height: 44px; flex-basis: 44px; }.tc-brand-mark i { font-size: 25px; }
.tc-brand-copy strong { font-size: 19px; }.tc-brand-copy small { font-size: 10px; }
.tc-plant-state { min-height: 56px; margin: 12px 2px 8px; padding: 11px; }.tc-plant-state strong { font-size: 12px; }.tc-plant-state small { font-size: 10px; }.tc-state-label { font-size: 9px; }

.tc-topbar { min-height: var(--ev-topbar); padding: 11px 20px; }
.tc-topbar-kicker { font-size: 10px; }.tc-topbar-left strong { font-size: 16px; }
.tc-topbar-button { min-width: 42px; height: 42px; }.tc-topbar-button span { font-size: 12px; }
.tc-topbar-profile > span { width: 36px; height: 36px; }.tc-topbar-profile strong { font-size: 12px; }.tc-topbar-profile small { font-size: 10px; }

.tc-page-head { min-height: 82px; margin-bottom: 14px; padding: 15px 18px; }
.tc-page-head h1 { margin: 2px 0 4px; font-size: clamp(25px,2.3vw,34px); }
.tc-page-head p { font-size: 14px; line-height: 1.5; }
.tc-eyebrow { margin-bottom: 4px; font-size: 10px; }

.card, .tc-panel { margin-bottom: 14px; }
.card-header, .tc-panel-head { min-height: 60px; padding: 13px 16px; }
.card-header, .card-header h4, .card-header h5, .tc-panel-head h5 { font-size: 16px; }
.card-body { padding: 16px; }
.card-footer { padding: 11px 16px; }

.form-label, label, .tc-form .form-label { margin-bottom: 6px; font-size: 13px; line-height: 1.35; }
.form-control, .form-select, .selectize-input, .select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple { min-height: 46px; padding: 10px 13px; font-size: 14px; }
.form-floating > .form-control, .form-floating > .form-select { height: 54px; min-height: 54px; }
.form-floating > label { padding: 1rem .85rem; }
.input-group-text { min-height: 46px; font-size: 14px; }
.form-text, small.text-muted { font-size: 11px; }
.tc-form-section { padding: 16px; }.tc-form-section h6 { font-size: 15px; }

.btn { min-height: 40px; padding: 8px 14px; font-size: 12px; }
.btn-sm, .btn-group-sm > .btn { min-height: 34px; padding: 6px 10px; font-size: 11px; }
.btn-lg { min-height: 46px; font-size: 13px; }
.badge { font-size: 10px; }.dropdown-item { min-height: 38px; font-size: 12px; }
.alert { padding: 12px 14px; font-size: 13px; }

table.table, table.dataTable { font-size: 13px; }
table.table thead th, table.dataTable thead th { padding: 12px 13px; font-size: 11px; line-height: 1.35; }
table.table tbody td, table.dataTable tbody td, .tc-table tbody td { padding: 11px 13px; font-size: 12.5px; line-height: 1.4; }
.tc-dt-toolbar { min-height: 62px; padding: 10px 12px; gap: 8px; }
.tc-dt-toolbar .dataTables_length label, .tc-dt-toolbar .dataTables_filter label { font-size: 12px; }
.tc-dt-toolbar select, .tc-dt-toolbar input { height: 38px; min-height: 38px; font-size: 12px; }
.dt-buttons .dt-button { min-height: 36px; padding: 7px 11px; font-size: 11px; }
.tc-dt-date-range > span, .dataTables_info, .dataTables_wrapper .dataTables_paginate .paginate_button { font-size: 11px; }
.tc-dt-footer { min-height: 54px; padding: 9px 12px; }

.tc-command-hero { margin-bottom: 16px; padding: 25px 28px; border-radius: 18px; }
.tc-command-kicker { font-size: 11px; }.tc-command-hero h1 { font-size: clamp(28px,3vw,40px); }.tc-command-hero p { max-width: 760px; font-size: 14px; line-height: 1.5; }
.tc-command-actions { gap: 8px; }.tc-refresh-meta { font-size: 11px; }
#loaddynamic > .row.gy-4 { row-gap: 12px; }
#loaddynamic .daily-card { min-height: 142px; margin-bottom: 0; }
#loaddynamic .daily-card .card-header { padding: 13px 15px 8px 18px; font-size: 12px; }
#loaddynamic .daily-card .card-body { padding: 4px 15px 12px 18px; }
#loaddynamic .daily-card .card-body h1 { font-size: clamp(32px,3vw,44px); }
#loaddynamic .daily-card .card-footer { padding: 8px 15px 8px 18px; }
#loaddynamic .daily-card .card-footer h2, #loaddynamic .daily-card .card-footer h2 span { font-size: 12px; }
#loaddynamic .h1-pm-0 { margin: 0; padding: 0; }
#loaddynamic .cfooter { margin: 0; }
#loaddynamic .dc-h2 { margin: 0; }
#loaddynamic .blinking-dot { display: inline-block; width: 10px; height: 10px; border: 2px solid #e5fff3; border-radius: 50%; background: var(--ev-green); box-shadow: 0 0 0 4px rgba(0,180,126,.12); animation: tc-live-pulse 2s ease-in-out infinite; }
@keyframes tc-live-pulse { 50% { opacity: .45; transform: scale(.85); } }

.tc-metric span, .tc-live-summary article span { font-size: 11px; }.tc-metric strong, .tc-live-summary article strong { font-size: 30px; }
.tc-list-item small, .tc-timeline-item small, .tc-detail-grid span, .tc-check-grid span { font-size: 11px; }
.tc-list-item strong, .tc-timeline-item strong, .tc-detail-grid strong, .tc-check-grid strong { font-size: 13px; }

/* Dashboard workspace */
.tc-dashboard-live { display: grid; width: 100%; gap: 16px; }
.tc-dashboard-live > .row { margin-right: 0; margin-left: 0; }
.tc-dashboard-live > .row > [class*="col-"] { padding-right: 7px; padding-left: 7px; }
.tc-dashboard-search {
  display: grid; min-height: 108px; padding: 18px 20px; align-items: center; grid-template-columns: minmax(210px,.75fr) minmax(420px,1.5fr); gap: 22px;
  border: 1px solid var(--ev-border); border-radius: 16px; background: linear-gradient(135deg,#fff,#f6fafc); box-shadow: 0 12px 30px rgba(17,45,72,.07);
}
.tc-dashboard-search-copy { display: grid; gap: 3px; }
.tc-dashboard-search-copy label { margin: 0; color: #152b40; font: 700 16px/1.35 "Space Grotesk",sans-serif; }
.tc-dashboard-search-control { position: relative; display: flex; align-items: center; gap: 9px; }
.tc-dashboard-search-control > i { position: absolute; z-index: 2; left: 14px; color: var(--ev-cyan-dark); font-size: 21px; pointer-events: none; }
.tc-dashboard-search-control .form-control { min-width: 0; padding-left: 44px; flex: 1 1 auto; }
.tc-dashboard-search-control .btn { flex: 0 0 auto; white-space: nowrap; }

#loaddynamic .accordion { display: grid; gap: 8px; }
#loaddynamic .accordion-item { overflow: hidden; border: 1px solid var(--ev-border); border-radius: 13px; background: #fff; box-shadow: 0 6px 18px rgba(17,45,72,.045); }
#loaddynamic .accordion-header { margin: 0; }
#loaddynamic .accordion-button {
  min-height: 54px; padding: 12px 16px; color: #20364c; border: 0; background: #fff; box-shadow: none;
  font: 700 14px/1.35 "Space Grotesk",sans-serif;
}
#loaddynamic .accordion-button:not(.collapsed) { color: #056f87; background: #edf9fb; }
#loaddynamic .accordion-button::after { filter: none; opacity: .65; }
#loaddynamic .accordion-button .card-header { display: flex; width: 100%; min-height: auto; padding: 0; align-items: center; justify-content: space-between; color: inherit; background: transparent; }
#loaddynamic .accordion-button .card-header > div { float: none; }
#loaddynamic .accordion-button .card-header h5 { min-height: auto; margin: 0; padding: 0; color: inherit; background: transparent; font-size: 14px; }
#loaddynamic .accordion-body { padding: 14px; }
#loaddynamic #chart:empty { display: grid; min-height: 240px; place-items: center; color: var(--ev-muted); }

.modal-title { color: #152b40; font: 700 19px "Space Grotesk",sans-serif; }
.modal-header .tc-eyebrow { margin-bottom: 2px; }

/* Readability for specialist components inherited from the legacy theme */
.tc-chip, .tc-status-select, .tc-pack-tags span, .tc-assumption, .tc-note { font-size: 12px; line-height: 1.45; }
.tc-section-title { font-size: 17px; }
.tc-filterbar, .tc-report-filter { gap: 10px; }
.tc-filterbar label, .tc-report-filter label { font-size: 12px; }
.tc-metric-card small, .tc-oee-card small, .tc-pack-kpis span, .tc-station-step small { font-size: 11px; }
.tc-metric-card strong, .tc-oee-card strong, .tc-pack-kpis strong { font-size: 26px; }
.tc-station-step strong, .tc-pack-verdict strong, .tc-integrity-grid strong { font-size: 13px; }
.tc-station-step p, .tc-pack-verdict p, .tc-integrity-grid span, .tc-contact-list, .tc-engineering-list { font-size: 12px; }
.tc-pack-actions .dropdown-item { font-size: 12px; }
.pagination, .tc-pagination { font-size: 12px; }

@media (max-width: 1199.98px) {
  .tc-app-stage { width: 100%; margin-left: 0; }
  .tc-sidebar { transform: translateX(-105%); }
  body.tc-nav-open .tc-sidebar { transform: translateX(0); }
}
@media (max-width: 767.98px) {
  :root { --ev-topbar: 64px; }
  body { font-size: 14px; }
  .tc-main-content { padding: 10px; }
  .tc-topbar { padding: 8px 10px; }
  .tc-page-head { min-height: 68px; padding: 12px; }
  .tc-page-head h1 { font-size: 23px; }.tc-page-head p { font-size: 12px; }
  .card-header, .tc-panel-head { min-height: 54px; padding: 11px 12px; }
  .card-body { padding: 12px; }
  .form-label, label, .tc-form .form-label { font-size: 12px; }
  .form-control, .form-select { font-size: 14px; }
  .tc-command-hero { padding: 18px; }.tc-command-hero h1 { font-size: 27px; }.tc-command-hero p { font-size: 13px; }
  .tc-command-actions { margin-top: 14px; justify-content: flex-start; }
  .tc-dashboard-search { grid-template-columns: 1fr; gap: 12px; }
  table.table, table.dataTable { font-size: 12px; }
  table.table thead th, table.dataTable thead th { font-size: 10px; }
  table.table tbody td, table.dataTable tbody td { font-size: 12px; }
}
@media (max-width: 575.98px) {
  .tc-dashboard-search { min-height: auto; padding: 14px; }
  .tc-dashboard-search-control { align-items: stretch; flex-direction: column; }
  .tc-dashboard-search-control > i { top: 12px; }
  .tc-dashboard-search-control .btn { width: 100%; }
  #loaddynamic .accordion-button { padding: 11px 12px; font-size: 13px; }
  #loaddynamic .accordion-button .card-header { align-items: flex-start; flex-direction: column; gap: 3px; }
}
