:root {
  color-scheme: light;
  --bg: #f4f8fc;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #102033;
  --muted: #64748b;
  --line: #d8e4f2;
  --line-strong: #b8c9dc;
  --blue: #1268a8;
  --blue-dark: #084a7a;
  --blue-soft: #e7f3ff;
  --green: #137a42;
  --green-soft: #daf7e6;
  --red: #b42318;
  --red-soft: #fee4e2;
  --amber: #98620a;
  --amber-soft: #fff1cc;
  --violet: #6d45b8;
  --violet-soft: #eee8ff;
  --shadow: 0 16px 36px rgba(16, 32, 51, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eaf5ff 0, #f4f8fc 270px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: var(--blue-dark);
  box-shadow: 0 8px 18px rgba(18, 104, 168, 0.18);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  box-shadow: none;
  transform: none;
}

.secondary {
  border-color: rgba(18, 104, 168, 0.28);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.secondary:hover {
  border-color: rgba(18, 104, 168, 0.45);
  background: #dceeff;
  box-shadow: none;
}

.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: #344054;
}

.ghost:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  box-shadow: none;
}

.danger {
  background: var(--red);
}

.danger:hover {
  background: #8f1d15;
  box-shadow: 0 8px 18px rgba(180, 35, 24, 0.18);
}

.app-shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0;
}

.login-view {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
}

.login-card,
.dashboard-view {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  width: min(430px, 100%);
  padding: 30px;
}

.brand-logo {
  display: block;
  width: min(220px, 100%);
  height: auto;
}

.brand-logo-login {
  margin-bottom: 20px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(18, 104, 168, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
}

.brand-mark-login {
  margin-bottom: 20px;
}

.brand-mark-topbar {
  flex: 0 0 auto;
}

.brand-mark-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 104, 168, 0.14), rgba(15, 159, 110, 0.14)),
    #ffffff;
  box-shadow: inset 0 0 0 1px rgba(18, 104, 168, 0.12);
}

.brand-pin {
  position: absolute;
  top: 8px;
  left: 13px;
  width: 16px;
  height: 16px;
  border: 4px solid var(--blue);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.brand-pin::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #ffffff;
}

.brand-route {
  position: absolute;
  right: 7px;
  bottom: 8px;
  width: 27px;
  height: 13px;
  border-right: 3px solid #0f9f6e;
  border-bottom: 3px solid #0f9f6e;
  border-radius: 0 0 8px 0;
}

.brand-mark-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-mark-copy strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.brand-mark-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.14;
}

h1 {
  font-size: 27px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  margin: 10px 0 0;
  padding: 4px 9px;
  border: 1px solid rgba(19, 122, 66, 0.22);
  border-radius: 999px;
  background: #e8f8ee;
  color: #137a42;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.version-badge-login {
  margin: 20px auto 0;
  min-height: 19px;
  padding: 3px 7px;
  font-size: 9px;
}

h2 {
  font-size: 25px;
}

h3 {
  font-size: 18px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.login-form,
.create-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #26384d;
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 104, 168, 0.14);
}

