:root {
  color-scheme: dark;
  --bg: #060706;
  --surface: #0d0e0f;
  --panel: #141210;
  --panel-strong: #1b1713;
  --panel-soft: #101112;
  --line: #312d27;
  --line-strong: #5a4b2a;
  --text: #f8f5ef;
  --muted: #b8afa3;
  --muted-strong: #d8cec0;
  --gold: #ffc400;
  --gold-strong: #f0b400;
  --gold-soft: rgba(255, 196, 0, 0.16);
  --blue: #63b3ff;
  --green: #5ee0a0;
  --red: #ff6b6b;
  --shadow: rgba(0, 0, 0, 0.38);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Painel de custos e margem */
.cost-dashboard {
  display: grid;
  gap: 16px;
}

.cost-filter-bar {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(200px, 1fr) minmax(260px, 1.35fr) minmax(170px, .65fr) auto;
  align-items: end;
  margin-bottom: 0;
}

.cost-filter-bar label { margin: 0; }
.cost-filter-bar input,
.cost-filter-bar select { width: 100%; }

.cost-quality-banner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 13px 16px;
  background: #111515;
  color: var(--muted-strong);
}

.cost-quality-banner strong { color: var(--text); }
.cost-quality-banner.is-warning { border-left-color: #f1a72c; background: rgba(241, 167, 44, .07); }
.cost-quality-banner.is-complete { border-left-color: #5ee0a0; background: rgba(94, 224, 160, .07); }
.cost-quality-banner.is-error { border-left-color: var(--red); background: rgba(255, 99, 99, .07); }

.cost-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 12px;
}

.cost-kpi-card {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-top: 3px solid #4e5757;
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(145deg, #151919, #0c0f0f);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
}

.cost-kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.cost-kpi-card strong { margin: 10px 0 6px; color: var(--text); font-size: clamp(24px, 2vw, 34px); line-height: 1; }
.cost-kpi-card small { color: var(--muted); line-height: 1.35; }
.cost-kpi-card.cost-kpi-primary { border-top-color: var(--gold); background: linear-gradient(145deg, rgba(255, 196, 0, .13), #0c0f0f 72%); }
.cost-kpi-card.is-risk { border-top-color: var(--red); }
.cost-kpi-card.is-risk strong { color: #ff8888; }

.cost-layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.cost-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: linear-gradient(180deg, #121616, #0c0f0f);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .17);
}

.cost-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.cost-panel-heading h2 { margin: 3px 0 0; font-size: 22px; }
.cost-panel-heading > small { max-width: 360px; color: var(--muted); text-align: right; line-height: 1.4; }

.cost-table-wrap { width: 100%; overflow-x: auto; }
.cost-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cost-table th { border-bottom: 1px solid var(--line); padding: 0 12px 11px; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.cost-table td { border-bottom: 1px solid rgba(255, 255, 255, .07); padding: 13px 12px; color: var(--muted-strong); vertical-align: middle; }
.cost-table tbody tr:last-child td { border-bottom: 0; }
.cost-table td strong { display: block; color: var(--text); }
.cost-table td small { display: block; margin-top: 4px; color: var(--muted); }
.cost-table td:not(:first-child) { white-space: nowrap; }
.cost-empty-cell { height: 90px; text-align: center; }

.cost-margin-pill,
.cost-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
}

.cost-margin-pill.is-positive { border-color: rgba(94, 224, 160, .32); color: #82e9b5; }
.cost-margin-pill.is-warning { border-color: rgba(255, 196, 0, .35); color: var(--gold); }
.cost-margin-pill.is-negative { border-color: rgba(255, 99, 99, .38); color: #ff8888; }
.cost-negative { color: #ff8888 !important; font-weight: 800; }

.cost-component-chart { display: grid; gap: 5px; }
.cost-component-row { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.cost-component-row:last-child { border-bottom: 0; }
.cost-component-row summary {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(150px, 1.4fr) 92px;
  gap: 12px;
  align-items: center;
  min-height: 41px;
  cursor: pointer;
  list-style: none;
}
.cost-component-row summary::-webkit-details-marker { display: none; }
.cost-component-name { color: var(--muted-strong); font-weight: 700; }
.cost-component-name em { display: block; color: #f1a72c; font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.cost-component-track { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .07); }
.cost-component-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b6b00, var(--gold)); }
.cost-component-row summary strong { color: var(--text); text-align: right; }
.cost-component-row p { margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; background: #090c0c; color: var(--muted); font-size: 12px; line-height: 1.45; }

.cost-client-table { min-width: 1080px; }
.cost-detail-button { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: #0b0e0e; color: var(--gold); cursor: pointer; font-weight: 800; }
.cost-client-detail td { padding: 0 12px 18px; background: rgba(255, 196, 0, .025); }
.cost-client-detail td > div { display: grid; grid-template-columns: repeat(6, minmax(115px, 1fr)); gap: 8px; padding-top: 13px; }
.cost-client-detail span { border: 1px solid rgba(255, 255, 255, .07); border-radius: 6px; padding: 9px; background: #0a0d0d; }
.cost-client-detail span small { margin: 0 0 4px; }
.cost-client-detail p { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.cost-operation-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; }
.cost-operation-grid article { min-height: 112px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 7px; padding: 14px; background: #0a0d0d; }
.cost-operation-grid span { display: block; min-height: 30px; color: var(--muted); font-size: 12px; font-weight: 800; }
.cost-operation-grid strong { display: block; margin: 9px 0 7px; color: var(--gold); font-size: 25px; }
.cost-operation-grid small { color: var(--muted); }

.cost-quota-list { display: grid; gap: 10px; }
.cost-quota-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(120px, 1.4fr) 64px; gap: 12px; align-items: center; }
.cost-quota-row strong,
.cost-quota-row span { display: block; }
.cost-quota-row strong { color: var(--text); font-size: 13px; }
.cost-quota-row span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.cost-quota-track { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, .07); }
.cost-quota-track i { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.cost-quota-row b { color: var(--muted-strong); font-size: 12px; text-align: right; }

.cost-limitations { display: grid; gap: 10px; margin: 0; padding: 0 0 0 18px; color: var(--muted); line-height: 1.45; }
.cost-limitations li::marker { color: var(--gold); }
.cost-rule-help { max-width: 1000px; margin: -5px 0 18px; color: var(--muted); line-height: 1.5; }
.cost-rule-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cost-rule-card { border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; padding: 15px; background: #0a0d0d; }
.cost-rule-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.cost-rule-title strong,
.cost-rule-title span { display: block; }
.cost-rule-title strong { color: var(--text); font-size: 16px; }
.cost-rule-title div > span { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.cost-source-pill { flex: 0 0 auto; align-self: start; color: var(--gold); text-transform: capitalize; }
.cost-rule-fields { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 9px; align-items: end; }
.cost-rule-fields label { margin: 0; }
.cost-rule-fields label > span { display: block; min-height: 29px; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.cost-rule-fields input { width: 100%; min-height: 40px; }
.cost-rule-notes { grid-column: span 2; }
.cost-rule-save { min-height: 40px; margin: 0; }
.cost-rule-card > small { display: block; margin-top: 10px; color: var(--muted); }

@media (max-width: 1420px) {
  .cost-kpi-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .cost-operation-grid { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
  .cost-filter-bar { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
  .cost-filter-bar .toolbar-action { grid-column: span 4; width: 100%; }
}

@media (max-width: 980px) {
  .cost-layout-two,
  .cost-rule-list { grid-template-columns: 1fr; }
  .cost-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-filter-bar .toolbar-action { grid-column: span 2; }
  .cost-client-detail td > div { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
}

@media (max-width: 680px) {
  .cost-filter-bar,
  .cost-kpi-grid,
  .cost-operation-grid { grid-template-columns: 1fr; }
  .cost-filter-bar .toolbar-action { grid-column: auto; }
  .cost-quality-banner { grid-template-columns: 1fr; }
  .cost-panel { padding: 15px; }
  .cost-panel-heading { display: block; }
  .cost-panel-heading > small { display: block; margin-top: 6px; text-align: left; }
  .cost-component-row summary { grid-template-columns: minmax(120px, 1fr) 80px; }
  .cost-component-track { display: none; }
  .cost-rule-fields { grid-template-columns: 1fr; }
  .cost-rule-notes { grid-column: auto; }
  .cost-client-detail td > div { grid-template-columns: repeat(2, minmax(105px, 1fr)); }
}

/* PRS Mail: workspace and Outlook-inspired composer */
.email-page .admin-view {
  width: min(1840px, 100%);
}

.email-page .topbar {
  grid-template-columns: minmax(290px, 330px) minmax(0, 1fr);
}

.email-page .topbar > div:first-child {
  width: min(310px, 100%);
}

.email-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 16px;
}

.email-page-heading h1 {
  margin: 5px 0 4px;
  font-size: clamp(24px, 2.4vw, 34px);
}

.email-page-heading p {
  margin: 0;
  color: var(--muted);
}

.email-mailbox-summary {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 196, 0, 0.24);
  border-radius: 999px;
  background: rgba(255, 196, 0, 0.08);
  color: #f5e8c8;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 800;
}

.email-page .email-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) minmax(160px, .7fr) minmax(280px, 1.35fr) 44px auto auto;
  align-items: end;
}

.email-page .email-toolbar .select-field,
.email-page .email-toolbar .search-field {
  width: 100%;
  min-width: 0;
}

.email-page .email-toolbar .primary-button,
.email-page .email-toolbar .ghost-button,
.email-page .email-toolbar .icon-button {
  width: auto;
  min-height: 44px;
  height: 44px;
  max-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
}

.email-page .email-toolbar .primary-button {
  min-width: 166px;
}

.email-page .email-toolbar .ghost-button {
  min-width: 154px;
}

.email-page #messageDetail .detail-header {
  align-items: flex-start;
}

.email-page #messageDetail .detail-header > .form-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-left: auto;
}

.email-page #messageDetail .detail-header .primary-button,
.email-page #messageDetail .detail-header .ghost-button {
  width: auto;
  min-width: 112px;
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.email-page .email-workspace {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  min-height: calc(100vh - 350px);
}

.email-page .email-message-list,
.email-page #messageDetail {
  min-height: 560px;
  max-height: calc(100vh - 350px);
}

.email-page .email-message-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-color: #303737;
  background: #0b0f10;
}

.email-page .email-message-list .ticket-list,
.email-page #messageDetail {
  overflow: auto;
}

.email-page .ticket-item.email-message-item,
.email-page .ticket-item.email-message-item.unread {
  color: #fffdf8;
}

.email-page .ticket-item.email-message-item.unread {
  background: #111a20;
}

.email-page .ticket-item.email-message-item:hover {
  background: #171b1a;
}

.email-page .ticket-item.email-message-item.active,
.email-page .ticket-item.email-message-item.active:hover {
  background: #211c0c;
  box-shadow: inset 4px 0 0 var(--gold), inset 0 0 0 1px rgba(255, 196, 0, 0.16);
}

.email-page .email-message-item .ticket-meta {
  color: #c7cecc;
}

.email-page .email-message-item.active .ticket-meta {
  color: #eee5d6;
}

.email-dialog.email-compose-dialog {
  width: min(1320px, calc(100vw - 40px));
  height: min(880px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid #343b3b;
  border-radius: 14px;
  background: #0d1112;
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .72);
}

.email-dialog.email-compose-dialog::backdrop {
  background: rgba(0, 0, 0, .76);
  backdrop-filter: blur(5px);
}

.email-compose-dialog .email-compose-form {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto auto minmax(260px, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.email-compose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid #303737;
  background: linear-gradient(180deg, #171c1d, #101415);
}

.email-compose-header h2 {
  margin: 3px 0 0;
  font-size: 22px;
}

.email-compose-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-send-button {
  min-width: 132px;
  min-height: 42px;
}

.email-addressing {
  padding: 7px 20px 5px;
  border-bottom: 1px solid #303737;
  background: #0d1112;
}

.email-address-row {
  display: grid;
  min-height: 48px;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid #2a3030;
}

.email-address-row:last-child {
  border-bottom: 0;
}

.email-address-label {
  color: #d7cec1;
  font-size: 13px;
  font-weight: 800;
}

.email-address-row input,
.email-address-row input:hover,
.email-address-row input:focus,
.email-address-row input:disabled {
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  padding: 8px 0;
  box-shadow: none;
}

.email-address-row input:disabled {
  color: #c8d0ce;
  opacity: 1;
}

.email-subject-row input {
  font-size: 16px;
  font-weight: 700;
}

.email-recipient-actions {
  display: flex;
  gap: 4px;
}

.email-recipient-actions button {
  border: 0;
  background: transparent;
  color: #e6c85b;
  padding: 8px;
  font-weight: 800;
}

.email-recipient-actions button:hover {
  color: var(--gold);
  text-decoration: underline;
}

.email-compose-dialog .email-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 58px;
  overflow-x: auto;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid #d8dde1;
  border-radius: 0;
  background: #f4f6f7;
  color: #28323a;
  scrollbar-width: thin;
}

.email-compose-dialog .email-editor-toolbar button,
.email-compose-dialog .email-editor-toolbar select,
.email-color-control,
.email-attachment-button {
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #26323a;
  padding: 7px 9px;
}

.email-compose-dialog .email-editor-toolbar select {
  border-color: #d7dde1;
  background: #fff;
}

.email-compose-dialog .email-editor-toolbar button:hover,
.email-color-control:hover,
.email-attachment-button:hover {
  border-color: #c9d0d5;
  background: #e5eaed;
}

.email-toolbar-separator {
  width: 1px;
  height: 28px;
  flex: 0 0 1px;
  margin: 0 4px;
  background: #ccd3d7;
}

.email-color-control,
.email-attachment-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 800;
}

.email-color-control input,
.email-attachment-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.email-highlight-control {
  color: #9b7600;
}

.email-attachment-button {
  margin-left: auto;
  white-space: nowrap;
}

.email-compose-dialog .email-editor {
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: #ffffff;
  color: #1d2939;
  padding: 24px 28px;
  font: 15px/1.6 Arial, sans-serif;
}

.email-compose-dialog .email-editor:focus {
  border: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 196, 0, .24);
}

.email-editor:empty::before {
  content: attr(data-placeholder);
  color: #8b949b;
  pointer-events: none;
}

.email-compose-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 9px 16px;
  border-top: 1px solid #303737;
  background: #101415;
}

.email-attachment-summary {
  overflow: hidden;
  color: #bfc8c6;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-compose-footer .form-error {
  margin: 0;
}

@media (max-width: 1050px) {
  .email-page .email-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .email-page .email-workspace {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .email-page .topbar {
    grid-template-columns: 1fr;
  }

  .email-page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .email-page .email-toolbar,
  .email-page .email-workspace {
    grid-template-columns: 1fr;
  }

  .email-page .email-toolbar .primary-button,
  .email-page .email-toolbar .ghost-button,
  .email-page .email-toolbar .icon-button {
    width: 100%;
  }

  .email-page #messageDetail .detail-header > .form-actions {
    width: 100%;
    margin-left: 0;
  }

  .email-page #messageDetail .detail-header .primary-button,
  .email-page #messageDetail .detail-header .ghost-button {
    flex: 1 1 0;
    min-width: 0;
  }

  .email-page .email-message-list,
  .email-page #messageDetail {
    min-height: 420px;
    max-height: none;
  }

  .email-compose-dialog {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .email-compose-header,
  .email-addressing {
    padding-right: 12px;
    padding-left: 12px;
  }

  .email-address-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .email-compose-footer {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .email-compose-footer .form-error {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

/* Central privada do Administrador Geral */
.executive-dashboard { display: grid; gap: 20px; }
.executive-toolbar { grid-template-columns: minmax(180px, 250px) minmax(220px, 1fr) auto auto; align-items: end; }
.executive-access-seal { min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 9px 14px; border: 1px solid rgba(94, 224, 160, .25); border-radius: 11px; background: rgba(94, 224, 160, .06); }
.executive-access-seal div { display: grid; gap: 2px; }
.executive-access-seal small, .executive-freshness, .executive-panel-heading small, .executive-help { color: var(--muted); }
.executive-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #5ee0a0; box-shadow: 0 0 0 6px rgba(94, 224, 160, .1); }
.executive-freshness { align-self: center; white-space: nowrap; }
.executive-status-banner { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 20px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 13px; background: var(--panel); }
.executive-status-banner > div { display: flex; align-items: center; gap: 13px; }
.executive-status-banner > div > div { display: grid; gap: 3px; }
.executive-status-banner small, .executive-status-banner span { color: var(--muted); }
.executive-status-banner.is-healthy { border-left-color: #5ee0a0; }
.executive-status-banner.is-warning { border-left-color: var(--gold); }
.executive-status-banner.is-critical, .executive-status-banner.is-unknown { border-left-color: #ff7676; }
.executive-status-mark { width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
.is-healthy .executive-status-mark { color: #5ee0a0; }
.is-warning .executive-status-mark { color: var(--gold); }
.is-critical .executive-status-mark, .is-unknown .executive-status-mark { color: #ff7676; }
.executive-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; }
.executive-kpi-card { min-height: 132px; display: flex; flex-direction: column; gap: 9px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.executive-kpi-card.is-primary { border-color: rgba(255, 196, 0, .48); background: linear-gradient(145deg, rgba(255,196,0,.13), var(--panel) 70%); }
.executive-kpi-card span { color: var(--muted); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.executive-kpi-card strong { color: var(--text); font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1; }
.executive-kpi-card small { margin-top: auto; color: var(--muted); }
.executive-main-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(360px, .7fr); gap: 20px; }
.executive-table-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.executive-panel { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.executive-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.executive-panel-heading h2 { margin: 3px 0 0; }
.executive-resource-grid { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 10px; }
.executive-resource-card { display: grid; gap: 7px; min-height: 112px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.2); }
.executive-resource-card > span, .executive-resource-card small { color: var(--muted); }
.executive-resource-card strong { font-size: 1.35rem; }
.executive-meter { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.executive-meter i { display: block; height: 100%; border-radius: inherit; background: #5ee0a0; }
.executive-resource-card.is-warning .executive-meter i { background: var(--gold); }
.executive-resource-card.is-critical .executive-meter i { background: #ff7676; }
.executive-trend-block { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; }
.executive-trend-block > div { display: flex; justify-content: space-between; color: var(--muted); }
.executive-trend-block svg { display: block; width: 100%; margin-top: 8px; }
.executive-chart-grid { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 1; }
.executive-line-memory, .executive-line-disk { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.executive-line-memory { stroke: var(--gold); }
.executive-line-disk { stroke: #63b3ff; }
.executive-chart-label { fill: var(--muted); font-size: 11px; }
.executive-alert-list { display: grid; gap: 9px; margin-top: 16px; }
.executive-alert { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,.8fr); gap: 14px; padding: 13px 15px; border-left: 3px solid; border-radius: 9px; background: rgba(0,0,0,.2); }
.executive-alert > div { display: grid; gap: 3px; }
.executive-alert span, .executive-alert small { color: var(--muted); }
.executive-alert.is-critical { border-color: #ff7676; }
.executive-alert.is-warning { border-color: var(--gold); }
.executive-all-clear { display: grid; gap: 3px; padding: 14px; border: 1px solid rgba(94,224,160,.25); border-radius: 10px; color: #5ee0a0; }
.executive-all-clear span { color: var(--muted); }
.executive-readonly-pill, .executive-state { padding: 5px 9px; border-radius: 999px; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.executive-readonly-pill { color: var(--gold); background: rgba(255,196,0,.1); border: 1px solid rgba(255,196,0,.3); }
.executive-copilot-panel { position: relative; overflow: hidden; }
.executive-copilot-panel::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--gold), transparent); }
.executive-prompt-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 17px 0; }
.executive-prompt-list button { width: auto; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: rgba(0,0,0,.24); font: inherit; font-size: .82rem; cursor: pointer; }
.executive-prompt-list button:hover { border-color: var(--gold); color: var(--gold); }
.executive-copilot-form { display: grid; gap: 9px; }
.executive-copilot-form label { font-weight: 800; }
.executive-copilot-form textarea { width: 100%; resize: vertical; min-height: 100px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--background); font: inherit; line-height: 1.5; }
.executive-copilot-form textarea:focus { outline: 2px solid rgba(255,196,0,.28); border-color: var(--gold); }
.executive-copilot-answer { display: grid; gap: 14px; margin-top: 18px; padding: 17px; border: 1px solid rgba(255,196,0,.24); border-radius: 11px; background: rgba(255,196,0,.045); }
.executive-answer-heading { display: flex; justify-content: space-between; gap: 10px; }
.executive-answer-heading span, .executive-answer-sources span { color: var(--muted); font-size: .82rem; }
.executive-answer-list ul, .executive-quality-grid ul { margin: 7px 0 0; padding-left: 20px; color: var(--muted); }
.executive-answer-sources { display: flex; flex-wrap: wrap; gap: 7px; }
.executive-answer-sources strong { width: 100%; }
.executive-answer-sources span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; }
.executive-ai-thinking { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.executive-ai-thinking span { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: executive-spin .8s linear infinite; }
@keyframes executive-spin { to { transform: rotate(360deg); } }
.executive-answer-error { display: grid; gap: 5px; color: #ff8b8b; }
.executive-table-wrap { overflow-x: auto; }
.executive-table-wrap table { width: 100%; border-collapse: collapse; }
.executive-table-wrap th, .executive-table-wrap td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.executive-table-wrap th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.executive-table-wrap td small { display: block; margin-top: 4px; color: var(--muted); }
.executive-table-wrap tbody tr:last-child td { border-bottom: 0; }
.executive-negative { color: #ff8b8b; font-weight: 800; }
.executive-empty-cell { color: var(--muted); text-align: center !important; }
.executive-monthly-trend { min-height: 240px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; }
.executive-monthly-trend article { min-width: 0; display: grid; gap: 8px; text-align: center; }
.executive-month-bars { height: 150px; display: flex; align-items: end; justify-content: center; gap: 5px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 36px, rgba(255,255,255,.045) 37px); }
.executive-month-bars i { width: min(24px, 35%); min-height: 0; border-radius: 5px 5px 0 0; }
.executive-month-bars .is-revenue { background: #5ee0a0; }
.executive-month-bars .is-overdue { background: #ff7676; }
.executive-monthly-trend small { color: var(--muted); white-space: normal; }
.executive-service-list { display: flex; flex-wrap: wrap; gap: 9px; }
.executive-service { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; }
.executive-service i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.is-up { color: #5ee0a0; }
.is-down { color: #ff7676; }
.executive-backup-list { display: grid; gap: 10px; margin-top: 16px; }
.executive-backup-list article { padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.executive-backup-list article > div { display: flex; justify-content: space-between; gap: 10px; }
.executive-backup-list small { color: var(--muted); }
.executive-quality-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
.executive-quality-grid h3 { margin-top: 0; }

@media (max-width: 1500px) {
  .executive-kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .executive-resource-grid { grid-template-columns: repeat(3, minmax(120px,1fr)); }
}
@media (max-width: 1120px) {
  .executive-toolbar, .executive-main-grid, .executive-table-grid { grid-template-columns: 1fr; }
  .executive-toolbar .toolbar-action { width: 100%; }
}
@media (max-width: 720px) {
  .executive-kpi-grid, .executive-resource-grid, .executive-quality-grid { grid-template-columns: 1fr; }
  .executive-status-banner, .executive-panel-heading, .executive-alert { align-items: flex-start; grid-template-columns: 1fr; flex-direction: column; }
  .executive-monthly-trend { overflow-x: auto; grid-template-columns: repeat(6, minmax(86px,1fr)); }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #090a09 0, var(--bg) 260px, #030403 100%);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.email-workspace { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 18px; min-height: 68vh; }
.email-message-list { background: var(--surface, #fff); border: 1px solid var(--border, #e4e7ec); border-radius: 18px; overflow: hidden; }
.email-message-item {
  background: #0b0f10;
  color: var(--text);
}
.email-message-item .ticket-subject { color: #fffdf8; }
.email-message-item .ticket-meta { color: #c7cecc; }
.email-message-item.unread { background: #111a20; }
.email-message-item.unread .ticket-subject {
  color: #ffffff;
  font-weight: 800;
}
.ticket-item.email-message-item:hover {
  background: #171b1a;
}
.ticket-item.email-message-item.active,
.ticket-item.email-message-item.active:hover {
  background: #211c0c;
  box-shadow:
    inset 4px 0 0 var(--gold),
    inset 0 0 0 1px rgba(255, 196, 0, 0.16);
}
.email-message-item.active .ticket-subject { color: #ffffff; }
.email-message-item.active .ticket-meta { color: #eee5d6; }
.email-message-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}
.email-content-frame { width: 100%; min-height: 440px; border: 1px solid #e4e7ec; border-radius: 14px; background: white; }
.email-dialog { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 24px 80px rgba(16, 24, 40, .28); }
.email-dialog::backdrop { background: rgba(16, 24, 40, .55); }
.email-compose-form, .email-dialog .compact-form { padding: 24px; display: grid; gap: 14px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.email-editor-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; border: 1px solid #d0d5dd; border-bottom: 0; border-radius: 12px 12px 0 0; background: #f9fafb; }
.email-editor-toolbar button { border: 1px solid #d0d5dd; border-radius: 7px; background: white; min-width: 36px; padding: 7px 10px; cursor: pointer; }
.email-editor { min-height: 260px; padding: 16px; border: 1px solid #d0d5dd; border-radius: 0 0 12px 12px; outline: none; overflow: auto; }
.email-editor:focus { border-color: #2e74b5; box-shadow: 0 0 0 3px rgba(46,116,181,.12); }
@media (max-width: 900px) { .email-workspace { grid-template-columns: 1fr; } .email-message-list { max-height: 420px; } }

.feedback-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: grid;
  width: min(380px, calc(100vw - 32px));
  gap: 10px;
  pointer-events: none;
}

.feedback-toast {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 42px 14px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  background: rgba(17, 15, 12, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.52);
  color: var(--text);
  pointer-events: auto;
  animation: feedback-in 160ms ease-out;
}

.feedback-toast[data-closing='true'] {
  animation: feedback-out 140ms ease-in forwards;
}

.feedback-toast strong {
  font-size: 0.78rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.feedback-toast span {
  color: var(--text);
  line-height: 1.35;
}

.feedback-toast-success {
  border-left-color: var(--green);
}

.feedback-toast-error {
  border-left-color: var(--red);
}

.feedback-toast-warning {
  border-left-color: var(--gold);
}

.feedback-toast-info {
  border-left-color: var(--blue);
}

.feedback-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  line-height: 1;
}

.feedback-close:hover,
.feedback-close:focus-visible {
  border-color: var(--gold);
  color: var(--text);
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes feedback-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.admin-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

.admin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.admin-dialog form {
  display: grid;
  gap: 14px;
}

.full-field {
  width: 100%;
}

.search-field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 12px;
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  position: relative;
  overflow: hidden;
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #181513, var(--panel));
  box-shadow: 0 24px 64px var(--shadow);
  padding: 28px;
}

.login-panel::before {
  content: "";
  display: block;
  height: 138px;
  margin: -10px 0 24px;
  background: url("./assets/prs-logo-admin.png") center / contain no-repeat;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.34));
}

.login-panel .brand-block {
  display: none;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    #080807 url("./assets/prs-logo-mark.png") center / cover no-repeat;
  color: var(--gold);
  font-size: 0;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 196, 0, 0.08);
}

.brand-block h1,
.topbar h1,
.panel-heading h2,
.ticket-detail h2,
.detail-section h3 {
  margin: 0;
}

.brand-block h1 {
  font-size: 22px;
}

.brand-block p,
.detail-meta,
.ticket-meta,
.ticket-preview,
.session-box,
.empty-state,
.field span,
.select-field span,
.search-field span,
.readonly-field span,
.metric span,
.panel-heading span,
.data-list dt,
.response-footer p {
  color: var(--muted);
}

.brand-block p {
  margin: 4px 0 0;
}

.field,
.select-field,
.search-field,
.readonly-field {
  display: grid;
  gap: 7px;
}

.field,
.select-field,
.readonly-field {
  margin-bottom: 14px;
}

.field span,
.select-field span,
.search-field span,
.readonly-field span {
  font-size: 13px;
  font-weight: 700;
}

.readonly-field {
  min-height: 72px;
  align-content: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.readonly-field strong {
  color: var(--text);
  line-height: 1.25;
}

.readonly-field small {
  color: var(--muted);
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090a0a;
  color: var(--text);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 164px;
  resize: vertical;
  padding: 12px;
}

.field-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  width: 100%;
  background: linear-gradient(180deg, #ffd64a, var(--gold-strong));
  color: #14100a;
  box-shadow: 0 10px 24px rgba(255, 196, 0, 0.12);
}

.primary-button:hover,
.primary-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(255, 196, 0, 0.16);
}

.primary-button:disabled,
.ghost-button:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.ghost-button {
  padding: 0 14px;
  border-color: var(--line);
  background: #0c0d0d;
  color: var(--text);
}

.ghost-link,
.primary-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.ghost-link {
  border: 1px solid var(--line);
  padding: 0 14px;
  color: var(--text);
  background: #0c0d0d;
}

.primary-link {
  background: linear-gradient(180deg, #ffd64a, var(--gold-strong));
  color: #14100a;
  padding: 0 18px;
}

.ghost-link:hover,
.ghost-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: #141516;
  color: var(--gold);
}

.icon-button {
  display: grid;
  width: 44px;
  place-items: center;
  border-color: var(--line);
  background: #0c0d0d;
  color: var(--gold);
  font-size: 22px;
}

.form-error {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 14px;
}

#generateInfo {
  margin: -6px 0 14px;
  color: var(--muted);
}

.admin-view {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 24px 28px 32px;
}

.topbar,
.toolbar,
.response-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(410px, max-content) minmax(0, 1fr);
  align-items: center;
  margin: -24px -28px 22px;
  padding: 18px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(6, 7, 6, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.topbar > div:first-child {
  position: relative;
  width: min(390px, 100%);
  aspect-ratio: 1701 / 670;
}

.topbar > div:first-child::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/prs-logo-admin-horizontal.png") left center / contain no-repeat;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.34));
}

.topbar > div:first-child .eyebrow,
.topbar > div:first-child h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h1 {
  margin-top: 4px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
}

.session-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  white-space: normal;
}

.session-box[hidden],
.admin-menu-toggle[hidden] {
  display: none !important;
}

.admin-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0d0d;
  color: var(--gold);
  font-size: 22px;
  cursor: pointer;
}

.session-box #userName {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid rgba(255, 196, 0, 0.18);
  border-radius: 8px;
  background: rgba(255, 196, 0, 0.08);
  color: var(--muted-strong);
  padding: 0 12px;
  font-weight: 700;
}

.topbar .ghost-link,
.topbar .ghost-button {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.11);
  padding: 0 12px;
  color: var(--muted-strong);
  font-size: 14px;
}

.topbar .marketing-nav-link {
  border-color: var(--gold);
  background: linear-gradient(180deg, #ffd64a, var(--gold-strong));
  color: #14100a;
  box-shadow: 0 8px 20px rgba(255, 196, 0, 0.14);
}

.topbar .marketing-nav-link:hover,
.topbar .marketing-nav-link[aria-current="page"] {
  border-color: #ffe17a;
  background: #ffe06c;
  color: #14100a;
}

.topbar .ghost-link[href="./index.html"],
.topbar .ghost-link[href="./trackers.html"],
.topbar .ghost-link[href="./clients.html"],
.topbar .ghost-link[href="./finance.html"],
.topbar .ghost-link[href="./operation.html"],
.topbar .ghost-link[href="./technical.html"],
.topbar .ghost-link[href="./operators.html"],
.topbar .ghost-link[href="./reports.html"],
.topbar .ghost-link[href="./marketing.html"],
.topbar .ghost-link[href="./privacy.html"],
.topbar .ghost-link[href="./notifications.html"],
.topbar .ghost-link[href="./audit.html"] {
  min-width: 0;
}

.toolbar {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #151311, var(--panel-soft));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 12px 32px rgba(0, 0, 0, 0.18);
}

.audit-intro {
  margin-bottom: 16px;
}

.audit-intro h2 {
  margin: 0 0 6px;
}

.audit-intro p {
  margin: 0;
  color: var(--muted);
}

.toolbar .search-field {
  flex: 1 1 520px;
}

.toolbar .select-field {
  flex: 0 1 230px;
  margin-bottom: 0;
}

.toolbar .audit-client-filter {
  flex: 1 1 360px;
}

.toolbar-action {
  flex: 0 0 auto;
  width: auto;
  padding: 0 18px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  min-height: 96px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: linear-gradient(180deg, #171411, #111111);
  padding: 16px 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 28px rgba(0, 0, 0, 0.16);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
}

.accent-blue {
  border-left-color: var(--blue);
}

.accent-green {
  border-left-color: var(--green);
}

.accent-muted {
  border-left-color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.ticket-list-panel,
.ticket-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #151311, #100f0e);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 36px rgba(0, 0, 0, 0.16);
}

.ticket-list-panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  font-size: 18px;
}

.ticket-list {
  max-height: calc(100vh - 330px);
  min-height: 320px;
  overflow: auto;
  scrollbar-color: var(--line-strong) transparent;
}

.ticket-item {
  display: grid;
  width: 100%;
  min-height: 92px;
  grid-template-columns: 12px minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  padding: 14px 16px;
  text-align: left;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.ticket-item:hover,
.ticket-item.active {
  background: rgba(255, 196, 0, 0.06);
  box-shadow: inset 3px 0 0 var(--gold);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
}

.ticket-item-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ticket-subject,
.ticket-meta,
.ticket-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-meta,
.ticket-preview {
  font-size: 13px;
}

.ticket-arrow {
  color: var(--muted);
  font-size: 30px;
}

.ticket-detail {
  min-height: 540px;
  padding: 18px;
}

.empty-state {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 26px;
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold);
  font-size: 28px;
  background: rgba(255, 196, 0, 0.07);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin-top: 10px;
  font-size: 26px;
}

.status-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 14px;
  margin-bottom: 16px;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0d0d;
  padding: 16px;
}

.detail-section h3 {
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 16px;
}

.detail-section p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.data-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.data-list div {
  display: grid;
  gap: 4px;
}

.data-list dt {
  font-size: 12px;
  font-weight: 800;
}

.data-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.ai-copilot-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(255, 196, 0, 0.38);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 196, 0, 0.08), transparent 48%),
    #0c0d0d;
}

.ai-copilot-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ai-copilot-heading h3 {
  margin: 3px 0 0;
  color: #fffdf8;
}

.ai-human-badge,
.ai-draft-meta span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(94, 224, 160, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--success);
  background: rgba(94, 224, 160, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.ai-copilot-description,
.ai-copilot-status,
.ai-draft-protections {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ai-copilot-actions,
.ai-draft-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-copilot-actions .primary-button,
.ai-copilot-actions .ghost-button {
  width: auto;
  min-width: 150px;
}

.ai-draft-result {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.ai-draft-content {
  margin: 0;
  color: #fffdf8;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-draft-sources summary {
  cursor: pointer;
  color: var(--gold);
  font-weight: 800;
}

.ai-draft-sources ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .ai-copilot-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-human-badge {
    align-self: flex-start;
  }

  .ai-copilot-actions .primary-button,
  .ai-copilot-actions .ghost-button {
    width: 100%;
  }
}

.compact-form {
  display: grid;
  gap: 12px;
}

.compact-form .field,
.compact-form .select-field {
  margin-bottom: 0;
}

.compact-form .primary-button {
  width: auto;
  min-width: 160px;
  padding: 0 18px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.grid-form .form-error {
  grid-column: 1 / -1;
}

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

.form-actions .primary-button,
.form-actions .ghost-button {
  width: auto;
  min-width: 170px;
  padding: 0 18px;
}

.inline-action {
  min-height: 34px;
  margin: 2px 4px 2px 0;
  padding: 0 10px;
  font-size: 13px;
}

.inline-link {
  min-height: 34px;
  margin: 2px 4px 2px 0;
  padding: 0 10px;
  font-size: 13px;
}

.check-field {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.section-heading-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.section-heading-line strong {
  color: var(--text);
}

.section-heading-line span {
  color: var(--muted);
  font-size: 13px;
}

.plan-editor-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

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

.feature-check {
  display: flex;
  min-height: 74px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090a0a;
  padding: 10px;
}

.feature-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold);
}

.feature-check span {
  display: grid;
  gap: 3px;
}

.feature-check strong {
  color: var(--text);
  font-size: 13px;
}

.feature-check small {
  color: var(--muted);
  line-height: 1.35;
}

.plan-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090a0a;
  padding: 12px;
}

.plan-card > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.plan-card .plan-name {
  color: var(--gold);
}

.plan-card .plan-price {
  color: var(--text);
  font-weight: 800;
}

.plan-card .plan-summary {
  color: var(--muted);
  line-height: 1.4;
}

.compact-row,
.muted-line {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090a0a;
  padding: 10px 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #090908;
}

.photo-card figcaption {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

button.compact-row {
  width: 100%;
  cursor: pointer;
  text-align: left;
}

button.compact-row:hover {
  border-color: var(--gold);
  color: var(--text);
}

.audit-heading {
  margin: -18px -18px 16px;
}

.operation-subheading {
  margin: 18px -18px 16px;
}

.operation-map-panel {
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #151311, #100f0e);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.operation-map-heading {
  margin: 0;
}

.operation-map-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.operation-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 0;
  min-height: 520px;
  border-bottom: 1px solid var(--line);
}

.operation-map {
  min-height: 520px;
  background: #090a0a;
}

.operation-map .leaflet-control-attribution {
  background: rgba(8, 8, 8, 0.72);
  color: var(--muted);
}

.operation-map .leaflet-control-attribution a {
  color: var(--gold);
}

.map-vehicle-card {
  display: grid;
  align-content: start;
  gap: 12px;
  border-left: 1px solid var(--line);
  background: #0c0d0d;
  padding: 16px;
}

.map-vehicle-card h3 {
  margin: 0;
  color: var(--gold);
  font-size: 18px;
}

.map-vehicle-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.map-card-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-card-status .status-pill {
  min-height: 28px;
}

.map-card-data {
  display: grid;
  gap: 8px;
  margin: 0;
}

.map-card-data div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090908;
  padding: 10px;
}

.map-card-data dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-card-data dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-dot.moving,
.fleet-marker.moving {
  background: var(--green);
}

.legend-dot.stopped,
.fleet-marker.stopped {
  background: var(--gold);
}

.legend-dot.offline,
.fleet-marker.offline {
  background: var(--red);
}

.legend-dot.stale,
.fleet-marker.stale {
  background: var(--blue);
}

.fleet-marker {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #fff7df;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
  color: #090908;
  font-size: 15px;
  font-weight: 1000;
}

.fleet-marker.selected {
  width: 42px;
  height: 42px;
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px rgba(255, 196, 0, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.48);
  transform: translate(-4px, -4px);
}

.fleet-marker-icon {
  background: transparent;
  border: 0;
}

.vehicle-row-selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

.audit-list {
  display: grid;
  gap: 12px;
}

.audit-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0d0d;
  padding: 14px;
}

.audit-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.audit-action {
  color: var(--gold);
}

.audit-date {
  color: var(--muted);
  font-size: 13px;
}

.audit-data {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.audit-metadata {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090908;
  color: var(--muted);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.audit-detail-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  line-height: 1.35;
}

.audit-detail-label {
  color: var(--muted);
  font-weight: 700;
}

.audit-detail-value {
  color: var(--text);
  overflow-wrap: anywhere;
}

.audit-detail-empty {
  margin: 0;
}

.finance-section {
  margin-top: 16px;
}

.public-tracking-view {
  max-width: 1280px;
}

.tracking-topbar {
  align-items: flex-start;
}

.tracking-subtitle {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.tracking-notice {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  border: 1px solid rgba(255, 196, 0, 0.28);
  border-radius: 8px;
  background: rgba(255, 196, 0, 0.08);
  padding: 12px 14px;
  color: var(--muted);
}

.tracking-notice strong {
  color: var(--gold);
  white-space: nowrap;
}

.tracking-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
}

.tracking-map {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090a0a;
}

.tracking-actions {
  margin: 12px 0;
}

.marketing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 16px;
  align-items: start;
}

.marketing-gallery-panel {
  min-height: 640px;
}

.marketing-editor {
  position: sticky;
  top: 128px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.asset-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090a0a;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.asset-card:hover,
.asset-card.active {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px var(--gold-soft);
  transform: translateY(-1px);
}

.asset-preview {
  display: block;
  width: 100%;
  border: 0;
  background: #050505;
  padding: 0;
}

.asset-preview img,
.asset-detail-preview img {
  display: block;
  width: 100%;
  background: #050505;
  object-fit: cover;
}

.asset-preview img {
  aspect-ratio: 16 / 10;
}

.asset-card-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.asset-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.asset-card-heading strong {
  min-width: 0;
  color: var(--text);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.asset-meta,
.asset-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.asset-copy {
  display: -webkit-box;
  min-height: 36px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.asset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.asset-tags span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(255, 196, 0, 0.22);
  border-radius: 999px;
  background: rgba(255, 196, 0, 0.07);
  color: var(--muted-strong);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-detail-preview {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
}

.asset-detail-preview img {
  max-height: 360px;
  object-fit: contain;
}

.tracking-trail-list {
  margin-top: 10px;
}

.tracking-trail-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
}

.tracking-trail-row:hover {
  border-color: var(--gold);
}

.tracking-trail-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tracking-trail-row em {
  color: var(--gold);
  font-style: normal;
  font-weight: 800;
}

.public-tracking-view .metric strong {
  overflow-wrap: anywhere;
  font-size: 22px;
}

.response-footer {
  margin-top: 14px;
}

.response-footer .primary-button {
  width: auto;
  min-width: 170px;
  padding: 0 18px;
}

@media (max-width: 980px) {
  .metrics-grid,
  .workspace,
  .detail-grid,
  .marketing-layout,
  .operation-map-layout,
  .audit-data {
    grid-template-columns: 1fr;
  }

  .marketing-editor {
    position: static;
  }

  .map-vehicle-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

  .tracking-trail-row {
    grid-template-columns: 1fr;
  }

  .ticket-list {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .admin-view {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    margin: -14px -14px 16px;
    padding: 14px;
  }

  .topbar > div:first-child {
    width: min(320px, 100%);
  }

  .topbar > div:first-child::before {
    background-position: center;
  }

  .toolbar,
  .response-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-menu-toggle:not([hidden]) {
    display: inline-flex;
    justify-self: start;
  }

  .session-box:not([hidden]) {
    display: none;
    align-items: stretch;
    flex-direction: column;
  }

  .session-box.menu-open:not([hidden]) {
    display: flex;
  }

  .session-box {
    justify-content: flex-start;
  }

  .session-box #userName,
  .topbar .ghost-link,
  .topbar .ghost-button {
    width: 100%;
  }

  .toolbar .select-field,
  .toolbar .search-field {
    flex-basis: auto;
    width: 100%;
  }

  .toolbar-action {
    width: 100%;
  }

  .map-actions,
  .map-actions .ghost-button {
    width: 100%;
  }

  .icon-button {
    width: 100%;
  }

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

  .response-footer .primary-button {
    width: 100%;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .form-actions .primary-button,
  .form-actions .ghost-button {
    width: 100%;
  }
}

/* Administrative shell v2 */
:root {
  --admin-sidebar-width: 276px;
  --bg: #07090a;
  --surface: #0d1112;
  --panel: #121718;
  --panel-strong: #171b1b;
  --panel-soft: #0e1314;
  --line: #2b3131;
  --line-strong: #655426;
  --muted: #a9b0ae;
  --muted-strong: #d7dad8;
  --blue: #62aee8;
  --green: #4fd09a;
  --red: #f06d6d;
}

body.has-admin-sidebar {
  background: #080b0c;
}

body.admin-drawer-open {
  overflow: hidden;
}

body.has-admin-sidebar .admin-view {
  width: auto;
  max-width: none;
  margin: 0 0 0 var(--admin-sidebar-width);
  padding: 0 28px 40px;
}

.admin-sidebar.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--admin-sidebar-width);
  height: 100vh;
  grid-template-columns: none;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #090a09;
  padding: 14px 12px 12px;
  box-shadow: 18px 0 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: none;
}

.admin-sidebar-brand.topbar > div:first-child,
.admin-sidebar > div:first-child {
  position: relative;
  width: 100%;
  height: 136px;
  min-height: 136px;
  aspect-ratio: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 94px 10px 12px;
}

.admin-sidebar-brand.topbar > div:first-child::before,
.admin-sidebar > div:first-child::before {
  inset: 4px 10px auto;
  height: 82px;
  background-image: url("./assets/prs-logo-admin-horizontal.png");
  background-position: left center;
  background-size: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.4));
}

.admin-sidebar-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.admin-sidebar-caption strong {
  color: var(--text);
  font-size: 13px;
}

.admin-sidebar-caption span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-sidebar .session-box {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  white-space: normal;
}

.admin-sidebar .session-box[hidden] {
  display: none !important;
}

.admin-nav {
  display: grid;
  gap: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 4px 12px 0;
  scrollbar-color: #474235 transparent;
  scrollbar-width: thin;
}

.admin-nav-group {
  display: grid;
  gap: 3px;
}

.admin-nav-label {
  padding: 0 10px 5px;
  color: #777e7c;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-sidebar .admin-nav-link,
.admin-sidebar .marketing-nav-link {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #b9bfbd;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.admin-sidebar .admin-nav-link:hover,
.admin-sidebar .marketing-nav-link:hover {
  border-color: rgba(255, 196, 0, 0.18);
  background: rgba(255, 196, 0, 0.06);
  color: #fff8e6;
}

.admin-sidebar .admin-nav-link[aria-current="page"],
.admin-sidebar .marketing-nav-link[aria-current="page"] {
  border-color: rgba(255, 196, 0, 0.28);
  background: rgba(255, 196, 0, 0.11);
  box-shadow: inset 3px 0 0 var(--gold);
  color: #fff8df;
}

.admin-sidebar .admin-nav-link[hidden] {
  display: none !important;
}

.admin-nav-icon,
.admin-control-icon,
.admin-inline-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.admin-nav-link[aria-current="page"] .admin-nav-icon,
.admin-nav-link:hover .admin-nav-icon {
  color: var(--gold);
}

.admin-account {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 12px;
}

.admin-account-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0 8px;
}

.admin-account-copy small {
  color: #777e7c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-sidebar .session-box #userName {
  display: block;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  padding: 0;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar .admin-logout-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  border-color: rgba(255, 255, 255, 0.08);
  background: #0e1111;
  color: var(--muted);
  padding: 0 10px;
}

.admin-sidebar-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111515;
  color: var(--text);
}

.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  padding: 0;
}

.admin-page-header {
  position: sticky;
  top: 0;
  z-index: 18;
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 -28px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 11, 12, 0.94);
  padding: 16px 28px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.admin-page-heading {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-page-heading .eyebrow {
  font-size: 10px;
}

.admin-page-heading h1 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 28px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-page-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-secure-label {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(79, 208, 154, 0.18);
  border-radius: 6px;
  background: rgba(79, 208, 154, 0.06);
  color: #9ad9bd;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.admin-inline-icon {
  width: 15px;
  height: 15px;
}

.admin-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111515;
  color: var(--gold);
}

.toolbar {
  gap: 12px;
  border-color: #2b3232;
  background: #111617;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

input,
select,
textarea {
  border-color: #303737;
  background: #090d0e;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #46504e;
}

.primary-button,
.primary-link {
  background: var(--gold);
  box-shadow: 0 10px 22px rgba(255, 196, 0, 0.1);
}

.ghost-button,
.ghost-link,
.icon-button {
  border-color: #303737;
  background: #0c1011;
}

.metrics-grid {
  gap: 14px;
}

.metric {
  min-height: 104px;
  border-color: #2b3232;
  border-left-width: 3px;
  background: #111617;
  padding: 17px 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.metric span {
  color: #9fa7a5;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  margin-top: 11px;
  font-size: 30px;
}

.ticket-list-panel,
.ticket-detail,
.operation-map-panel {
  border-color: #2b3232;
  background: #101415;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
}

.panel-heading {
  background: #131819;
}

.ticket-item {
  min-height: 86px;
}

.ticket-item:hover,
.ticket-item.active {
  background: rgba(255, 196, 0, 0.055);
}

.ticket-detail {
  padding: 20px;
}

.detail-section,
.audit-item,
.plan-editor-block {
  border-color: #2b3232;
  background: #0b0f10;
}

.detail-section h3 {
  color: #f0c94a;
}

.status-pill,
.asset-tags span {
  border-radius: 6px;
}

.asset-card,
.photo-card,
.plan-card,
.compact-row,
.muted-line,
.feature-check {
  border-color: #2b3232;
  background: #0b0f10;
}

.asset-card:hover,
.asset-card.active {
  border-color: rgba(255, 196, 0, 0.52);
}

.login-view {
  background: #070909;
}

.login-panel {
  width: min(100%, 460px);
  border-color: #34352f;
  border-top: 3px solid var(--gold);
  background: #111413;
  padding: 34px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.login-panel::before {
  height: 112px;
  margin: -2px 0 30px;
  background-image: url("./assets/prs-logo-admin-horizontal.png");
}

@media (max-width: 1180px) {
  body.has-admin-sidebar .admin-view {
    margin-left: 0;
  }

  .admin-sidebar.topbar {
    width: min(304px, calc(100vw - 44px));
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .admin-sidebar.topbar.menu-open {
    transform: translateX(0);
  }

  .admin-sidebar-close {
    display: grid;
  }

  .admin-drawer-open .admin-sidebar-backdrop {
    display: block;
  }

  .admin-menu-toggle:not([hidden]) {
    display: inline-flex;
  }

  .workspace {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  }

  .operation-map-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  }
}

@media (max-width: 920px) {
  .workspace,
  .detail-grid,
  .marketing-layout,
  .operation-map-layout,
  .audit-data,
  .tracking-layout {
    grid-template-columns: 1fr;
  }

  .ticket-list {
    max-height: 440px;
  }

  .marketing-editor {
    position: static;
  }

  .map-vehicle-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 700px) {
  body.has-admin-sidebar .admin-view {
    padding: 0 14px 28px;
  }

  .admin-page-header {
    min-height: 72px;
    margin: 0 -14px 16px;
    padding: 12px 14px;
  }

  .admin-page-heading h1 {
    max-width: 58vw;
    font-size: 22px;
  }

  .admin-page-heading .eyebrow,
  .admin-secure-label span {
    display: none;
  }

  .admin-secure-label {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .toolbar .search-field,
  .toolbar .select-field,
  .toolbar-action,
  .toolbar .icon-button {
    width: 100%;
    flex-basis: auto;
  }

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

  .metric {
    min-height: 92px;
    padding: 14px;
  }

  .metric span {
    font-size: 10px;
  }

  .metric strong {
    font-size: 25px;
  }

  .ticket-detail {
    min-height: 420px;
    padding: 14px;
  }

  .ticket-list {
    min-height: 260px;
    max-height: 390px;
  }

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

  .detail-header h2 {
    font-size: 22px;
  }

  .grid-form,
  .plan-feature-grid,
  .plan-limit-grid {
    grid-template-columns: 1fr;
  }

  .form-actions .primary-button,
  .form-actions .ghost-button,
  .response-footer .primary-button {
    width: 100%;
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }

  .operation-map,
  .operation-map-layout {
    min-height: 380px;
  }

  .login-view {
    padding: 16px;
  }

  .login-panel {
    padding: 26px 22px;
  }

  .login-panel::before {
    height: 96px;
    margin-bottom: 24px;
  }
}
.commercial-admin-view {
  display: grid;
  gap: 20px;
}

.commercial-toolbar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
}

.commercial-toolbar .primary-button {
  width: 220px;
  justify-self: end;
}

.muted-copy,
.panel-heading p,
.commercial-record p {
  color: var(--muted);
}

.commercial-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.commercial-tab {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.commercial-tab.active {
  border-color: var(--gold);
  background: rgba(255, 196, 0, 0.12);
  color: var(--gold);
}

.commercial-card-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.commercial-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.record-title,
.record-facts,
.record-actions,
.dialog-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.record-title {
  justify-content: space-between;
  font-size: 1.05rem;
}

.record-facts {
  flex-wrap: wrap;
  margin-top: 10px;
}

.record-facts span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
}

.record-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 310px;
}

.compact-action {
  min-height: 42px;
  width: auto;
  padding-inline: 15px;
}

.agreement-line {
  margin: 10px 0 0;
}

.commercial-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  padding: 24px;
}

.commercial-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.small-dialog {
  width: min(580px, calc(100vw - 28px));
}

.dialog-heading {
  justify-content: space-between;
}

.dialog-heading h2 {
  margin: 4px 0 0;
}

.policy-box {
  padding: 14px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 196, 0, 0.08);
}

.policy-box p {
  margin-bottom: 0;
}

.form-error {
  min-height: 1.2em;
  color: #ff7676;
}

.danger-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 107, 107, 0.7);
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.12);
  color: #ff8b8b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.danger-button:hover {
  border-color: #ff8b8b;
  background: rgba(255, 107, 107, 0.2);
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-active,
.status-orderCreated,
.status-paid { color: #5ee0a0; }
.status-pending,
.status-pendingApproval,
.status-pendingReview,
.status-requested,
.status-released { color: var(--gold); }
.status-rejected,
.status-terminated,
.status-canceled { color: #ff7676; }

@media (max-width: 760px) {
  .commercial-toolbar,
  .commercial-record {
    grid-template-columns: 1fr;
  }
  .record-actions {
    justify-content: stretch;
    max-width: none;
  }
  .record-actions > * {
    flex: 1 1 150px;
  }
}
