#platform-header {
  min-height: 64px;
  background: #16243f;
}

#platform-header .brand {
  gap: 16px;
  font-size: 19px;
  font-weight: 700;
}

#platform-header .brand-mark { width: 22px; height: 24px; }
#platform-header .brand > span:last-child { padding-left: 16px; }
#platform-header .identity { font-size: 14px; }

#platform-main {
  width: min(1320px, calc(100% - 56px));
  margin: 38px auto 72px;
}

#platform {
  color: #1c2b45;
  font-size: 14px;
}

#platform .page-heading {
  align-items: center;
  border: 0;
  margin-bottom: 24px;
  padding: 0;
}

#platform .page-heading h1 {
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -.02em;
}

#platform .page-subtitle {
  color: #728096;
  font-size: 14px;
  margin: 7px 0 0;
}

#platform .page-heading .actions button {
  min-height: 42px;
  padding: 9px 17px;
  font-size: 14px;
}

#platform .workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  align-items: start;
  gap: 20px;
}

#platform .panel {
  border-color: #e0e7f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(27, 47, 79, .035);
}

#platform .list-panel { padding: 22px; }
#platform .list-heading { margin: 0 0 18px; }
#platform .list-heading h2 { margin: 0; font-size: 16px; font-weight: 700; }
#platform .filters { gap: 8px; margin: 0 0 20px; }
#platform .filters input,
#platform .filters select,
#platform .filters button { min-height: 42px; font-size: 13px; }
#platform .filters select { width: 112px; padding-inline: 12px 24px; }
#platform .search-field::before { top: 11px; }
#platform .search-field::after { top: 25px; }

#platform table { table-layout: fixed; }
#platform th, #platform td { border-bottom: 1px solid #edf1f6; padding: 14px 12px; }
#platform th {
  background: #f6f8fb;
  color: #748096;
  font-size: 12px;
  font-weight: 600;
}
#platform th:first-child { width: 47%; }
#platform th:nth-child(2) { width: 24%; }
#platform td:first-child { border-left-width: 2px; padding-left: 10px; }
#platform td .link-button { font-size: 14px; line-height: 1.5; }
#platform td small { margin-top: 3px; color: #8995a6; font-size: 12px; }
#platform tr.selected td { background: #f1f5ff; }
#platform tr.selected td:first-child { border-left-color: #315fc6; }
#platform .badge, #platform .code-pill {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
}
#platform .badge { background: #eaf7ed; color: #237747; }
#platform .badge.disabled, #platform .code-pill { background: #f0f3f7; color: #6b798e; }
#platform .badge::before, #platform .pending-status::before { width: 7px; height: 7px; }
#platform .pending-status { font-size: 13px; }

#platform .detail { padding: 0; font-size: 14px; }
#platform #detail-empty { margin: 0; padding: 28px; }
#platform .detail-heading { border: 0; padding: 24px 24px 18px; }
#platform .company-profile { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
#platform .company-monogram {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  background: #edf2ff;
  color: #315ebd;
  font-size: 19px;
  font-weight: 700;
}
#platform .company-profile-copy { min-width: 0; }
#platform .detail h2 { margin: 0 0 9px; font-size: 20px; line-height: 1.4; }
#platform .detail-meta { gap: 8px; margin: 0; }
#platform .detail-links { gap: 16px; margin: 17px 0 0 60px; font-size: 13px; }
#platform .detail-links a { text-decoration: none; font-weight: 650; }
#platform .detail-links a:hover { text-decoration: underline; }
#platform .detail-links button { border-left-color: #e1e7ef; padding-left: 16px; }

#platform .admin-pending {
  margin: 0 24px 16px;
  padding: 10px 12px;
  font-size: 13px;
}
#platform .admin-pending button { min-height: 36px; font-size: 13px; }
#platform .warning-icon { width: 20px; height: 20px; font-size: 12px; }

