:root {
  --bg: #020f2a;
  --bg-soft: #081a3f;
  --bg-soft-2: #0a2552;
  --panel: #ffffff;
  --text: #13233d;
  --muted: #5b6981;
  --brand: #001a48;
  --red: #ff0032;
  --line: #d9e0ec;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Lato", "Arial", sans-serif;
  background:
    radial-gradient(1000px 600px at 95% 0%, #0c2557 0%, #020f2a 50%),
    linear-gradient(130deg, #020f2a 0%, #041538 100%);
  color: var(--text);
  min-height: 100vh;
}

.hero {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 36px 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(120deg, #011338 0%, #031a45 72%, #05215a 100%);
  color: white;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.manager-tabs {
  width: fit-content;
  margin-top: 16px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  padding-top: 12px;
}

.manager-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
  border-radius: 0;
  padding: 8px 0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border-bottom: 2px solid transparent;
}

.manager-tab.active {
  background: transparent;
  color: #ffffff;
  border-bottom-color: #ff0032;
}

.manager-tab.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(255, 0, 50, 0.6);
  border-radius: 42% 58% 60% 40% / 58% 40% 60% 42%;
  pointer-events: none;
}

.hero::before {
  width: 480px;
  height: 480px;
  right: -170px;
  top: -140px;
}

.hero::after {
  width: 260px;
  height: 260px;
  right: 150px;
  top: -100px;
  opacity: 0.55;
}

.eyebrow {
  margin: 0;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #ff4b6a;
  font-weight: 700;
}

h1 {
  margin: 10px 0;
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
}

.lead {
  margin: 0;
  max-width: 780px;
  opacity: 0.95;
}

.hero-tag {
  margin: 14px 0 0;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

button,
a {
  border: none;
  background: white;
  color: var(--brand);
  border-radius: 12px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  background: var(--red);
  color: #ffffff;
}

.secondary {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

main {
  padding: 24px 36px 40px;
  display: grid;
  gap: 18px;
}

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

.kpi {
  background: var(--panel);
  border: 1px solid #cfd8e7;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(0, 12, 35, 0.18);
  border-top: 4px solid var(--red);
}

.kpi h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.kpi p {
  margin: 8px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(0, 12, 35, 0.18);
}

.panel h2 {
  margin-top: 0;
  color: var(--brand);
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 3px solid rgba(255, 0, 50, 0.8);
}

.panel-head {
  display: block;
}

.panel-head h2 {
  margin: 0;
  padding: 0;
  border-bottom: none;
  display: block;
}

.panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--brand);
  text-align: left;
  cursor: pointer;
}

.panel-toggle-label {
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  padding-bottom: 6px;
  border-bottom: 3px solid rgba(255, 0, 50, 0.8);
}

.panel-toggle-icon {
  min-width: 34px;
  height: 34px;
  border: 1px solid #d7e1f0;
  border-radius: 8px;
  background: #f8fbff;
  color: #23406d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
}

.panel-content {
  margin-top: 12px;
}

.panel-collapsed {
  display: none;
}

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

.filter-help {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.filter-grid > label {
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--muted);
}

label.onboarding-field-error {
  color: #8c1f44;
}

label.onboarding-field-error input,
label.onboarding-field-error select,
label.onboarding-field-error textarea,
label.onboarding-field-error .ms-trigger {
  border-color: #ff345a;
  background: #fff4f8;
}

label .field-error {
  display: block;
  margin-top: 2px;
  color: #9f173f;
  font-size: 0.73rem;
  line-height: 1.2;
  font-weight: 700;
}

select,
input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-family: inherit;
  width: 100%;
  min-width: 0;
}

textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-family: inherit;
  width: 100%;
  min-width: 0;
  resize: vertical;
}

select[multiple] {
  min-height: 120px;
}

.ms {
  position: relative;
  width: 100%;
}

