* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", Inter, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
a { color: var(--zq-info); }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--zq-focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px; background: var(--panel); }
.skip-link:focus { top: 12px; }
.app { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100vh; }
.brand { display: block; background: var(--zq-white); border-radius: var(--zq-radius); padding: 4px; }
.brand img { display: block; width: 100%; height: auto; }
.sub { color: var(--text); font-size: 14px; font-weight: 650; letter-spacing: .03em; margin: 12px 0 6px; }
.version { color: var(--muted); font-size: 11px; margin-top: auto; padding-top: 24px; }
.main { min-width: 0; padding: 24px 28px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 24px; letter-spacing: -.025em; line-height: 1.25; margin-bottom: 6px; }
h2 { font-size: 21px; } h3 { font-size: 15px; }
.title p, .module p { color: var(--muted); margin-bottom: 0; }
.topactions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.avatar { display: none; }
.btn, .action { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 36px; padding: 7px 12px; border-radius: var(--zq-radius); border: 1px solid transparent; background: var(--zq-blue); color: var(--zq-white); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover, .action:hover { filter: brightness(1.12); }
.btn.secondary, .action { background: var(--panel2); border-color: var(--line); color: var(--text); }
.action.primary { border-color: var(--zq-cyan); }
.btn.danger, .action.danger { color: var(--red); border-color: var(--red); background: var(--panel); }
button:disabled { opacity: .5; cursor: not-allowed; }
.stats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--zq-radius); }
.card { padding: 16px; }
.label { color: var(--muted); font-size: 12px; font-weight: 500; }
.num { font-size: 25px; line-height: 1.3; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 7px; }
.hint, .tiny { color: var(--muted); font-size: 11px; }
.hint { margin-top: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.online { background: var(--green); } .offline { background: var(--red); } .retired { background: var(--muted); } .warn { background: var(--amber); }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); }
input[type=checkbox] { accent-color: var(--zq-blue); }
.toolbar .search { flex: 1; min-width: 200px; }
.panel { overflow: auto; }
.view > .panel { margin-bottom: var(--zq-space-4); }
.panel > p { padding: var(--zq-space-3) var(--zq-space-4); margin: 0; }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
th { color: var(--muted); font-weight: 600; background: var(--panel2); white-space: nowrap; }
th, td { padding: var(--zq-table-padding); border-bottom: 1px solid var(--line); vertical-align: middle; }
td { max-width: 260px; overflow-wrap: anywhere; }
tr.device:hover { background: var(--zq-hover); }
tr.device[aria-selected=true] { background: var(--zq-selected); }
.device-link { border: 0; padding: 0; background: none; color: var(--zq-info); cursor: pointer; text-align: left; font-weight: 650; }
.status { white-space: nowrap; }
.pill { display: inline-block; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10px; }
.simpill { color: var(--amber); margin-left: 4px; } .retiredpill { color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.pager .pageInfo { margin-right: auto; color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.view { display: none; } .view.active { display: block; }
.module { padding: 0 0 20px; }
.modulegrid, .distribution { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.distribution dl { display: grid; grid-template-columns: 1fr auto; gap: 4px; margin-bottom: 0; }
.distribution dt { color: var(--muted); } .distribution dd { margin: 0; font-variant-numeric: tabular-nums; }
.drawer { position: fixed; right: 0; top: 0; width: min(720px,95vw); height: 100vh; overflow: auto; background: var(--zq-navigation); border-left: 1px solid var(--line); padding: 24px; box-shadow: var(--zq-shadow); z-index: 20; transform: translateX(110%); visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.close { float: right; width: 36px; height: 36px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.state { color: var(--muted); margin-bottom: 16px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.tab { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.tab.active { color: var(--zq-white); border-color: var(--zq-cyan); background: var(--zq-selected); }
.section { border-top: 1px solid var(--line); padding: 16px 0; }
.section h3 { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.kv { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 8px 16px; font-size: 13px; overflow-wrap: anywhere; }
.kv div:nth-child(odd) { color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace,monospace; color: var(--text); background: var(--bg); padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.notice, .dangertext { color: var(--amber); font-size: 12px; line-height: 1.6; }
.good { color: var(--green); } .bad, .error { color: var(--red); }
.error { min-height: 22px; }
.modalbg { position: fixed; inset: 0; background: var(--zq-overlay); display: none; place-items: center; z-index: 30; }
.modalbg.open { display: grid; }
.modal { background: var(--panel); width: min(640px,94vw); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--zq-radius); padding: 24px; }
.field { margin: 14px 0; } .field label { display: block; margin-bottom: 6px; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; }
.field textarea { min-height: 150px; resize: vertical; }
.modalactions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.footer { margin-top: 24px; color: var(--muted); font-size: 11px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px,100%); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px; box-shadow: var(--zq-shadow); }
.auth-card h1 { margin-top: 24px; font-size: 28px; }
.auth-card p { color: var(--muted); }
.auth-card .btn { width: 100%; }
/* Byte-identical approved PNG; viewport hides reference caption, not logo geometry. */
.primary-logo { width: 210px; aspect-ratio: 286/212; overflow: hidden; margin-inline: auto; }
.primary-logo img { display: block; width: 110.14%; max-width: none; height: auto; margin-left: -4.2%; }
.print-header { display: none; }
@media(max-width:1100px) { .stats { grid-template-columns: repeat(3,minmax(0,1fr)); } .top { align-items: flex-start; } .main { padding: 20px; } }
@media(max-width:800px) { .app { display: block; } .brand { width: 140px; } .sub { margin: 6px 0; } .version { display: none; } .top { flex-direction: column; gap: 12px; } .stats { grid-template-columns: repeat(2,minmax(0,1fr)); } .modulegrid,.distribution { grid-template-columns: 1fr; } .main { padding: 16px; } .drawer { width: 100%; } table { min-width: 800px; } .auth-card { padding: 24px; } }
.workflow-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.workflow-row small { display: block; color: var(--muted); margin-top: 3px; }
.workflow-row .workflow-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.detail-panel { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--zq-radius); background: var(--bg); }
.oc-step { margin-top: 10px; }
@media(max-width:800px) {
  .workflow-row { align-items: flex-start; flex-direction: column; }
  .workflow-row .workflow-actions { justify-content: flex-start; }
  body { overflow-x: hidden; }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .side,.topactions,.toolbar,.pager,.footer { display: none; } .app { display: block; } .print-header { display: block; margin-bottom: 24px; } .print-header img { width: 160px; height: auto; } .main { padding: 0; } .panel { overflow: visible; } }




/* ZENQIX_P1A_SITES_GROUPS */
.workflow-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.workflow-banner span {
  color: var(--muted);
  font-size: 13px;
}

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

.workflow-panel {
  overflow: hidden;
}

.workflow-form {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.workflow-form h3 {
  margin-top: 0;
}

.workflow-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.workflow-status {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.workflow-status.good {
  color: var(--green);
}

.workflow-status.bad {
  color: var(--red);
}

.workflow-table {
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

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

.device-picker {
  max-height: 290px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 8px 0;
}

.device-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.device-option:last-child {
  border-bottom: 0;
}

.device-option:hover {
  background: var(--zq-hover);
}

.device-option span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.device-option small {
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
}

.workflow-panel code {
  white-space: normal;
  overflow-wrap: anywhere;
}

@media(max-width:1100px) {
  .workflow-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:800px) {
  .criteria-grid {
    grid-template-columns: 1fr;
  }
}


/* ZENQIX_P1B_V3_OPERATIONS */

.ops-catalog {
  display: grid;
  gap: 10px;
}

.ops-action-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ops-action-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.ops-risk {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.ops-risk.low {
  color: var(--green);
}

.ops-risk.medium {
  color: var(--amber);
}

.ops-risk.high {
  color: var(--red);
}

.ops-detail-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ops-detail-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ops-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}

.ops-detail-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.ops-decision {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ops-cancel-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.ops-result-summary {
  margin: 0 16px 16px;
  padding: 12px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mono {
  font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
}

@media(max-width:1100px) {
  .ops-detail-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media(max-width:700px) {
  .ops-detail-grid {
    grid-template-columns: 1fr;
  }

  .ops-cancel-row {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* P1C_MAINTENANCE_UI_START */

.mw-loading,
.mw-error-state,
.mw-empty {
  padding: 24px;
}

.mw-toolbar,
.mw-section-head,
.mw-detail-head,
.mw-form-actions,
.mw-row-actions,
.mw-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mw-toolbar {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.mw-toolbar h3,
.mw-section-head h3,
.mw-detail-head h3,
.mw-blackouts h4,
.mw-blackout-detail h4 {
  margin: 0;
}

.mw-toolbar p,
.mw-section-head p,
.mw-detail-head p,
.mw-blackouts p {
  margin: 5px 0 0;
}

.mw-summary {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  padding: 16px 20px;
}

.mw-summary > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--panel);
}

.mw-summary span,
.mw-detail-grid span,
.mw-decision-label,
.mw-decision-card span,
.mw-eyebrow {
  display: block;
  font-size: 12px;
  opacity: .72;
}

.mw-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
}

.mw-create-panel,
.mw-list-section,
.mw-detail {
  margin: 16px 20px 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.mw-form {
  margin-top: 16px;
}

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

.mw-span-2 {
  grid-column: span 2;
}

.mw-field {
  display: grid;
  gap: 6px;
}

.mw-field > span,
.mw-days legend {
  font-size: 13px;
  font-weight: 650;
}

.mw-field input,
.mw-field select,
.mw-blackout-row input {
  width: 100%;
  box-sizing: border-box;
}

.mw-device-scope {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
}

.mw-days {
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mw-day-grid {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  gap: 8px;
  margin-top: 10px;
}

.mw-day-grid label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}

.mw-blackouts {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mw-blackout-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.mw-blackout-row label {
  display: grid;
  gap: 5px;
}

.mw-blackout-row span {
  font-size: 12px;
  font-weight: 650;
}

.mw-feedback,
.mw-page-feedback {
  margin-top: 12px;
}

.mw-form-actions {
  justify-content: flex-start;
  margin-top: 16px;
}

.mw-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.mw-table {
  min-width: 1050px;
}

.mw-row-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.mw-state {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 650;
}

.mw-state.is-enabled::before,
.mw-state.is-disabled::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}

.mw-state.is-enabled {
  opacity: 1;
}

.mw-state.is-disabled {
  opacity: .62;
}

.mw-detail {
  scroll-margin-top: 20px;
}

.mw-detail-head {
  align-items: flex-start;
}

.mw-decision-card {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  margin: 16px 0;
}

.mw-decision-card > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.mw-decision-value,
.mw-decision-card strong {
  display: block;
  margin-top: 5px;
}

.mw-decision-value.is-open::before,
.mw-decision-value.is-closed::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.mw-detail-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin-top: 16px;
}

.mw-detail-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.mw-detail-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.mw-blackout-detail {
  margin-top: 18px;
}

.mw-detail-actions {
  justify-content: flex-start;
  margin-top: 16px;
}

.mw-boundary-note {
  padding: 0 20px 20px;
}

@media(max-width:1100px) {
  .mw-day-grid {
    grid-template-columns: repeat(4,minmax(0,1fr));
  }

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

@media(max-width:800px) {
  .mw-toolbar,
  .mw-section-head,
  .mw-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mw-summary,
  .mw-grid,
  .mw-device-scope,
  .mw-decision-card,
  .mw-detail-grid {
    grid-template-columns: 1fr;
  }

  .mw-span-2 {
    grid-column: auto;
  }

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

  .mw-blackout-row {
    grid-template-columns: 1fr;
  }
}

/* P1C_MAINTENANCE_UI_END */


/* P1C_VISUAL_POLISH_1_START */

/*
 * Keep compact status badges intact at every desktop width.
 */
.mw-state {
  white-space: nowrap;
  word-break: keep-all;
}

/*
 * Mobile list deliberately becomes a compact operational summary.
 * Full scope/schedule/timezone/next-allowed truth remains available
 * through Inspect rather than forcing a desktop-width table.
 */
@media(max-width:800px) {
  .mw-table-wrap {
    overflow-x: visible;
  }

  .mw-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .mw-table th:nth-child(3),
  .mw-table td:nth-child(3),
  .mw-table th:nth-child(4),
  .mw-table td:nth-child(4),
  .mw-table th:nth-child(5),
  .mw-table td:nth-child(5),
  .mw-table th:nth-child(6),
  .mw-table td:nth-child(6),
  .mw-table th:nth-child(7),
  .mw-table td:nth-child(7) {
    display: none;
  }

  .mw-table th:nth-child(1),
  .mw-table td:nth-child(1) {
    width: 43%;
  }

  .mw-table th:nth-child(2),
  .mw-table td:nth-child(2) {
    width: 24%;
  }

  .mw-table th:nth-child(8),
  .mw-table td:nth-child(8) {
    width: 33%;
  }

  .mw-table th,
  .mw-table td {
    padding-left: 7px;
    padding-right: 7px;
    vertical-align: top;
  }

  .mw-table td:first-child strong {
    display: block;
  }

  .mw-state {
    max-width: 100%;
    padding: 4px 6px;
    font-size: 11px;
    white-space: nowrap;
  }

  .mw-row-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .mw-row-actions .btn {
    width: 100%;
    min-width: 0;
    padding: 7px 6px;
  }
}

/* P1C_VISUAL_POLISH_1_END */