#platform .detail-tabs {
  display: flex;
  gap: 26px;
  padding: 0 24px;
  border-bottom: 1px solid #e9edf3;
}
#platform .detail-tabs button {
  min-height: 44px;
  padding: 0 1px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #7a8798;
  font-size: 14px;
  font-weight: 600;
}
#platform .detail-tabs button:hover { color: #2456b5; }
#platform .detail-tabs button[aria-selected="true"] { border-bottom-color: #285bc4; color: #2456b5; }
#platform .detail-section { padding: 0 24px 24px; border: 0; }
#platform .overview-section { padding: 19px 0; border-bottom: 1px solid #edf1f6; }
#platform .overview-section h3 { margin: 0 0 10px; color: #69788e; font-size: 13px; font-weight: 600; }
#platform .overview-section p { margin: 0; }
#platform .brand-row { gap: 12px; align-items: center; padding: 0; font-weight: 600; }
#platform .brand-row .muted { color: #8a97a8; font-size: 12px; font-weight: 400; }
#platform .detail-footer { padding-top: 20px; }
#platform .detail-footer button { font-size: 13px; }

#platform .module-row { padding: 0; border-bottom: 1px solid #edf1f6; }
#platform .module-row > .module-summary { padding: 16px 0; }
#platform .module-row summary {
  display: list-item;
  list-style-position: outside;
  margin-left: 15px;
  padding: 15px 0;
  color: #8190a5;
}
#platform .module-summary {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #1c2b45;
  vertical-align: middle;
}
#platform .module-title { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 9px; }
#platform .module-title strong { font-size: 14px; }
#platform .module-state { border-radius: 5px; background: #edf4ff; color: #4269a9; padding: 2px 7px; font-size: 11px; }
#platform .module-state[data-status="UNGRANTED"], #platform .module-state[data-status="REVOKED"] {
  background: #f0f3f7;
  color: #758296;
}
#platform .module-state[data-status="EXPIRED"], #platform .module-state[data-status="SCHEDULED"] {
  background: #fff4e3;
  color: #a56814;
}
#platform .module-summary > small { white-space: nowrap; font-size: 12px; }
#platform .module-row form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 0 0 17px 15px;
}
#platform .module-row label { gap: 5px; color: #738196; font-size: 12px; font-weight: 500; }
#platform .module-row input, #platform .module-row button { min-height: 38px; font-size: 13px; }
#platform .module-row .actions { gap: 6px; }

#platform #audit li { padding: 14px 0; border-bottom: 1px solid #edf1f6; }
#platform #audit summary { font-size: 13px; }
#platform #audit time { color: #8a97a8; font-size: 12px; }
#platform #audit details p { overflow-wrap: anywhere; line-height: 1.6; }

#tenant-dialog { width: min(820px, calc(100% - 40px)); border-radius: 15px; }
#tenant-dialog .dialog-body { padding: 28px 32px; }
#tenant-dialog .dialog-heading h2 { font-size: 24px; }
#tenant-dialog .form-section { padding: 12px 0 18px; }
#tenant-dialog .form-section legend { font-size: 16px; }
#tenant-dialog .form-grid { gap: 14px 24px; }
#tenant-dialog .form-grid label, #tenant-dialog .password-field { font-size: 14px; }
#tenant-dialog input { font-weight: 400; }
#tenant-dialog input::placeholder { color: #98a4b5; }
#tenant-dialog .dialog-footer { position: sticky; bottom: 0; background: #fff; padding: 16px 30px; }

@media (max-width: 1000px) {
  #platform .workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  #platform-main { width: calc(100% - 28px); margin: 24px auto 48px; }
  #platform .page-heading { align-items: flex-start; gap: 18px; }
  #platform .page-heading h1 { font-size: 25px; }
  #platform .page-heading .actions { flex-wrap: wrap; }
  #platform .page-heading .actions button { min-height: 40px; padding-inline: 13px; }
  #platform .list-panel { padding: 18px 16px; }
  #platform .filters { flex-wrap: wrap; }
  #platform .search-field { flex-basis: 100%; }
  #platform th, #platform td { padding: 11px 6px; }
  #platform td:first-child { padding-left: 4px; }
  #platform td .link-button { font-size: 13px; }
  #platform .detail-heading { padding: 20px 18px 16px; }
  #platform .detail h2 { font-size: 18px; }
  #platform .detail-links { margin-left: 0; }
  #platform .detail-tabs { gap: 20px; padding-inline: 18px; }
  #platform .detail-section { padding: 0 18px 20px; }
  #platform .admin-pending { margin-inline: 18px; }
  #platform .module-row form { grid-template-columns: minmax(0, 1fr); }
  #tenant-dialog .dialog-body { padding: 22px 20px; }
  #tenant-dialog .form-grid { grid-template-columns: minmax(0, 1fr); }
  #tenant-dialog .dialog-footer { padding: 14px 20px; }
}