.ms-trigger {
  display: block;
  width: 100%;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #1f3355;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-trigger::-webkit-details-marker {
  display: none;
}

.ms-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  width: min(520px, 100%);
  max-width: min(92vw, 560px);
  max-height: 320px;
  overflow: auto;
  border: 1px solid #d6e0ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 20px rgba(3, 20, 49, 0.22);
  padding: 8px;
}

.ms.ms-open-up .ms-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.ms-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e7edf7;
}

.ms-search {
  width: 100%;
  margin-bottom: 8px;
}

.ms-clear {
  border: 1px solid #d7e1f0;
  border-radius: 6px;
  background: #f8fbff;
  color: #23406d;
  padding: 2px 8px;
  font-size: 0.75rem;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  color: #1f3355;
  border: none;
  background: transparent;
  border-radius: 6px;
  width: 100%;
  text-align: left;
  font-weight: 500;
}

.ms-option:hover {
  background: #f3f7ff;
}

.ms-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.ms-option input {
  margin: 0;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
}

#userTable {
  table-layout: fixed;
}

#employeesTable {
  table-layout: fixed;
  width: 100%;
}

#employeesTable th:nth-child(1),
#employeesTable td:nth-child(1) {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  text-align: center;
}

#employeesTable th:nth-child(2),
#employeesTable td:nth-child(2) {
  width: 27%;
  min-width: 0;
}

#employeesTable th:nth-child(3),
#employeesTable td:nth-child(3) {
  width: 34%;
  min-width: 0;
}

#employeesTable th:nth-child(4),
#employeesTable td:nth-child(4) {
  width: 12%;
  min-width: 0;
}

#employeesTable th:nth-child(5),
#employeesTable td:nth-child(5) {
  width: 10%;
  min-width: 0;
}

#employeesTable th:nth-child(6),
#employeesTable td:nth-child(6) {
  width: 10%;
  min-width: 0;
}

#employeesTable th:nth-child(7),
#employeesTable td:nth-child(7) {
  width: 7%;
  min-width: 0;
}

#userTable th[data-col-key="displayName"],
#userTable td[data-col-key="displayName"] {
  width: 26%;
}

#userTable th[data-col-key="userPrincipalName"],
#userTable td[data-col-key="userPrincipalName"] {
  width: 32%;
}

#userTable th[data-col-key="companyName"],
#userTable td[data-col-key="companyName"] {
  width: 14%;
}

#userTable th[data-col-key="department"],
#userTable td[data-col-key="department"] {
  width: 11%;
}

#userTable th[data-col-key="extensionAttribute1"],
#userTable td[data-col-key="extensionAttribute1"] {
  width: 8%;
  min-width: 72px;
}

#userTable th[data-col-key="createdDateTime"],
#userTable td[data-col-key="createdDateTime"] {
  width: 9%;
  min-width: 132px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #edf1f7;
  font-size: 0.9rem;
  vertical-align: top;
  max-width: 0;
}

