:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: #182033;
  background: #f5f7fb;
  font-synthesis: none;

  --page-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --surface-hover: #f0f3ff;
  --sidebar-bg: #ffffff;
  --border: #e6e9f0;
  --border-strong: #d7dce8;

  --text: #182033;
  --text-soft: #697386;
  --text-faint: #929bad;

  --accent: #6558f5;
  --accent-dark: #5548dc;
  --accent-soft: #efedff;

  --danger: #c73245;
  --danger-soft: #fff1f3;
  --success: #18855b;

  --shadow-sm:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 4px 12px rgba(16, 24, 40, 0.04);

  --shadow-card:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 8px 28px rgba(16, 24, 40, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

button {
  color: #ffffff;
  background: var(--accent);
}

button:hover {
  background: var(--accent-dark);
}

button:active,
.button:active {
  transform: translateY(1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--accent);
}

.button:hover {
  color: #ffffff;
  background: var(--accent-dark);
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(101, 88, 245, 0.12);
}

label {
  display: grid;
  gap: 8px;
  color: #3d4658;
  font-size: 0.92rem;
  font-weight: 600;
}

form:not(.logout-form) {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 2vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.muted {
  color: var(--text-soft);
}

.error {
  color: var(--danger);
}

.mono {
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  overflow-wrap: anywhere;
}

/* ================================================================
   ADMIN SHELL
   ================================================================ */

.admin-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--border);
  padding: 22px 16px 18px;
  background: var(--sidebar-bg);
}

.sidebar-brand {
  padding: 0 8px 22px;
}

.brand-link,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
}

.brand-link:hover {
  color: var(--text);
}

.brand-mark {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #ffffff;
  background:
    linear-gradient(
      145deg,
      #7669ff,
      #5548dc
    );
  box-shadow:
    0 7px 16px rgba(101, 88, 245, 0.2);
  font-size: 1.05rem;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong,
.auth-brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.brand-copy small,
.auth-brand span:not(.brand-mark) {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  border-radius: 10px;
  padding: 10px 12px;
  color: #596276;
  font-size: 0.91rem;
  font-weight: 650;
  transition:
    color 140ms ease,
    background 140ms ease;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.sidebar-link.is-active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.sidebar-link.is-active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
}

.nav-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-link:first-child .nav-icon svg,
.sidebar-link:nth-child(3) .nav-icon svg,
.sidebar-link:nth-child(4) .nav-icon svg {
  fill: currentColor;
  stroke: none;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 18px 8px 0;
}

.admin-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-identity > div {
  display: grid;
  gap: 1px;
}

.admin-identity strong {
  font-size: 0.82rem;
}

.admin-identity small {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(24, 133, 91, 0.1);
}

.logout-form {
  margin: 0;
}

.logout-button {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  color: #525c70;
  background: #ffffff;
  font-size: 0.82rem;
}

.logout-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-soft);
}