input:disabled,
select:disabled {
  background: #eef3f8;
  color: var(--muted);
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.form-message,
.page-message {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 750;
}

.dashboard-view {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: min(760px, calc(100vh - 68px));
  overflow: hidden;
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff 0, #f7fbff 100%);
}

.brand-block {
  display: grid;
  gap: 9px;
}

.brand-block .brand-logo {
  width: 100%;
  max-width: 220px;
  margin-bottom: 3px;
}

.brand-block .brand-mark {
  width: 100%;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-color: transparent;
  background: transparent;
  color: #475467;
  text-align: left;
  box-shadow: none;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  box-shadow: none;
}

.nav-item.is-active {
  border-color: rgba(18, 104, 168, 0.24);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.main-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
  min-width: 0;
  padding: 24px;
  background: var(--surface);
}

.admin-section {
  display: none;
  min-width: 0;
}

.admin-section.is-active {
  display: grid;
  align-content: start;
  gap: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-copy {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid article {
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface);
}

.stats-grid article:nth-child(2) {
  border-left-color: var(--green);
}

.stats-grid article:nth-child(3) {
  border-left-color: var(--amber);
}

.stats-grid article:nth-child(4) {
  border-left-color: var(--red);
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stats-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

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

.summary-card,
.panel-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.summary-card {
  align-content: start;
}

.summary-card button {
  justify-self: start;
}

.panel-card-primary {
  background:
    linear-gradient(180deg, #ffffff 0, #f8fbff 100%);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.panel-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.create-form {
  grid-template-columns: minmax(260px, 1.25fr) minmax(210px, 0.85fr) 130px 140px;
  align-items: end;
}

.create-form button[type="submit"] {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 190px;
}

.license-key-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.license-key-control button {
  min-height: 40px;
  padding: 8px 12px;
}

.bulk-actions {
  display: grid;
  grid-template-columns: 180px 180px auto;
  align-items: end;
  gap: 12px;
}

.bulk-actions select {
  width: 100%;
}

.bulk-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.created-license-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(19, 122, 66, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, #f4fff8 0, #ffffff 100%);
}

.created-license-panel strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

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

.selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(18, 104, 168, 0.22);
  border-radius: 8px;
  background: #edf6ff;
}

.selection-toolbar strong {
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid #e6edf5;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf6ff;
  color: #103f66;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.select-column {
  width: 42px;
  text-align: center;
}

.select-column input,
td input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f7fbff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-active {
  background: var(--green-soft);
  color: var(--green);
}

.status-expired {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-inactive,
.status-revoked {
  background: var(--red-soft);
  color: var(--red);
}

.owner-badge {
  display: inline-flex;
  margin-left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

.action-list button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

@media (max-width: 1120px) {
  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .bulk-buttons {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 1320px);
    padding: 18px 0;
  }

  .dashboard-view,
  .login-card,
  .sidebar,
  .main-panel {
    padding: 18px;
  }

  .section-heading,
  .panel-header {
    display: grid;
  }

  .section-copy {
    max-width: none;
  }

  .side-nav,
  .sidebar-footer,
  .create-form,
  .bulk-actions,
  .stats-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .create-form button[type="submit"],
  .summary-card button,
  .bulk-buttons button {
    justify-self: stretch;
    width: 100%;
  }

  .bulk-buttons {
    display: grid;
  }

  .created-license-panel,
  .selection-toolbar {
    display: grid;
  }

  .share-actions,
  .selection-actions {
    justify-content: stretch;
  }

  .share-actions button,
  .selection-actions button {
    width: 100%;
  }
}

.dashboard-view {
  position: relative;
  display: block;
  min-height: min(760px, calc(100vh - 68px));
  overflow: hidden;
}

.menu-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(16, 32, 51, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.menu-backdrop:hover {
  background: rgba(16, 32, 51, 0.2);
  box-shadow: none;
}

.dashboard-view.is-menu-open .menu-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: min(300px, calc(100% - 34px));
  transform: translateX(-104%);
  transition: transform 210ms ease;
  box-shadow: 18px 0 36px rgba(16, 32, 51, 0.13);
}

.dashboard-view.is-menu-open .sidebar {
  transform: translateX(0);
}

.main-panel {
  min-height: min(760px, calc(100vh - 68px));
}

.main-topbar {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  min-width: 0;
}

.main-topbar strong {
  display: block;
  color: var(--text);
  font-size: 19px;
  line-height: 1.1;
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.menu-toggle:hover {
  border-color: rgba(18, 104, 168, 0.38);
  background: var(--blue-soft);
  box-shadow: none;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--blue-dark);
}

@media (max-width: 1120px) {
  .sidebar {
    grid-template-rows: auto 1fr auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .side-nav,
  .sidebar-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-view {
    padding: 0;
  }

  .brand-logo-topbar {
    width: 132px;
  }

  .brand-mark-topbar .brand-mark-copy {
    display: none;
  }
}