th {
  color: var(--brand);
  background: #f8fafe;
  position: sticky;
  top: 0;
  z-index: 1;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 6px;
  vertical-align: middle;
  background-repeat: no-repeat;
  background-size: 11px 11px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath d='M2.2 4.3L5.5 1.4l3.3 2.9M2.2 6.7l3.3 2.9 3.3-2.9' fill='none' stroke='%238a98b2' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

th.sortable[data-sort="asc"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath d='M2.2 7.2L5.5 3.9l3.3 3.3' fill='none' stroke='%23ff0032' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

th.sortable[data-sort="desc"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath d='M2.2 3.8L5.5 7.1l3.3-3.3' fill='none' stroke='%23274a83' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.company-col {
  width: 150px;
  max-width: 150px;
}

.truncate {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

#userTableWrap {
  max-height: min(64vh, 700px);
  overflow: auto;
  contain: layout paint;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.table-toolbar .page-size-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: #324e7d;
}

.table-page-size,
.table-toolbar .secondary.dark {
  padding: 6px 8px;
  min-height: 30px;
}

.pager-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pager-info {
  font-size: 0.85rem;
  color: #5e6f8d;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .table-toolbar {
    align-items: stretch;
    gap: 8px;
  }

  .pager-controls,
  .table-toolbar .page-size-control {
    width: 100%;
  }

  .table-toolbar .secondary.dark,
  .table-page-size {
    width: 100%;
  }
}

.sku-name {
  font-weight: 700;
  color: #142d5c;
}

.sku-code {
  color: var(--muted);
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#catalogTable td code,
#catalogTable td .sku-code {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.license-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.license-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f2f5fc 0%, #e8eef8 100%);
  color: #162a53;
  font-size: 0.8rem;
  line-height: 1.1;
}

.panel,
.kpi {
  animation: rise 280ms ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.license-chip small {
  color: #5d6b84;
  font-size: 0.68rem;
}

.free-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 0, 50, 0.12);
  border: 1px solid rgba(255, 0, 50, 0.35);
  color: #cf0030;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-bottom: 12px;
  overflow: visible;
}

.chart-dimension-picker {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  max-width: fit-content;
  margin-left: auto;
}

.chart-dimension-picker label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #0a2f66;
  white-space: nowrap;
  margin: 0;
}

.chart-head .ms-trigger {
  max-width: 240px;
}

.chart-head .ms-menu {
  left: auto;
  right: 0;
  width: max(260px, 100%);
  max-width: min(86vw, 340px);
}

.chart-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(240px, 1fr);
  gap: 14px;
  align-items: center;
}

.chart-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.chart-card {
  border: 1px solid #e2e8f2;
  border-radius: 12px;
  padding: 12px;
  background: #fdfdff;
}

.chart-card h3 {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 1rem;
}

.chart-card canvas {
  width: min(100%, 320px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.legend {
  display: grid;
  gap: 8px;
}

.legend-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #e5ebf5;
  border-radius: 10px;
  cursor: pointer;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.orders-context-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

.orders-employee-picker {
  grid-column: 1 / -1;
  width: min(760px, 100%);
  min-width: 0;
}

.orders-employee-picker .ms {
  width: 100%;
  max-width: 100%;
}

.orders-employee-picker .ms-trigger {
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orders-employee-picker .ms-menu {
  width: min(760px, 92vw);
  max-width: min(760px, 92vw);
}

.orders-context-meta-field {
  width: 100%;
  max-width: 320px;
  min-width: 0;
}

.orders-context-meta-field input {
  width: 100%;
  min-width: 0;
}

.onboarding-dual-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  align-items: start;
}

.upn-preview-field {
  grid-column: auto;
  max-width: min(520px, 100%);
}

.onboarding-dual-card {
  min-width: 0;
  min-height: 0;
}

.onboarding-dual-card .form-section-title {
  grid-column: auto;
  margin-top: 0;
  padding-top: 0;
}

.onboarding-dual-card .feature-disabled {
  grid-column: auto;
  width: 100%;
  max-width: none;
}

.short-input {
  grid-column: auto;
  width: fit-content;
  max-width: 320px;
}

.short-input input,
.short-input select,
.short-input textarea,
.short-input .ms-trigger {
  width: min(280px, 100%);
}

.filter-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

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

.filter-action-cell {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 22px;
}

.filter-chip-btn {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #1f3355;
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1;
  white-space: nowrap;
}

.service-top-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.service-health-top-grid {
  margin-top: 8px;
}

.service-health-components-wrap {
  margin-top: 8px;
}

.service-health-components-table td {
  vertical-align: top;
}

.service-health-details-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.full-row {
  grid-column: 1 / -1;
}

.info-note.full-row {
  width: 100%;
  max-width: 100%;
}

.form-note {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.form-section-title {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1f3e6d;
}

.scope-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  border: 1px solid #d9e3f3;
  background: #f8fbff;
  color: #35527f;
  vertical-align: middle;
}

.scope-chip.m365 {
  border-color: #cfdcf2;
  color: #274a83;
}

.scope-chip.manager {
  border-color: #d9e6f7;
  color: #355f96;
}

.scope-chip.distributor {
  border-color: #ead5db;
  color: #8a3650;
}

.feature-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  border: 1px solid #d9dfea;
  background: #edf2ff;
  color: #415f8d;
  vertical-align: middle;
}

fieldset {
  margin: 0;
}

.feature-disabled {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  border: 1px solid #dce5f5;
  border-left: 4px solid #ff3252;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6ff 100%);
}

.feature-disabled .hardware-placeholder-note {
  margin: 0;
}

.feature-disabled select,
.feature-disabled input,
.feature-disabled .ms-trigger {
  background: #fbfcff;
  width: min(280px, 100%);
  max-width: 100%;
}

.feature-disabled .equipment-options,
.feature-disabled .shipping-address,
.feature-disabled label {
  width: 100%;
  max-width: 100%;
}

.feature-disabled .equipment-options {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  column-gap: 12px;
}

.feature-disabled .check-row {
  max-width: 280px;
  white-space: normal;
  line-height: 1.25;
}

input[readonly] {
  background: #f6f9ff;
  color: #45608a;
}

.check-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1f3355;
  font-weight: 600;
}

