:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #68707a;
  --line: #d9dee5;
  --soft: #f5f7fa;
  --panel: #ffffff;
  --primary: #12665a;
  --primary-strong: #0b4d44;
  --warning: #a26213;
  --danger: #ad3434;
  --approved: #26734d;
  --shadow: 0 12px 30px rgba(31, 42, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eef2f5;
  font-family: Arial, Helvetica, sans-serif;
}

.is-hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 70px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 6px;
  min-height: 30px;
  padding: 4px 8px;
  color: var(--primary);
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
}

.password-toggle:hover {
  color: #fff;
  background: var(--primary);
}

.auth-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: #eef2f5;
}

.auth-card {
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-tab {
  color: var(--ink);
  background: transparent;
}

.auth-tab:hover,
.auth-tab.active {
  color: #fff;
  background: var(--primary);
}

.auth-copy,
.user-line {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.signature-preview,
.signature-image {
  display: block;
  width: min(260px, 100%);
  max-height: 110px;
  object-fit: contain;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  font-size: 16px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 8px;
  min-width: 420px;
}

.status-strip span {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-strip strong {
  color: var(--ink);
  font-size: 20px;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 94px);
}

.sidebar {
  padding: 18px;
  background: #26343b;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 10px 12px;
  color: #e8eef1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.nav-button:hover,
.nav-button.active {
  background: #34464e;
  border-color: #4b626c;
}

.content {
  padding: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.permit-form,
.permit-card,
.dialog-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.permit-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd3dc;
  border-radius: 6px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 102, 90, 0.12);
}

.requirements {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #fbf6e8;
  border: 1px solid #e7d9b8;
  border-radius: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 10px;
  color: #39434a;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.checklist-block {
  display: grid;
  gap: 10px;
}

.checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.check-item input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.precaution-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.precaution-choice label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 42px;
  padding: 10px 16px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--primary-strong);
}

.secondary-button {
  color: var(--ink);
  background: #e6ebef;
}

.secondary-button:hover {
  background: #d7dee5;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #8d2929;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--ink);
  background: #edf1f4;
}

