:root {
  --ink: #17211d;
  --muted: #64736d;
  --line: rgba(36, 91, 116, 0.14);
  --paper: rgba(255, 255, 255, 0.9);
  --teal: #10a893;
  --teal-dark: #0a766e;
  --blue: #2f80ed;
  --blue-dark: #1d5fbf;
  --green: #28a745;
  --red: #d94b4b;
  --amber: #c88719;
  --cyan: #18a8c7;
  --shadow: 0 18px 55px rgba(22, 35, 31, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.user-shell {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #05214b 0%, #07172f 34%, #130f2a 58%, #05070d 82%, #000 100%);
}

.user-shell::before,
.user-shell::after {
  display: none;
}

.night-sky-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.admin-shell {
  background: #f5f7f6;
}

.app-frame,
.admin-frame {
  width: min(1180px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.app-frame {
  position: relative;
  z-index: 1;
}

.login-layout {
  min-height: calc(100vh - 52px);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  align-items: stretch;
}

.brand-panel {
  min-height: 520px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  color: white;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(rgba(6, 27, 24, 0.28), rgba(6, 27, 24, 0.74)),
    url("https://images.unsplash.com/photo-1519681393784-d120267933ba?auto=format&fit=crop&w=1500&q=80") center/cover;
  box-shadow: var(--shadow);
}

.user-shell .brand-panel {
  border-color: rgba(185, 224, 255, 0.22);
  background: transparent;
  box-shadow:
    0 24px 70px rgba(0, 5, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 34px rgba(114, 190, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(transparent, rgba(5, 18, 16, 0.55));
}

.user-shell .brand-panel::after {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .night-sky-canvas {
    opacity: 0.72;
  }
}

.brand-panel > * {
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  font-size: 25px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-panel .eyebrow {
  color: rgba(255, 255, 255, 0.82);
}

.brand-panel h1,
.topbar h1,
.admin-topbar h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-copy {
  max-width: 420px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
}

.topbar-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-topbar .topbar-note {
  color: var(--muted);
}

.auth-panel,
.admin-auth,
.control-panel,
.chart-panel,
.screen-panel,
.log-panel,
.license-form,
.license-table-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.user-shell .topbar h1,
.user-shell .topbar .eyebrow {
  color: rgba(255, 255, 255, 0.96);
}

.user-shell .topbar-note {
  color: rgba(224, 242, 254, 0.82);
}

.user-shell .control-panel,
.user-shell .chart-panel,
.user-shell .screen-panel,
.user-shell .log-panel,
.user-shell .status-pill,
.user-shell .metric,
.user-shell .auth-panel {
  border-color: rgba(188, 226, 255, 0.32);
  background: transparent;
  box-shadow:
    0 18px 48px rgba(0, 5, 20, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 30px rgba(117, 194, 255, 0.07);
  backdrop-filter: blur(8px);
}

.user-shell .status-pill,
.user-shell .metric {
  border-color: rgba(202, 235, 255, 0.34);
  background: rgba(2, 8, 22, 0.08);
  box-shadow:
    0 14px 36px rgba(0, 5, 18, 0.27),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 24px rgba(115, 207, 255, 0.08);
}

.user-shell .screen-panel,
.user-shell .chart-panel {
  background: transparent;
  box-shadow:
    0 20px 54px rgba(0, 5, 22, 0.31),
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 0 34px rgba(88, 219, 224, 0.07);
}

.user-shell .log-panel,
.user-shell .control-panel {
  background: transparent;
  box-shadow:
    0 20px 54px rgba(0, 5, 22, 0.31),
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 0 34px rgba(145, 190, 255, 0.07);
}

.user-shell .section-title h2,
.user-shell .metric strong,
.user-shell .status-pill,
.user-shell .panel-kicker,
.user-shell .auth-panel h2 {
  color: rgba(244, 250, 255, 0.96);
}

.user-shell .metric span,
.user-shell .section-title span,
.user-shell .field span,
.user-shell .panel-note {
  color: rgba(223, 240, 255, 0.82);
}

.auth-panel {
  padding: 28px;
  align-self: center;
  display: grid;
  gap: 18px;
}

.auth-panel h2,
.admin-auth h1,
.section-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

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

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.field input:focus,
.field select:focus {
  border-color: rgba(15, 159, 143, 0.65);
  box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.12);
}

.primary-action,
.run-button,
.stop-button,
.icon-text-button,
.ghost-button,
.icon-button,
.table-action {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action,
.run-button {
  background: linear-gradient(135deg, #16b28f, #38c172);
  color: white;
  box-shadow: 0 12px 26px rgba(16, 168, 147, 0.24);
}

.secondary-action {
  color: var(--teal-dark);
  background: rgba(15, 159, 143, 0.1);
  border: 1px solid rgba(15, 159, 143, 0.24);
  box-shadow: none;
}

.primary-action:disabled,
.secondary-action:disabled,
.run-button:disabled,
.stop-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.stop-button {
  background: linear-gradient(135deg, #ef5350, #ff8a65);
  color: white;
  box-shadow: 0 12px 26px rgba(217, 75, 75, 0.22);
}

.primary-action:hover,
.run-button:hover,
.stop-button:hover,
.icon-text-button:hover,
.ghost-button:hover,
.icon-button:hover,
.table-action:hover {
  transform: translateY(-1px);
}

.run-button:active {
  background: linear-gradient(135deg, #087c68, #18a058);
  box-shadow: 0 6px 14px rgba(16, 168, 147, 0.28);
  transform: translateY(1px) scale(0.98);
}

.stop-button:active {
  background: linear-gradient(135deg, #b32626, #e85c45);
  box-shadow: 0 6px 14px rgba(217, 75, 75, 0.28);
  transform: translateY(1px) scale(0.98);
}

.icon-text-button:active,
.ghost-button:active,
.icon-button:active,
.mini-icon-button:active,
.table-action:active {
  background: rgba(47, 128, 237, 0.12);
  transform: translateY(1px) scale(0.98);
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

.panel-note {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.topbar,
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 8px 0 18px;
}

.topbar h1,
.admin-topbar h1 {
  font-size: clamp(26px, 5vw, 42px);
}

.ghost-button,
.icon-button,
.icon-text-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
}

.ghost-button,
.icon-button {
  width: 46px;
  padding: 0;
}

.icon-text-button {
  padding: 0 14px;
}

.icon-text-button.subtle {
  color: var(--muted);
}

.icon-text-button.active {
  color: var(--teal-dark);
  background: rgba(15, 159, 143, 0.1);
  border-color: rgba(15, 159, 143, 0.28);
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 0.85fr 1.2fr;
  gap: 12px;
  margin-bottom: 14px;
}

.status-pill,
.metric {
  min-height: 78px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 24px rgba(24, 36, 32, 0.08);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 22px;
  font-weight: 900;
}

.pulse-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 7px rgba(217, 75, 75, 0.13);
}

.status-pill.running .pulse-dot {
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(40, 167, 69, 0.13);
}

.metric {
  display: grid;
  align-content: center;
  gap: 5px;
}

.metric span,
.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  font-size: clamp(20px, 4.4vw, 30px);
  line-height: 1;
}

.metric .type-badge {
  width: fit-content;
  font-size: 13px;
}

.metric span i {
  color: #16a085;
}

.license-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.license-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(47, 128, 237, 0.18);
  border-radius: 10px;
  color: var(--blue-dark);
  background: rgba(47, 128, 237, 0.08);
}

.control-grid,
.media-log-grid,
.primary-work-grid,
.media-stat-grid,
.admin-content {
  display: grid;
  gap: 14px;
}

.control-grid,
.primary-work-grid {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.media-log-grid,
.media-stat-grid {
  grid-template-columns: 1fr;
}

.control-panel,
.chart-panel,
.screen-panel,
.log-panel,
.license-form,
.license-table-panel {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.table-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.log-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.run-button,
.stop-button {
  min-height: 58px;
  font-size: 17px;
}

.chart-box {
  height: 210px;
}

.screen-window {
  min-height: 320px;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 29, 0.16);
  border-radius: 14px;
  background: #111a17;
}

.screen-window img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: #0e1513;
}

.screen-window.has-image img {
  display: block;
}

.screen-window.has-image .screen-empty {
  display: none;
}

.screen-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.screen-empty i {
  font-size: 30px;
}

.log-output {
  height: 320px;
  padding: 14px;
  overflow: auto;
  border: 1px solid rgba(16, 168, 147, 0.2);
  border-radius: 14px;
  background: #dff7e9;
  color: #10231c;
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.total-harvest {
  min-height: 42px;
  margin: -4px 0 12px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(47, 128, 237, 0.16);
  border-radius: 12px;
  color: var(--blue-dark);
  background: linear-gradient(135deg, rgba(47, 128, 237, 0.1), rgba(16, 168, 147, 0.08));
  font-size: 15px;
  font-weight: 900;
}

.admin-frame {
  width: min(1360px, calc(100vw - 36px));
  padding-top: 24px;
}

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

.admin-auth {
  width: min(420px, 100%);
  padding: 28px;
  display: grid;
  gap: 16px;
}

.admin-dashboard {
  min-height: calc(100vh - 52px);
}

.admin-topbar {
  padding: 18px 22px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 30px rgba(22, 35, 31, 0.08);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.admin-stat {
  min-height: 108px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 13px;
  row-gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 28px rgba(22, 35, 31, 0.07);
}

.admin-stat i {
  width: 42px;
  height: 42px;
  grid-row: span 2;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--teal-dark);
  background: rgba(15, 159, 143, 0.11);
}

.admin-stat span {
  align-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-stat strong {
  align-self: start;
  font-size: 30px;
  line-height: 1;
}

.admin-content {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 16px;
}

.license-form {
  align-self: start;
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(150px, 0.7fr) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 15px;
}

.license-form .section-title,
.license-form .form-error {
  grid-column: 1 / -1;
}

.license-form .primary-action {
  min-width: 138px;
}

.license-table-panel {
  min-height: 540px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.license-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: white;
}

.license-table th,
.license-table td {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(23, 33, 29, 0.09);
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
}

.license-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #f6faf8;
}

.license-table tr:last-child td {
  border-bottom: 0;
}

.note-cell {
  max-width: 220px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.active {
  color: #09694e;
  background: rgba(40, 167, 69, 0.12);
}

.status-badge.frozen {
  color: #8b3b33;
  background: rgba(217, 75, 75, 0.12);
}

.status-badge.expired {
  color: #836016;
  background: rgba(200, 135, 25, 0.14);
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 54px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.type-badge.day {
  color: #1d5fbf;
  background: rgba(47, 128, 237, 0.12);
}

.type-badge.week {
  color: #087c68;
  background: rgba(16, 168, 147, 0.13);
}

.type-badge.month {
  color: #836016;
  background: rgba(200, 135, 25, 0.14);
}

.type-badge.permanent {
  color: #8b3b33;
  background: rgba(217, 75, 75, 0.12);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.table-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.table-action.danger {
  color: var(--red);
}

.empty-table {
  display: none;
  padding: 32px;
  color: var(--muted);
  text-align: center;
  background: white;
}

.empty-table.visible {
  display: block;
}

.expiry-dialog {
  width: min(430px, calc(100vw - 26px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.expiry-dialog::backdrop {
  background: rgba(12, 19, 17, 0.42);
}

.expiry-dialog form {
  padding: 20px;
  display: grid;
  gap: 15px;
}

.user-shell .brand-panel,
.user-shell .auth-panel,
.user-shell .control-panel,
.user-shell .chart-panel,
.user-shell .screen-panel,
.user-shell .log-panel,
.user-shell .status-pill,
.user-shell .metric {
  background-color: transparent;
  background-image: none;
}

.user-shell .brand-panel,
.user-shell .auth-panel,
.user-shell .control-panel,
.user-shell .chart-panel,
.user-shell .screen-panel,
.user-shell .log-panel {
  border-color: rgba(196, 231, 255, 0.34);
  box-shadow:
    0 20px 54px rgba(0, 5, 22, 0.32),
    0 0 0 1px rgba(105, 190, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 0 34px rgba(105, 190, 255, 0.08);
}

.user-shell .status-pill,
.user-shell .metric {
  border-color: rgba(206, 237, 255, 0.36);
  box-shadow:
    0 14px 34px rgba(0, 5, 18, 0.28),
    0 0 0 1px rgba(134, 213, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 26px rgba(124, 208, 255, 0.08);
}

.user-shell .section-title h2,
.user-shell .metric strong,
.user-shell .status-pill,
.user-shell .auth-panel h2 {
  color: #f7fbff;
  text-shadow: 0 0 18px rgba(121, 206, 255, 0.22);
}

.user-shell .panel-kicker,
.user-shell .metric span i {
  color: #8feaff;
  text-shadow: 0 0 14px rgba(143, 234, 255, 0.28);
}

.user-shell .topbar-note,
.user-shell .panel-note,
.user-shell .section-title span,
.user-shell .metric span,
.user-shell .field span {
  color: rgba(226, 243, 255, 0.84);
}

.user-shell .screen-window {
  border-color: rgba(180, 228, 255, 0.28);
  background: transparent;
  box-shadow:
    inset 0 0 28px rgba(88, 185, 255, 0.08),
    0 12px 32px rgba(0, 5, 20, 0.22);
}

.user-shell .screen-window img {
  background: transparent;
}

.user-shell .screen-empty {
  color: rgba(238, 248, 255, 0.78);
  text-shadow: 0 0 16px rgba(120, 210, 255, 0.22);
}

.user-shell .log-output {
  border-color: rgba(157, 235, 198, 0.36);
  background: transparent;
  color: #eafff3;
  box-shadow:
    inset 0 0 28px rgba(103, 255, 180, 0.08),
    0 12px 32px rgba(0, 5, 20, 0.2);
  text-shadow: 0 0 10px rgba(103, 255, 180, 0.12);
}

.user-shell .total-harvest,
.user-shell .mini-icon-button,
.user-shell .ghost-button,
.user-shell .icon-button,
.user-shell .icon-text-button {
  border-color: rgba(185, 228, 255, 0.28);
  background: transparent;
  color: #eaf8ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.user-shell .total-harvest {
  color: #c8f7ff;
  text-shadow: 0 0 14px rgba(143, 234, 255, 0.26);
}

.user-shell .field input,
.user-shell .field select {
  border-color: rgba(190, 229, 255, 0.32);
  background: transparent;
  color: #f7fbff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(120, 210, 255, 0.05);
}

.user-shell .field input::placeholder {
  color: rgba(222, 240, 255, 0.58);
}

.user-shell .field input:focus,
.user-shell .field select:focus {
  border-color: rgba(143, 234, 255, 0.68);
  box-shadow:
    0 0 0 4px rgba(143, 234, 255, 0.08),
    inset 0 0 18px rgba(120, 210, 255, 0.08);
}

@media (max-width: 900px) {
  .login-layout,
  .control-grid,
  .media-log-grid,
  .primary-work-grid,
  .media-stat-grid,
  .admin-content {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 360px;
  }

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

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

  .license-form {
    position: static;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-frame,
  .admin-frame {
    width: 100%;
    padding: 8px 8px 18px;
  }

  .brand-panel,
  .auth-panel,
  .control-panel,
  .chart-panel,
  .screen-panel,
  .log-panel,
  .admin-auth,
  .license-form,
  .license-table-panel {
    border-radius: 14px;
    padding: 15px;
  }

  .dashboard-layout {
    display: grid;
    gap: 10px;
  }

  .topbar {
    padding: 10px 0 6px;
  }

  .topbar .eyebrow {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .topbar h1 {
    font-size: 25px;
  }

  .ghost-button,
  .icon-button {
    width: 42px;
    min-height: 42px;
    border-radius: 11px;
  }

  .brand-panel {
    min-height: 300px;
  }

  .brand-panel h1 {
    font-size: 34px;
  }

  .status-strip {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 8px;
    margin-bottom: 0;
  }

  .status-pill,
  .metric {
    min-height: 58px;
    padding: 12px 13px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(24, 36, 32, 0.07);
  }

  .status-pill {
    gap: 9px;
    font-size: 19px;
  }

  .pulse-dot {
    width: 11px;
    height: 11px;
    box-shadow: 0 0 0 6px rgba(217, 75, 75, 0.13);
  }

  .status-pill.running .pulse-dot {
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.13);
  }

  .metric {
    gap: 3px;
  }

  .metric span,
  .section-title span {
    font-size: 11px;
  }

  .metric strong {
    font-size: 20px;
  }

  .metric:nth-child(3) {
    grid-column: 1 / -1;
  }

  .control-grid,
  .media-log-grid,
  .primary-work-grid,
  .media-stat-grid {
    gap: 10px;
    margin-bottom: 0;
  }

  .control-panel,
  .chart-panel,
  .screen-panel,
  .log-panel {
    padding: 14px;
    border-radius: 15px;
    box-shadow: 0 10px 28px rgba(22, 35, 31, 0.11);
  }

  .section-title {
    align-items: center;
    flex-direction: row;
    margin-bottom: 11px;
  }

  .section-title h2 {
    font-size: 20px;
  }

  .action-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .run-button,
  .stop-button {
    min-height: 50px;
    border-radius: 12px;
    font-size: 15px;
  }

  .chart-box {
    height: 168px;
  }

  .screen-window {
    min-height: 0;
    border-radius: 12px;
  }

  .log-output {
    height: 230px;
    padding: 12px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.5;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    border-radius: 14px;
    padding: 15px;
  }

  .section-title .icon-text-button,
  .section-title .icon-button {
    align-self: center;
    flex: 0 0 auto;
  }

  .icon-text-button {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 13px;
  }

  .user-shell .brand-panel,
  .user-shell .auth-panel,
  .user-shell .control-panel,
  .user-shell .chart-panel,
  .user-shell .screen-panel,
  .user-shell .log-panel,
  .user-shell .status-pill,
  .user-shell .metric {
    background-color: transparent;
    background-image: none;
  }

  .user-shell .control-panel,
  .user-shell .chart-panel,
  .user-shell .screen-panel,
  .user-shell .log-panel {
    box-shadow:
      0 16px 38px rgba(0, 5, 22, 0.3),
      0 0 0 1px rgba(105, 190, 255, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      inset 0 0 26px rgba(105, 190, 255, 0.08);
  }

  .user-shell .status-pill,
  .user-shell .metric {
    box-shadow:
      0 10px 28px rgba(0, 5, 18, 0.27),
      0 0 0 1px rgba(134, 213, 255, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      inset 0 0 22px rgba(124, 208, 255, 0.08);
  }
}

/* Global base: full-screen deep-space background for the user page only. */
body.user-shell {
  min-height: 100vh;
  background: transparent;
  isolation: isolate;
}

.user-shell::before {
  content: "";
  display: block;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background: linear-gradient(180deg, #020310 0%, #050a28 32%, #081240 58%, #0c1a52 100%);
}

.user-shell::after {
  display: none;
}

/* Starfield canvas: all animated sky rendering stays behind every control. */
.user-shell .night-sky-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  filter: saturate(1.04) blur(0.05px);
  transform: translateZ(0);
}

.user-shell .app-frame {
  position: relative;
  z-index: 0;
}

/* Card shell: keep the floating outlines while leaving panel padding transparent. */
.user-shell .brand-panel,
.user-shell .auth-panel,
.user-shell .control-panel,
.user-shell .chart-panel,
.user-shell .screen-panel,
.user-shell .log-panel,
.user-shell .status-pill,
.user-shell .metric {
  background: transparent;
  background-image: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Inner content layer: only real content receives a soft dark backing for readability. */
.user-shell .brand-panel .brand-mark,
.user-shell .brand-panel .eyebrow,
.user-shell .brand-panel h1,
.user-shell .brand-copy,
.user-shell .auth-panel > div,
.user-shell .auth-panel > .field,
.user-shell .auth-panel > .form-error,
.user-shell .control-panel > .section-title,
.user-shell .control-panel > .panel-note,
.user-shell .control-panel > .action-row,
.user-shell .log-panel > .section-title,
.user-shell .screen-panel > .section-title,
.user-shell .chart-panel > .section-title,
.user-shell .status-pill > span:not(.pulse-dot),
.user-shell .metric > span,
.user-shell .metric > strong,
.user-shell .metric > .license-row,
.user-shell .screen-window,
.user-shell .log-output,
.user-shell .total-harvest,
.user-shell .chart-box {
  border-radius: 12px;
  background: rgba(3, 8, 25, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 18px rgba(115, 188, 255, 0.05);
}

.user-shell .brand-panel .eyebrow,
.user-shell .brand-panel h1,
.user-shell .brand-copy,
.user-shell .auth-panel > div,
.user-shell .auth-panel > .field,
.user-shell .auth-panel > .form-error,
.user-shell .control-panel > .section-title,
.user-shell .control-panel > .panel-note,
.user-shell .control-panel > .action-row,
.user-shell .log-panel > .section-title,
.user-shell .screen-panel > .section-title,
.user-shell .chart-panel > .section-title,
.user-shell .chart-box {
  padding: 10px 12px;
}

.user-shell .status-pill > span:not(.pulse-dot),
.user-shell .metric > span,
.user-shell .metric > strong,
.user-shell .metric > .license-row,
.user-shell .total-harvest {
  padding: 7px 10px;
  width: fit-content;
  max-width: 100%;
}

.user-shell .metric > strong,
.user-shell .license-row {
  color: #f7fbff;
}

.user-shell .screen-window,
.user-shell .log-output {
  background: rgba(3, 8, 25, 0.48);
}

.user-shell .screen-empty {
  color: rgba(243, 250, 255, 0.82);
}

.user-shell .field input,
.user-shell .field select,
.user-shell .mini-icon-button,
.user-shell .ghost-button,
.user-shell .icon-button,
.user-shell .icon-text-button {
  background: rgba(3, 8, 25, 0.28);
}

/* Admin workspace */
.admin-shell {
  background: #f3f6f7;
}

.admin-shell .admin-frame {
  width: min(1360px, calc(100vw - 40px));
  padding: 22px 0 36px;
}

.admin-shell .admin-topbar {
  margin-bottom: 14px;
  padding: 8px 2px 18px;
  border: 0;
  border-bottom: 1px solid #dce3e5;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-shell .admin-topbar h1 {
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.15;
}

.admin-shell .admin-topbar .eyebrow {
  color: #0a766e;
}

.admin-shell .admin-topbar .ghost-button,
.admin-shell .icon-button,
.admin-shell .icon-text-button {
  border-radius: 6px;
  background: #fff;
}

.admin-shell .admin-stats {
  gap: 10px;
  margin-bottom: 14px;
}

.admin-shell .admin-stat {
  --stat-color: #2f6fbb;
  --stat-tint: #eaf2fb;
  min-height: 88px;
  padding: 14px 16px;
  column-gap: 12px;
  border-color: #dfe6e8;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(29, 44, 48, 0.05);
}

.admin-shell .admin-stat:nth-child(2) {
  --stat-color: #16815f;
  --stat-tint: #e8f6f0;
}

.admin-shell .admin-stat:nth-child(3) {
  --stat-color: #b04b54;
  --stat-tint: #fbecee;
}

.admin-shell .admin-stat:nth-child(4) {
  --stat-color: #a56d17;
  --stat-tint: #fbf2df;
}

.admin-shell .admin-stat i {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  color: var(--stat-color);
  background: var(--stat-tint);
}

.admin-shell .admin-stat strong {
  font-size: 25px;
}

.admin-shell .admin-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.admin-shell .license-form,
.admin-shell .license-table-panel,
.admin-shell .admin-auth {
  min-width: 0;
  border-color: #dfe6e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(29, 44, 48, 0.06);
  backdrop-filter: none;
}

.admin-shell .license-form {
  display: block;
  padding: 20px;
}

.admin-shell .license-form .section-title {
  margin-bottom: 16px;
}

.admin-shell .license-form .section-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
}

.admin-shell .license-form .section-title h2 i {
  color: #0a766e;
  font-size: 15px;
}

.license-form-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(230px, 1fr) minmax(180px, 0.75fr) minmax(220px, 1fr);
  align-items: end;
  gap: 16px;
}

.expiry-method-field {
  display: grid;
  gap: 8px;
}

.control-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.segmented-control {
  min-height: 48px;
  padding: 3px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border: 1px solid #dce3e5;
  border-radius: 7px;
  background: #edf1f2;
}

.segmented-control label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  height: 100%;
  min-width: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 5px;
  color: #66747a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.segmented-control input:checked + span {
  color: #075f59;
  background: #fff;
  box-shadow: 0 1px 4px rgba(30, 48, 53, 0.14);
}

.segmented-control input:focus-visible + span {
  outline: 2px solid rgba(15, 159, 143, 0.55);
  outline-offset: 1px;
}

.admin-shell .field input,
.admin-shell .field select {
  min-height: 48px;
  border-color: #d6dfe1;
  border-radius: 6px;
  background: #fff;
}

.admin-shell .field input:hover,
.admin-shell .field select:hover {
  border-color: #aab9bd;
}

.license-form-actions {
  margin-top: 16px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e6ebec;
}

.license-form-actions .form-error {
  flex: 1;
}

.admin-shell .license-form-actions .primary-action {
  min-width: 148px;
  min-height: 46px;
  border-radius: 6px;
  background: #0e8379;
  box-shadow: 0 7px 16px rgba(14, 131, 121, 0.18);
}

.admin-shell .license-form-actions .primary-action:hover {
  background: #096e67;
}

.admin-shell .license-table-panel {
  min-height: 480px;
  padding: 20px;
}

.admin-shell .license-table-panel .section-title {
  margin-bottom: 14px;
}

.admin-shell .license-table-panel .section-title h2 {
  font-size: 17px;
}

.license-summary {
  color: #64736d;
  font-size: 13px;
  font-weight: 700;
}

.admin-shell .table-wrap {
  border-color: #dfe6e8;
  border-radius: 6px;
}

.admin-shell .license-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #526168;
  background: #f5f7f8;
}

.admin-shell .license-table th,
.admin-shell .license-table td {
  padding: 13px 15px;
}

.admin-shell .license-table th:first-child,
.admin-shell .license-table td:first-child,
.admin-shell .license-table th:nth-child(5),
.admin-shell .license-table td:nth-child(5) {
  text-align: left;
}

.admin-shell .license-table tbody tr:hover {
  background: #f8fbfa;
}

.type-badge.custom {
  color: #7048a0;
  background: #f1eafa;
}

.admin-shell .table-action {
  border-radius: 6px;
}

@media (max-width: 1080px) {
  .license-form-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .license-note-field {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .admin-shell .admin-frame {
    width: 100%;
    padding: 10px 10px 24px;
  }

  .admin-shell .admin-topbar {
    padding: 8px 2px 14px;
  }

  .admin-shell .admin-topbar h1 {
    font-size: 25px;
  }

  .admin-shell .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shell .admin-stat {
    min-height: 80px;
    padding: 12px;
  }

  .admin-shell .license-form,
  .admin-shell .license-table-panel {
    padding: 15px;
    border-radius: 8px;
  }

  .license-form-fields {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .license-note-field {
    grid-column: auto;
  }

  .license-form-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .admin-shell .license-form-actions .primary-action {
    width: 100%;
  }

  .admin-shell .license-table-panel .section-title {
    align-items: flex-start;
    gap: 10px;
  }

  .admin-shell .table-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .license-summary {
    width: 100%;
    text-align: right;
  }
}