.check-row input[type="checkbox"] {
  width: 16px;
}

.check-row.compact {
  grid-column: auto;
  font-weight: 500;
}

.hardware-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
}

.equipment-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: start;
  justify-self: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f2;
  border-radius: 10px;
  background: #ffffff;
  width: 100%;
  max-width: 100%;
}

.shipping-address {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
  justify-content: start;
  justify-self: start;
  gap: 10px;
  margin-top: 2px;
  padding: 10px;
  border: 1px solid #e2e8f2;
  border-radius: 10px;
  background: #ffffff;
  width: 100%;
  max-width: 100%;
}

.shipping-address.panel-collapsed {
  display: none;
}

.license-picker {
  width: 100%;
}

.license-picker .ms-trigger {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.license-picker .ms-menu {
  width: max(620px, 100%);
  max-width: min(95vw, 1100px);
}

.license-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.license-summary .meta-chip {
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item-input-grid {
  grid-column: 1 / -1;
  display: block;
}

.order-item-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 4px;
}

.order-item-row button {
  white-space: nowrap;
}

.order-shipping-confirm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #1f3355;
  font-weight: 500;
}

.order-shipping-confirm input[type='checkbox'] {
  width: 16px;
  height: 16px;
}

.button-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.admin-test-inline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.2fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-test-inline-actions {
  display: flex;
  align-items: end;
  min-height: 42px;
}

.admin-test-inline .full-row {
  margin: 0;
}

.admin-test-inline-actions button {
  width: 100%;
}
.onboarding-notification-matrix {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: start;
}

.onboarding-notification-card {
  min-height: 0;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dce3ee;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
}

.onboarding-notification-card .status,
.onboarding-notification-card .status-meta {
  margin: 8px 0 0;
  width: 100%;
}

@media (max-width: 760px) {
  .onboarding-notification-matrix {
    grid-template-columns: 1fr;
  }

  .orders-context-grid {
    grid-template-columns: 1fr;
  }

  .orders-context-meta-field {
    max-width: none;
  }

  .orders-employee-picker {
    width: 100%;
  }

  .admin-test-inline {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .admin-test-inline-actions {
    width: 100%;
  }

  .admin-test-inline-actions button {
    width: 100%;
  }
}

.status {
  margin-top: 10px;
  color: #23406d;
  font-weight: 600;
  margin-bottom: 0;
  width: fit-content;
  min-width: 0;
}

.status-meta {
  margin-top: 8px;
  margin-bottom: 0;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px dashed #d6e1ef;
  border-left: 3px solid #ff0032;
  border-radius: 10px;
  background: #f8fbff;
  color: #1e3a67;
  font-size: 0.86rem;
  font-weight: 600;
}

.status-meta.ok {
  color: #1e6a49;
  border-left-color: #19a06b;
  background: #f3fffa;
}

.status-meta.warn {
  color: #8a4c0f;
  border-left-color: #f2a64f;
  background: #fff8ec;
}

.status-meta.error {
  color: #802338;
  border-left-color: #ea2d5d;
  background: #fff1f6;
}

.alert-balloon {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f1ccd7;
  background: #fff6f8;
  color: #7d3048;
  font-size: 0.84rem;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
}

.bulk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
}