.permit-list {
  display: grid;
  gap: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-tab {
  flex: 1;
  min-height: 38px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.admin-tab.active {
  color: #fff;
  background: var(--primary);
}

.admin-panel {
  margin-top: 14px;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
}

.responsive-table table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.responsive-table th,
.responsive-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-notifications {
  display: grid;
  gap: 12px;
}

.notification-item {
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #7d8790;
  border-radius: 8px;
  cursor: pointer;
}

.notification-item.unread {
  border-left-color: var(--danger);
  background: #fff8f5;
}

.permit-card {
  padding: 16px;
}

.compact-card {
  box-shadow: none;
}

.quick-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.admin-filter-bar {
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(120px, 180px));
}

.permit-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.permit-title {
  margin: 0 0 4px;
  font-size: 18px;
}

.permit-meta,
.history {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-badge {
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--warning);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-approved {
  background: var(--approved);
}

.status-rejected {
  background: var(--danger);
}

.status-expiring {
  display: inline-block;
  margin-right: 6px;
  background: #a26213;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-card {
  display: grid;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 16px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--primary);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.dashboard-card strong {
  font-size: 28px;
}

.dashboard-card.status-draft { border-left-color: #68707a; }
.dashboard-card.status-manager_review,
.dashboard-card.status-submitted { border-left-color: #a26213; }
.dashboard-card.status-client_review { border-left-color: #7b4bb3; }
.dashboard-card.status-approved { border-left-color: #26734d; background: var(--panel); }
.dashboard-card.status-active { border-left-color: #12665a; }
.dashboard-card.status-suspended,
.dashboard-card.status-sent_back,
.dashboard-card.status-expiring { border-left-color: #bf7c1f; }
.dashboard-card.status-closed { border-left-color: #3b4850; }
.dashboard-card.status-rejected,
.dashboard-card.status-cancelled,
.dashboard-card.status-expired { border-left-color: #ad3434; background: var(--panel); }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 170px;
  gap: 10px;
  margin-bottom: 14px;
}

.permit-filter-bar {
  grid-template-columns: minmax(260px, 1fr) 190px 170px auto;
}

.clear-permit-filters {
  min-width: 76px;
  white-space: nowrap;
}

.company-delete-dialog {
  width: min(560px, calc(100vw - 32px));
}

.create-user-dialog {
  width: min(720px, calc(100vw - 32px));
}

.destructive-warning {
  padding: 14px 16px;
  border: 1px solid #efb1b1;
  border-left: 4px solid #c63f48;
  border-radius: 8px;
  color: #79252b;
  background: #fff5f5;
}

.destructive-warning p {
  margin: 6px 0 0;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed #b8c2cc;
  border-radius: 8px;
  text-align: center;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(20, 27, 31, 0.45);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-action-details {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  white-space: pre-line;
}

.app-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(20, 27, 31, 0.16);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

#appActionMessage {
  white-space: pre-wrap;
  line-height: 1.5;
}

#appActionInputLabel input {
  width: 100%;
}

.app-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-notice.is-error {
  border-color: #b42318;
  color: #b42318;
}

#dialogBody {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 880px) {
  .app-header,
  .section-head,
  .permit-top {
    align-items: stretch;
    flex-direction: column;
  }

  .status-strip {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .nav-button {
    margin-bottom: 0;
    text-align: center;
  }

  .form-grid,
  .checklist,
  .settings-grid,
  .dashboard-grid,
  .filter-bar,
  .admin-filter-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-header,
  .content {
    padding: 16px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }
}

/* Admin enterprise portal */
.ui-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-brand {
  display: none;
}

.admin-portal-shell {
  min-height: 100vh;
  background: #f3f6f7;
  color: #173038;
}

.admin-portal-shell .app-header {
  position: sticky;
  top: 0;
  z-index: 18;
  min-height: 68px;
  margin-left: 244px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid #dce5e7;
  box-shadow: none;
}

.admin-portal-shell .brand-lockup,
.admin-portal-shell #activeRigButton,
.admin-portal-shell .logout-button {
  display: none !important;
}

.platform-admin-shell #companyDisplay { display: none !important; }

.admin-portal-shell .global-search-shell {
  position: relative;
  display: block;
  width: min(720px, 100%);
  margin-right: auto;
}

.admin-portal-shell .global-search-toggle {
  display: none;
}

.admin-portal-shell .global-search-field {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #d4e0e2;
  border-radius: 10px;
  background: #f8fafb;
  color: #70858b;
}

.admin-portal-shell .global-search-field:focus-within {
  border-color: #138a86;
  box-shadow: 0 0 0 3px rgba(19, 138, 134, 0.12);
  background: #fff;
}

.admin-portal-shell .global-search-field input {
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.admin-portal-shell .global-search-clear {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #71868b;
}

.admin-portal-shell .global-search-results {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  z-index: 30;
  max-height: min(60vh, 520px);
  overflow: auto;
  padding: 8px;
  border: 1px solid #d7e2e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(18, 52, 57, 0.16);
}

.admin-portal-shell .header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-portal-shell .header-notification,
.admin-portal-shell .user-control {
  min-height: 42px;
  border: 1px solid #d8e3e5;
  background: #fff;
  color: #173038;
}

.admin-portal-shell .header-notification {
  position: relative;
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

.admin-portal-shell .notification-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d94343;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.admin-portal-shell .user-control {
  display: grid;
  grid-template-columns: 34px minmax(110px, auto) 16px;
  gap: 9px;
  align-items: center;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  text-align: left;
}

.admin-portal-shell .avatar,
.person-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #d9efed;
  color: #0a6664;
  font-size: 13px;
  font-weight: 800;
  object-fit: cover;
}

.avatar-tone-1 { background: #e5ebfb; color: #3658a8; }
.avatar-tone-2 { background: #efe5fb; color: #7044a0; }
.avatar-tone-3 { background: #f9e8dc; color: #a35526; }
.avatar-tone-4 { background: #e2f1df; color: #35763b; }
.avatar-tone-5 { background: #f6e4e8; color: #9d4054; }

.admin-portal-shell .user-identity {
  display: grid;
  gap: 1px;
  line-height: 1.2;
}

.admin-portal-shell .user-level {
  color: #70848a;
  font-size: 11px;
}

.admin-portal-shell .header-user-menu {
  position: absolute;
  top: 52px;
  right: 0;
  z-index: 32;
  width: 190px;
  padding: 7px;
  border: 1px solid #d8e3e5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(14, 47, 52, 0.16);
}

.admin-portal-shell .header-user-menu button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #173038;
  text-align: left;
}

.admin-portal-shell .header-user-menu button:hover {
  background: #edf6f5;
}

.admin-portal-shell .app-shell {
  display: block;
  min-height: calc(100vh - 68px);
  margin-left: 244px;
}

.admin-portal-shell .sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 22;
  width: 244px;
  height: 100vh;
  padding: 18px 14px;
  overflow-y: auto;
  background: #0d3439;
  border: 0;
  box-shadow: none;
}

.admin-portal-shell .sidebar-brand {
  min-height: 48px;
  margin: 0 8px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-portal-shell .sidebar-logo {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: #69d6ce;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-portal-shell .nav-button {
  width: 100%;
  min-height: 46px;
  margin: 0 0 5px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #c8d8da;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.admin-portal-shell .nav-button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.admin-portal-shell .nav-button.active {
  border-color: #2ba9a2;
  background: #138a86;
  color: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.13);
}

.admin-portal-shell .nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: inherit;
}

.admin-portal-shell .content {
  width: 100%;
  max-width: none;
  padding: 30px clamp(22px, 3vw, 42px) 48px;
  overflow: visible;
}

.admin-portal-shell #adminView > .permit-form,
.admin-portal-shell #clientadminView > .permit-form {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-portal-shell .admin-panel {
  display: grid;
  gap: 22px;
}

.admin-portal-shell .admin-page-header {
  min-height: 68px;
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.admin-portal-shell .admin-page-header .eyebrow {
  margin: 0 0 5px;
  color: #16847f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-portal-shell .admin-page-header h2 {
  margin: 0;
  color: #112e36;
  font-size: clamp(25px, 2.2vw, 32px);
  line-height: 1.15;
}

.admin-portal-shell .admin-page-header p:not(.eyebrow) {
  margin: 7px 0 0;
  color: #6c8086;
  font-size: 14px;
}

.admin-portal-shell .admin-filter-bar {
  width: auto;
  margin: 0 0 18px auto;
  justify-content: flex-end;
  gap: 9px;
  border: 0;
  background: transparent;
}

.admin-portal-shell .admin-filter-bar select {
  min-width: 150px;
  height: 42px;
  border-color: #d5e0e2;
  background: #fff;
}

.admin-data-table,
.admin-portal-shell .dashboard-panel,
.admin-portal-shell .company-settings-card,
.admin-portal-shell .settings-option-card,
.admin-portal-shell .license-card {
  overflow: hidden;
  border: 1px solid #dbe5e7;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(18, 50, 56, 0.045);
}

.admin-data-table table {
  min-width: 760px;
  border-collapse: collapse;
}

.admin-data-table th {
  height: 48px;
  padding: 12px 18px;
  border: 0;
  background: #f7f9fa;
  color: #64787e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.admin-data-table td {
  min-height: 64px;
  padding: 14px 18px;
  border: 0;
  border-top: 1px solid #e7edef;
  color: #263e45;
  vertical-align: middle;
}

.admin-data-table tbody tr:hover {
  background: #fbfdfd;
}

.identity-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 150px;
}

.identity-cell > div {
  display: grid;
  gap: 2px;
}

.identity-cell > div > span,
.license-card-head .identity-cell span {
  color: #70848a;
  font-size: 12px;
}

.role-badge,
.soft-status {
  width: max-content;
  max-width: 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: capitalize;
}

.role-holder { background: #e4f4e7; color: #287238; }
.role-authorizer { background: #eee8f8; color: #69449a; }
.role-client { background: #e4f0fb; color: #286a9c; }
.role-client_admin { background: #dff2f0; color: #116b68; }
.role-admin { background: #e8edef; color: #344e55; }
.status-pending, .status-expiring { background: #fff1d8; color: #94600b; }
.status-active, .status-approved { background: #e3f4e7; color: #247038; }
.status-disabled, .status-rejected, .status-expired { background: #fae7e7; color: #a23d3d; }
.status-review, .status-open { background: #e5f0fa; color: #286b9e; }

.audit-severity-badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.audit-severity-informational { background: #e7f0f3; color: #48656d; }
.audit-severity-warning { background: #fff1d8; color: #94600b; }
.audit-severity-security { background: #fae7e7; color: #a23d3d; }

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.icon-action {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d8e3e5;
  border-radius: 8px;
  background: #fff;
  color: #456269;
}

.icon-action:hover:not(:disabled) {
  border-color: #79bcb8;
  background: #edf7f6;
  color: #0c7773;
}

.icon-action.approve { color: #28743c; }
.icon-action.danger { color: #ad4444; }
.icon-action:disabled { opacity: 0.45; }
.icon-previous { transform: rotate(180deg); }

.table-footer {
  min-height: 54px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e4ebed;
  color: #6c8086;
  font-size: 12px;
}

.table-pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-empty-state {
  min-height: 240px;
  padding: 32px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 1px dashed #c9d8da;
  border-radius: 14px;
  background: #fff;
  color: #71858a;
  text-align: center;
}

.admin-empty-state strong { color: #29434a; font-size: 17px; }
.admin-empty-state .empty-state-icon { width: 32px; height: 32px; color: #188b86; }

.admin-portal-shell .dashboard-grid.admin-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-portal-shell .dashboard-card {
  min-height: 112px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid #dce5e7;
  border-left: 3px solid #168b86;
  border-radius: 12px;
  background: #fff;
  color: #213a41;
  text-align: left;
  box-shadow: 0 3px 12px rgba(17, 49, 55, 0.04);
}

.admin-portal-shell .dashboard-card:hover {
  transform: translateY(-1px);
  border-color: #9bc9c6;
  box-shadow: 0 8px 22px rgba(17, 49, 55, 0.08);
}

.admin-portal-shell .kpi-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e4f3f2;
  color: #0c817c;
}

.admin-portal-shell .kpi-icon .ui-icon { width: 24px; height: 24px; }
.admin-portal-shell .kpi-content { display: grid; gap: 5px; }
.admin-portal-shell .kpi-content span { color: #5f747a; font-size: 13px; }
.admin-portal-shell .kpi-content strong { color: #12333a; font-size: 28px; line-height: 1; }

.admin-portal-shell .platform-admin-dashboard-columns,
.admin-portal-shell .client-admin-dashboard-columns {
  gap: 16px;
}

.admin-portal-shell .dashboard-panel {
  padding: 0;
}

.admin-portal-shell .dashboard-panel-head {
  min-height: 56px;
  padding: 14px 18px;
  border-bottom: 1px solid #e3eaec;
}

.admin-portal-shell .dashboard-list-row {
  width: 100%;
  min-height: 58px;
  padding: 11px 18px;
  border: 0;
  border-bottom: 1px solid #edf1f2;
  background: #fff;
  color: #213b42;
  text-align: left;
}

.admin-portal-shell .dashboard-list-row:hover:not(.static) { background: #f6fbfa; }
.admin-portal-shell .dashboard-list-row small { display: block; margin-top: 3px; color: #71858a; }

.license-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.license-card { padding: 20px; }
.license-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.license-metrics { margin: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.license-metrics span { padding: 12px; display: grid; gap: 4px; border-radius: 9px; background: #f5f8f9; }
.license-metrics small { color: #71858a; }
.license-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e3eaec; }
.license-details summary { cursor: pointer; color: #126f6c; font-weight: 750; }
.license-form-grid { margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.license-form-grid label { display: grid; gap: 5px; color: #60757b; font-size: 12px; }
.license-form-grid input { width: 100%; }
.license-card .history { margin-top: 14px; color: #6b7f85; font-size: 12px; line-height: 1.65; }
.license-file-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: end;
}
.license-file-form label,
.license-upload-row label { display: grid; gap: 6px; color: #526970; font-size: 12px; font-weight: 700; }
.license-file-form .full-field { grid-column: 1 / -1; }
.license-file-form button { min-height: 44px; }
.license-file-form .field-help { margin: 0; color: #6b7f85; font-size: 12px; line-height: 1.5; }

.company-settings-stack { display: grid; gap: 16px; }
.subscription-activation-card {
  padding: 20px;
  overflow: hidden;
  border: 1px solid #dbe5e7;
  border-radius: 14px;
  background: #fff;
}
.subscription-activation-head { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; }
.subscription-activation-head p { margin: 5px 0 0; color: #70848a; }
.subscription-activation-card .license-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.license-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.license-upload-row input { width: 100%; }
.subscription-activation-card > .field-help { margin: 12px 0 0; color: #6b7f85; font-size: 12px; }

.company-settings-card { padding: 22px; }
.company-settings-identity { margin-bottom: 22px; display: flex; align-items: center; gap: 14px; }
.company-settings-identity .person-avatar,
.company-logo-large { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.company-settings-identity h3 { margin: 0 0 6px; font-size: 21px; }
.settings-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-form-grid label { display: grid; gap: 7px; }
.settings-form-grid .full-field { grid-column: 1 / -1; }
.company-settings-card > button { margin-top: 16px; }

.settings-option-card {
  padding: 20px;
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  align-items: center;
  gap: 15px;
}
.settings-option-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: #e5f4f2; color: #0e7d79; }
.settings-option-card p { margin: 5px 0 0; color: #70848a; }
.switch-control { display: flex; align-items: center; gap: 7px; }

.admin-portal-shell .notification-item {
  min-height: 70px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #dce6e8;
  border-radius: 12px;
  background: #fff;
}
.notification-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #e5f3f2; color: #0e7d79; }

.admin-portal-shell button:focus-visible,
.admin-portal-shell input:focus-visible,
.admin-portal-shell select:focus-visible,
.admin-portal-shell textarea:focus-visible,
.admin-portal-shell summary:focus-visible {
  outline: 3px solid rgba(19, 138, 134, 0.24);
  outline-offset: 2px;
}

@media (max-width: 1240px) {
  .admin-portal-shell .dashboard-grid.admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-portal-shell .platform-admin-dashboard-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .admin-portal-shell .app-header { margin-left: 0; padding-left: 64px; }
  .admin-portal-shell .app-shell { margin-left: 0; }
  .admin-portal-shell .sidebar { transform: translateX(-100%); transition: transform 180ms ease; }
  .admin-portal-shell:not(.sidebar-collapsed) .sidebar { transform: translateX(0); }
  .admin-portal-shell.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  .admin-portal-shell .brand-lockup { position: absolute; left: 14px; display: block !important; }
  .admin-portal-shell .brand-lockup > div { display: none; }
  .admin-portal-shell .menu-button { display: grid; }
  .admin-portal-shell .global-search-shell { width: 100%; }
  .admin-portal-shell .client-admin-dashboard-columns { grid-template-columns: 1fr; }
  .admin-portal-shell .content { padding: 24px 18px 40px; }
}

@media (max-width: 680px) {
  .admin-portal-shell .app-header { min-height: 62px; padding: 9px 12px 9px 58px; gap: 8px; }
  .admin-portal-shell .global-search-shell { width: 42px; margin-right: auto; }
  .admin-portal-shell .global-search-toggle { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #d8e3e5; border-radius: 9px; background: #fff; color: #173038; }
  .admin-portal-shell .global-search-field { display: none; }
  .admin-portal-shell .global-search-shell.is-open { position: absolute; left: 58px; right: 12px; width: auto; }
  .admin-portal-shell .global-search-shell.is-open .global-search-toggle { display: none; }
  .admin-portal-shell .global-search-shell.is-open .global-search-field { display: flex; }
  .admin-portal-shell .user-control { grid-template-columns: 34px 14px; min-width: 56px; }
  .admin-portal-shell .user-identity { display: none; }
  .admin-portal-shell .admin-page-header { min-height: auto; flex-direction: column; }
  .admin-portal-shell .admin-filter-bar { width: 100%; margin: 0 0 14px; display: grid; grid-template-columns: 1fr; }
  .admin-portal-shell .admin-filter-bar select { width: 100%; }
  .admin-portal-shell .dashboard-grid.admin-kpi-grid { grid-template-columns: 1fr; }
  .admin-portal-shell .platform-admin-dashboard-columns { grid-template-columns: 1fr; }
  .license-grid { grid-template-columns: 1fr; }
  .license-form-grid, .settings-form-grid, .license-file-form, .license-upload-row { grid-template-columns: 1fr; }
  .subscription-activation-card .license-metrics { grid-template-columns: 1fr; }
  .subscription-activation-head { grid-template-columns: 42px 1fr; }
  .subscription-activation-head > .soft-status { grid-column: 1 / -1; width: fit-content; }
  .settings-option-card { grid-template-columns: 42px 1fr; }
  .settings-option-card .switch-control, .settings-option-card button { grid-column: 1 / -1; }
  .admin-data-table { max-width: calc(100vw - 36px); overflow-x: auto; }
  .table-footer { position: sticky; left: 0; }
}

/* Direct admin navigation and compact control-center layouts */
.sidebar { overflow-y: auto; overscroll-behavior: contain; }

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
  padding: 4px 0 14px;
  border-bottom: 1px solid #dce6e8;
}

.admin-page-header h2,
.admin-page-header p { margin: 0; }
.admin-page-header h2 { margin-top: 2px; color: #12343b; font-size: 26px; }
.admin-page-header p:not(.eyebrow) { margin-top: 5px; color: #60737a; }
.page-header-actions { display: flex; align-items: center; gap: 10px; }
.quick-actions, .kpi-group { margin-bottom: 18px; }
.quick-actions { padding: 16px; background: #fff; border: 1px solid #dce6e8; border-radius: 10px; }
.quick-actions h3, .kpi-group h3 { margin: 0 0 12px; color: #23454c; font-size: 15px; }

.client-admin-dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.dashboard-main-column,
.dashboard-side-column { display: grid; gap: 18px; min-width: 0; }
.platform-admin-dashboard-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.dashboard-list-row {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  color: #18363d;
  text-align: left;
  background: #fff;
  border: 0;
  border-top: 1px solid #e4ecee;
  border-radius: 0;
}

.dashboard-list-row:not(.static):hover { color: #086f6b; background: #f4f9f9; }
.dashboard-list-row span, .dashboard-list-row small { display: block; }
.dashboard-list-row small { margin-top: 3px; color: #6b7e84; }
.page-filter-bar { grid-template-columns: minmax(240px, 1fr) minmax(170px, 220px) minmax(170px, 220px) auto !important; margin-bottom: 16px; }
#adminView, #clientadminView { min-width: 0; }
#adminView > .permit-form, #clientadminView > .permit-form { width: 100%; }

@media (max-width: 1100px) {
  .client-admin-dashboard-columns,
  .platform-admin-dashboard-columns { grid-template-columns: 1fr; }
  .page-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 720px) {
  .admin-page-header,
  .page-header-actions { align-items: stretch; flex-direction: column; }
  .admin-page-header h2 { font-size: 22px; }
  .page-filter-bar { grid-template-columns: 1fr !important; }
  #adminView .card-actions,
  #clientadminView .card-actions { align-items: stretch; flex-direction: column; }
  #adminView .card-actions button,
  #clientadminView .card-actions button { width: 100%; }
}

/* The dashboard renderer owns the inner grid. Keep its host full width so the
   whole dashboard is not placed into the first track of the legacy grid. */
#dashboardGrid {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
}

#dashboardGrid .dashboard-layout {
  width: 100%;
  min-width: 0;
}

/* Shared enterprise shell */
.app-header {
  min-height: 74px;
  padding: 12px 28px;
}

.brand-lockup,
.header-actions,
.header-control,
.logout-button {
  display: flex;
  align-items: center;
}

.brand-lockup { gap: 14px; }
.brand-lockup .eyebrow { margin: 0 0 2px; }
.brand-lockup h1 { margin: 0; }
.menu-button { width: 40px; min-height: 40px; padding: 0; color: #243943; background: transparent; border: 0; font-size: 22px; }
.menu-button:hover { color: var(--primary); background: #edf6f5; }
.header-actions { justify-content: flex-end; gap: 12px; }
.global-search-shell { position: relative; flex: 1 1 420px; max-width: 620px; min-width: 220px; }
.global-search-field { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 11px; color: #60737a; background: #f7faf9; border: 1px solid #d4e0de; border-radius: 10px; }
.global-search-field:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22, 130, 126, .12); }
.global-search-field input { min-width: 0; flex: 1; padding: 0; color: #18373b; background: transparent; border: 0; outline: 0; }
.global-search-clear, .global-search-toggle { display: grid; place-items: center; width: 28px; min-height: 28px; padding: 0; color: #60737a; background: transparent; border: 0; box-shadow: none; }
.global-search-clear:hover, .global-search-toggle:hover { color: var(--primary); background: #e6f2f0; }
.global-search-toggle { display: none; }
.global-search-results { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; left: 0; max-height: min(56vh, 460px); overflow: auto; padding: 6px; background: #fff; border: 1px solid #cbd9d7; border-radius: 10px; box-shadow: 0 16px 32px rgba(16, 48, 54, .18); }
.global-search-result { display: grid; grid-template-columns: 92px minmax(0, 1fr); width: 100%; gap: 10px; padding: 10px; color: #1b3439; text-align: left; background: transparent; border: 0; border-radius: 7px; box-shadow: none; }
.global-search-result:hover, .global-search-result:focus-visible { background: #ecf7f5; }
.global-search-result-type { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.global-search-result strong, .global-search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search-result small { margin-top: 3px; color: #61747a; font-size: 12px; }
.global-search-empty { padding: 16px; color: #60737a; text-align: center; }
.header-control { min-height: 44px; gap: 10px; padding: 0 14px; color: #1c2d36; background: #fff; border: 1px solid #d9e2e4; border-radius: 9px; }
#companyDisplay > .header-icon { display: none; }
.company-logo-compact,
.company-branding {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 30px;
  overflow: hidden;
  color: #0c6f70;
  background: #e7f3f1;
  border: 1px solid #d2e3e1;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}
.company-logo-compact img,
.company-branding img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.company-branding.permit-company-branding { width: 62px; height: 38px; }
.company-branding.board-company-branding { width: 52px; height: 34px; }
.company-branding.company-settings-logo-branding { width: 88px; height: 58px; }
.company-branding.admin-company-branding { width: 38px; height: 32px; }
.header-icon { color: var(--primary); font-size: 20px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; color: #75858a; background: #eef2f3; border: 1px solid #d5dfe1; border-radius: 50%; font-size: 15px; }
.user-identity { display: inline-flex; align-items: baseline; gap: 7px; min-width: 0; white-space: nowrap; }
.user-level { color: #6b7b81; font-size: 12px; font-weight: 600; }
.user-level::before { content: "•"; margin-right: 7px; color: #a1afb3; }
.logout-button { gap: 7px; min-height: 42px; padding: 0 8px; color: #33464d; background: transparent; border: 0; font-size: 14px; }
.logout-button:hover { color: var(--primary); }

.rig-control { cursor: pointer; }
.rig-control:disabled { cursor: default; opacity: .7; }
#activeRigDialog { width: min(460px, calc(100vw - 32px)); border: 0; padding: 0; background: transparent; }
#activeRigDialog::backdrop { background: rgba(10, 34, 38, .48); }
#activeRigForm { display: grid; gap: 16px; }
#activeRigForm select { width: 100%; }
.admin-panel .form-grid { margin-bottom: 18px; align-items: end; }
#rigManagementDialog { width: min(680px, calc(100vw - 32px)); border: 0; padding: 0; background: transparent; }
#rigManagementDialog::backdrop { background: rgba(10, 34, 38, .48); }
#rigManagementBody { display: grid; gap: 12px; max-height: min(62vh, 620px); overflow: auto; }
.rig-user-group { padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.rig-user-group h3 { margin: 0 0 8px; font-size: 15px; }
.text-button { border: 0; background: transparent; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; padding: 2px 5px; }

.sidebar { background: #fff; border-right: 1px solid #dce5e7; }
.nav-button { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 10px 14px; color: #263943; background: transparent; border-color: transparent; font-size: 14px; font-weight: 600; }
.nav-icon { display: inline-grid; place-items: center; width: 22px; color: #52676d; font-size: 20px; line-height: 1; }
.nav-button:hover { color: #14383e; background: #edf6f5; border-color: #d5e8e6; box-shadow: none; }
.nav-button:hover .nav-icon { color: var(--primary); }
.nav-button.active { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: none; }
.nav-button.active .nav-icon { color: #fff; }
.content { max-width: none; min-width: 0; }

.dashboard-status-grid { grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 18px; }
.dashboard-card { display: flex; align-items: center; gap: 16px; width: auto; min-width: 0; min-height: 118px; padding: 20px; background: #fff; border: 1px solid #dce5e7; border-left-width: 1px; border-radius: 11px; text-align: left; }
.dashboard-card .kpi-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; color: var(--primary); border: 2px solid currentColor; border-radius: 50%; font-size: 22px; font-weight: 700; }
.dashboard-card .kpi-content { display: grid; gap: 6px; min-width: 0; }
.dashboard-card .kpi-content > span { color: #293b42; font-size: 14px; white-space: normal; }
.dashboard-card strong { font-size: 32px; line-height: 1; }
.dashboard-card.status-manager_review .kpi-icon { color: #cf8b10; }
.dashboard-card.status-client_review .kpi-icon { color: #147eb4; }
.dashboard-card.status-approved .kpi-icon { color: #26804f; }
.dashboard-card.status-active .kpi-icon { color: #147d83; }
.dashboard-card.status-expiring .kpi-icon { color: #c94b32; }
.dashboard-card.status-subscription .kpi-icon { color: #147d83; }
.dashboard-card.status-expiring { background: #fff; }
.dashboard-card .kpi-icon .ui-icon { width: 23px; height: 23px; }

.dashboard-content-grid { grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr); gap: 22px; }
.dashboard-panel { border-radius: 10px; }
.dashboard-table { width: 100%; }
.dashboard-table th { color: #60737a; font-size: 11px; letter-spacing: .06em; }
.dashboard-table td { min-height: 58px; padding: 16px 14px; }
.dashboard-permit-row { cursor: pointer; }
.dashboard-permit-row:hover td { background: #f3f9f9; }
.dashboard-permit-row:focus-visible { outline: 3px solid rgba(20, 125, 121, 0.35); outline-offset: -3px; }
.table-action { color: #126d78; background: #fff; border: 1px solid #76aeb3; border-radius: 6px; }
.table-action:hover, .table-action:focus-visible { color: #fff; background: var(--primary); }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 9px; color: #385057; background: #eef3f3; border-radius: 7px; font-size: 11px; font-weight: 700; }
.status-badge.status-submitted, .status-badge.status-manager_review, .status-badge.status-changes_requested { color: #8a5a06; background: #fff4d8; }
.status-badge.status-client_review { color: #176b93; background: #e5f3fb; }
.status-badge.status-client_approved { color: #86620a; background: #fff2c7; }
.status-badge.status-approved { color: #26733f; background: #e6f4e9; }
.status-badge.status-active { color: #176c70; background: #e1f3f1; }
.status-badge.status-suspended { color: #9a5b14; background: #fff0d8; }
.status-badge.status-rejected, .status-badge.status-cancelled, .status-badge.status-expired { color: #a03d3d; background: #fbe9e9; }
.status-badge.status-closed { color: #536268; background: #edf1f2; }
.status-badge.status-superseded { color: #67557f; background: #f0ecf7; }

.timeline-permit-group { border-bottom: 1px solid #e1e9ea; }
.timeline-permit-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 64px; padding: 12px 16px; color: #1e343b; background: #fff; border: 0; text-align: left; }
.timeline-permit-toggle:hover, .timeline-permit-toggle:focus-visible { background: #f4f9f8; }
.timeline-permit-toggle > span:first-child { display: grid; gap: 4px; min-width: 0; }
.timeline-permit-toggle small { overflow: hidden; color: #718087; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-chevron { color: var(--primary); font-size: 20px; transition: transform .15s ease; }
.timeline-permit-group.expanded .timeline-chevron { transform: rotate(180deg); }
.dashboard-timeline-events { padding: 4px 16px 18px 24px; }
.timeline-permit-heading { display: grid; gap: 3px; padding: 10px 0 12px 34px; color: #24464e; }
.timeline-permit-heading span { color: #718087; font-size: 12px; }
.dashboard-timeline-event { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.dashboard-timeline-event:not(:last-child)::after { position: absolute; top: 30px; left: 11px; width: 2px; height: calc(100% - 8px); background: #d7e6e6; content: ""; }
.dashboard-timeline-event strong, .dashboard-timeline-event small, .dashboard-timeline-event p { display: block; margin: 0; }
.dashboard-timeline-event small { margin-top: 3px; color: #718087; font-size: 11px; }
.dashboard-timeline-event p { margin-top: 5px; color: #52676d; font-size: 12px; }
.timeline-dot.returned { color: #8a5a06; background: #fff4d8; border-color: #f1d28c; }
.timeline-dot.rejected { color: #a03d3d; background: #fbe9e9; border-color: #efbaba; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 0; color: #60737a; }
.view-state { min-height: 20px; margin: 6px 0; color: #718087; font-size: 12px; }
.loading-state { padding: 28px; color: #60737a; background: #fff; border: 1px solid #dce5e7; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sidebar-collapsed .sidebar { width: 76px; padding-inline: 12px; }
.sidebar-collapsed .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
.sidebar-collapsed .nav-button { justify-content: center; padding-inline: 8px; font-size: 0; }
.sidebar-collapsed .nav-icon { font-size: 20px; }

@media (max-width: 1180px) {
  .dashboard-status-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .dashboard-content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app-header { padding: 12px 16px; }
  .global-search-shell { order: 3; flex: 0 0 auto; min-width: 0; }
  .global-search-toggle { display: grid; }
  .global-search-field { display: none; }
  .global-search-shell.is-open .global-search-field { display: flex; position: absolute; z-index: 51; top: calc(100% + 8px); right: 0; width: min(78vw, 360px); box-shadow: 0 14px 28px rgba(16, 48, 54, .18); }
  .global-search-shell.is-open .global-search-results { top: calc(100% + 58px); width: min(90vw, 420px); left: auto; }
  .header-control { padding-inline: 9px; }
  .header-control > span:not(.header-icon):not(.avatar), .logout-button { font-size: 0; }
  .user-identity > span { font-size: 0; }
  .header-actions { gap: 6px; }
  .dashboard-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #adminView .filter-bar,
  #adminView .admin-filter-bar:first-of-type,
  #adminView .admin-filter-bar + .admin-filter-bar,
  #clientadminView .filter-bar { grid-template-columns: 1fr; }
  .admin-section-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .dashboard-status-grid { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 100px; }
}

/* Shared component polish for every portal view */
.app-header {
  grid-template-columns: minmax(0, 1fr) auto;
}

.auth-form,
.settings-grid,
.admin-panel,
.permit-list,
#dialogBody,
.admin-action-details {
  color: var(--ink);
}

.auth-tabs,
.admin-tabs {
  background: #f1f7f7;
  border-color: #d7e5e6;
}

.auth-tab,
.admin-tab,
.client-admin-tab {
  min-height: 40px;
  padding: 9px 14px;
  color: #567078;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.auth-tab:hover,
.auth-tab.active,
.admin-tab:hover,
.admin-tab.active,
.client-admin-tab:hover,
.client-admin-tab.active {
  color: #fff;
  background: var(--primary);
}

.admin-tabs .client-admin-tab {
  flex: 1;
}

.check-item,
.check-line {
  border-color: #dce7e8;
  border-radius: 8px;
}

.check-item {
  background: #f5f9f9;
}

.check-line {
  color: #28474e;
}

.history {
  padding: 10px 0;
}

.notification-item {
  background: #fff;
  border-color: #dce6e8;
  border-left-color: #087e7a;
}

.notification-item.unread {
  background: #f1faf9;
  border-left-color: #d08b16;
}

.status-badge {
  color: #fff;
  background: #b47a08;
}

.status-approved {
  background: #26804f;
}

.status-rejected {
  background: #c44545;
}

.status-expiring {
  background: #b47a08;
}

.admin-action-details {
  background: #f4f9f9;
}

dialog .dialog-card {
  border-color: #d6e4e5;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(17, 45, 53, 0.2);
}

dialog::backdrop {
  background: rgba(12, 32, 38, 0.5);
}

.app-notice {
  border-radius: 10px;
}

#adminView .permit-form,
#clientadminView .permit-form {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#adminView .admin-tabs,
#clientadminView .admin-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 6px;
  padding: 7px;
  background: #fff;
  border: 1px solid #dce6e8;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

#adminView .admin-tab,
#clientadminView .client-admin-tab {
  color: #3f5960;
  border: 1px solid transparent;
}

#adminView .admin-tab:hover,
#adminView .admin-tab.active,
#clientadminView .client-admin-tab:hover,
#clientadminView .client-admin-tab.active {
  color: #fff;
  background: #087e7a;
  border-color: #087e7a;
}

#adminView .filter-bar,
#clientadminView .filter-bar {
  padding: 14px;
  background: #fff;
  border: 1px solid #dce6e8;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

#adminView .admin-panel,
#clientadminView .admin-panel {
  padding-top: 4px;
}

#adminView .admin-panel > h3,
#clientadminView .admin-panel > h3 {
  margin: 20px 0 14px;
  color: #12343b;
  font-size: 18px;
}

.admin-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 14px;
}

.admin-section-heading h3 { margin: 0; color: #12343b; font-size: 22px; }
.admin-kpi-grid { grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 14px; }
.admin-kpi-grid .dashboard-card { min-height: 104px; padding: 16px; }
.admin-kpi-grid .dashboard-card strong { font-size: 27px; }
.admin-kpi-grid .dashboard-card .kpi-icon { width: 36px; height: 36px; flex-basis: 36px; font-size: 18px; }
.admin-kpi-grid .dashboard-card .kpi-content > span { font-size: 12px; }

#adminView .filter-bar,
#clientadminView .filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 190px) minmax(150px, 190px); align-items: center; gap: 10px; }
#adminView .admin-filter-bar:first-of-type { grid-template-columns: minmax(0, 1fr) 170px 170px 190px; }
#adminView .admin-filter-bar + .admin-filter-bar { grid-template-columns: minmax(0, 1fr) 190px auto; }
#adminView .admin-panel,
#clientadminView .admin-panel { min-width: 0; }

#adminView .dashboard-card,
#clientadminView .dashboard-card {
  background: #fff;
}

#adminView .permit-card,
#clientadminView .permit-card {
  box-shadow: 0 6px 18px rgba(25, 50, 59, 0.05);
}

.dashboard-layout {
  display: grid;
  gap: 20px;
}

.dashboard-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

.archive-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.user-ptw-activity {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-ptw-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 7px;
  color: #294249;
  background: #eef5f5;
  border-radius: 6px;
  white-space: nowrap;
}

.user-ptw-stat strong {
  color: var(--primary);
}

.no-ptw-activity,
.activity-unavailable { color: #667a80; font-size: 12px; white-space: nowrap; }
.activity-unavailable { color: #9b5d13; }
.activity-range-controls,
.activity-panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.activity-range-controls label { display: inline-flex; align-items: center; gap: 6px; color: #60737a; font-size: 12px; }
.activity-range-controls select,
.activity-range-controls input { min-height: 36px; padding: 6px 9px; }
.activity-panel-head small { display: block; margin-top: 3px; color: #667a80; }
.job-workflow-control { display: flex; align-items: center; gap: 8px; min-width: 360px; }
.job-workflow-control select { min-width: 220px; }

.company-logo-manager { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin: 18px 0; padding: 16px; background: #f8fbfb; border: 1px solid #dce7e7; border-radius: 9px; }
.company-logo-preview { display: grid; place-items: center; width: 112px; height: 76px; overflow: hidden; background: #fff; border: 1px solid #d6e2e1; border-radius: 8px; }
.company-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.company-logo-preview .person-avatar { width: 48px; height: 48px; }
.company-logo-status strong,
.company-logo-status span { display: block; }
.company-logo-status span { margin-top: 4px; color: #64777d; font-size: 12px; }
.company-logo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.company-logo-selection { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding-top: 12px; border-top: 1px solid #dce7e7; }
.company-logo-selection img { width: 72px; height: 52px; object-fit: contain; background: #fff; border: 1px solid #d6e2e1; border-radius: 7px; }
.company-logo-selection .actions { justify-content: flex-start; margin: 8px 0 0; }
.permit-company-line,
.permit-board-company { display: flex; align-items: center; gap: 10px; }
.permit-company-line > span:last-child,
.permit-board-company > span:last-child { display: grid; gap: 2px; }
.permit-company-line small,
.permit-board-company small { color: #64777d; font-size: 11px; }
.permit-company-line strong { color: #0f6669; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.permit-board-heading { align-items: center; }
.permit-board-company { padding: 7px 10px; background: #fff; border: 1px solid #d9e4e4; border-radius: 9px; }
.user-information-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; white-space: normal; }
.user-information-grid > span { display: grid; gap: 3px; padding: 10px; background: #f7faf9; border: 1px solid #e0e8e7; border-radius: 7px; }
.user-information-grid small { color: #687b81; }
.user-activity-detail { white-space: normal; }
.user-activity-detail h3 { margin: 18px 0 9px; font-size: 14px; }
.user-activity-detail td small { display: block; max-width: 260px; margin-top: 3px; color: #687b81; }

@media (max-width: 760px) {
  .activity-panel-head { align-items: flex-start; flex-direction: column; }
  .activity-panel-actions,
  .activity-range-controls { justify-content: flex-start; }
  .job-workflow-control { min-width: 280px; flex-direction: column; align-items: stretch; }
  .company-logo-manager { grid-template-columns: 1fr; }
  .company-logo-preview { width: 100%; }
  .user-information-grid { grid-template-columns: 1fr; }
}

.platform-admin-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.platform-admin-recent-panel {
  min-width: 0;
}

.dashboard-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.dashboard-side-stack {
  display: grid;
  gap: 18px;
}

.dashboard-panel {
  overflow: hidden;
  background: #fff;
  border: 1px solid #dce6e8;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.dashboard-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #e1eaeb;
}

.dashboard-panel-head h3 {
  margin: 0;
  color: #12343b;
  font-size: 16px;
}

.dashboard-link {
  min-height: auto;
  padding: 0;
  color: #086f78;
  background: transparent;
  font-size: 12px;
}

.dashboard-link:hover {
  color: #04545b;
  background: transparent;
}

.dashboard-link span {
  padding-left: 4px;
  font-size: 18px;
  vertical-align: -1px;
}

.dashboard-table-wrap {
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 15px 16px;
  border-bottom: 1px solid #e6edef;
  text-align: left;
  white-space: nowrap;
}

.dashboard-table th {
  color: #6b7b82;
  background: #fbfdfd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-table td {
  color: #24434a;
  font-size: 12px;
}

.dashboard-table tr:last-child td {
  border-bottom: 0;
}

.table-action {
  min-height: 32px;
  padding: 6px 10px;
  color: #176b75;
  background: #fff;
  border: 1px solid #8ab9be;
  border-radius: 6px;
  font-size: 11px;
}

.table-action:hover {
  color: #fff;
  background: #087e7a;
}

.dashboard-timeline {
  padding: 14px 20px;
}

.dashboard-timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-height: 62px;
  padding: 10px 0;
  border-bottom: 1px solid #e6edef;
}

.dashboard-timeline-item:last-child {
  border-bottom: 0;
}

.dashboard-timeline-item strong {
  display: block;
  color: #213e45;
  font-size: 12px;
}

.dashboard-timeline-item small {
  display: block;
  margin-top: 4px;
  color: #718087;
  font-size: 11px;
}

.dashboard-timeline-item > span:last-child {
  color: #718087;
  font-size: 11px;
  text-align: right;
}

.timeline-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: #fff;
  background: #b7c5c7;
  border: 3px solid #e6eff0;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.timeline-dot.done {
  background: #26804f;
  border-color: #d7efdf;
}

.timeline-dot.pending {
  background: #1689a2;
  border-color: #d8eef2;
}

.handover-time {
  align-self: center;
  padding: 6px 8px;
  color: #17718a;
  background: #edf8fa;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
}

.dashboard-wide-action {
  width: calc(100% - 32px);
  min-height: 36px;
  margin: 0 16px 16px;
  color: #176b75;
  background: #fff;
  border: 1px solid #8ab9be;
  border-radius: 6px;
  font-size: 11px;
}

.dashboard-wide-action:hover {
  color: #fff;
  background: #087e7a;
}

.dashboard-empty {
  padding: 26px !important;
  color: #718087 !important;
  text-align: center !important;
}

.dashboard-loading {
  min-height: 430px;
}

.dashboard-skeleton,
.dashboard-loading-panel {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  background: #eef4f4;
  border: 1px solid #dce8e9;
  border-radius: 10px;
}

.dashboard-loading-panel {
  min-height: 300px;
}

.dashboard-skeleton::after,
.dashboard-loading-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(255, 255, 255, 0.35);
  animation: dashboard-pulse 1.3s ease-in-out infinite;
}

@keyframes dashboard-pulse {
  50% { opacity: 0.25; }
}

.dashboard-error {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  color: #8a3030;
  background: #fff8f7;
  border: 1px solid #edc7c4;
  border-left: 4px solid #c44545;
  border-radius: 10px;
}

.dashboard-error span {
  color: #765b5b;
  font-size: 13px;
}

.dashboard-error button {
  min-height: 36px;
  color: #fff;
  background: #c44545;
}

@media (max-width: 1180px) {
  .dashboard-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .platform-admin-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .dashboard-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-admin-status-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-head {
    padding: 15px;
  }

  .dashboard-timeline {
    padding: 10px 15px;
  }
}

.signature-preview,
.signature-image {
  border-color: #d5e3e4;
}

@media (max-width: 880px) {
  .admin-tabs {
    justify-content: flex-start;
  }

  .admin-tabs .admin-tab,
  .admin-tabs .client-admin-tab {
    flex: 0 0 auto;
  }
}

/* Futuristic operations workspace theme */
:root {
  --ink: #14232b;
  --muted: #63737b;
  --line: #d9e2e6;
  --soft: #f3f7f7;
  --panel: #ffffff;
  --primary: #087e7a;
  --primary-strong: #05635f;
  --warning: #b47a08;
  --danger: #c44545;
  --approved: #26804f;
  --shadow: 0 8px 24px rgba(25, 50, 59, 0.07);
}

body {
  background: #f5f8f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-screen {
  background: #f5f8f8;
}

.auth-card {
  width: min(580px, 100%);
  padding: 32px;
  border-color: #d7e3e4;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(25, 50, 59, 0.1);
}

.auth-card h1 {
  letter-spacing: -0.02em;
}

.app-layout {
  min-height: 100vh;
  background: #f5f8f8;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #dce6e8;
  box-shadow: 0 2px 12px rgba(25, 50, 59, 0.04);
}

.app-header h1 {
  font-size: 24px;
  letter-spacing: -0.02em;
}

.status-strip {
  min-width: 0;
}

.status-strip span {
  background: #f5f9f9;
  border-color: #dbe7e8;
  border-radius: 9px;
}

.app-header > button {
  justify-self: end;
  min-height: 38px;
  background: transparent;
  border: 1px solid #bdd2d3;
  color: #21535a;
}

.app-header > button:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 82px);
}

.sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  height: calc(100vh - 82px);
  padding: 22px 16px;
  background: #102f35;
  border-right: 1px solid #1e4a50;
}

.nav-button {
  min-height: 44px;
  margin-bottom: 6px;
  color: #c8dbdd;
  border-radius: 9px;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: #087e7a;
  border-color: #32aaa4;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.12);
}

.content {
  width: 100%;
  max-width: 1600px;
  padding: 30px 34px 48px;
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  color: #102b33;
  font-size: 26px;
  letter-spacing: -0.025em;
}

.eyebrow {
  color: #087e7a;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.permit-form,
.permit-card,
.dialog-card {
  border-color: #dce6e8;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.permit-form {
  padding: 24px;
  gap: 22px;
}

input,
select,
textarea {
  min-height: 44px;
  border-color: #cbdadc;
  border-radius: 8px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0d9a95;
  box-shadow: 0 0 0 3px rgba(13, 154, 149, 0.12);
}

button {
  min-height: 42px;
  border-radius: 8px;
}

.secondary-button {
  color: #24464e;
  background: #e8f0f0;
}

.secondary-button:hover {
  color: #173a40;
  background: #d9e7e7;
}

.dashboard-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-card {
  min-height: 116px;
  padding: 18px;
  border: 1px solid #dce6e8;
  border-left-width: 4px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.dashboard-card:hover {
  border-color: #a5c8ca;
  transform: translateY(-1px);
}

.dashboard-card span {
  color: #62757c;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-card strong {
  color: #12343b;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.dashboard-card.status-manager_review,
.dashboard-card.status-submitted {
  border-left-color: #d08b16;
}

.dashboard-card.status-client_review {
  border-left-color: #1689a2;
}

.dashboard-card.status-approved,
.dashboard-card.status-active {
  border-left-color: #26804f;
}

.dashboard-card.status-expiring {
  border-left-color: #d08b16;
}

.filter-bar {
  gap: 12px;
  margin-bottom: 18px;
}

.permit-list {
  gap: 16px;
}

.permit-card {
  padding: 20px;
}

/* Permit details: structured record view shared by all operational roles. */
.permit-detail-card {
  width: 100%;
  max-width: none;
  margin: 0 0 22px;
  padding: 0;
  overflow: visible;
  background: #f7fafb;
  border: 1px solid #dce7e9;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(31, 57, 64, 0.08);
}

.permit-detail-card.is-collapsed {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.permit-detail-card.is-collapsed:hover {
  border-color: #9dc5c6;
  box-shadow: 0 8px 22px rgba(31, 57, 64, 0.12);
  transform: translateY(-1px);
}

.permit-detail-card:focus-visible {
  outline: 3px solid rgba(20, 125, 121, 0.35);
  outline-offset: 3px;
}

.permit-detail-card:not(.permit-list-row).is-collapsed > :not(.permit-card-summary) {
  display: none;
}

.permit-card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 96px;
  padding: 18px 22px;
  background: #fff;
  border-radius: 12px;
}

.permit-card-summary-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.permit-card-summary-main strong {
  color: #17343b;
  font-size: 16px;
}

.permit-card-summary-main span {
  overflow: hidden;
  color: #4d6870;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-card-summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px 14px;
  color: #506a71;
  font-size: 12px;
}

.permit-card-end { white-space: nowrap; }

.permit-card-chevron {
  color: var(--primary);
  font-size: 22px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .15s ease;
}

.permit-detail-card.is-expanded .permit-card-chevron { transform: rotate(180deg); }

.permit-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  background: #fff;
  border-bottom: 1px solid #e2ebed;
  border-radius: 12px 12px 0 0;
}

.permit-detail-title {
  min-width: 0;
  flex: 1 1 auto;
}

.permit-detail-title small {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  color: #294a52;
}

.permit-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.permit-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.permit-header-badges .status-badge {
  white-space: nowrap;
}

.permit-detail-title > span,
.permit-detail-title small,
.permit-detail-title p {
  display: block;
  color: #587079;
}

.permit-detail-title > span {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.permit-detail-title h3 {
  margin: 0;
  color: #152f37;
  font-size: 27px;
  line-height: 1.15;
}

.permit-detail-title p {
  margin: 8px 0 3px;
  color: #1b4c55;
  font-size: 17px;
  font-weight: 700;
}

.permit-detail-title small {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 13px;
}

.permit-detail-status { display: none; }

.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: #49626a;
  background: #eef4f5;
  border: 1px solid #d8e6e8;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.detail-chip.is-positive { color: #256a3c; background: #e8f6ec; border-color: #cfe9d6; }

.detail-alert {
  margin: 18px 20px 0;
  padding: 14px 16px;
  border: 1px solid #e6c77c;
  border-radius: 8px;
  background: #fff9e9;
}

.detail-alert p { margin: 7px 0; }
.detail-alert small { color: #6d5a2d; }

.permit-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.72fr);
  gap: 16px;
  padding: 20px;
}

.detail-section {
  padding: 20px;
  background: #fff;
  border: 1px solid #dfe9eb;
  border-radius: 9px;
}

.detail-accordion { padding: 0; overflow: hidden; }
.detail-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 16px 20px;
  color: #183c45;
  background: #fff;
  border: 0;
  text-align: left;
}
.detail-section-toggle:hover { background: #f7fbfb; }
.detail-section-toggle:focus-visible { outline: 3px solid rgba(20, 125, 121, 0.32); outline-offset: -3px; }
.detail-section-toggle > span:first-child { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; }
.detail-section-count { color: #60767d; font-size: 12px; font-weight: 600; }
.detail-section-chevron { color: #547279; font-size: 18px; transition: transform 160ms ease; }
.detail-accordion.is-open .detail-section-chevron { transform: rotate(180deg); }
.detail-accordion.is-collapsed .detail-section-content { display: none; }
.detail-section-content { padding: 0 20px 20px; }

.detail-section h4 {
  margin: 0 0 17px;
  color: #183c45;
  font-size: 16px;
}

.detail-general,
.detail-description,
.detail-precautions,
.detail-timeline,
.detail-comments,
.detail-legacy,
.detail-signature { grid-column: 1 / -1; }

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
}

.permit-detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #edf2f3;
}

.permit-detail-row:last-child { border-bottom: 0; }
.permit-detail-row span { color: #62777d; font-size: 12px; font-weight: 700; }
.permit-detail-row strong { color: #1e373e; font-size: 13px; overflow-wrap: anywhere; }

.detail-description p {
  margin: 0;
  color: #263e45;
  font-size: 15px;
  line-height: 1.7;
}

.detail-chip-row,
.safety-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.precaution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.precaution-tile {
  display: flex;
  gap: 11px;
  min-height: 70px;
  padding: 12px;
  background: #fbfcfc;
  border: 1px solid #e0e9ea;
  border-radius: 8px;
}

.precaution-tile.is-complete { background: #f2faf4; border-color: #d7ecd9; }
.precaution-mark {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  color: #fff;
  background: #809397;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}
.precaution-tile.is-complete .precaution-mark { background: #2a8746; }
.precaution-tile strong,
.precaution-tile small { display: block; }
.precaution-tile strong { color: #264149; font-size: 13px; line-height: 1.35; }
.precaution-tile small { margin-top: 4px; color: #657a80; font-size: 12px; }

.safety-list { margin-top: 15px; }
.safety-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #e8eff0;
}
.safety-row:last-child { border-bottom: 0; }
.safety-icon,
.attachment-icon {
  display: block;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: #147d79;
  border-radius: 2px;
}
.safety-row strong,
.safety-row small { display: block; }
.safety-row strong { color: #29454d; font-size: 13px; }
.safety-row small { margin-top: 3px; color: #64787e; font-size: 12px; line-height: 1.45; }

.attachment-list,
.comment-list,
.legacy-list { display: grid; gap: 10px; }

.audit-event-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dce8e9;
  border-radius: 9px;
}

.audit-filter-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  background: #f6fafb;
  border: 1px solid #dce8e9;
  border-radius: 10px;
}

.audit-filter-top,
.audit-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.audit-filter-primary {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 9px;
  align-items: end;
}

.audit-filter-primary label {
  display: grid;
  gap: 4px;
  color: #536c73;
  font-size: 11px;
  font-weight: 700;
}

.audit-filter-primary input,
.audit-filter-primary select { margin: 0; }

.audit-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-filter-chip {
  min-height: 26px;
  padding: 3px 9px;
  color: #075f5a;
  background: #e2f3f1;
  border: 1px solid #b8dfda;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.audit-filter-chip span { margin-left: 4px; font-size: 15px; line-height: 0; }

.audit-filter-top input[type="search"] { flex: 1 1 280px; }

.audit-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 9px;
}

.audit-filter-grid label {
  display: grid;
  gap: 4px;
  color: #536c73;
  font-size: 11px;
  font-weight: 700;
}

.audit-filter-grid input,
.audit-filter-grid select { margin: 0; }

.audit-summary-cards { margin-bottom: 14px; }
.audit-summary-cards .dashboard-card { min-height: 72px; text-align: left; }

.audit-result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.audit-result-success, .audit-result-informational { color: #09635f; background: #dff4f1; }
.audit-result-warning { color: #8b5610; background: #fff1d6; }
.audit-result-security, .audit-result-failed { color: #a52e2e; background: #ffe1e1; }

.audit-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #587078;
  font-size: 12px;
}

.audit-details-dialog {
  width: min(720px, calc(100vw - 32px));
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgb(17 51 59 / 28%);
}
.audit-details-dialog::backdrop { background: rgb(15 34 39 / 52%); }
.audit-details-dialog form { display: grid; gap: 15px; padding: 18px; }
.audit-details-dialog header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.audit-details-dialog h2 { margin: 2px 0 0; color: #183e46; }
.audit-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.audit-details-grid > div { display: grid; gap: 3px; padding: 9px; background: #f7fbfb; border: 1px solid #deeaeb; border-radius: 8px; }
.audit-details-grid span, .audit-detail-reason > span { color: #71858a; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.audit-details-grid strong { color: #294b53; font-size: 13px; overflow-wrap: anywhere; }
.audit-detail-reason { padding: 10px; background: #f7fbfb; border: 1px solid #deeaeb; border-radius: 8px; }
.audit-detail-reason p { margin: 5px 0 0; white-space: pre-wrap; }

@media (max-width: 680px) {
  .audit-filter-primary { grid-template-columns: 1fr; }
  .audit-filter-top > .secondary-button { flex: 1 1 auto; }
  .audit-filter-actions > button { flex: 1 1 auto; }
  .audit-details-grid { grid-template-columns: 1fr; }
  .audit-pagination { justify-content: center; }
}

.audit-event-list {
  gap: 7px;
}

.audit-event-card-compact {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 11px;
}

.audit-event-card-compact .audit-event-icon {
  width: 24px;
  height: 24px;
  font-size: 13px;
}

.audit-event-card-compact .audit-event-heading strong {
  font-size: 13px;
}

.audit-event-summary {
  margin: 4px 0 0;
  color: #526b71;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.audit-event-card-compact .audit-event-comment {
  margin-top: 7px;
  padding-top: 7px;
  font-size: 12px;
}

.audit-event-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: #147d79;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
}

.audit-event-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.audit-event-heading strong {
  color: #1d4149;
  font-size: 14px;
}

.audit-event-heading time {
  flex: 0 0 auto;
  color: #6b7f84;
  font-size: 11px;
}

.audit-event-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 18px;
  margin-top: 13px;
}

.audit-event-field {
  display: grid;
  gap: 2px;
}

.audit-event-field span,
.audit-event-comment span {
  color: #71858a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.audit-event-field strong {
  color: #294b53;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.audit-event-comment {
  margin: 13px 0 0;
  padding-top: 10px;
  color: #3d565d;
  border-top: 1px solid #e5eeee;
  font-size: 13px;
  line-height: 1.45;
}

.audit-event-comment span {
  display: block;
  margin-bottom: 3px;
}

.attachment-record,
.comment-record,
.legacy-record {
  position: relative;
  padding: 12px;
  background: #fafcfc;
  border: 1px solid #e1ebed;
  border-radius: 7px;
}
.legacy-record strong,
.legacy-record span { display: block; }
.legacy-record strong { color: #29464d; font-size: 13px; }
.legacy-record span { margin-top: 4px; color: #64787e; font-size: 12px; }

.attachment-record {
  display: flex;
  align-items: center;
  gap: 11px;
}
.attachment-record .attachment-icon { width: 17px; height: 21px; margin: 0; background: #5e747a; border-radius: 3px; }
.attachment-record > div { min-width: 0; flex: 1; }
.attachment-record strong,
.attachment-record small { display: block; overflow-wrap: anywhere; }
.attachment-record strong { color: #29464d; font-size: 13px; }
.attachment-record small { margin-top: 3px; color: #667a80; font-size: 12px; }

.detail-timeline .dashboard-timeline-event {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 14px;
  position: relative;
  min-height: 62px;
  margin: 0;
  padding: 0 0 16px;
}
.detail-timeline .dashboard-timeline-event:not(:last-child)::before {
  position: absolute;
  top: 23px;
  bottom: 0;
  left: 11px;
  width: 2px;
  background: #d4e4e3;
  content: "";
}
.detail-timeline .timeline-dot { position: relative; top: 0; left: auto; z-index: 1; }
.dashboard-timeline-event-body { min-width: 0; }
.dashboard-timeline-event-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.detail-timeline .dashboard-timeline-event strong { color: #25434b; font-size: 14px; line-height: 1.3; }
.detail-timeline .dashboard-timeline-event time { color: #60767d; font-size: 12px; white-space: nowrap; }
.dashboard-timeline-event-actor { margin-top: 3px; color: #60767d; font-size: 12px; overflow-wrap: anywhere; }
.detail-timeline .dashboard-timeline-event p { margin: 8px 0 0; color: #3d565d; font-size: 13px; line-height: 1.45; }

.filter-help { margin: -6px 0 16px; color: #60767d; font-size: 12px; line-height: 1.5; }

.comment-record > div { display: flex; align-items: center; gap: 8px; }
.comment-record strong { color: #29464d; font-size: 13px; }
.comment-record span { color: #547078; font-size: 12px; }
.comment-record small { display: block; margin-top: 5px; color: #71848a; font-size: 11px; }
.comment-record p { margin: 9px 0 0; color: #334e55; font-size: 13px; line-height: 1.5; }

.detail-empty {
  padding: 18px;
  color: #60757b;
  background: #f7fafb;
  border: 1px dashed #ceddde;
  border-radius: 7px;
  font-size: 13px;
}
.detail-muted { color: #70858a; font-size: 12px; }

.permit-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid #dce8ea;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 -7px 20px rgba(40, 62, 68, 0.06);
}

@media (max-width: 900px) {
  .permit-detail-layout { grid-template-columns: 1fr; }
  .detail-general,
  .detail-description,
  .detail-precautions,
  .detail-timeline,
  .detail-comments,
  .detail-legacy,
  .detail-signature { grid-column: auto; }
}

@media (max-width: 640px) {
  .permit-detail-header { align-items: stretch; }
  .permit-detail-header { flex-direction: column; padding: 18px; }
  .permit-card-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }
  .permit-card-summary-main span { white-space: normal; }
  .permit-card-summary-meta { justify-content: flex-start; }
  .permit-detail-title h3 { font-size: 23px; }
  .permit-header-meta {
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
    padding-top: 14px;
    border-top: 1px solid #e2ebed;
  }
  .permit-header-badges {
    align-items: center;
    flex-wrap: wrap;
  }
  .audit-event-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .audit-event-fields { grid-template-columns: 1fr; }
  .permit-detail-layout { gap: 12px; padding: 12px; }
  .dashboard-timeline-event-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .detail-section { padding: 16px; }
  .detail-accordion { padding: 0; }
  .detail-section-toggle { min-height: 54px; padding: 14px 16px; }
  .detail-section-content { padding: 0 16px 16px; }
  .detail-info-grid,
  .precaution-grid { grid-template-columns: 1fr; }
  .permit-detail-row { grid-template-columns: 1fr; gap: 4px; }
  .permit-action-bar { padding: 12px; }
}

.permit-title {
  font-size: 17px;
  color: #153940;
}

.requirements {
  background: #f4f9f8;
  border-color: #d7e9e6;
  border-radius: 9px;
}

.correction-required {
  color: #704a00;
  background: #fff7e4;
  border-color: #edcf85;
}

.correction-required strong { color: #8a5a06; }
.correction-required p { margin: 0; color: #2f3c40; font-weight: 600; }
.correction-required small { color: #6f6b5f; }

.tag {
  border-radius: 7px;
  background: #f8fbfb;
}

.admin-tabs {
  gap: 6px;
  overflow-x: auto;
  background: #f3f7f7;
  border-color: #dce7e8;
}

.admin-tab,
.client-admin-tab {
  min-width: max-content;
  color: #60737a;
  border-radius: 8px;
}

.admin-tab.active,
.client-admin-tab.active {
  background: var(--primary);
}

.responsive-table {
  border: 1px solid #dce6e8;
  border-radius: 10px;
  background: #fff;
}

.responsive-table th {
  color: #60737a;
  background: #f5f9f9;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.responsive-table td,
.responsive-table th {
  padding: 13px 12px;
  border-bottom-color: #e4ecee;
}

.status-badge {
  border-radius: 7px;
}

.empty {
  border-color: #c7d8da;
  background: #fff;
}

.app-notice {
  border-color: #c9dcdd;
  background: #ffffff;
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-header {
    grid-template-columns: 1fr auto;
  }

  .status-strip {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 880px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-header > button {
    justify-self: start;
  }

  .status-strip {
    grid-column: auto;
    grid-row: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 12px;
  }

  .nav-button {
    margin-bottom: 0;
    text-align: center;
  }

  .content {
    padding: 24px 18px 36px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .app-header,
  .content {
    padding: 16px;
  }

  .sidebar,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Keep the admin shell authoritative over earlier shared collapsed/mobile rules. */
@media (min-width: 901px) {
  .admin-portal-shell .sidebar,
  .admin-portal-shell.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    height: 100vh;
    padding: 18px 14px;
    display: block;
    transform: none;
  }

  .admin-portal-shell .app-shell,
  .admin-portal-shell.sidebar-collapsed .app-shell {
    display: block;
    margin-left: 244px;
  }

  .admin-portal-shell .app-header,
  .admin-portal-shell.sidebar-collapsed .app-header {
    margin-left: 244px;
  }

  .admin-portal-shell .nav-button,
  .admin-portal-shell.sidebar-collapsed .nav-button {
    justify-content: flex-start;
    padding: 0 13px;
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  .admin-portal-shell .app-header {
    position: sticky;
    z-index: 24;
    display: flex;
    grid-template-columns: none;
    margin-left: 0;
    padding: 10px 12px 10px 62px;
  }

  .admin-portal-shell .app-shell {
    display: block;
    margin-left: 0;
  }

  .admin-portal-shell .sidebar,
  .admin-portal-shell.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    height: 100vh;
    padding: 76px 14px 18px;
    display: block;
    grid-template-columns: none;
    transform: translateX(-100%);
  }

  .admin-portal-shell:not(.sidebar-collapsed) .sidebar {
    transform: translateX(0);
  }

  .admin-portal-shell .nav-button,
  .admin-portal-shell.sidebar-collapsed .nav-button {
    justify-content: flex-start;
    padding: 0 13px;
    font-size: 14px;
    text-align: left;
  }

  .admin-portal-shell .content {
    padding: 24px 18px 40px;
  }
}

/* Secure account and authentication surfaces */
.auth-method-form { display: grid; gap: 16px; }
.auth-help { margin: 0; color: #65787e; font-size: 13px; line-height: 1.5; }
.auth-text-button { justify-self: start; min-height: auto; padding: 0; color: #0b716d; background: transparent; border: 0; box-shadow: none; }
.auth-text-button:hover, .auth-text-button:focus-visible { color: #075a57; text-decoration: underline; background: transparent; }
.header-actions { position: relative; }
.user-control { cursor: pointer; }
.header-user-menu, .admin-portal-shell .header-user-menu { position: absolute; z-index: 70; top: calc(100% + 8px); right: 0; width: min(260px, calc(100vw - 24px)); padding: 8px; border: 1px solid #d5e1e3; border-radius: 10px; background: #fff; box-shadow: 0 18px 42px rgba(13, 52, 57, .18); }
.header-user-summary { display: grid; gap: 2px; padding: 10px 11px; color: #17343b; }
.header-user-summary strong { overflow: hidden; text-overflow: ellipsis; }
.header-user-summary span { overflow: hidden; color: #687b81; font-size: 12px; text-overflow: ellipsis; }
.header-menu-divider { height: 1px; margin: 5px 3px; background: #e2eaec; }
.header-user-menu button, .admin-portal-shell .header-user-menu button { display: flex; width: 100%; min-height: 40px; align-items: center; gap: 10px; padding: 8px 10px; color: #173038; text-align: left; background: transparent; border: 0; border-radius: 7px; box-shadow: none; }
.header-user-menu button:hover, .header-user-menu button:focus-visible, .admin-portal-shell .header-user-menu button:hover, .admin-portal-shell .header-user-menu button:focus-visible { color: #0a6966; background: #edf6f5; }

/* Role-aware administration landing */
.administration-home-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid #cfe0df;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5fbfa 0%, #ffffff 72%);
}

.administration-home-intro h2,
.administration-home-intro p { margin: 0; }
.administration-home-intro .eyebrow { margin-bottom: 5px; }
.administration-home-intro h2 { color: #12333a; font-size: clamp(21px, 2vw, 28px); }
.administration-home-intro h2 + p { margin-top: 7px; color: #5f747a; }
.administration-home-intro > button { flex: 0 0 auto; }

.administration-quick-links {
  display: grid;
  gap: 14px;
  padding: 20px 0 4px;
}

.administration-quick-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.administration-quick-link-grid > button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 82px;
  padding: 14px;
  color: #173038;
  text-align: left;
  background: #fff;
  border: 1px solid #d8e4e5;
  border-radius: 10px;
  box-shadow: none;
}

.administration-quick-link-grid > button:hover { border-color: #7fb8b4; background: #f5fbfa; }
.administration-quick-link-grid .ui-icon { width: 24px; height: 24px; color: #087c77; }
.administration-quick-link-grid span { display: grid; gap: 3px; }
.administration-quick-link-grid strong { font-size: 14px; }
.administration-quick-link-grid small { color: #667b80; font-size: 12px; line-height: 1.35; }

.module-hub-empty-applications {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed #c9d9db;
  border-radius: 10px;
  color: #5f747a;
  background: #f9fbfb;
}
.module-hub-empty-applications h3,
.module-hub-empty-applications p { margin: 0; }
.module-hub-empty-applications h3 { color: #173038; }
.module-hub-empty-applications p { margin-top: 6px; }
.administration-scope-card { border-color: #b9d7d4; }

@media (max-width: 700px) {
  .administration-home-intro { align-items: stretch; flex-direction: column; }
  .administration-home-intro > button { width: 100%; }
  .administration-quick-link-grid { grid-template-columns: 1fr; }
}
.header-user-menu .ui-icon { width: 18px; height: 18px; }
.section-subtitle { margin: 5px 0 0; color: #677a80; }
.account-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }

/* Responsive application shell: one drawer model for every role. */
html, body { min-width: 0; overflow-x: hidden; }
.app-layout, .app-header, .app-shell, .content, .brand-lockup, .header-actions, .company-identity { min-width: 0; }
.app-header { position: relative; z-index: 60; }
.header-actions { flex: 0 1 auto; display: flex; align-items: center; min-width: 0; }
.company-identity, .company-identity-copy { min-width: 0; }
.company-identity-copy { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-backdrop { display: none; }

@media (min-width: 1400px) {
  .app-shell { grid-template-columns: 280px minmax(0, 1fr) !important; }
  .sidebar { position: sticky; top: 0; width: auto; min-width: 0; height: calc(100vh - 94px); overflow-y: auto; }
  .content { max-width: none; }
}

@media (min-width: 1024px) and (max-width: 1399px) {
  .app-header { gap: 14px; padding: 16px 20px; }
  .app-shell { grid-template-columns: 240px minmax(0, 1fr) !important; }
  .content { max-width: none; padding: 24px; }
  .company-identity { max-width: 190px; }
  .company-identity-copy { font-size: 13px; }
}

@media (max-width: 1023px) {
  .app-header { display: flex; min-height: 64px; gap: 10px; padding: 10px 14px 10px 58px; }
  .brand-lockup { flex: 1 1 auto; }
  .brand-lockup .eyebrow { display: none; }
  .brand-lockup h1 { max-width: 100%; overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
  .app-shell { display: block !important; width: 100%; min-width: 0; margin: 0 !important; }
  .content { width: 100%; max-width: none; padding: 24px clamp(16px, 3vw, 28px) 40px; }
  .menu-button { position: absolute; top: 10px; left: 12px; z-index: 2; }
  .company-identity, #quickActionsShell, #adminHeaderNotification, .header-help { display: none !important; }
  .user-control { width: 44px; min-width: 44px; justify-content: center; padding-inline: 0; }
  .user-control .user-identity, .user-control .user-chevron { display: none; }
  .header-actions { gap: 6px; }
  .header-control-copy { min-width: 0; max-width: 130px; }
  .header-control-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar, .admin-portal-shell .sidebar, .admin-portal-shell.sidebar-collapsed .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 80;
    width: min(320px, 85vw) !important;
    max-width: 85vw;
    height: 100dvh !important;
    padding: 16px 12px 20px !important;
    overflow-y: auto;
    display: block !important;
    transform: translateX(-105%) !important;
    transition: transform .2s ease;
  }
  .app-layout:not(.sidebar-collapsed) .sidebar { transform: translateX(0) !important; }
  .sidebar-brand { margin-bottom: 18px; padding: 6px 8px; }
  .nav-button, .admin-portal-shell .nav-button, .admin-portal-shell.sidebar-collapsed .nav-button {
    min-height: 48px; margin: 0 0 8px; padding: 0 14px !important; justify-content: flex-start; text-align: left; font-size: 14px;
  }
  .drawer-backdrop { position: fixed; inset: 0; z-index: 70; display: block; background: rgba(8, 24, 31, .46); opacity: 1; transition: opacity .2s ease; }
  .drawer-backdrop.is-hidden { display: none; }
  body.drawer-open { overflow: hidden; }
  .permit-list, .permit-list-row, .permit-list-row .shared-permit-row { min-width: 0; }
}

@media (max-width: 767px) {
  .app-header { min-height: 60px; padding: 8px 10px 8px 54px; }
  .brand-lockup h1 { font-size: 18px; }
  .rig-control { width: 44px; min-width: 44px; justify-content: center; padding-inline: 0; }
  .rig-control .header-control-copy, .rig-control .header-control-chevron { display: none; }
  .header-icon-button { width: 44px; min-width: 44px; }
  .content { padding: 18px 12px 32px; }
  .section-head h2 { font-size: 22px; }
  .permit-row-detail-grid { grid-template-columns: 1fr !important; }
  .permit-row-panel, .permit-full-details { min-width: 0; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .drawer-backdrop { transition: none !important; }
}
.settings-card { display: grid; gap: 16px; min-width: 0; padding: 20px; background: #fff; border: 1px solid #d8e3e5; border-radius: 9px; box-shadow: 0 8px 22px rgba(21, 58, 63, .05); }
.settings-card h3, .settings-card p { margin: 0; }
.settings-card-head { display: flex; align-items: flex-start; gap: 12px; }
.settings-card-head p { margin-top: 3px; color: #687b81; font-size: 13px; line-height: 1.4; }
.settings-card-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; color: #0b7672; background: #eaf5f4; border-radius: 8px; }
.settings-card-icon .ui-icon { width: 19px; height: 19px; }
.account-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid #e0e9eb; border-radius: 7px; background: #e0e9eb; }
.account-facts div { min-width: 0; padding: 10px 12px; background: #f9fbfb; }
.account-facts dt { color: #708187; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.account-facts dd { margin: 4px 0 0; overflow-wrap: anywhere; color: #1a363d; font-weight: 700; }
.account-value { display: grid; gap: 4px; padding: 12px; background: #f7faf9; border: 1px solid #e0e8ea; border-radius: 7px; }
.account-value span { color: #6c7e84; font-size: 12px; }
.account-value strong { overflow-wrap: anywhere; }
.account-status { color: #167447; }
.settings-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.session-actions { justify-content: flex-start; }
.compact-dialog { width: min(520px, calc(100vw - 32px)); }

@media (max-width: 820px) {
  .account-settings-grid { grid-template-columns: 1fr; }
  .header-user-menu { position: fixed; top: 68px; right: 12px; }
}

@media (max-width: 540px) {
  .account-facts { grid-template-columns: 1fr; }
  .settings-card { padding: 16px; }
  .session-actions button { width: 100%; }
}

.auth-callback-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #eef4f4; }
.auth-callback-card { display: grid; width: min(520px, 100%); justify-items: center; gap: 14px; padding: 34px; color: #18363d; text-align: center; background: #fff; border: 1px solid #d6e2e4; border-radius: 10px; box-shadow: 0 18px 44px rgba(13, 52, 57, .12); }
.auth-callback-card h1, .auth-callback-card p { margin: 0; }
.auth-callback-card h1 { font-size: 26px; }
.auth-callback-card > p:not(.eyebrow):not(.auth-error) { color: #62777d; line-height: 1.55; }
.callback-brand { display: grid; width: 48px; height: 48px; place-items: center; color: #fff; background: #0e7b77; border-radius: 9px; font-weight: 800; }
.callback-progress { width: 100%; height: 4px; overflow: hidden; background: #dfe9ea; border-radius: 999px; }
.callback-progress span { display: block; width: 42%; height: 100%; background: #0e7b77; border-radius: inherit; animation: callback-progress 1.1s ease-in-out infinite alternate; }
.callback-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 4px; }
.button-link { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 15px; color: #fff; text-decoration: none; background: #0e7b77; border: 1px solid #0e7b77; border-radius: 7px; font-weight: 700; }
.button-link:hover, .button-link:focus-visible { color: #fff; background: #096763; }
@keyframes callback-progress { from { transform: translateX(-35%); } to { transform: translateX(140%); } }

/* Offline role-based Help Center */
.header-help {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #294047;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}
.header-help:hover,
.header-help:focus-visible { color: var(--primary); background: #edf6f5; }
.header-help .ui-icon { width: 20px; height: 20px; }

.help-center-dialog {
  inset: 0 0 0 auto;
  width: min(1120px, calc(100vw - 48px));
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #18363d;
  background: #f5f8f8;
  border: 0;
  border-left: 1px solid #cfdcde;
  border-radius: 0;
  box-shadow: -20px 0 54px rgba(13, 45, 50, .18);
}
.help-center-dialog::backdrop { background: rgba(9, 29, 33, .46); }
.help-center-shell { display: grid; height: 100%; grid-template-rows: auto auto auto minmax(0, 1fr); }
.help-center-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 20px;
  background: #fff;
  border-bottom: 1px solid #dce6e7;
}
.help-center-head h2,
.help-center-head p,
.help-section-heading h3 { margin: 0; }
.help-center-head h2 { margin-top: 3px; font-size: 27px; }
.help-center-head > div > p:last-child { margin-top: 5px; color: #687a80; }
.help-version-meta { display: block; margin-top: 6px; color: #7a8c91; font-size: 11px; }
.help-center-head-actions { display: flex; align-items: center; gap: 8px; }
.help-center-head-actions .secondary-button { display: inline-flex; align-items: center; gap: 7px; }
.help-center-head-actions .ui-icon { width: 18px; height: 18px; }
.help-center-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 18px 28px 12px;
  padding: 0 13px;
  color: #61757b;
  background: #fff;
  border: 1px solid #cedcdf;
  border-radius: 9px;
}
.help-center-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(17, 125, 120, .12); }
.help-center-search input { min-height: 46px; padding: 0; background: transparent; border: 0; outline: 0; }
.help-center-search .ui-icon { width: 19px; height: 19px; }
.help-quick-section { padding: 0 28px 16px; border-bottom: 1px solid #dce6e7; }
.help-section-heading { display: flex; min-height: 28px; align-items: center; justify-content: space-between; gap: 12px; }
.help-section-heading h3 { font-size: 14px; }
.help-section-heading span { color: #6c7f84; font-size: 12px; }
.help-quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.help-quick-link {
  min-height: 36px;
  padding: 7px 11px;
  color: #126d69;
  background: #fff;
  border: 1px solid #bdd7d5;
  border-radius: 7px;
  box-shadow: none;
  font-size: 13px;
}
.help-quick-link:hover,
.help-quick-link:focus-visible { color: #fff; background: var(--primary); border-color: var(--primary); }
.help-center-body { display: grid; min-height: 0; grid-template-columns: 310px minmax(0, 1fr); }
.help-article-list { min-height: 0; overflow: auto; padding: 18px 14px 28px 20px; background: #f8fbfb; border-right: 1px solid #dce6e7; }
.help-category-title { margin: 18px 9px 7px; color: #6e8085; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.help-category-title:first-child { margin-top: 4px; }
.help-article-link {
  display: grid;
  width: 100%;
  min-height: 46px;
  gap: 3px;
  padding: 9px 10px;
  color: #253e45;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
}
.help-article-link span { color: #6e8086; font-size: 11px; font-weight: 500; }
.help-article-link:hover,
.help-article-link:focus-visible { color: #0c6c68; background: #eaf4f3; }
.help-article-link.is-selected { color: #fff; background: var(--primary); }
.help-article-link.is-selected span { color: rgba(255,255,255,.82); }
.help-article-detail { min-width: 0; min-height: 0; overflow: auto; padding: 34px clamp(26px, 5vw, 70px) 60px; background: #fff; outline: 0; }
.help-article-detail header { padding-bottom: 22px; border-bottom: 1px solid #e0e8ea; }
.help-article-detail h2 { margin: 5px 0 8px; font-size: clamp(24px, 3vw, 34px); letter-spacing: 0; }
.help-article-detail header p { max-width: 740px; margin: 0; color: #61757b; font-size: 15px; line-height: 1.65; }
.help-article-purpose { max-width: 780px; margin: 22px 0 0; padding: 14px 16px; color: #294149; background: #f3f8f8; border-left: 3px solid var(--primary); border-radius: 6px; line-height: 1.6; }
.help-article-section { max-width: 780px; margin-top: 24px; }
.help-article-section h3,
.help-article-subheading,
.help-related-articles h3 { margin: 0 0 9px; color: #18363d; font-size: 16px; }
.help-article-section ul { display: grid; gap: 7px; margin: 0; padding-left: 20px; color: #294149; line-height: 1.55; }
.help-article-section li { min-height: auto; padding: 0; counter-increment: none; }
.help-article-section li::before { display: none; }
.help-callout { padding: 14px 16px; border: 1px solid #cfe0e1; border-radius: 7px; }
.help-callout-info { background: #f1f8fb; border-left: 3px solid #2384a5; }
.help-callout-warning { background: #fff9ec; border-left: 3px solid #c58a12; }
.help-article-subheading { max-width: 780px; margin-top: 30px; }
.help-related-articles { display: flex; max-width: 780px; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 30px; padding-top: 18px; border-top: 1px solid #e0e8ea; }
.help-related-articles h3 { width: 100%; }
.help-related-link { padding: 8px 10px; color: #126d69; background: #edf6f5; border: 1px solid #c5dfdd; border-radius: 6px; font-size: 13px; }
.help-related-link:hover,
.help-related-link:focus-visible { color: #fff; background: var(--primary); border-color: var(--primary); }
.help-article-detail ol { display: grid; gap: 13px; max-width: 780px; margin: 26px 0 0; padding: 0; counter-reset: help-step; list-style: none; }
.help-article-detail li { position: relative; min-height: 38px; padding: 7px 0 7px 48px; color: #294149; line-height: 1.6; counter-increment: help-step; }
.help-article-detail li::before {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #0c716d;
  background: #e7f4f2;
  border: 1px solid #c7e1de;
  border-radius: 50%;
  content: counter(help-step);
  font-size: 13px;
  font-weight: 800;
}
.help-empty-state { display: grid; min-height: 280px; place-items: center; align-content: center; gap: 8px; color: #667b81; text-align: center; }
.help-empty-state strong { color: #213d44; font-size: 18px; }

.help-welcome-dialog { width: min(520px, calc(100vw - 28px)); padding: 0; background: transparent; border: 0; }
.help-welcome-dialog::backdrop { background: rgba(8, 30, 34, .5); }
.help-welcome-dialog .dialog-card { justify-items: start; gap: 16px; }
.help-welcome-dialog h2,
.help-welcome-dialog p { margin: 0; }
.help-welcome-dialog p:not(.eyebrow) { margin-top: 7px; color: #60747a; line-height: 1.55; }
.help-welcome-mark { display: grid; width: 48px; height: 48px; place-items: center; color: #fff; background: var(--primary); border-radius: 9px; }
.help-welcome-mark .ui-icon { width: 27px; height: 27px; }

.help-tour { position: fixed; z-index: 200; inset: 0; pointer-events: none; }
.help-tour-spotlight {
  position: fixed;
  z-index: 201;
  border: 3px solid #48d4cc;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(4, 23, 27, .66), 0 0 0 6px rgba(72, 212, 204, .22);
  transition: inset .18s ease, width .18s ease, height .18s ease;
}
.help-tour-card {
  position: fixed;
  z-index: 202;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(420px, calc(100vw - 32px));
  gap: 10px;
  padding: 22px;
  pointer-events: auto;
  color: #18363d;
  background: #fff;
  border: 1px solid #cbdadb;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(4, 28, 33, .28);
}
.help-tour-card > span { color: #0b746f; font-size: 12px; font-weight: 800; }
.help-tour-card h2,
.help-tour-card p { margin: 0; }
.help-tour-card p { color: #60747a; line-height: 1.55; }
.help-tour-card .actions { margin-top: 4px; }

/* Knowledge Center workspace: one large reading surface instead of a small
   stacked modal. The existing article data and role filtering remain intact. */
.help-center-dialog {
  inset: auto;
  width: min(94vw, 1600px);
  height: min(92dvh, 1000px);
  max-height: 92dvh;
  margin: auto;
  border: 1px solid #cbd9db;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(13, 45, 50, .24);
}
.help-center-dialog.is-fullscreen {
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border: 0;
}
.help-center-shell { grid-template-rows: auto auto auto minmax(0, 1fr); }
.help-center-head { padding: 16px 22px; gap: 16px; }
.help-center-head h2 { font-size: 22px; }
.help-center-head > div > p:last-child { margin-top: 2px; font-size: 12px; }
.help-version-meta { margin-top: 3px; }
.help-center-head-actions { flex: 0 0 auto; gap: 6px; }
.help-toolbar-button { min-height: 40px; padding: 8px 10px; font-size: 12px; }
.help-toolbar-button .ui-icon { width: 16px; height: 16px; }
.help-mobile-nav { display: none; }
.help-center-search { margin: 12px 22px 10px; min-height: 42px; }
.help-center-search input { min-height: 40px; }
.help-quick-section { padding: 0 22px 12px; }
.help-quick-links { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.help-quick-link { min-height: 32px; white-space: nowrap; }
.help-center-body { grid-template-columns: 300px minmax(0, 1fr) 220px; }
.help-article-list { padding: 14px 12px 24px 16px; }
.help-article-link { min-height: 42px; padding: 7px 9px; }
.help-article-link span { display: none; }
.help-article-detail { padding: 34px clamp(28px, 5vw, 80px) 60px; }
.help-article-detail > header,
.help-article-purpose,
.help-article-section,
.help-article-subheading,
.help-article-detail ol,
.help-related-articles { max-width: 860px; }
.help-article-detail h2 { font-size: clamp(30px, 3vw, 40px); }
.help-on-page { min-width: 0; padding: 30px 18px; background: #f8fbfb; border-left: 1px solid #dce6e7; }
.help-on-page > strong { display: block; margin-bottom: 10px; color: #5f747a; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.help-on-page-links { display: grid; gap: 3px; position: sticky; top: 0; }
.help-on-page-links button { padding: 7px 8px; color: #587077; text-align: left; background: transparent; border: 0; border-left: 2px solid transparent; border-radius: 0 5px 5px 0; font-size: 12px; }
.help-on-page-links button:hover, .help-on-page-links button:focus-visible { color: var(--primary); background: #eaf4f3; border-left-color: var(--primary); }

@media (max-width: 1180px) {
  .help-center-body { grid-template-columns: 280px minmax(0, 1fr); }
  .help-on-page { display: none; }
}

@media (max-width: 720px) {
  .help-center-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .help-center-head { padding: 12px 14px; }
  .help-center-head-actions { gap: 4px; }
  .help-mobile-nav { display: inline-flex; }
  .help-toolbar-button { width: 40px; min-height: 40px; justify-content: center; padding: 0; font-size: 0; }
  .help-toolbar-button span { display: none; }
  .help-center-head h2 { font-size: 20px; }
  .help-center-search { margin: 10px 14px 8px; }
  .help-quick-section { padding-inline: 14px; }
  .help-center-body { display: block; position: relative; overflow: hidden; }
  .help-article-list { display: none; position: absolute; z-index: 2; inset: 0 auto 0 0; width: min(86vw, 340px); padding: 14px 12px; background: var(--surface, #f8fbfb); border-right: 1px solid #dce6e7; box-shadow: 14px 0 32px rgba(13, 45, 50, .16); }
  .help-mobile-nav-open .help-article-list { display: block; overflow: auto; }
  .help-article-detail { height: 100%; min-height: 0; padding: 26px 18px 48px; }
  .help-article-detail h2 { font-size: 28px; }
}

@media (max-width: 820px) {
  .help-center-dialog { width: min(760px, 100vw); }
  .help-center-head { padding: 20px; }
  .help-center-search { margin-inline: 20px; }
  .help-quick-section { padding-inline: 20px; }
  .help-center-body { grid-template-columns: 260px minmax(0, 1fr); }
  .help-article-list { padding-left: 12px; }
  .help-article-detail { padding: 28px 24px 48px; }
}

@media (max-width: 620px) {
  .header-help { width: 40px; min-height: 40px; justify-content: center; padding: 0; }
  .header-help span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .help-center-dialog { width: 100vw; height: 100dvh; }
  .help-center-head { align-items: flex-start; padding: 16px; }
  .help-center-head h2 { font-size: 23px; }
  .help-center-head-actions .secondary-button { padding-inline: 9px; font-size: 0; }
  .help-center-search { margin: 12px 16px 10px; }
  .help-quick-section { padding: 0 16px 12px; }
  .help-center-body { display: block; overflow: auto; }
  .help-article-list { max-height: 38vh; overflow: auto; padding: 10px 12px 16px; border-right: 0; border-bottom: 1px solid #dce6e7; }
  .help-article-detail { min-height: 54vh; overflow: visible; padding: 24px 18px 48px; }
  .help-tour-card { right: 16px; bottom: 16px; }
}

/* Final responsive overrides keep the workspace rules above ahead of the
   legacy Help Center breakpoints. */
@media (max-width: 1180px) {
  .help-center-body { grid-template-columns: 280px minmax(0, 1fr); }
  .help-on-page { display: none; }
}
@media (max-width: 720px) {
  .help-center-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .help-center-head { padding: 12px 14px; }
  .help-center-head-actions { gap: 4px; }
  .help-mobile-nav { display: inline-flex; }
  .help-toolbar-button { width: 40px; min-height: 40px; justify-content: center; padding: 0; font-size: 0; }
  .help-toolbar-button span { display: none; }
  .help-center-search { margin: 10px 14px 8px; }
  .help-quick-section { padding-inline: 14px; }
  .help-center-body { display: block; position: relative; overflow: hidden; }
  .help-article-list { display: none; position: absolute; z-index: 2; inset: 0 auto 0 0; width: min(86vw, 340px); max-height: none; padding: 14px 12px; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 0; box-shadow: 14px 0 32px rgba(13, 45, 50, .16); }
  .help-mobile-nav-open .help-article-list { display: block; overflow: auto; }
  .help-article-detail { height: 100%; min-height: 0; overflow: auto; padding: 26px 18px 48px; }
  .help-article-detail h2 { font-size: 28px; }
}

html[data-theme="dark"] .help-center-dialog {
  color: #e7f0f2;
  background: #111b22;
  border-color: #31434b;
}
html[data-theme="dark"] .help-center-head,
html[data-theme="dark"] .help-article-detail { background: #16232b; border-color: #31434b; }
html[data-theme="dark"] .help-center-search,
html[data-theme="dark"] .help-quick-link { color: #b8cbd0; background: #1b2c35; border-color: #3a555e; }
html[data-theme="dark"] .help-article-list,
html[data-theme="dark"] .help-on-page { color: #c6d6da; background: #101a21; border-color: #31434b; }
html[data-theme="dark"] .help-article-link { color: #c6d6da; }
html[data-theme="dark"] .help-article-link:hover,
html[data-theme="dark"] .help-article-link:focus-visible { color: #8de1da; background: #203c43; }
html[data-theme="dark"] .help-article-detail header { border-color: #31434b; }
html[data-theme="dark"] .help-article-detail header p,
html[data-theme="dark"] .help-article-section ul,
html[data-theme="dark"] .help-article-detail li,
html[data-theme="dark"] .help-article-purpose { color: #c6d6da; }
html[data-theme="dark"] .help-article-purpose { background: #1d343b; }
html[data-theme="dark"] .help-callout-info { background: #172f3a; border-color: #315868; }
html[data-theme="dark"] .help-callout-warning { background: #3a3020; border-color: #7a5b26; }
html[data-theme="dark"] .help-related-articles { border-color: #31434b; }
html[data-theme="dark"] .help-related-link { color: #9be4de; background: #1d343b; border-color: #3a555e; }
html[data-theme="dark"] .help-on-page-links button { color: #9fb7bd; }
html[data-theme="dark"] .help-version-meta,
html[data-theme="dark"] .help-center-head > div > p:last-child { color: #9fb7bd; }

/* Knowledge Center enterprise workspace: final layout pass. */
.help-center-dialog {
  width: min(95vw, 1700px);
  height: min(94dvh, 1100px);
  max-height: 94dvh;
  inset: auto;
  margin: auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary, #117d78) 18%, #cbd9db);
  border-radius: 12px;
  box-shadow: 0 22px 70px rgba(13, 45, 50, .22);
}
.help-center-dialog::backdrop { background: rgba(9, 29, 33, .38); }
.help-center-shell { grid-template-rows: 64px 44px minmax(0, 1fr); }
.help-center-head {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(300px, 1.15fr) auto;
  align-items: center;
  gap: 24px;
  min-width: 0;
  padding: 8px 20px;
}
.help-center-head > div:first-child { min-width: 0; }
.help-center-head h2 { margin: 0; font-size: 20px; line-height: 1.1; }
.help-center-head > div > p:last-child { overflow: hidden; margin-top: 3px; text-overflow: ellipsis; white-space: nowrap; }
.help-version-meta { display: none; }
.help-center-search {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  border-radius: 6px;
}
.help-center-search input { min-height: 34px; font-size: 13px; }
.help-center-search .text-button { padding: 4px 6px; font-size: 12px; }
.help-center-head-actions { gap: 4px; min-width: 0; }
.help-toolbar-button,
.help-center-head-actions .icon-button { min-height: 34px; height: 34px; padding: 0 9px; border-radius: 6px; font-size: 12px; }
.help-toolbar-button .ui-icon,
.help-center-head-actions .icon-button .ui-icon { width: 15px; height: 15px; }
.help-mobile-nav { display: none; }
.help-quick-section {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 5px 20px;
  border-bottom: 1px solid #dce6e7;
}
.help-section-heading { flex: 0 0 auto; min-height: 28px; }
.help-section-heading h3 { font-size: 12px; }
.help-quick-links { min-width: 0; flex-wrap: nowrap; gap: 6px; margin-top: 0; overflow-x: auto; }
.help-quick-link { min-height: 30px; padding: 5px 9px; border-radius: 5px; font-size: 12px; }
.help-center-body { grid-template-columns: 336px minmax(0, 1fr) 230px; min-height: 0; overflow: hidden; }
.help-article-list { overflow-y: auto; overflow-x: hidden; padding: 14px 12px 24px 16px; }
.help-category-title { margin: 16px 8px 5px; }
.help-article-link { min-height: 38px; padding: 7px 9px; border-radius: 5px; }
.help-article-link span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-article-detail { overflow-y: auto; overflow-x: hidden; padding: 32px clamp(34px, 5vw, 88px) 56px; }
.help-article-detail > header,
.help-article-purpose,
.help-article-section,
.help-article-subheading,
.help-article-detail ol,
.help-related-articles { width: min(100%, 900px); max-width: 900px; margin-left: auto; margin-right: auto; }
.help-article-detail > header { padding-bottom: 18px; }
.help-article-detail h2 { font-size: clamp(28px, 2.6vw, 38px); }
.help-article-detail header p { font-size: 15px; }
.help-on-page { overflow: hidden; padding: 24px 16px; background: color-mix(in srgb, var(--surface, #f8fbfb) 88%, transparent); border-left: 1px solid #dce6e7; }
.help-on-page > strong { position: sticky; top: 0; display: block; padding-bottom: 8px; }
.help-on-page-links { position: static; gap: 2px; }
.help-on-page-links button { padding: 6px 8px; }
.help-on-page-links button.is-active { color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, transparent); border-left-color: var(--primary); font-weight: 700; }

@media (max-width: 1399px) {
  .help-center-dialog { width: min(96vw, 1500px); }
  .help-center-body { grid-template-columns: 320px minmax(0, 1fr); }
  .help-on-page { display: none; }
}
@media (max-width: 1023px) {
  .help-center-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .help-center-head { grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) auto; gap: 12px; }
  .help-center-body { position: relative; display: block; }
  .help-mobile-nav { display: inline-flex; }
  .help-article-list { display: none; position: absolute; z-index: 3; inset: 0 auto 0 0; width: min(340px, 84vw); height: 100%; background: var(--panel, #f8fbfb); box-shadow: 14px 0 32px rgba(13,45,50,.16); }
  .help-mobile-nav-open .help-article-list { display: block; }
  .help-article-detail { height: 100%; min-height: 0; padding: 28px clamp(24px, 6vw, 68px) 48px; }
}
@media (max-width: 720px) {
  .help-center-shell { grid-template-rows: 66px minmax(0, 1fr); }
  .help-center-head { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px 12px; }
  .help-center-head > div:first-child { grid-column: 1; }
  .help-center-head h2 { font-size: 18px; }
  .help-center-head > div > p:last-child { display: none; }
  .help-center-search { grid-column: 1 / -1; grid-row: 2; min-height: 32px; }
  .help-center-head-actions { grid-column: 2; grid-row: 1; }
  .help-center-head-actions .help-toolbar-button { width: 32px; padding: 0; font-size: 0; justify-content: center; }
  .help-center-head-actions .help-toolbar-button span { display: none; }
  .help-center-head-actions .icon-button { width: 32px; padding: 0; }
  .help-quick-section { display: none; }
  .help-article-detail { padding: 24px 18px 44px; }
  .help-article-detail h2 { font-size: 27px; }
}
html[data-theme="dark"] .help-center-dialog { background: #111b22; border-color: #31434b; }
html[data-theme="dark"] .help-center-search,
html[data-theme="dark"] .help-quick-section { border-color: #31434b; }
html[data-theme="dark"] .help-on-page-links button.is-active { background: rgba(141,225,218,.12); }

@media print {
  body.printing-help-article > *:not(#helpCenterDialog) { display: none !important; }
  body.printing-help-article #helpCenterDialog { position: static; display: block; width: auto; height: auto; max-height: none; overflow: visible; border: 0; box-shadow: none; }
  body.printing-help-article .help-center-head,
  body.printing-help-article .help-center-search,
  body.printing-help-article .help-quick-section,
  body.printing-help-article .help-article-list,
  body.printing-help-article .help-center-head-actions,
  body.printing-help-article .help-related-articles,
  body.printing-help-article .help-on-page { display: none !important; }
  body.printing-help-article .help-center-body { display: block; }
  body.printing-help-article .help-article-detail { padding: 0; overflow: visible; }
}

/* Enterprise authentication page */
.auth-screen {
  min-height: 100svh;
  padding: 28px 18px;
  background: #f2f6f6;
}

.auth-card {
  width: min(480px, 100%);
  gap: 20px;
  padding: 30px;
  border: 1px solid #d8e3e5;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(21, 58, 63, 0.09);
  transition: width 180ms ease;
}

.auth-card.request-mode {
  width: min(480px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.auth-brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  color: #fff;
  background: #0e7b77;
  border-radius: 8px;
}

.auth-brand-mark .ui-icon {
  width: 24px;
  height: 24px;
}

.auth-brand .eyebrow,
.auth-brand h1,
.auth-brand p,
.auth-intro h2,
.auth-intro p,
.auth-form-note,
.email-link-intro p,
.email-link-success p {
  margin: 0;
}

.auth-brand .eyebrow {
  color: #0b716d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-brand h1 {
  margin-top: 2px;
  color: #17343b;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.auth-brand p:last-child {
  margin-top: 3px;
  color: #6a7d83;
  font-size: 12px;
  line-height: 1.35;
}

.auth-intro {
  display: grid;
  gap: 5px;
  padding-top: 2px;
}

.auth-intro h2 {
  color: #17343b;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-intro p {
  color: #667a80;
  font-size: 14px;
  line-height: 1.5;
}

.auth-form,
.auth-method-form,
.auth-request-form {
  gap: 15px;
}

.auth-card label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #29444b;
  font-size: 13px;
  font-weight: 600;
}

.auth-card input,
.auth-card select {
  width: 100%;
  min-width: 0;
  height: 45px;
  padding: 10px 12px;
  color: #17343b;
  background: #fff;
  border: 1px solid #cbdadd;
  border-radius: 6px;
  outline: none;
  box-shadow: none;
}

.auth-card input::placeholder {
  color: #91a0a4;
}

.auth-card input:hover,
.auth-card select:hover {
  border-color: #9eb7bb;
}

.auth-card input:focus,
.auth-card select:focus {
  border-color: #0e7b77;
  box-shadow: 0 0 0 3px rgba(14, 123, 119, 0.13);
}

.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: #17343b;
  box-shadow: 0 0 0 1000px #fff inset;
}

.auth-input-icon,
.password-field {
  position: relative;
  display: block;
  min-width: 0;
}

.auth-input-icon > .ui-icon,
.password-field > .field-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  color: #688087;
  pointer-events: none;
  transform: translateY(-50%);
}

.auth-input-icon input,
.password-field input {
  padding-left: 40px;
}

.password-field input {
  padding-right: 47px;
}

.password-toggle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 5px;
  display: grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0;
  color: #526b72;
  background: transparent;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  transform: translateY(-50%);
}

.password-toggle .ui-icon {
  width: 18px;
  height: 18px;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #0e716d;
  background: #eaf3f2;
}

.password-toggle.is-revealed::after {
  position: absolute;
  width: 21px;
  height: 1.5px;
  content: "";
  background: currentColor;
  transform: rotate(-42deg);
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-field-control {
  display: grid;
  gap: 7px;
}

.auth-label-row > label {
  display: block;
}

.auth-text-button {
  flex: 0 0 auto;
  min-height: auto;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.auth-primary-button {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 16px;
  color: #fff;
  background: #0e7b77;
  border: 1px solid #0e7b77;
  border-radius: 6px;
  box-shadow: none;
  font-weight: 800;
}

.auth-primary-button .ui-icon {
  width: 17px;
  height: 17px;
}

.auth-primary-button:hover,
.auth-primary-button:focus-visible {
  background: #096763;
  border-color: #096763;
}

.auth-primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-primary-button[aria-busy="true"]::before {
  width: 15px;
  height: 15px;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-button-spin 700ms linear infinite;
}

@keyframes auth-button-spin {
  to { transform: rotate(360deg); }
}

.auth-field-group {
  display: grid;
  gap: 13px;
  min-width: 0;
  margin: 0;
  padding: 0 0 17px;
  border: 0;
  border-bottom: 1px solid #e4ebec;
}

.auth-field-group:last-of-type {
  padding-bottom: 0;
  border-bottom: 0;
}

.auth-field-group legend {
  width: 100%;
  margin: 0 0 1px;
  padding: 0;
  color: #17343b;
  font-size: 14px;
  font-weight: 800;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.auth-help,
.auth-form-note {
  color: #6b7f84;
  font-size: 12px;
  line-height: 1.5;
}

.auth-form-note {
  padding: 11px 12px;
  color: #536d73;
  text-align: center;
  background: #f3f7f7;
  border: 1px solid #dfe8e9;
  border-radius: 6px;
}

.auth-message {
  display: none;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.auth-message.is-visible {
  display: block;
}

.auth-message.is-error {
  color: #9f2f2f;
  background: #fff2f2;
  border-color: #efcaca;
}

.auth-message.is-success {
  color: #176b46;
  background: #eef8f2;
  border-color: #cce7d7;
}

.email-link-intro,
.email-link-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  color: #49646b;
  background: #f4f8f8;
  border: 1px solid #dde8e9;
  border-radius: 6px;
}

.email-link-intro > .ui-icon,
.email-link-success > .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  color: #0e7b77;
}

.email-link-intro p,
.email-link-success p {
  font-size: 12px;
  line-height: 1.45;
}

.email-link-success {
  color: #176b46;
  background: #eef8f2;
  border-color: #cce7d7;
}

.email-link-success strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.auth-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-top: 16px;
  color: #788a8f;
  border-top: 1px solid #e5ecec;
  font-size: 11px;
  text-align: center;
}

.auth-security-note .ui-icon {
  width: 15px;
  height: 15px;
  color: #4b7677;
}

@media (max-width: 560px) {
  .auth-screen {
    align-items: start;
    padding: 12px;
  }

  .auth-card,
  .auth-card.request-mode {
    width: 100%;
    gap: 17px;
    padding: 22px 18px;
    box-shadow: 0 10px 30px rgba(21, 58, 63, 0.08);
  }

  .auth-brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .auth-brand h1 {
    font-size: 19px;
  }

  .auth-brand p:last-child {
    display: none;
  }

  .auth-intro h2 {
    font-size: 24px;
  }

  .auth-form-grid {
    grid-template-columns: 1fr;
  }
}

/* PTW detail and account cleanup */
.timeline-permit-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
}

.timeline-permit-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.timeline-permit-summary > strong,
.timeline-permit-summary > span,
.timeline-permit-summary > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-permit-summary > strong {
  overflow: visible;
  color: #183b42;
  text-overflow: clip;
  white-space: nowrap;
}

.timeline-permit-summary > span {
  color: #314f56;
  font-size: 12px;
}

.timeline-permit-summary > small {
  color: #718087;
  font-size: 11px;
}

.timeline-permit-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-permit-meta .status-badge {
  white-space: nowrap;
}

.dashboard-timeline-events {
  padding: 8px 16px 16px;
}

.dashboard-timeline-event {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 0;
}

.dashboard-timeline-event-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
}

.dashboard-timeline-event-head strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-timeline-event-head time {
  color: #6c7f85;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.dashboard-timeline-event-actor {
  margin-top: 3px;
  color: #667a80;
  font-size: 11px;
}

.dashboard-timeline-event p {
  margin: 5px 0 0;
  line-height: 1.4;
}

.account-settings-grid {
  gap: 14px;
}

.settings-card {
  gap: 13px;
  padding: 17px;
  box-shadow: 0 5px 16px rgba(21, 58, 63, 0.04);
}

.settings-card-head {
  gap: 10px;
}

.settings-card-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.settings-card-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.account-facts div {
  padding: 9px 10px;
}

.settings-message {
  min-height: 0;
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.settings-message.is-success { color: #176b46; }
.settings-message.is-error { color: #a23838; }

.permit-history-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: hidden;
}

.permit-history-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  color: #1f3c43;
  background: #f4f8f8;
  border: 1px solid #dce6e7;
  border-radius: 7px;
}

.permit-history-summary span {
  color: #657a80;
  font-size: 12px;
  text-align: right;
}

.permit-history-list {
  max-height: min(520px, calc(100vh - 230px));
  overflow: auto;
  padding-right: 4px;
}

.permit-history-event {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid #e3eaeb;
}

.permit-history-event:last-child { border-bottom: 0; }

.permit-history-event-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #fff;
  background: #16817c;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.permit-history-event-body { min-width: 0; }

.permit-history-event-head,
.permit-history-event-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.permit-history-event-head strong {
  overflow: hidden;
  color: #24434a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permit-history-event-head time {
  color: #6c7d83;
  font-size: 11px;
  white-space: nowrap;
}

.permit-history-event-meta {
  margin-top: 4px;
  color: #60757b;
  font-size: 12px;
}

.permit-history-event p {
  margin: 7px 0 0;
  padding: 8px 10px;
  color: #3e575e;
  background: #f7f9f9;
  border-left: 3px solid #9ec1bf;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .timeline-permit-toggle {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  .timeline-permit-meta {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
  }

  .dashboard-timeline-events {
    padding: 6px 12px 14px;
  }

  .dashboard-timeline-event-head {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .dashboard-timeline-event-head time {
    white-space: nowrap;
  }

  .permit-history-summary,
  .permit-history-event-head,
  .permit-history-event-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .permit-history-summary span { text-align: left; }
}

/* Minimal enterprise login */
.auth-card {
  width: min(430px, 100%);
  gap: 18px;
  padding: 32px;
}

.auth-card.signup-mode {
  width: min(480px, 100%);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 9px;
  text-align: center;
}

.auth-brand-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.auth-brand-mark .ui-icon {
  width: 21px;
  height: 21px;
}

.auth-brand h1 {
  margin-top: 1px;
  font-size: 20px;
}

.auth-brand p:last-child {
  margin-top: 3px;
  color: #718187;
  font-size: 12px;
}

.auth-intro {
  justify-items: center;
  padding: 3px 0 1px;
  text-align: center;
}

.auth-intro h2 {
  font-size: 25px;
  font-weight: 700;
}

.auth-card input,
.auth-card select,
.auth-email-link-dialog input {
  border-radius: 8px;
}

.auth-primary-button,
.auth-secondary-button {
  border-radius: 8px;
}

.auth-login-secondary {
  display: grid;
  gap: 15px;
}

.auth-company-setup {
  display: grid;
  gap: 13px;
}

.auth-company-context {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 10px 9px 13px;
  color: #28454b;
  background: #f3f8f7;
  border: 1px solid #d8e5e5;
  border-radius: 8px;
}

.auth-company-context span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.auth-company-context small {
  color: #718287;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-company-context strong {
  overflow: hidden;
  color: #17343b;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-company-context .auth-text-button,
.auth-login-help-trigger,
.auth-login-help-options .auth-text-button {
  min-height: 44px;
  padding: 6px 8px;
}

.auth-login-help-trigger {
  justify-self: center;
}

.auth-login-help-options {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding-top: 9px;
  border-top: 1px solid #e3ebec;
  text-align: center;
}

.auth-login-help-options .auth-recovery-copy {
  max-width: 330px;
  margin: 2px 0 0;
  color: #687b81;
  font-size: 12px;
  line-height: 1.45;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 11px;
  color: #8a999d;
  font-size: 12px;
  text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  content: "";
  background: #e0e8e9;
}

.auth-secondary-button {
  display: inline-flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  color: #25444b;
  background: #fff;
  border: 1px solid #cbd9dc;
  box-shadow: none;
  font-weight: 700;
}

.auth-secondary-button .ui-icon {
  width: 17px;
  height: 17px;
  color: #0e7b77;
}

.auth-secondary-button:hover,
.auth-secondary-button:focus-visible {
  color: #0a6966;
  background: #f3f8f7;
  border-color: #87aaa9;
}

.auth-account-switch {
  margin: 0;
  color: #687b81;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.auth-mode-link {
  min-height: auto;
  margin-left: 3px;
  padding: 0;
  color: #0b716d;
  background: transparent;
  border: 0;
  box-shadow: none;
  font-weight: 800;
}

.auth-mode-link:hover,
.auth-mode-link:focus-visible {
  color: #075a57;
  background: transparent;
  text-decoration: underline;
}

.auth-form-note {
  padding: 9px 11px;
}

.auth-email-link-dialog {
  width: min(440px, calc(100vw - 28px));
}

.auth-email-link-dialog > label {
  display: grid;
  gap: 7px;
  color: #29444b;
  font-size: 13px;
  font-weight: 600;
}

.auth-email-link-dialog input {
  width: 100%;
  height: 45px;
  padding: 10px 12px 10px 40px;
  color: #17343b;
  background: #fff;
  border: 1px solid #cbdadd;
  outline: none;
}

.auth-email-link-dialog input:focus {
  border-color: #0e7b77;
  box-shadow: 0 0 0 3px rgba(14, 123, 119, 0.13);
}

@media (max-width: 560px) {
  .auth-card,
  .auth-card.signup-mode {
    width: 100%;
    padding: 24px 20px;
  }

  .auth-brand p:last-child {
    display: block;
  }
}
/* Guided PTW creation and structured control-of-work actions */
.permit-wizard {
  display: grid;
  gap: 20px;
}

.permit-wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line, #d6e0e4);
  border-radius: 8px;
  background: #fff;
}

.permit-wizard-steps .wizard-step {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 10px;
  color: #40545c;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
  font-weight: 700;
}

.permit-wizard-steps .wizard-step span {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border: 1px solid #9bb0b8;
  border-radius: 50%;
}

.permit-wizard-steps .wizard-step.is-current {
  color: #fff;
  background: #0f766e;
}

.permit-wizard-steps .wizard-step.is-current span,
.permit-wizard-steps .wizard-step.is-complete span {
  border-color: currentColor;
}

.permit-wizard-steps .wizard-step.is-complete:not(.is-current) {
  color: #116149;
  background: #eef8f4;
}

.wizard-panel {
  min-width: 0;
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line, #d6e0e4);
  border-radius: 8px;
  background: #fff;
}

.wizard-panel-head h3,
.wizard-panel-head p {
  margin: 0;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 2px;
}

.wizard-save-row {
  justify-content: flex-end;
}

.routing-summary,
.permit-review-summary,
.wizard-missing {
  padding: 16px;
  border: 1px solid #d7e2e5;
  border-radius: 7px;
  background: #f8fbfb;
}

.permit-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.permit-review-item {
  display: grid;
  gap: 3px;
}

.permit-review-item span {
  color: #64777e;
  font-size: .82rem;
}

.wizard-missing:empty {
  display: none;
}

.wizard-missing.has-errors {
  color: #9f2727;
  border-color: #efb4b4;
  background: #fff6f6;
}

.selected-attachment-list {
  display: grid;
  gap: 8px;
}

.selected-attachment-list:empty {
  display: none;
}

.selected-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid #d7e2e5;
  border-radius: 7px;
  background: #f8fbfb;
}

.selected-attachment-item > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.selected-attachment-item strong {
  overflow-wrap: anywhere;
}

.selected-attachment-item span {
  color: #64777e;
  font-size: .82rem;
}

.selected-attachment-evidence {
  display: grid;
  gap: 0.25rem;
  min-width: min(18rem, 100%);
  color: var(--muted);
  font-size: 0.78rem;
}

.selected-attachment-evidence select {
  width: 100%;
  min-width: 0;
}

.permit-evidence-status {
  margin-top: 0.75rem;
}

.permit-evidence-status > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.65rem;
}

.permit-evidence-status span {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--panel);
  min-width: 0;
}

.permit-evidence-status .is-uploaded {
  border-color: color-mix(in srgb, var(--approved) 45%, var(--line));
}

.permit-evidence-status .is-missing {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.permit-requirements-load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line));
  border-radius: 0.75rem;
}

@media (max-width: 600px) {
  .selected-attachment-item,
  .permit-requirements-load-error {
    align-items: stretch;
    flex-direction: column;
  }
}

.selected-attachment-remove {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #d7e2e5;
  background: #fff;
  color: #9f2727;
}

.control-action-dialog {
  width: min(680px, calc(100vw - 32px));
}

.control-action-fields {
  display: grid;
  gap: 12px;
  max-height: min(56vh, 560px);
  overflow: auto;
  padding: 2px;
}

.control-action-fields fieldset {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid #d7e2e5;
  border-radius: 7px;
}

.control-action-fields .declaration-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}

.control-action-fields .declaration-check input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.closure-declarations {
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid #d7e2e5;
  border-radius: 8px;
  overflow: hidden;
}

.closure-declarations legend {
  width: 100%;
  padding: 12px 14px;
  border-bottom: 1px solid #d7e2e5;
  background: #f5f9f9;
  font-weight: 700;
}

.closure-declaration-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 14px;
  border-bottom: 1px solid #e7edef;
}

.closure-declaration-row:last-child {
  border-bottom: 0;
}

.closure-declaration-options {
  display: flex;
  align-items: center;
  gap: 14px;
}

.closure-declaration-options label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin: 0;
  white-space: nowrap;
}

.closure-declaration-options input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.closure-review-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #b9d8d5;
  border-radius: 8px;
  background: #f3faf9;
}

.closure-review-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.closure-review-summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
}

.closure-review-summary dt,
.closure-review-summary dd,
.closure-review-summary p {
  margin: 0;
}

.closure-review-summary dd {
  font-weight: 700;
}

.control-action-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.control-action-summary-grid > span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #d7e2e5;
  border-radius: 7px;
  background: #f8fbfb;
}

.control-action-summary-grid small,
.legal-evidence-row span,
.review-change-row span {
  color: #65777d;
  font-size: .78rem;
}

.control-action-summary-grid strong {
  overflow-wrap: anywhere;
}

.legal-evidence-list {
  display: grid;
  gap: 0;
}

.legal-evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 18px;
  padding: 12px 0;
  border-bottom: 1px solid #e3eaec;
}

.legal-evidence-row:last-child {
  border-bottom: 0;
}

.legal-evidence-row > div {
  display: grid;
  gap: 3px;
}

.legal-evidence-row time {
  color: #53676e;
  font-size: .82rem;
  white-space: nowrap;
}

.legal-evidence-row p {
  grid-column: 1 / -1;
  margin: 3px 0 0;
  color: #334a51;
}

.review-changes {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d6e1e4;
  border-radius: 8px;
  background: #fbfdfd;
}

.review-changes h3,
.review-changes p {
  margin: 0;
}

.correction-reference {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  color: #794d00;
  border-left: 4px solid #d28a00;
  background: #fff8e8;
}

.review-change-list {
  display: grid;
  gap: 10px;
}

.review-change-row {
  display: grid;
  grid-template-columns: minmax(140px, .65fr) repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #e3eaec;
}

.review-change-row:last-child {
  border-bottom: 0;
}

.review-change-row > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 3px;
}

.review-change-row p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.permit-board-filters {
  grid-template-columns: minmax(180px, .8fr) minmax(160px, .65fr) minmax(240px, 1.6fr);
}

.permit-board-list {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 14px;
  border: 1px solid #d7e1e4;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.permit-board-list .dashboard-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.permit-board-table {
  min-width: 940px;
  table-layout: auto;
}

.permit-board-table th,
.permit-board-table td {
  padding: 12px 10px;
  vertical-align: middle;
  white-space: normal;
}

.permit-board-table .status-badge {
  max-width: 100%;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
}

.permit-board-table .board-permit-cell,
.permit-board-table .board-job-cell,
.permit-board-table .board-validity-cell,
.permit-board-table .board-next-action-cell {
  line-height: 1.35;
}

.permit-board-table .board-permit-cell > *,
.permit-board-table .board-job-cell > *,
.permit-board-table .board-validity-cell > *,
.permit-board-table .board-next-action-cell > * {
  display: block;
}

.permit-board-table .board-permit-cell small,
.permit-board-table .board-job-cell small,
.permit-board-table .board-validity-cell small,
.permit-board-table .board-next-action-cell .board-warning {
  margin-top: 4px;
}

.permit-board-table .board-permit-cell {
  min-width: 145px;
}

.permit-board-table .board-permit-cell strong,
.permit-board-table .board-validity-cell time,
.permit-board-table .board-validity-cell small,
.permit-board-table .board-open-cell .table-action {
  white-space: nowrap;
}

.permit-board-table .board-job-cell {
  min-width: 220px;
  max-width: 330px;
}

.permit-board-table .board-holder-cell {
  min-width: 120px;
}

.permit-board-table .board-status-cell {
  min-width: 180px;
}

.permit-board-table .board-validity-cell {
  min-width: 155px;
}

.permit-board-table .board-next-action-cell {
  min-width: 170px;
}

.permit-board-table .board-open-cell {
  width: 74px;
  text-align: right;
}

.permit-board-table .board-open-cell .table-action {
  min-width: 58px;
}

.permit-board-table .board-permit-cell small,
.permit-board-table .board-job-cell small,
.permit-board-table .board-validity-cell small {
  color: #63777d;
}

.board-warning {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 0;
  padding: 3px 7px;
  color: #922d20;
  background: #fff0ed;
  border-radius: 5px;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.permit-board-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.permit-board-pagination span,
.permit-board-state {
  color: #61747b;
  font-size: .84rem;
}

.permit-board-empty {
  padding: 34px 20px;
  border: 0;
}

.permit-board-filters select:disabled {
  color: #28484f;
  background: #f4f8f8;
  opacity: 1;
}

.dashboard-content-grid-no-side {
  grid-template-columns: minmax(0, 1fr);
}

.client-admin-dashboard-columns.no-side-panels {
  grid-template-columns: minmax(0, 1fr);
}

.governed-template-panel {
  display: grid;
  gap: 18px;
}

.governed-template-form {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid #dde6e8;
}

.governed-template-form h4 {
  margin: 0;
}

.governed-template-form textarea {
  min-height: 104px;
}

.wizard-simops-review,
.review-simops-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d6e1e4;
  border-left: 4px solid #138a85;
  border-radius: 8px;
  background: #f8fbfb;
}

.review-simops-summary h3,
.review-simops-summary p,
.wizard-simops-review p {
  margin: 0;
}

.review-simops-summary.has-errors {
  border-left-color: #bd3f3f;
  background: #fff7f7;
}

.simops-conflict-list {
  display: grid;
  gap: 8px;
}

.simops-conflict-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(210px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #dce6e8;
  border-radius: 7px;
  background: #fff;
}

.simops-conflict-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.simops-conflict-row span,
.simops-conflict-row time,
.simops-conflict-empty {
  color: #60757b;
  font-size: .82rem;
}

.simops-conflict-row time {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .permit-wizard-steps {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
  }

  .permit-wizard-steps .wizard-step {
    justify-content: center;
    font-size: 0;
  }

  .permit-wizard-steps .wizard-step span {
    font-size: .88rem;
  }

  .permit-review-grid {
    grid-template-columns: 1fr;
  }

  .review-change-row {
    grid-template-columns: 1fr 1fr;
  }

  .review-change-row > strong {
    grid-column: 1 / -1;
  }

  .permit-board-filters {
    grid-template-columns: 1fr 1fr;
  }

  .simops-conflict-row {
    grid-template-columns: minmax(200px, 1fr) auto;
  }

  .simops-conflict-row time {
    grid-column: 1 / -1;
  }

  .permit-board-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .wizard-panel {
    padding: 16px;
  }

  .wizard-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .wizard-actions .actions,
  .wizard-actions button {
    width: 100%;
  }

  .control-action-summary-grid,
  .closure-review-summary dl,
  .review-change-row,
  .permit-board-filters,
  .simops-conflict-row {
    grid-template-columns: 1fr;
  }

  .closure-declaration-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .simops-conflict-row time {
    grid-column: auto;
    white-space: normal;
  }

  .review-change-row > strong,
  .permit-board-search {
    grid-column: auto;
  }

    .legal-evidence-row {
    grid-template-columns: 1fr;
  }

  .legal-evidence-row time {
    white-space: normal;
  }
}
.temporary-job-fields {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px solid #b9d8d4;
  border-left: 4px solid #0f8a83;
  border-radius: 8px;
  background: #f6fbfa;
}

.permit-duration {
  align-self: end;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #cbd9dc;
  border-radius: 8px;
  background: #f7fafb;
  color: #173b43;
  font-weight: 700;
}

.status-shared-rig {
  background: #e8f4f6;
  color: #155e68;
  border: 1px solid #b9dce1;
}

.shared-rig-label {
  display: block;
  margin-top: 4px;
  color: #155e68;
  font-weight: 700;
  white-space: nowrap;
}

.shared-holder-policy-card {
  margin-top: 16px;
}

.shared-holder-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.shared-holder-policy-grid .declaration-check {
  align-items: flex-start;
  min-height: 72px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfb;
}

@media (max-width: 900px) {
  .shared-holder-policy-grid {
    grid-template-columns: 1fr;
  }
}

[data-permit-countdown] {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

[data-permit-countdown].timer-warning {
  color: #b45309;
}

/* Permit toolbar: keep the operational summary left and a compact control group right. */
.permit-workspace-topbar .permit-toolbar-group {
  min-width: 0;
}

.permit-workspace-topbar .permit-filter-bar {
  grid-template-columns: minmax(260px, 300px) 190px 170px 190px auto auto;
  justify-content: end;
  align-items: center;
}

.permit-workspace-topbar .permit-filter-search {
  width: 100%;
  min-width: 0;
}

.permit-workspace-topbar .clear-permit-filters {
  min-height: 42px;
  padding: 8px 12px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  font-weight: 700;
}

.permit-workspace-topbar .clear-permit-filters:hover,
.permit-workspace-topbar .clear-permit-filters:focus-visible {
  background: var(--panel-muted);
  border-color: var(--primary);
  color: var(--primary-strong);
}

@media (max-width: 1260px) and (min-width: 901px) {
  .permit-workspace-topbar .permit-filter-bar {
    grid-template-columns: minmax(260px, 280px) 170px 150px 170px auto auto;
    gap: 8px;
  }
}

@media (max-width: 900px) {
  .permit-workspace-topbar .permit-filter-bar {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }
}

[data-permit-countdown].timer-ended {
  color: #b4232c;
  font-weight: 700;
}

.one-time-job-tag {
  border-color: #87c8bd;
  background: #e6f6f2;
  color: #0c625d;
}

.review-governance-warning,
.overdue-closure-warning {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid #e2b75b;
  border-left: 4px solid #bd7c00;
  border-radius: 8px;
  background: #fff9e9;
  color: #5c4008;
}

.review-governance-warning span,
.review-governance-warning small,
.overdue-closure-warning span {
  display: block;
}

.client-override-warning {
  border-color: #e2b75b;
  border-left-color: #bd7c00;
  background: #fff9e9;
}

.detail-alert.overdue-closure-warning {
  border-color: #e5a29b;
  border-left-color: #c53f35;
  background: #fff3f1;
  color: #7b2019;
}

@media (max-width: 760px) {
  .temporary-job-fields .form-grid {
    grid-template-columns: 1fr;
  }

  .permit-duration {
    width: 100%;
  }
}
/* Stage 1 Operational Profile: follows existing form controls and dialog spacing. */
.operational-profile-combobox { width: 100%; min-height: 42px; justify-content: space-between; text-align: left; }
.operational-profile-dialog-form, .operational-profile-status-card, .operational-profile-history, .operational-profile-workflow-preview { opacity: 1; filter: none; background: var(--surface, #fff); }
[data-operational-profile-industry-popup], [data-profile-popup] { position: relative; z-index: 30; margin: 8px 0 16px; border: 1px solid var(--border-color, #d7dde7); border-radius: 10px; background: var(--surface, #fff); padding: 8px; box-shadow: 0 10px 26px rgba(15, 23, 42, .14); }
[data-operational-profile-industry-popup] input, [data-profile-popup] input { position: sticky; top: 0; z-index: 2; width: 100%; margin-bottom: 6px; background: var(--surface, #fff); }
[data-operational-profile-industry-list], [data-profile-popup] [role="listbox"] { display: grid; max-height: 288px; overflow-y: auto; overscroll-behavior: contain; }
[data-operational-profile-industry-list] [role="option"], [data-profile-popup] [role="option"] { display: flex; width: 100%; min-height: 40px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: left; cursor: pointer; }
[data-operational-profile-industry-list] [role="option"]:hover, [data-operational-profile-industry-list] [role="option"].is-active, [data-operational-profile-industry-list] [role="option"][aria-selected="true"], [data-profile-popup] [role="option"]:hover, [data-profile-popup] [role="option"].is-active, [data-profile-popup] [role="option"][aria-selected="true"] { background: var(--surface-hover, #eef4ff); }
.operational-profile-dialog-form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(860px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); margin: 0; overflow: hidden; background: var(--surface, #fff); }
#operationalProfileDialog { width: min(860px, calc(100vw - 48px)); max-width: calc(100vw - 48px); max-height: calc(100dvh - 48px); padding: 0; overflow: hidden; background: var(--surface, #fff); }
.operational-profile-dialog-header { position: sticky; top: 0; z-index: 4; align-items: flex-start; padding: 20px 24px 16px; border-bottom: 1px solid var(--border-color, #d7dde7); background: var(--surface, #fff); }
.operational-profile-dialog-header h2 { margin: 0; }
.operational-profile-dialog-header p { margin: 8px 0 0; color: var(--muted-text, #667085); line-height: 1.5; }
.operational-profile-dialog-header .icon-action { position: absolute; top: 0; right: 0; }
.operational-profile-dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px 22px; background: var(--surface, #fff); }
.operational-profile-status-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; min-height: 68px; margin: 0 0 20px; padding: 11px 13px; border: 1px solid var(--border-color, #d7dde7); border-radius: 12px; background: var(--surface-subtle, #f8fafc); }
.operational-profile-status-card span { display: grid; gap: 4px; }.operational-profile-status-card small { color: var(--muted-text, #667085); }.operational-profile-status-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operational-profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }.operational-profile-fields label, .operational-profile-field { display: grid; gap: 8px; width: 100%; }.operational-profile-fields > [data-operational-profile-industry-popup], .operational-profile-fields > .form-error, .operational-profile-history, .operational-profile-workflow-preview { grid-column: 1 / -1; }.operational-profile-fields small { color: var(--muted-text, #667085); line-height: 1.35; }
.operational-profile-field .operational-profile-combobox, .operational-profile-fields > label .operational-profile-combobox { min-height: 42px; width: 100%; }
.operational-profile-workflow-preview { display: grid; gap: 4px; min-height: 18px; margin: 0; padding: 10px 12px; border: 1px solid var(--border-color, #d7dde7); border-radius: 9px; color: var(--muted-text, #667085); background: var(--surface-subtle, #f8fafc); }.operational-profile-workflow-preview strong { color: inherit; font-size: .8rem; }
.operational-profile-combobox:focus-visible { border-color: var(--accent, #2563eb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2563eb) 18%, transparent); outline: 0; }
.operational-profile-history { display: grid; gap: 4px; padding: 12px; border-radius: 10px; background: var(--surface-subtle, #f8fafc); color: var(--muted-text, #667085); }.operational-profile-history strong { color: inherit; }
.operational-profile-dialog-footer { position: sticky; bottom: 0; z-index: 4; justify-content: flex-end; margin: 0; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-color, #d7dde7); background: var(--surface, #fff); }
@media (max-width: 620px) { #operationalProfileDialog, .operational-profile-dialog-form { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); } .operational-profile-dialog-header, .operational-profile-dialog-body { padding-left: 16px; padding-right: 16px; } .operational-profile-fields { grid-template-columns: 1fr; } .operational-profile-fields > [data-operational-profile-industry-popup], .operational-profile-fields > .form-error, .operational-profile-history { grid-column: auto; } .operational-profile-dialog-footer { display: grid; grid-template-columns: 1fr; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); } }