.admin-workspace {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid rgba(230, 233, 240, 0.9);
  padding: 14px 34px;
  background: rgba(245, 247, 251, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-eyebrow {
  margin-bottom: 2px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-title {
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.console-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #ddd9ff;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-content {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 32px 34px 56px;
}

/* ================================================================
   LEGACY CONTENT COMPATIBILITY
   ================================================================ */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.narrow,
.narrow-card {
  max-width: 520px;
}

.narrow {
  margin-right: auto;
  margin-left: auto;
}

.spacing-top {
  margin-top: 20px;
}

.metrics {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(150px, 1fr)
    );
  gap: 14px;
  margin: 22px 0;
}

.metrics > div {
  min-height: 104px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px;
  color: var(--text-soft);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
  font-weight: 650;
}

.metrics strong {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

table {
  width: 100%;
  margin-top: 22px;
  border: 1px solid var(--border);
  border-spacing: 0;
  border-collapse: separate;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 0.87rem;
}

th {
  color: #586174;
  background: var(--surface-soft);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fcfcfe;
}

.detail-grid {
  display: grid;
  grid-template-columns:
    minmax(140px, 190px)
    minmax(0, 1fr);
  gap: 14px 22px;
}

.detail-grid dt {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 650;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 550;
}

.danger,
.danger-button {
  border: 1px solid #f1bcc4;
  color: var(--danger);
  background: var(--danger-soft);
}

.danger:hover,
.danger-button:hover {
  border-color: #e99aa7;
  color: #a82538;
  background: #ffe7eb;
}

.secret-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.secret-value {
  display: block;
  flex: 1 1 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-soft);
  font-size: 0.94rem;
}

/* ================================================================
   LOGIN
   ================================================================ */

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(
      circle at 15% 10%,
      rgba(101, 88, 245, 0.12),
      transparent 28%
    ),
    var(--page-bg);
}

.auth-shell {
  width: min(100%, 460px);
}

.auth-brand {
  justify-content: center;
  margin-bottom: 22px;
}

.auth-shell .card {
  width: 100%;
  max-width: none;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 900px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }

  .sidebar-brand {
    padding: 0 4px 12px;
  }

  .sidebar-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .sidebar-link {
    flex: 0 0 auto;
  }

  .sidebar-link.is-active::before {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .admin-topbar {
    padding: 12px 20px;
  }

  .admin-content {
    padding: 24px 20px 42px;
  }
}

@media (max-width: 640px) {
  .brand-copy {
    display: none;
  }

  .nav-icon {
    display: none;
  }

  .sidebar-link {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .console-badge {
    display: none;
  }

  .page-head {
    display: grid;
  }

  .page-head .button {
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .detail-grid dd {
    margin-bottom: 10px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* UI-A3: LICENSE MANAGEMENT PAGE */

.license-page {
  display: grid;
  gap: 22px;
}

.license-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.page-kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.license-page-head .muted {
  margin-bottom: 0;
}

.license-create-button {
  gap: 8px;
  flex: 0 0 auto;
}

.license-create-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.license-summary-grid {
  display: grid;
  grid-template-columns:
    repeat(
      5,
      minmax(0, 1fr)
    );
  gap: 12px;
}

.license-summary-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.license-summary-card > div:last-child {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.license-summary-card span {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.license-summary-card strong {
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.035em;
}

.summary-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.summary-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.summary-icon-total {
  color: #5c50df;
  background: #efedff;
}

.summary-icon-active {
  color: #187d59;
  background: #e9f8f1;
}

.summary-icon-unactivated {
  color: #a36a16;
  background: #fff6df;
}

.summary-icon-expired {
  color: #667085;
  background: #f1f3f6;
}

.summary-icon-blocked {
  color: #bd3044;
  background: #fff0f2;
}

.license-list-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.license-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}

.license-search-wrap {
  position: relative;
  width: min(100%, 340px);
}

.license-search {
  min-height: 40px;
  padding-left: 38px;
  background: var(--surface-soft);
}

.license-search-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.license-status-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  background: var(--surface-soft);
}

.license-filter {
  flex: 0 0 auto;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  padding: 6px 10px;
  color: var(--text-soft);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
}

.license-filter:hover {
  color: var(--text);
  background: #ffffff;
}

.license-filter.is-selected {
  color: var(--accent-dark);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.license-table-meta {
  padding: 12px 18px 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.license-table-meta strong {
  color: var(--text);
}

.license-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.license-table {
  min-width: 960px;
  margin: 10px 0 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.license-table th,
.license-table td {
  padding: 13px 16px;
}

.license-table th {
  background: #fbfbfd;
}

.license-table tbody tr:hover td {
  background: #fafaff;
}

.license-id {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.license-key {
  color: #343c4f;
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.license-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  color: #596276;
  background: var(--surface-soft);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: capitalize;
}

.license-status-badge,
.device-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.69rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-dot,
.device-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  color: #157456;
  background: #eaf8f2;
}

.status-unactivated {
  color: #9b671a;
  background: #fff5de;
}

.status-expired {
  color: #667085;
  background: #f0f2f5;
}

.status-blocked {
  color: #b72e42;
  background: #fff0f2;
}

.device-state.is-bound {
  color: #46536a;
  background: #f0f3f8;
}

.device-state.is-unbound {
  color: #7b8494;
  background: #f5f6f8;
}

.license-date {
  color: var(--text-soft);
  font-size: 0.78rem;
  white-space: nowrap;
}

.lifetime-label {
  color: var(--accent-dark);
  font-weight: 700;
}

.license-action-column {
  text-align: right;
}

.license-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 0.78rem;
  font-weight: 750;
}

.license-view-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.license-empty-state {
  padding: 38px 20px !important;
  text-align: center;
}

.license-empty-state strong,
.license-empty-state span {
  display: block;
}

.license-empty-state strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 0.88rem;
}

.license-empty-state span {
  color: var(--text-soft);
  font-size: 0.78rem;
}

@media (max-width: 1100px) {
  .license-summary-grid {
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );
  }

  .license-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .license-search-wrap {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .license-page-head {
    display: grid;
  }

  .license-create-button {
    width: 100%;
  }

  .license-summary-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}

@media (max-width: 460px) {
  .license-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* UI-A4: LICENSE CREATE AND DETAIL */

.license-create-page,
.license-detail-page {
  display: grid;
  gap: 22px;
}

.license-subpage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.license-subpage-head h1 {
  margin-bottom: 7px;
}

.license-back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 22px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.license-back-link:hover {
  color: var(--accent-dark);
}

.license-back-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.license-create-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(250px, 320px);
  gap: 18px;
  align-items: start;
}

.license-form-card,
.license-create-help-card,
.license-detail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.license-form-card {
  padding: 24px;
}

.license-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.license-card-heading h2,
.license-section-heading h2,
.license-create-help-card h3,
.license-state-card h3,
.license-danger-zone h3 {
  margin: 0;
}

.license-card-heading p,
.license-section-heading p,
.license-danger-heading p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.license-card-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.license-card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.license-create-form {
  display: grid;
  gap: 20px;
  padding-top: 22px;
}

.license-form-field {
  display: grid;
  gap: 8px;
}

.license-form-field > label {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.license-field-help {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.license-form-field.is-lifetime input {
  color: var(--text-soft);
  background: #f3f4f7;
  pointer-events: none;
}

.license-create-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #dedaff;
  border-radius: var(--radius-md);
  padding: 13px 14px;
  color: #554ca7;
  background: #f8f7ff;
}

.license-create-notice svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.license-create-notice p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.55;
}

.license-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.license-form-actions .button {
  gap: 7px;
}

.license-form-actions .button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.button-secondary:hover {
  border-color: #c9c4ef;
  color: var(--accent-dark);
  background: #faf9ff;
}

.license-create-help-card {
  padding: 20px;
}

.license-create-help-card > h3 {
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.license-lifecycle-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  position: relative;
  padding-bottom: 18px;
}

.license-lifecycle-item:last-child {
  padding-bottom: 0;
}

.license-lifecycle-index {
  display: inline-flex;
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.license-lifecycle-item strong {
  display: block;
  margin: 3px 0 3px;
  font-size: 0.8rem;
}

.license-lifecycle-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.73rem;
  line-height: 1.5;
}

.license-detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.license-detail-masked-key {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 650;
}

.license-detail-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(250px, 310px);
  gap: 18px;
  align-items: start;
}

.license-detail-main,
.license-detail-side {
  display: grid;
  gap: 18px;
}

.license-detail-card {
  padding: 22px;
}

.license-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.license-section-heading h2 {
  font-size: 0.94rem;
}

.license-overview-grid {
  display: grid;
  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );
  gap: 10px;
}

.license-overview-item {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 82px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px;
  background: var(--surface-soft);
}

.license-overview-item > span:first-child {
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 650;
}

.license-overview-item > strong {
  font-size: 0.83rem;
}

.license-type-value {
  text-transform: capitalize;
}

.license-time-grid {
  display: grid;
  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.license-time-item {
  display: grid;
  gap: 5px;
  min-height: 72px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 13px 15px;
}

.license-time-item:nth-child(2n) {
  border-right: 0;
}

.license-time-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.license-time-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}

.license-time-item span {
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 650;
}

.license-time-item strong {
  font-size: 0.78rem;
  font-weight: 650;
}

.license-action-stack {
  display: grid;
}

.license-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.license-action-row:first-child {
  padding-top: 0;
}

.license-action-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.license-action-copy strong {
  display: block;
  font-size: 0.82rem;
}

.license-action-copy p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.73rem;
}

.license-renew-form {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.license-renew-form input {
  width: 112px;
  min-height: 40px;
}

.license-security-label {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  color: #5f55ae;
  background: var(--accent-soft);
  font-size: 0.68rem;
  font-weight: 750;
}

.license-hidden-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 15px;
  background: var(--surface-soft);
}

.license-hidden-key strong,
.license-hidden-key span {
  display: block;
}

.license-hidden-key strong {
  margin-bottom: 5px;
  color: #596276;
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
  letter-spacing: 0.07em;
}

.license-hidden-key span {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.license-reveal-warning,
.license-reveal-error {
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.74rem;
}

.license-reveal-warning {
  color: #8a5b12;
  background: #fff7df;
}

.license-reveal-error {
  color: var(--danger);
  background: var(--danger-soft);
}

.license-secret-row {
  align-items: stretch;
}

.license-copy-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.license-hide-key {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 700;
}

.license-devices-card {
  margin-top: 18px;
}

.license-device-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface-soft);
  font-size: 0.75rem;
  font-weight: 750;
}

.license-device-list {
  display: grid;
  gap: 12px;
}

.license-device-item {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  background: var(--surface-soft);
}

.license-device-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.license-device-item-head > div {
  display: grid;
  gap: 4px;
}

.license-device-item-head strong {
  font-size: 0.84rem;
}

.license-device-item-head > div > span {
  color: var(--text-soft);
  font-size: 0.7rem;
}

.license-device-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.license-device-meta > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.license-device-meta span {
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 650;
}

.license-device-meta strong,
.license-device-meta code {
  overflow-wrap: anywhere;
  font-size: 0.75rem;
}

.license-device-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  color: var(--text-soft);
  text-align: center;
  font-size: 0.78rem;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 700px) {
  .license-device-meta {
    grid-template-columns: 1fr;
  }

  .license-device-item-head {
    align-items: stretch;
    flex-direction: column;
  }
}

.license-state-card > h3 {
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.license-state-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding: 12px 0;
}

.license-state-line:last-child {
  padding-bottom: 0;
}

.license-state-line > span:first-child {
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 650;
}

.license-state-line > strong {
  font-size: 0.78rem;
}

.license-danger-zone {
  border-color: #f1c5cb;
}

.license-danger-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid #f4d7dc;
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.license-danger-heading svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--danger);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.license-danger-zone h3 {
  color: var(--danger);
  font-size: 0.88rem;
}