.bulk-meta {
  min-height: 40px;
  display: flex;
  align-items: center;
  color: #244372;
  font-weight: 700;
  border: 1px dashed #d6e0ef;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fbff;
}

#bulkEditContent .button-row {
  margin-top: 10px;
}

#employeesTable tbody tr {
  cursor: pointer;
}

#employeesTable tbody tr.row-selected {
  background: #f5f9ff;
}

.employee-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #d8e1ef;
  box-shadow: -12px 0 28px rgba(3, 20, 49, 0.22);
  z-index: 40;
  padding: 14px;
  overflow: auto;
}

.employee-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.employee-drawer-head h3 {
  margin: 0;
  color: var(--brand);
  font-size: 1.05rem;
}

.employee-drawer .secondary {
  background: #f2f6fd;
  color: #1e3a66;
  border: 1px solid #d3deef;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(2, 15, 42, 0.5);
  display: grid;
  place-items: center;
  padding: 16px;
}

.confirm-modal.panel-collapsed {
  display: none;
}

.confirm-modal-card {
  width: min(560px, 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 0, 50, 0.5);
  border-left: 4px solid var(--red);
  background: linear-gradient(120deg, #03183f 0%, #082655 100%);
  box-shadow: 0 16px 36px rgba(3, 20, 49, 0.3);
  padding: 16px;
}

.confirm-modal-card h3 {
  margin: 0 0 8px;
  color: #ffffff;
}

.confirm-modal-card p {
  margin: 0 0 12px;
  color: #dce9ff;
}

.catalog-modal-card {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: hidden;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
}

.catalog-edit-card {
  max-height: none;
  overflow: visible;
}

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

.catalog-modal-head h3 {
  margin: 0;
  color: var(--brand);
  padding-bottom: 6px;
  border-bottom: 3px solid rgba(255, 0, 50, 0.8);
}

.catalog-modal-card .form-note {
  color: var(--muted);
}

.catalog-modal-card .table-wrap {
  max-height: min(62vh, 620px);
  overflow: auto;
  contain: layout paint;
}

#catalogTable th {
  position: static;
}

.secondary.dark {
  background: #e9eef7;
  color: #1e3a66;
  border: 1px solid #ccd9ee;
}

.action-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  max-width: min(560px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 0, 50, 0.5);
  border-left: 4px solid var(--red);
  background: linear-gradient(120deg, #03183f 0%, #082655 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(3, 20, 49, 0.25);
  font-weight: 700;
}

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

.alias-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #1f3f6f;
}

.icon-btn {
  border: 1px solid #d7e1f0;
  background: #f8fbff;
  color: #23406d;
  border-radius: 8px;
  padding: 4px 8px;
  font-weight: 700;
  line-height: 1;
}

.icon-btn:hover {
  background: #eef3fb;
}

.expense-sheet .form-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.expense-title {
  grid-column: 1 / -1;
  font-size: 1.05rem;
  font-weight: 800;
  color: #112a58;
  padding: 10px 12px;
  border: 1px solid #d8e2f1;
  border-left: 4px solid var(--red);
  border-radius: 10px;
  background: #f8fbff;
}

.expense-table-wrap {
  grid-column: 1 / -1;
}

