html {
  scroll-behavior: smooth;
}
.platform-app {
  min-height: 100vh;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: none;
}
.platform-chip {
  margin-left: auto;
  padding: 5px 6px;
  border-radius: var(--r);
  font-size: 9px;
  letter-spacing: 0.03em;
  background: var(--surface-2);
  color: var(--muted);
}
.btn svg,
.manage-btn svg,
.nav-item svg,
.icon-button svg,
.search-box svg,
.form-note svg,
.status-explainer svg,
.security-note svg,
.login-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 1;
}
.error {
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
  min-height: 18px;
}
/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--bg);
}
.login-brand {
  position: absolute;
  top: 28px;
  left: 34px;
  display: flex;
  align-items: center;
  gap: 11px;
}
.login-brand .brand-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-top: 1px;
  color: var(--muted);
}
.login-card {
  width: min(440px, 100%);
  padding: 32px;
}
.login-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: var(--brand-soft);
  color: var(--brand);
}
.login-icon svg {
  width: 24px;
  height: 24px;
}
.login-card h1 {
  font-size: 27px;
  letter-spacing: -0.035em;
  margin: 0 0 8px;
}
.login-card p {
  margin: 0 0 25px;
  line-height: 1.55;
}
.field label span {
  font-weight: 500;
  color: var(--muted);
}
/* Shell */
.platform-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 15px 14px;
  display: flex;
  flex-direction: column;
  z-index: 30;
  background: var(--surface);
  color: var(--muted);
  border-right: 1px solid var(--line);
}
.sidebar-brand {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 10px;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand .brand-wordmark {
  width: 120px;
  flex: 0 0 auto;
}
.sidebar-nav {
  padding-top: 14px;
  display: grid;
  gap: 5px;
}
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: var(--r);
  font-weight: 650;
  cursor: pointer;
  text-align: left;
  color: var(--muted);
}
.nav-item svg {
  width: 20px;
  height: 20px;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: inset 2px 0 0 var(--brand);
}
.sidebar-foot {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r);
}
.sidebar-foot strong {
  font-size: 16px;
}
.sidebar-foot p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--brand);
  margin: 7px 0 13px;
}
.sidebar-foot span {
  font-size: 11px;
  color: var(--brand);
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  color: var(--ink);
}
.topbar-spacer {
  flex: 1;
}
.owner-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.owner-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-round);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--brand-soft);
  color: var(--brand);
}
.owner-copy {
  display: grid;
  min-width: 150px;
}
.owner-copy strong {
  font-size: 13px;
  color: var(--ink);
}
.owner-copy span {
  font-size: 11px;
  color: var(--brand);
  margin-top: 2px;
}
.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
}
.icon-button:hover {
  background: var(--surface-2);
}
.mobile-menu {
  display: none;
  border: 0;
  background: transparent;
  font-size: 24px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--ink);
  min-width: 44px;
  min-height: 44px;
}
.main-content {
  padding: 22px 24px 44px;
  scroll-margin-top: 82px;
}
.content-grid {
  max-width: 1510px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: 20px;
  align-items: start;
}
.primary-column {
  min-width: 0;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 3px 2px 18px;
}
.page-head h1 {
  margin: 0 0 4px;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-size: var(--text-title);
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.page-head .btn {
  margin-top: 1px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat {
  min-height: 108px;
  padding: 15px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.stat-icon {
  width: 43px;
  height: 43px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: transparent;
  color: var(--brand);
}
.stat-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-icon.blue {
  background: var(--surface-2);
  color: var(--brand);
}
.stat-icon.green {
  background: var(--surface-2);
  color: var(--success);
}
.stat-icon.red {
  background: var(--surface-2);
  color: var(--danger);
}
.stat-copy {
  display: grid;
  min-width: 0;
}
.stat-copy > span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-copy strong {
  font-size: 26px;
  line-height: 1.05;
  margin-top: 4px;
  letter-spacing: -0.03em;
}
.stat-copy small {
  font-size: 11px;
  margin-top: 6px;
  color: var(--muted);
}
.client-card {
  overflow: hidden;
}
.toolbar {
  display: flex;
  gap: 12px;
  padding: 13px;
  border-bottom: 1px solid var(--line);
}
.search-box {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 11px;
  background: var(--surface);
  color: var(--muted);
  min-height: var(--control-height);
}
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: none;
}
.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 10px 0;
  color: var(--brand);
  background: transparent;
}
.toolbar select {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--brand);
  /* Native selects center their text; vertical padding clips it in WebKit. */
  padding: 0 34px 0 11px;
}
.table-wrap {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table th,
.table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  font-weight: 600;
}
.table tbody tr:hover {
  background: var(--surface);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
}
.company-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-round);
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--surface);
  font-size: 11px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.company-avatar.large {
  width: 48px;
  height: 48px;
  font-size: 14px;
}
.company-cell > div:last-child {
  display: grid;
}
.company-cell strong {
  font-size: 12.5px;
}
.company-cell small {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-sm);
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.ACTIVE {
  background: var(--surface-2);
  color: var(--success);
}
.badge.SUSPENDED {
  background: var(--surface-2);
  color: var(--danger);
}
.badge.ARCHIVED {
  background: var(--surface-2);
  color: var(--muted);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-round);
  background: currentColor;
}
.metric-cell {
  white-space: nowrap;
  font-size: 12px;
}
.metric-cell strong {
  font-size: 12.5px;
}
.metric-cell span {
  color: var(--muted);
}
.actions-column {
  text-align: right !important;
}
.manage-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-ink);
  border-radius: var(--r);
  padding: 7px 9px 7px 11px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.manage-btn:hover:not(:disabled),
