    :root {
      --bg: #07111f;
      --panel: #122137;
      --panel-2: #182a43;
      --panel-3: #0d1a2d;
      --line: #2a4262;
      --text: #f5f8ff;
      --muted: #9fb2cb;
      --cyan: #22c7ee;
      --cyan-2: #16a7d8;
      --blue: #5167f6;
      --green: #19c987;
      --yellow: #ffc247;
      --red: #ff6972;
      --shadow: 0 20px 70px rgba(0, 0, 0, 0.32);
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      font-family: Inter, Segoe UI, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      background:
        radial-gradient(circle at 18% 12%, rgba(34, 199, 238, 0.16), transparent 30%),
        radial-gradient(circle at 85% 2%, rgba(92, 106, 255, 0.18), transparent 32%),
        linear-gradient(135deg, #07111f 0%, #0c1728 50%, #121837 100%);
      color: var(--text);
    }
    button, input, select, textarea { font: inherit; }
    button {
      border: 0;
      border-radius: 10px;
      min-height: 44px;
      padding: 0 18px;
      color: var(--text);
      background: var(--cyan);
      font-weight: 800;
      cursor: pointer;
      transition: transform .16s ease, opacity .16s ease, background .16s ease;
    }
    button:hover { transform: translateY(-1px); }
    button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
    .secondary { background: #1d3552; border: 1px solid var(--line); }
    .success { background: var(--green); }
    .danger { background: var(--red); }
    .ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
    .shell { width: min(1800px, calc(100vw - 48px)); margin: 0 auto; padding: 28px 0 48px; }
    header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 22px;
    }
    .brand { display: flex; align-items: center; gap: 16px; }
    .brand img { width: 52px; height: 52px; border-radius: 13px; }
    .breadcrumb {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 800;
      margin-bottom: 6px;
    }
    .breadcrumb a { color: var(--cyan); text-decoration: none; }
    .breadcrumb a:hover { text-decoration: underline; }
    h1, h2, h3 { margin: 0; letter-spacing: 0; }
    h1 { font-size: clamp(32px, 3vw, 56px); line-height: 1; }
    h2 { font-size: 22px; }
    h3 { font-size: 16px; }
    p { color: var(--muted); line-height: 1.55; margin: 0; }
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 13px;
      border-radius: 999px;
      background: rgba(34, 199, 238, 0.12);
      border: 1px solid rgba(34, 199, 238, 0.35);
      color: var(--cyan);
      font-weight: 800;
      font-size: 13px;
    }
    .hero {
      display: grid;
      grid-template-columns: minmax(320px, 1.2fr) minmax(320px, .8fr);
      gap: 18px;
      margin-bottom: 18px;
    }
    .panel {
      background: linear-gradient(180deg, rgba(24, 42, 67, .96), rgba(16, 30, 50, .96));
      border: 1px solid var(--line);
      border-radius: 16px;
      box-shadow: var(--shadow);
    }
    .hero-main, .access, .card { padding: 26px; }
    .hero-main {
      display: flex;
      flex-direction: column;
      gap: 18px;
      min-height: 250px;
    }
    .hero-main strong { color: var(--cyan); }
    .access { display: grid; gap: 14px; }
    label { display: grid; gap: 7px; color: #b8cff0; font-size: 13px; font-weight: 800; }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #081426;
      color: var(--text);
      padding: 12px 13px;
      min-height: 44px;
      outline: none;
    }
    textarea { resize: vertical; min-height: 90px; }
    input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 199, 238, .14); }
    .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
    .actions.compact button { min-width: 150px; }
    .status { min-height: 22px; color: var(--muted); font-weight: 700; }
    .status.error { color: #ffbac0; }
    .status.ok { color: #7dffc9; }
    .summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }
    .summary-card {
      padding: 16px;
      border: 1px solid rgba(42, 66, 98, .72);
      border-radius: 14px;
      background: #081426;
    }
    .summary-card strong { display: block; font-size: 24px; }
    .summary-card span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
    .report-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      align-items: start;
    }
    .report-grid h3 {
      margin-bottom: 10px;
      font-size: 16px;
    }
    .queue-tools {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) repeat(2, 180px);
      gap: 10px;
      align-items: end;
    }
    .queue-tools.advanced {
      grid-template-columns: minmax(220px, 1.3fr) repeat(5, minmax(140px, .75fr));
    }
    .queue-tools.time-tools {
      grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(160px, .75fr));
    }
    .time-filter-panel {
      margin-bottom: 14px;
    }
    .form-note {
      padding: 12px 14px;
      border: 1px solid rgba(34, 199, 238, .18);
      border-radius: 12px;
      background: rgba(34, 199, 238, .08);
      color: #b8cff0;
      font-size: 13px;
    }
    .toolbar-panel {
      padding: 16px;
      box-shadow: none;
    }
    .toolbar-actions {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
    }
    .toolbar-actions button {
      min-width: 136px;
    }
    .app {
      display: none;
      grid-template-columns: 190px minmax(0, 1fr);
      gap: 18px;
      align-items: start;
    }
    .stats {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 12px;
      margin-bottom: 18px;
    }
    .platform-notice {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 18px;
      padding: 16px 18px;
      border: 1px solid rgba(34, 199, 238, .42);
      border-radius: 16px;
      background:
        linear-gradient(135deg, rgba(34, 199, 238, .13), rgba(17, 34, 58, .92));
      box-shadow: 0 18px 44px rgba(0, 0, 0, .18);
    }
    .platform-notice div {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .platform-notice strong {
      color: var(--text);
      font-size: 16px;
    }
    .platform-notice span {
      color: var(--muted);
      line-height: 1.5;
    }
    .platform-notice button {
      width: auto;
      min-width: 110px;
      flex: 0 0 auto;
    }
    .stat {
      padding: 18px;
      background: rgba(24, 42, 67, .85);
      border: 1px solid var(--line);
      border-radius: 14px;
    }
    .stat strong { display: block; font-size: 28px; color: var(--text); }
    .stat span { color: var(--muted); font-size: 13px; font-weight: 800; }
    .stack { display: grid; gap: 18px; }
    .card { display: grid; gap: 14px; }
    .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .table-wrap {
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #071120;
      max-height: 500px;
    }
    table { width: 100%; border-collapse: collapse; min-width: 780px; }
    th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid rgba(42, 66, 98, .65); vertical-align: top; }
    th { color: #bdd3f1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; background: #0f1f35; position: sticky; top: 0; z-index: 1; }
    td { color: #eaf2ff; }
    tr.ticket-row { cursor: pointer; }
    tr.ticket-row:hover, tr.ticket-row.active { background: rgba(34, 199, 238, .1); }
    .select-col {
      width: 72px;
      text-align: center;
    }
    .select-col input {
      width: auto;
      min-height: auto;
      transform: scale(1.05);
    }
    .pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 5px 10px;
      font-size: 12px;
      font-weight: 900;
      color: #061121;
      background: var(--cyan);
      white-space: nowrap;
    }
    .pill.urgent { background: var(--red); color: white; }
    .pill.high { background: var(--yellow); color: #201500; }
    .pill.closed, .pill.resolved { background: #7dffc9; }
    .pill.overdue { background: var(--red); color: white; }
    .pill.due_soon { background: var(--yellow); color: #201500; }
    .pill.scheduled { background: #315f8f; color: #d9ecff; }
    .timeline {
      display: grid;
      gap: 10px;
      max-height: 320px;
      overflow: auto;
      padding-right: 4px;
    }
    .timeline-item {
      padding: 12px;
      border-radius: 12px;
      background: #081426;
      border: 1px solid rgba(42, 66, 98, .7);
    }
    .timeline-item small { color: var(--muted); display: block; margin-bottom: 6px; }
    .timeline-item.compact {
      display: grid;
      gap: 5px;
      padding: 10px 12px;
    }
    .list-surface {
      display: grid;
      gap: 10px;
      max-height: 560px;
      overflow: auto;
      padding-right: 4px;
    }
    .list-row {
      display: grid;
      grid-template-columns: minmax(220px, 1.1fr) minmax(160px, .8fr) auto;
      gap: 14px;
      align-items: center;
      min-height: 78px;
      padding: 14px 16px;
      border: 1px solid rgba(42, 66, 98, .72);
      border-radius: 14px;
      background:
        linear-gradient(180deg, rgba(12, 26, 44, .94), rgba(8, 20, 38, .94));
      cursor: pointer;
      transition: border-color .16s ease, background .16s ease, transform .16s ease;
    }
    .list-row:hover,
    .list-row.active {
      border-color: rgba(34, 199, 238, .58);
      background: rgba(34, 199, 238, .09);
      transform: translateY(-1px);
    }
    .list-row-main,
    .list-row-meta,
    .list-row-actions {
      min-width: 0;
      display: grid;
      gap: 4px;
    }
    .list-row-main strong {
      font-size: 16px;
      overflow-wrap: anywhere;
    }
    .list-row-main small,
    .list-row-meta small {
      color: var(--muted);
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    .list-row-meta {
      color: #c9defb;
      font-size: 13px;
    }
    .list-row-actions {
      justify-items: end;
      gap: 8px;
    }
    .list-row-actions button {
      min-height: 34px;
      min-width: 94px;
      padding: 0 12px;
      border-radius: 9px;
      font-size: 12px;
    }
    .client-link-review {
      grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(260px, auto);
    }
    .review-actions {
      grid-template-columns: repeat(2, minmax(112px, 1fr));
      justify-items: stretch;
    }
    .review-actions button {
      width: 100%;
      min-width: 0;
    }
    .workspace-empty {
      min-height: 190px;
      display: grid;
      place-items: center;
      padding: 26px;
      border: 1px dashed rgba(42, 66, 98, .9);
      border-radius: 16px;
      background:
        radial-gradient(circle at 50% 0%, rgba(34, 199, 238, .09), transparent 32%),
        rgba(8, 20, 38, .48);
      color: var(--muted);
      text-align: center;
    }
    .workspace-empty strong {
      display: block;
      margin-bottom: 6px;
      color: var(--text);
      font-size: 18px;
    }
    .compact-list {
      max-height: 360px;
      min-height: 120px;
    }
    .muted { color: var(--muted); }
    .empty {
      padding: 22px;
      border: 1px dashed var(--line);
      border-radius: 12px;
      color: var(--muted);
      text-align: center;
      background: rgba(8, 20, 38, .45);
    }
    .inline-output {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid rgba(42, 66, 98, .75);
      border-radius: 12px;
      background: #081426;
      overflow-wrap: anywhere;
    }
    .inline-output a { color: var(--cyan); font-weight: 800; }
    .mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
    .hidden { display: none !important; }
    .work-panel {
      border-left: 4px solid rgba(34, 199, 238, .74);
    }
    .detail-summary {
      display: grid;
      gap: 12px;
      padding: 14px;
      border-radius: 12px;
      background: rgba(8, 20, 38, .55);
      border: 1px solid rgba(42, 66, 98, .7);
    }

    .app-shell {
      display: none;
      grid-template-columns: 260px minmax(0, 1fr);
      gap: 18px;
      align-items: start;
    }
    .app-rail {
      position: sticky;
      top: 18px;
      display: grid;
      gap: 16px;
      padding: 14px;
    }
    .workspace-card {
      display: grid;
      grid-template-columns: 54px minmax(0, 1fr);
      gap: 12px;
      align-items: center;
      padding: 12px;
      border: 1px solid rgba(42, 66, 98, .72);
      border-radius: 14px;
      background: rgba(8, 20, 38, .58);
    }
    .workspace-card img {
      width: 54px;
      height: 54px;
      border-radius: 13px;
    }
    .workspace-card h2 {
      font-size: 17px;
      overflow-wrap: anywhere;
    }
    .workspace-card p {
      font-size: 12px;
      overflow-wrap: anywhere;
    }
    .app-nav {
      display: grid;
      gap: 8px;
    }
    .nav-item {
      width: 100%;
      justify-content: flex-start;
      text-align: left;
      background: rgba(8, 20, 38, .52);
      border: 1px solid transparent;
      color: #c9defb;
    }
    .nav-item.active {
      background: rgba(34, 199, 238, .16);
      border-color: rgba(34, 199, 238, .42);
      color: var(--text);
      box-shadow: inset 3px 0 0 var(--cyan);
    }
    .rail-actions {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .app-main {
      min-width: 0;
      display: grid;
      gap: 18px;
    }
    .page {
      display: none;
      gap: 18px;
    }
    .page.active {
      display: grid;
    }
    .page-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 18px;
      padding: 20px 22px;
      border: 1px solid rgba(42, 66, 98, .65);
      border-radius: 16px;
      background: linear-gradient(135deg, rgba(24, 42, 67, .92), rgba(11, 25, 43, .92));
    }
    .page-header > div {
      display: grid;
      gap: 8px;
    }
    .page-header h2 {
      font-size: 28px;
    }
    .ticket-editor {
      border-left: 4px solid rgba(34, 199, 238, .72);
    }
    .ticket-workspace {
      display: grid;
      grid-template-columns: minmax(430px, .95fr) minmax(540px, 1.05fr);
      gap: 18px;
      align-items: start;
    }
    .ticket-detail-panel {
      min-height: 620px;
    }
    .detail-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      padding-bottom: 4px;
      border-bottom: 1px solid rgba(42, 66, 98, .65);
    }
    .detail-tab {
      min-height: 38px;
      background: #10233b;
      border: 1px solid var(--line);
      color: #c9defb;
    }
    .detail-tab.active {
      background: rgba(34, 199, 238, .18);
      border-color: rgba(34, 199, 238, .5);
      color: white;
    }
    .detail-section {
      display: none;
      gap: 14px;
    }
    .detail-section.active {
      display: grid;
    }
    .composer {
      padding-top: 12px;
      border-top: 1px solid rgba(42, 66, 98, .65);
    }
    .split-view {
      display: grid;
      grid-template-columns: minmax(320px, .85fr) minmax(520px, 1.15fr);
      gap: 18px;
      align-items: start;
    }
    .settings-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 18px;
      align-items: start;
    }
    .soft-rule {
      width: 100%;
      border: 0;
      border-top: 1px solid rgba(42, 66, 98, .68);
      margin: 4px 0;
    }
    #clientList .timeline-item {
      cursor: pointer;
    }
    #clientList .timeline-item:hover,
    #clientList .timeline-item.active {
      border-color: rgba(34, 199, 238, .55);
      background: rgba(34, 199, 238, .08);
    }
    #clientList .list-row {
      cursor: pointer;
    }
    #workApprovalList .timeline-item {
      grid-template-columns: minmax(0, 1fr);
    }
    @media (max-width: 1300px) {
      .stats { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
      .queue-tools.advanced { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      .ticket-workspace, .split-view, .settings-grid, .report-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 900px) {
      .shell { width: min(100% - 24px, 900px); }
      header, .hero { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
      .app, .app-shell, .form-row, .form-row.three, .stats, .summary-grid, .report-grid, .queue-tools, .mini-grid { grid-template-columns: 1fr; }
      .app-rail { position: static; }
      .app-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .page-header { align-items: stretch; flex-direction: column; }
      .toolbar-actions { justify-content: flex-start; }
      .list-row { grid-template-columns: 1fr; }
      .list-row-actions { justify-items: start; }
      table { min-width: 680px; }
    }

    /*
      Light-first workspace pass.
      ServiceDesk remains New4Tek-branded, but the daily technician workspace now
      reads like a professional admin center instead of a dark demo dashboard.
    */
    :root[data-theme="light"] {
      --bg: #f6f8fc;
      --panel: #ffffff;
      --panel-2: #f8fbff;
      --panel-3: #eef4fb;
      --line: #d8e3f1;
      --text: #15243a;
      --muted: #60738e;
      --cyan: #11bde4;
      --cyan-2: #078cb2;
      --blue: #4568f0;
      --green: #16a972;
      --yellow: #f4b023;
      --red: #d94b5c;
      --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
    }

    :root[data-theme="light"] body {
      background:
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 44%, #f6f8fc 100%);
      color: var(--text);
    }

    :root[data-theme="light"] .panel {
      background: var(--panel);
      border-color: var(--line);
      box-shadow: var(--shadow);
    }

    :root[data-theme="light"] .secondary {
      background: #edf4fb;
      border-color: var(--line);
      color: var(--text);
    }

    :root[data-theme="light"] .ghost {
      background: #ffffff;
      border-color: var(--line);
      color: var(--muted);
    }

    :root[data-theme="light"] input,
    :root[data-theme="light"] select,
    :root[data-theme="light"] textarea {
      background: #ffffff;
      color: var(--text);
      border-color: var(--line);
    }

    :root[data-theme="light"] label {
      color: #516784;
    }

    :root[data-theme="light"] .badge {
      background: #e7f9fd;
      border-color: rgba(17, 189, 228, 0.32);
      color: #078cb2;
    }

    :root[data-theme="light"] .hero-main,
    :root[data-theme="light"] .workspace-card,
    :root[data-theme="light"] .summary-card,
    :root[data-theme="light"] .stat,
    :root[data-theme="light"] .timeline-item,
    :root[data-theme="light"] .detail-summary,
    :root[data-theme="light"] .inline-output,
    :root[data-theme="light"] .empty,
    :root[data-theme="light"] .workspace-empty,
    :root[data-theme="light"] .table-wrap {
      background: #ffffff;
      border-color: var(--line);
    }

    :root[data-theme="light"] .access,
    :root[data-theme="light"] .card,
    :root[data-theme="light"] .toolbar-panel,
    :root[data-theme="light"] .app-rail {
      background: #ffffff;
    }

    :root[data-theme="light"] .page-header {
      background:
        linear-gradient(135deg, #ffffff, #f3f8fd);
      border-color: var(--line);
    }

    :root[data-theme="light"] .list-row {
      background: #ffffff;
      border-color: var(--line);
    }

    :root[data-theme="light"] .list-row:hover,
    :root[data-theme="light"] .list-row.active,
    :root[data-theme="light"] #clientList .timeline-item:hover,
    :root[data-theme="light"] #clientList .timeline-item.active {
      background: #eaf9fd;
      border-color: rgba(17, 189, 228, 0.55);
    }

    :root[data-theme="light"] .list-row-meta,
    :root[data-theme="light"] td,
    :root[data-theme="light"] .nav-item,
    :root[data-theme="light"] .detail-tab {
      color: #334963;
    }

    :root[data-theme="light"] .nav-item {
      background: #f3f7fc;
      border-color: transparent;
    }

    :root[data-theme="light"] .nav-item.active {
      background: #e7f9fd;
      border-color: rgba(17, 189, 228, 0.34);
      color: var(--text);
      box-shadow: inset 3px 0 0 var(--cyan);
    }

    :root[data-theme="light"] .table-wrap {
      background: #ffffff;
    }

    :root[data-theme="light"] th {
      background: #f3f7fc;
      color: #60738e;
    }

    :root[data-theme="light"] td {
      color: #223852;
    }

    :root[data-theme="light"] tr.ticket-row:hover,
    :root[data-theme="light"] tr.ticket-row.active {
      background: #eaf9fd;
    }

    :root[data-theme="light"] .detail-tab {
      background: #f3f7fc;
      border-color: var(--line);
    }

    :root[data-theme="light"] .detail-tab.active {
      background: #e7f9fd;
      border-color: rgba(17, 189, 228, 0.5);
      color: var(--text);
    }

    :root[data-theme="light"] .workspace-empty,
    :root[data-theme="light"] .empty {
      background: #f8fbff;
    }

    :root[data-theme="light"] .workspace-empty strong,
    :root[data-theme="light"] .stat strong {
      color: var(--text);
    }

    :root[data-theme="light"] .soft-rule,
    :root[data-theme="light"] .detail-tabs,
    :root[data-theme="light"] .composer {
      border-color: var(--line);
    }