#expensesTable input,
#expensesTable select {
  min-width: 120px;
}

#expensesTable .expense-attachment {
  min-width: 220px;
}

#expensesTable .expense-attachment-label {
  display: block;
  margin-top: 4px;
  color: #4f6891;
  font-size: 0.72rem;
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

.expense-total {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d8e2f1;
  border-radius: 10px;
  background: #f8fbff;
}

.expense-total strong {
  color: #123769;
}

.expense-signature {
  grid-column: 1 / -1;
  margin-top: 6px;
  min-height: 48px;
  border-bottom: 1px solid #cfd9ea;
  color: #274574;
  display: flex;
  align-items: end;
  padding-bottom: 6px;
}

.expense-note-block {
  grid-column: 1 / -1;
  border: 1px solid #d8e2f1;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}

.expense-note-block h3 {
  margin: 0 0 8px;
  color: #163463;
  font-size: 0.95rem;
}

.expense-note-block ul {
  margin: 0;
  padding-left: 18px;
  color: #34547f;
  display: grid;
  gap: 6px;
}

.info-note {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border: 1px solid #b8d1ef;
  background: #e9f3ff;
  border-radius: 10px;
  display: block;
  width: min(660px, 100%);
  max-width: 100%;
}

.info-note-title {
  font-weight: 700;
  color: #204d84;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.25;
}

.info-note p {
  margin: 5px 0;
  color: #204d84;
  line-height: 1.3;
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.employee-info-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.analytics-kpi-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.analytics-kpi-card {
  border: 1px solid #d8e3f3;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
  display: grid;
  gap: 4px;
}

.analytics-kpi-card small {
  color: #40608f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  font-weight: 700;
}

.analytics-kpi-card strong {
  color: #143668;
  font-size: 1.24rem;
  line-height: 1.2;
}

.settings-accordion {
  border: 1px solid #dce6f4;
  border-radius: 10px;
  background: #f8fbff;
  margin: 0 0 12px;
  overflow: hidden;
}

.settings-accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 12px;
  color: #1d3f73;
  font-weight: 700;
  border-bottom: 1px solid #dce6f4;
  background: #f2f7ff;
}

.settings-accordion > summary::-webkit-details-marker {
  display: none;
}

.settings-accordion > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  color: #355f96;
}

.settings-accordion[open] > summary::before {
  content: "▾";
}

.settings-accordion > .table-wrap,
.settings-accordion > form {
  padding: 10px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d7e1f0;
  background: #f8fbff;
  color: #244a82;
  font-size: 0.72rem;
  line-height: 1.2;
  margin: 2px 4px 2px 0;
}

.meta-chip.chip-ok {
  border-color: #b7e1c2;
  background: #edf9f0;
  color: #145d2c;
}

.meta-chip.chip-warning {
  border-color: #ead1a5;
  background: #fff8ea;
  color: #7a4c04;
}

.meta-chip.chip-error {
  border-color: #efbfd0;
  background: #ffeef1;
  color: #8f1732;
}

.service-actions-row {
  margin-top: 6px;
}

.service-actions-row .secondary.dark {
  background: #f2f6fd;
}

@media (max-width: 900px) {
  .hero,
  main {
    padding: 18px;
  }

  .hero-top {
    flex-direction: column;
  }

  .chart-wrap {
    grid-template-columns: 1fr;
  }

  .onboarding-dual-grid {
    grid-template-columns: 1fr;
  }

  .ms-menu {
    width: 100%;
    max-width: 100%;
  }

  .ms-menu {
    width: min(100%, calc(100vw - 28px));
    max-width: min(100vw - 28px, 100%);
  }

  .service-top-blocks {
    grid-template-columns: 1fr;
  }

  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-action-cell {
    width: 100%;
    padding-top: 0;
    justify-content: flex-start;
  }

  .filter-chip-btn {
    width: auto;
    min-width: 118px;
  }
}