.manage-btn:active:not(:disabled) {
  background: var(--button-secondary-hover);
  border-color: var(--line);
}
.manage-btn svg {
  width: 14px;
  height: 14px;
}
.table-footer {
  min-height: 53px;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
}
.pagination {
  display: flex;
  gap: 5px;
}
.pagination button {
  min-width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-ink);
  border-radius: var(--r);
  cursor: pointer;
}
.pagination button:hover:not(:disabled):not(.active),
.pagination button:active:not(:disabled):not(.active) {
  background: var(--button-secondary-hover);
}
.pagination button.active {
  background: var(--success);
  border-color: var(--success);
  color: var(--surface);
}
.pagination button:disabled,
.manage-btn:disabled {
  background: var(--surface);
  color: var(--brand);
  opacity: 0.42;
  cursor: not-allowed;
}
/* Audit */
.right-column {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 89px;
  scroll-margin-top: 85px;
}
.audit-card {
  overflow: hidden;
}
.panel-head {
  padding: 17px 17px 13px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.panel-head h2 {
  margin: 0;
  font-size: 15.5px;
  letter-spacing: -0.02em;
}
.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.audit-count {
  min-width: 27px;
  height: 27px;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.audit-list {
  max-height: 630px;
  overflow: auto;
  padding: 0 15px;
}
.audit-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.audit-row:last-child {
  border-bottom: 0;
}
.audit-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-round);
  display: grid;
  place-items: center;
}
.audit-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.audit-icon.success {
  background: var(--surface-2);
  color: var(--success);
}
.audit-icon.info {
  background: var(--surface-2);
  color: var(--info);
}
.audit-icon.danger {
  background: var(--surface-2);
  color: var(--danger);
}
.audit-icon.violet {
  background: var(--surface-2);
  color: var(--brand);
}
.audit-icon.warning {
  background: var(--surface-2);
  color: var(--warning);
}
.audit-copy {
  display: grid;
  min-width: 0;
}
.audit-copy strong {
  font-size: 11.5px;
  color: var(--brand);
}
.audit-copy span {
  font-size: 11.5px;
  margin-top: 2px;
  color: var(--brand);
}
.audit-copy small {
  font-size: 10.5px;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}