.license-danger-action strong {
  display: block;
  font-size: 0.8rem;
}

.license-danger-action p {
  margin: 4px 0 14px;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .license-create-layout,
  .license-detail-grid {
    grid-template-columns: 1fr;
  }

  .license-create-help-card {
    order: -1;
  }

  .license-overview-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}

@media (max-width: 700px) {
  .license-form-card,
  .license-detail-card {
    padding: 18px;
  }

  .license-overview-grid,
  .license-time-grid {
    grid-template-columns: 1fr;
  }

  .license-time-item,
  .license-time-item:nth-child(2n),
  .license-time-item:nth-last-child(-n + 2),
  .license-time-item:last-child:nth-child(odd) {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .license-time-item:last-child {
    border-bottom: 0;
  }

  .license-action-row,
  .license-hidden-key {
    align-items: stretch;
    flex-direction: column;
  }

  .license-renew-form {
    width: 100%;
  }

  .license-renew-form input {
    width: 100%;
  }

  .license-renew-form .button {
    flex: 0 0 auto;
  }

  .license-form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .license-form-actions > * {
    width: 100%;
  }
}

/* UI-A5: RELEASE MANAGEMENT PAGE */

.release-management-page {
  display: grid;
  gap: 22px;
}

.release-page-head {
  margin-bottom: 0;
}

.release-page-head .page-description {
  max-width: 680px;
}

.release-upload-button {
  flex: 0 0 auto;
}

.release-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.release-summary-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.release-summary-card span {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.release-summary-card strong {
  display: block;
  margin-top: 9px;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.035em;
}

.release-list-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.release-list-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 20px;
}

.release-list-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.release-list-heading p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.release-total {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 0.74rem;
  font-weight: 700;
}

.release-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.release-table {
  min-width: 760px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.release-table th,
.release-table td {
  padding: 14px 18px;
}

.release-table th {
  background: #fbfbfd;
}

.release-table tbody tr:hover td {
  background: #fafaff;
}

.release-version {
  color: var(--text);
  font-size: 0.88rem;
}

.release-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.release-status-draft {
  color: #6d5a10;
  background: #fff9db;
}

.release-status-published {
  color: #176b43;
  background: #eaf8f0;
}

.release-status-disabled {
  color: #6b7280;
  background: #f3f4f6;
}

.release-view-link {
  font-size: 0.8rem;
  font-weight: 700;
}

.release-empty {
  padding: 32px 18px !important;
  color: var(--text-soft);
  text-align: center;
}

@media (max-width: 900px) {
  .release-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .release-page-head,
  .release-list-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .release-upload-button {
    width: 100%;
  }
}
/* UI-A5: RELEASE UPLOAD PAGE */

.release-upload-page {
  display: grid;
  gap: 22px;
}

.release-upload-head {
  margin-bottom: 0;
}

.release-upload-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1.65fr)
    minmax(260px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.release-upload-card,
.release-upload-help-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.release-upload-card {
  padding: 24px;
}

.release-upload-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.release-upload-card-heading h2,
.release-upload-help-card h2 {
  margin: 0;
  font-size: 1rem;
}

.release-upload-card-heading p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.release-upload-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.release-upload-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.release-upload-form {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.release-upload-field {
  display: grid;
  gap: 7px;
}

.release-upload-field label {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.release-upload-field p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.release-upload-field input[type="file"] {
  min-height: 46px;
  padding: 7px;
  background: var(--surface-soft);
}

.release-upload-actions {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.release-upload-actions button {
  width: 100%;
}

.release-upload-help-card {
  padding: 20px;
}

.release-upload-help-card > h2 {
  margin-bottom: 18px;
}

.release-upload-step {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 11px;
  padding: 12px 0;
}

.release-upload-step + .release-upload-step {
  border-top: 1px solid var(--border);
}

.release-upload-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.75rem;
  font-weight: 800;
}

.release-upload-step strong {
  display: block;
  font-size: 0.82rem;
}

.release-upload-step p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.5;
}

.release-upload-note {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 0.75rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .release-upload-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .release-upload-head {
    align-items: stretch;
    flex-direction: column;
  }

  .release-upload-head .button-secondary {
    width: 100%;
  }

  .release-upload-card,
  .release-upload-help-card {
    padding: 18px;
  }
}

/* UI-A5: RELEASE DETAIL PAGE */

.release-detail-page {
  display: grid;
  gap: 22px;
}

.release-detail-head {
  margin-bottom: 0;
}

.release-detail-head .page-description {
  max-width: 700px;
}

.release-detail-back {
  flex: 0 0 auto;
}

.release-detail-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1.55fr)
    minmax(280px, 0.65fr);
  align-items: start;
  gap: 18px;
}

.release-detail-main,
.release-detail-sidebar {
  display: grid;
  gap: 18px;
}

.release-detail-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.release-detail-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 20px 22px;
}

.release-detail-card-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.release-detail-card-heading p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.5;
}

.release-detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 4px 22px 20px;
}

.release-detail-info-grid > div {
  min-width: 0;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.release-detail-info-grid > div:nth-child(odd):not(
  .release-detail-info-wide
) {
  padding-right: 18px;
}

.release-detail-info-grid > div:nth-child(even):not(
  .release-detail-info-wide
) {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.release-detail-info-grid > div:last-child {
  border-bottom: 0;
}

.release-detail-info-wide {
  grid-column: 1 / -1;
}

.release-detail-info-grid dt {
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.release-detail-info-grid dd {
  margin: 0;
  color: var(--text);
  font-size: 0.84rem;
}

.release-detail-version {
  font-weight: 800;
}

.release-detail-filename,
.release-detail-hash {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.release-detail-hash {
  font-size: 0.74rem !important;
  line-height: 1.55;
}

.release-metadata-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.release-metadata-notes {
  display: grid;
  gap: 8px;
}

.release-metadata-notes > span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.release-metadata-notes textarea:disabled {
  color: var(--text-soft);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.release-mandatory-control {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  background: var(--surface-soft);
}

.release-mandatory-control input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
}

.release-mandatory-control span {
  display: grid;
  gap: 3px;
}

.release-mandatory-control strong {
  font-size: 0.8rem;
}

.release-mandatory-control small {
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.release-metadata-actions {
  display: flex;
  justify-content: flex-end;
}

.release-metadata-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.release-current-state {
  display: grid;
  gap: 5px;
  padding: 20px 22px;
}

.release-current-state span {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.release-current-state strong {
  color: var(--text);
  font-size: 1rem;
}

.release-lifecycle-form {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--border);
  padding: 18px 22px;
}

.release-lifecycle-form button {
  width: 100%;
}

.release-lifecycle-form p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.5;
}

.release-lifecycle-unavailable,
.release-lifecycle-disabled-state {
  border-top: 1px solid var(--border);
  padding: 18px 22px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.release-lifecycle-unavailable strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.release-lifecycle-unavailable p {
  margin: 0;
}

@media (max-width: 1000px) {
  .release-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .release-detail-head,
  .release-detail-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .release-detail-back,
  .release-metadata-actions button {
    width: 100%;
  }

  .release-detail-info-grid {
    grid-template-columns: 1fr;
  }

  .release-detail-info-grid > div,
  .release-detail-info-grid > div:nth-child(odd):not(
    .release-detail-info-wide
  ),
  .release-detail-info-grid > div:nth-child(even):not(
    .release-detail-info-wide
  ) {
    grid-column: 1;
    border-left: 0;
    padding: 15px 0;
  }

  .release-detail-info-grid > div:last-child {
    border-bottom: 0;
  }

  .release-metadata-form {
    padding: 18px;
  }
}

/* UI-A6-A3: DASHBOARD REDESIGN */

.dashboard-page {
  display: grid;
  gap: 22px;
}

.dashboard-page-head {
  margin-bottom: 0;
}

.dashboard-page-head .page-description {
  max-width: 680px;
}

.dashboard-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.dashboard-releases-button,
.dashboard-settings-button {
  white-space: nowrap;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-summary-card {
  min-width: 0;
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.dashboard-summary-card span {
  display: block;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
}

.dashboard-summary-card strong {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

@media (max-width: 1100px) {
  .dashboard-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dashboard-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-releases-button,
  .dashboard-settings-button {
    width: 100%;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* UI-A6-A4: SETTINGS REDESIGN */

.settings-page {
  display: grid;
  gap: 22px;
}

.settings-page-head {
  margin-bottom: 0;
}

.settings-page-head .page-description {
  max-width: 680px;
}

.settings-back-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.settings-card {
  overflow: hidden;
  width: min(100%, 780px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.settings-card-heading {
  border-bottom: 1px solid var(--border);
  padding: 20px 22px;
}

.settings-card-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.settings-card-heading p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.settings-form {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field > span {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.settings-field input {
  max-width: 420px;
}

.settings-field small {
  max-width: 620px;
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.5;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

@media (max-width: 700px) {
  .settings-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-back-button {
    width: 100%;
  }

  .settings-card {
    width: 100%;
  }

  .settings-card-heading,
  .settings-form {
    padding: 18px;
  }

  .settings-field input {
    max-width: none;
  }

  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-actions button {
    width: 100%;
  }
}

/* ================================================================
   WEB-P6-01: ADMIN NAVIGATION & ROADMAP BADGES
   ================================================================ */

.sidebar-section-divider {
  margin: 14px 4px 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.sidebar-link.is-upcoming {
  opacity: 0.65;
  cursor: not-allowed;
  color: var(--text-soft);
}

.sidebar-link.is-upcoming:hover {
  background: transparent;
  color: var(--text-soft);
}

.nav-badge-upcoming {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  letter-spacing: 0.02em;
}

/* ================================================================
   WEB-P6-01: ADMIN DASHBOARD MODULE CARDS
   ================================================================ */

.dashboard-section-head {
  margin-top: 32px;
  margin-bottom: 16px;
}

.dashboard-section-head h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.dashboard-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.module-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
  color: inherit;
}

.module-card:hover:not(.is-planned) {
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.module-card.is-planned {
  opacity: 0.72;
  cursor: default;
  background: #fcfdfe;
}

.module-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.module-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent);
}

.module-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.module-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.module-badge.status-active {
  background: #ecfdf5;
  color: #047857;
}

.module-badge.status-planned {
  background: #f1f5f9;
  color: #64748b;
}

.module-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--text);
}

.module-card p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}

.module-cta {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--accent);
}

/* ================================================================
   WEB-P6-01: AUDIT LOG VIEWER
   ================================================================ */

.audit-page {
  display: grid;
  gap: 20px;
}

.audit-filters-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.audit-filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin: 0 !important;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  flex: 1 1 180px;
}

.filter-field label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-soft);
}

.filter-field select {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.88rem;
}

.filter-field-sm {
  min-width: 120px;
  flex: 0 1 120px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
}

.filter-submit-button {
  min-height: 38px;
  padding: 6px 18px;
}

.filter-reset-button {
  min-height: 38px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

.audit-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.audit-table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.audit-table-heading h2 {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.audit-count-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--text-soft);
}

.audit-table-scroll {
  overflow-x: auto;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.audit-table th {
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.audit-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.audit-table tbody tr:hover {
  background: var(--surface-hover);
}

.col-id {
  width: 65px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.82rem;
}

.col-time {
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.col-target {
  font-size: 0.84rem;
  word-break: break-all;
  max-width: 220px;
}

.audit-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
}

.badge-event-type {
  background: #f1f5f9;
  color: #475569;
}

.badge-resource-type {
  background: #eef2ff;
  color: #4338ca;
}

.badge-action {
  background: #fdf4ff;
  color: #a21caf;
}

.audit-details {
  cursor: pointer;
}

.audit-details-summary {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
}

.audit-json-block {
  margin-top: 8px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px;
  font-size: 0.76rem;
  max-height: 250px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.audit-empty-row {
  background: transparent !important;
}

.audit-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
}

.audit-empty-state strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text);
}

.audit-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.pagination-nav {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
}

.pagination-btn:hover:not(.is-disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.pagination-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