.security-note {
  display: flex;
  gap: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--brand);
}
.security-note svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
}
.security-note strong {
  font-size: 12px;
}
.security-note p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--brand);
}
/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  backdrop-filter: none;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 80;
  background: var(--scrim);
}
.modal {
  width: min(610px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 0;
}
.modal-wide {
  width: min(690px, 100%);
}
.modal-head {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.modal-head h2 {
  margin: 3px 0 5px;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.modal-kicker {
  color: var(--brand);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
}
.close-button {
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.close-button:hover {
  background: var(--surface-2);
}
.modal-form {
  padding: 5px 24px 22px;
}
.form-section {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.form-section-title {
  display: grid;
  margin-bottom: 8px;
}
.form-section-title strong {
  font-size: 13px;
}
.form-section-title span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-note,
.status-explainer {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--brand);
  padding: 10px 11px;
  font-size: 11.5px;
  line-height: 1.45;
  margin-top: 14px;
}
.form-note svg,
.status-explainer svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
  flex: 0 0 auto;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}
.modal-actions.split {
  justify-content: space-between;
}
.manage-summary {
  padding: 18px 24px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.manage-title {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.manage-title > strong {
  font-size: 16px;
}
.manage-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px 24px 3px;
}
.detail {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px;
}
.detail > span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 5px;
}
.detail > strong {
  font-size: 18px;
  letter-spacing: -0.02em;
}
.detail > strong small {
  font-size: 11px;
  color: var(--muted);
}
.detail-date {
  font-size: 12px !important;
  line-height: 1.4;
}
.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}
@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .right-column {
    position: static;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  }
  .audit-list {
    max-height: 420px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 820px) {
  .platform-shell {
    display: block;
  }
  .sidebar {
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: none;
    background: var(--surface);
    color: var(--muted);
    border-right: 1px solid var(--line);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .workspace {
    min-width: 0;
  }
  .topbar {
    padding: 0 14px;
    background: var(--surface);
    color: var(--ink);
  }
  .mobile-menu {
    display: block;
    color: var(--ink);
    min-width: 44px;
    min-height: 44px;
  }
  .main-content {
    padding: 18px 14px 35px;
  }
  .page-head {
    align-items: stretch;
  }
  .page-head .btn {
    align-self: flex-start;
  }
  .right-column {
    grid-template-columns: 1fr;
  }
  .owner-copy {
    display: none;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .search-box {
    flex-basis: 100%;
    min-height: var(--control-height);
  }
  .toolbar select {
    width: 100%;
    height: var(--control-height);
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .login-brand {
    left: 24px;
    top: 24px;
  }
}
@media (max-width: 560px) {
  .page-head {
    display: grid;
  }
  .page-head h1 {
    color: var(--ink);
    font-size: var(--text-title);
  }
  .page-head .btn {
    width: 100%;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    min-height: 98px;
    padding: 13px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    background: transparent;
    color: var(--brand);
  }
  .stat-copy strong {
    font-size: 23px;
  }
  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    padding: 10px;
    background: var(--scrim);
  }
  .modal-head {
    padding: 18px;
  }
  .modal-form {
    padding: 4px 18px 18px;
  }
  .manage-summary,
  .detail-grid {
    padding-left: 18px;
    padding-right: 18px;
  }
  .modal-actions.split {
    flex-direction: column;
  }
  .modal-actions.split .btn {
    width: 100%;
  }
  .login-wrap {
    padding: 18px;
  }
  .login-card {
    padding: 24px;
  }
  .login-brand {
    position: static;
    margin-bottom: 18px;
    justify-self: start;
    align-self: end;
  }
  .login-wrap {
    grid-template-rows: auto auto 1fr;
    align-items: start;
    background: var(--bg);
  }
  .login-card {
    align-self: start;
  }
}
@media (max-width: 390px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .owner-avatar {
    width: 34px;
    height: 34px;
    background: var(--brand-soft);
    color: var(--brand);
  }
  .topbar {
    height: 62px;
    background: var(--surface);
    color: var(--ink);
  }
}
.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.toolbar {
  flex-wrap: wrap;
}
.toolbar select {
  min-width: 150px;
  height: var(--control-height);
}
.field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 12px;
  font: inherit;
  background: var(--surface);
}
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  align-self: end;
  padding-bottom: 12px;
}
.checkbox-field input {
  width: 17px;
  height: 17px;
}
.table-subline {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.expiry-alert {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
}
.modal-wide {
  max-height: 92vh;
  overflow: auto;
}
@media (max-width: 820px) {
  .page-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .toolbar select {
    flex: 1;
    min-width: 135px;
    height: var(--control-height);
  }
}
/* Dedicated platform journal view */
.journal-page {
  max-width: 1460px;
  width: 100%;
  margin: 0 auto;
}
.journal-card {
  overflow: hidden;
}
.journal-toolbar {
  border-bottom: 1px solid var(--line);
}
.journal-list {
  padding: 0 20px;
}
.journal-list .audit-row {
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 17px 0;
}
.journal-list .audit-icon {
  width: 38px;
  height: 38px;
}
.audit-row-full .audit-copy {
  grid-template-columns:
    minmax(190px, 0.8fr) minmax(180px, 0.7fr) minmax(230px, 1fr)
    auto;
  align-items: center;
  column-gap: 18px;
}
.audit-row-full .audit-copy > strong,
.audit-row-full .audit-copy > span,
.audit-row-full .audit-copy > small {
  margin: 0;
}
.audit-row-full .audit-copy code {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 4px 7px;
  white-space: nowrap;
}
.journal-toolbar .search-box {
  max-width: 720px;
}
@media (max-width: 900px) {
  .audit-row-full .audit-copy {
    grid-template-columns: 1fr;
  }
  .audit-row-full .audit-copy > * {
    margin-top: 3px !important;
  }
  .audit-row-full .audit-copy code {
    justify-self: start;
    margin-top: 7px !important;
  }
  .journal-list {
    padding: 0 15px;
  }
}
.mfa-setup-card {
  max-width: 560px;
}
.mfa-instructions {
  display: grid;
  gap: 12px;
  text-align: left;
}
.mfa-instructions > strong {
  margin-top: 6px;
}
.mfa-secret {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  display: grid;
  gap: 6px;
}
.mfa-secret span {
  font-size: 0.78rem;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mfa-secret code,
.mfa-uri {
  overflow-wrap: anywhere;
  user-select: all;
}
.recovery-panel {
  display: grid;
  gap: 14px;
  text-align: left;
}
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.recovery-codes code {
  padding: 9px 10px;
  border-radius: var(--r);
  background: var(--surface-2);
  text-align: center;
  user-select: all;
}
@media (max-width: 560px) {
  .recovery-codes {
    grid-template-columns: 1fr;
  }
}
.platform-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.watch-card {
  overflow: hidden;
  margin-bottom: 14px;
}
.watch-list {
  display: grid;
}
.watch-row {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  text-align: left;
  padding: 11px 14px;
  cursor: pointer;
}
.watch-row:hover {
  background: var(--surface);
}
.watch-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-round);
  margin-top: 5px;
  background: var(--warning);
}
.watch-row.high .watch-dot {
  background: var(--danger);
}
.watch-row span:last-child {
  display: grid;
}
.watch-row strong {
  font-size: 11.5px;
  color: var(--brand);
}
.watch-row small {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.empty.compact {
  padding: 18px;
}
.storage-watch {
  border-top: 1px solid var(--line);
  padding: 11px 14px 12px;
  background: var(--surface);
}
.storage-watch-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 5px;
}
.storage-watch button {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.storage-watch button:hover span {
  color: var(--brand);
}
.storage-watch button span {
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.storage-watch button strong {
  font-size: 10.5px;
  color: var(--brand);
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .platform-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Progressive personnel editor inside the existing platform section and modals. */
.staff-tabs {
  justify-content: flex-start;
}
.staff-tabs [aria-pressed="true"],
.staff-tabs [aria-pressed="true"]:hover:not(:disabled) {
  background: var(--brand);
  color: var(--surface);
}
.permission-search {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.permission-search > label:first-child {
  flex: 1;
  min-width: 180px;
}
.permission-search input[type="search"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  font: inherit;
}
.permission-domains > details {
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin: 8px 0;
  padding: 0 12px;
}
.permission-domains summary,
.operator-actions > summary,
.effective-rights > summary,
.role-secondary > summary {
  cursor: pointer;
  padding: 13px 0;
  min-height: 44px;
  font-weight: 600;
}
.permission-domains summary span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 8px;
}
.permission-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.permission-row > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  min-height: 44px;
}
.permission-row span {
  min-width: 0;
}
.permission-row strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.permission-row small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 4px;
}
.permission-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 3px;
}
.permission-row select {
  width: 145px;
  flex: none;
}
.permission-fields {
  padding-left: 14px;
  border-left: 2px solid var(--line);
}
.permission-group {
  display: flex;
  gap: 8px;
  font-size: 12px;
  min-height: 40px;
  align-items: center;
}
.permission-save {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 12px 0;
  border-top: 1px solid var(--line);
  z-index: 2;
}
.operator-actions,
.effective-rights,
.role-secondary {
  border-top: 1px solid var(--line);
  margin-top: 14px;
}
.effective-rights ul {
  font-size: 13px;
  line-height: 1.8;
}
@media (max-width: 600px) {
  .permission-row select {
    width: 120px;
  }
  .permission-search {
    align-items: stretch;
    flex-direction: column;
  }
  .permission-save {
    justify-content: stretch;
  }
  .permission-save .btn {
    flex: 1;
  }
  .staff-tabs {
    flex-wrap: wrap;
  }
  .permission-fields {
    padding-left: 8px;
  }
}
/* Private journal: local updates, shared preview and keyboard-operable details. */
.journal-main-filters,
.journal-secondary-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  padding: 16px;
}
.journal-main-filters label,
.journal-secondary-filters label {
  display: flex;
  flex: 1 1 150px;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.journal-main-filters label.journal-search {
  flex: 2 1 220px;
}
.journal-main-filters input,
.journal-main-filters select,
.journal-secondary-filters select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 38px;
}
.journal-main-filters input,
.journal-main-filters select,
.journal-secondary-filters select {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
  background: var(--surface);
  color: var(--brand);
  font-size: 12px;
}
#journalList {
  padding: 0;
}
#journalError:empty {
  display: none;
}
@media (max-width: 820px) {
  .platform-shell .sidebar:not(.open) {
    visibility: hidden;
  }
}
#journalMoreFilters {
  margin: 0 16px;
}
#journalMoreFilters summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--brand);
  min-height: 32px;
  line-height: 32px;
}
.journal-secondary-filters {
  padding: 8px 0 12px;
}
.journal-reset {
  border: 0;
  background: none;
  color: var(--brand);
  text-decoration: underline;
  font-size: 12px;
  cursor: pointer;
  margin: 0 16px 12px;
  min-height: 28px;
}
.journal-status,
#journalError {
  margin: 0 16px;
  padding: 8px 0;
  font-size: 13px;
}
.journal-head,
.journal-entry {
  display: grid;
  grid-template-columns:
    minmax(115px, 1.05fr) minmax(120px, 1.1fr) minmax(150px, 1.5fr)
    minmax(100px, 1.2fr) 100px;
  gap: 14px;
  align-items: center;
  padding: 11px 16px;
}
.journal-head {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.journal-entry {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  font: inherit;
  font-size: 12px;
  color: var(--brand);
  cursor: pointer;
  min-height: 62px;
}
.journal-entry:hover {
  background: var(--surface-2);
}
.journal-entry:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: -3px;
}
.journal-entry > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.journal-entry strong {
  font-size: 12px;
  font-weight: 600;
}
.journal-entry small {
  display: block;
  font-size: 11px;
  margin-top: 3px;
  color: var(--muted);
}
.journal-when {
  font-size: 11px;
  color: var(--muted);
}
.journal-result {
  justify-self: start;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-sm);
  padding: 4px 7px;
  background: var(--surface-2);
  color: var(--muted);
}
.result-SUCCESS {
  background: var(--surface-2);
  color: var(--success);
}
.result-DENIED {
  background: var(--warning-soft);
  color: var(--warning);
}
.result-FAILED {
  background: var(--surface-2);
  color: var(--danger);
}
.journal-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.journal-history-note {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.journal-preview {
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  padding: 12px 16px;
}
.journal-preview .journal-when {
  grid-column: 1/-1;
}
.journal-preview > span:nth-child(3),
.journal-preview > span:nth-child(4) {
  grid-column: 1/-1;
}
.journal-preview > span:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
}
.journal-detail {
  padding: 0 24px 24px;
  overflow-wrap: anywhere;
}
.journal-detail dl {
  margin: 0 0 20px;
}
.journal-detail dl > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.journal-detail dt {
  font-size: 12px;
  color: var(--muted);
}
.journal-detail dd {
  margin: 0;
  font-size: 13px;
  white-space: pre-wrap;
}
.journal-change,
.journal-change-heading {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.2fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  white-space: pre-wrap;
}
.journal-change-heading {
  font-weight: 600;
  color: var(--muted);
}
.journal-change span {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  .journal-head,
  .journal-entry {
    grid-template-columns:
      105px minmax(100px, 1fr) minmax(110px, 1.2fr) minmax(90px, 1fr)
      80px;
    gap: 9px;
  }
  .journal-preview {
    grid-template-columns: 1fr auto;
  }
}
@media (max-width: 700px) {
  .journal-head {
    display: none;
  }
  .journal-entry {
    grid-template-columns: 1fr auto;
    gap: 6px;
    padding: 12px;
  }
  .journal-entry .journal-when,
  .journal-entry > span:nth-child(3),
  .journal-entry > span:nth-child(4) {
    grid-column: 1/-1;
  }
  .journal-entry > span:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
  }
  .journal-main-filters,
  .journal-secondary-filters {
    gap: 8px;
    padding: 12px;
  }
  .journal-main-filters label {
    flex-basis: 125px;
  }
  .journal-main-filters .journal-search {
    flex-basis: 100%;
  }
  .journal-main-filters .btn {
    width: 100%;
  }
  .journal-detail {
    padding: 0 14px 20px;
  }
  .journal-detail dl > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .journal-change {
    grid-template-columns: 1fr 1fr;
  }
  .journal-change strong {
    grid-column: 1/-1;
  }
  .journal-change-heading {
    grid-template-columns: 1fr 1fr;
  }
  .journal-change-heading span:first-child {
    display: none;
  }
}


#platformNotifButton { position: relative; }
#platformUnreadBadge { position: absolute; top: -5px; right: -5px; padding: 2px 5px; border-radius: 12px; background: var(--danger); color: var(--surface); font-size: 11px; }
#notifications .list-filter-row, #notifications .list-pagination { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-block: 16px; }
#notifications .list-filter-search { flex: 1; }
