:root {
  color-scheme: light;
  --bg: #edf3f8;
  --bg-end: #dde8f1;
  --bg-accent: rgba(80, 193, 255, 0.14);
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --panel-soft: #f7fbff;
  --sidebar: rgba(255, 255, 255, 0.84);
  --topbar: rgba(255, 255, 255, 0.76);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #182235;
  --text-soft: #4d5c75;
  --muted: #7a889d;
  --primary: #12cfe2;
  --primary-2: #4f8cff;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 22px 44px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.05);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

.php-admin-page .sidebar-search {
  display: none;
}

.php-admin-page .nav-group:not(.expanded) .nav-group-items {
  display: none;
}

.php-admin-page .nav-group.expanded .nav-group-items {
  display: flex;
}

.php-flash {
  border: 1px solid rgba(69, 214, 166, .35);
  background: rgba(69, 214, 166, .12);
  color: var(--text);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-weight: 700;
}

.php-flash.error {
  border-color: rgba(255, 102, 127, .45);
  background: rgba(255, 102, 127, .13);
  color: #ff8ca0;
}

.php-filter-card,
.php-batch-card,
.php-form-card {
  margin-bottom: 18px;
}

.php-filter-form,
.php-batch-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.php-filter-form input[type="text"],
.php-filter-form input[type="search"] {
  flex: 0 1 320px;
}

.php-filter-form select {
  flex: 0 1 220px;
}

.php-batch-card {
  padding: 14px 16px;
}

.php-batch-form {
  display: grid;
  grid-template-columns: minmax(140px, auto) minmax(160px, 220px) minmax(160px, 220px) minmax(200px, 240px) minmax(200px, 260px) auto;
  gap: 10px;
  align-items: center;
}

.php-batch-form input,
.php-batch-form select {
  width: 100%;
  min-width: 0;
}

.batch-selected-count {
  color: var(--text-soft);
  font-weight: 900;
  white-space: nowrap;
}

.status-filter-card {
  padding: 14px 16px;
}

.status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-filter .ghost-btn,
.status-filter .primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
}

.php-filter-form input,
.php-filter-form select,
.php-batch-form input,
.php-batch-form select,
.php-record-form input,
.php-record-form select,
.php-record-form textarea,
.php-data-table input,
.php-data-table select {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.php-record-form textarea,
.code-editor {
  padding: 12px;
  line-height: 1.55;
}

.php-data-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border-radius: 4px;
  vertical-align: middle;
}

.php-record-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px;
}

.php-field,
.php-record-form .field {
  display: grid;
  gap: 8px;
}

.php-record-form .full-row,
.php-record-form .field:has(textarea),
.php-record-form .field:has(.php-check-grid),
.php-record-form .field:has(.sortable-check-list) {
  grid-column: 1 / -1;
}

.php-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px;
}

.php-check-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px;
}

.php-check-item label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-admin-form {
  display: block;
}

.app-edit-card h2 {
  margin-bottom: 16px;
}

.app-admin-form .app-admin-tabbar {
  margin-bottom: 18px;
}

.app-admin-panel.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.app-admin-panel[hidden] {
  display: none !important;
}

.app-form-actions {
  margin-top: 18px;
}

.sortable-check-list {
  display: grid;
  gap: 14px;
  width: 100%;
}

.sortable-check-list .sortable-source-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  max-height: 260px;
  overflow: auto;
}

.sortable-check-list .php-check-item {
  grid-template-columns: minmax(0, 1fr);
  min-height: 54px;
}

.sortable-check-list .php-check-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 760;
}

.selected-order-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  background: rgba(79, 140, 255, 0.06);
}

.selected-order-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.selected-order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 70px;
  padding: 12px;
  border: 1px dashed rgba(116, 168, 255, 0.42);
  border-radius: 8px;
  background: rgba(18, 207, 226, 0.05);
}

.selected-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(79, 140, 255, 0.42);
  background: rgba(79, 140, 255, 0.16);
  color: var(--text);
  font-weight: 800;
  cursor: grab;
}

.selected-order-chip.dragging {
  opacity: 0.45;
}

.drag-handle {
  color: var(--muted);
  font-weight: 900;
}

.chip-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}

.package-admin-form {
  display: grid;
  gap: 18px;
}

.package-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: end;
}

.package-source-module {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

.package-source-module h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.package-source-module .php-field > span {
  display: none;
}

.package-form-actions {
  margin-top: 2px;
}

.php-data-table th,
.php-data-table td {
  vertical-align: middle;
  text-align: center;
}

.php-data-table .account-col,
.php-data-table .kami-code-col {
  text-align: left;
  max-width: 180px;
  overflow-wrap: anywhere;
}

.php-data-table .device-col span,
.php-data-table .location-col span,
.php-data-table .user-col span,
.stack-main,
.stack-sub {
  display: block;
  line-height: 1.45;
}

.stack-main {
  font-weight: 800;
  color: var(--text);
}

.stack-sub {
  color: var(--muted);
  font-size: .88em;
}

.stack-sub.success {
  color: #37d99a;
}

.stack-sub.warning {
  color: #ffbd4a;
}

.stack-sub.danger {
  color: #ff667f;
}

.stack-main.danger {
  color: #ff8da1;
}

.package-edit-col {
  min-width: 240px;
}

.package-edit-col select,
.package-edit-col input {
  width: 100%;
  margin: 4px 0;
}

.actions-cell {
  white-space: nowrap;
}

.inline-form {
  display: inline-flex;
  margin: 0 4px;
}

.table-actions,
.php-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}

.php-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.php-dashboard-grid .dashboard-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel);
}

.php-dashboard-grid .dashboard-card span {
  display: block;
  color: var(--muted);
}

.php-dashboard-grid .dashboard-card strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

.code-editor {
  width: 100%;
  min-height: 520px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ghost-btn.disabled {
  pointer-events: none;
  opacity: .45;
}

@media (max-width: 1100px) {
  .php-record-form,
  .php-check-grid,
  .php-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #081120;
  --bg-end: #050d18;
  --bg-accent: rgba(21, 207, 232, 0.12);
  --panel: rgba(18, 30, 48, 0.9);
  --panel-strong: #132235;
  --panel-soft: #101d2e;
  --sidebar: rgba(17, 26, 43, 0.95);
  --topbar: rgba(22, 34, 52, 0.78);
  --line: rgba(148, 163, 184, 0.12);
  --line-strong: rgba(148, 163, 184, 0.2);
  --text: #edf3fb;
  --text-soft: #c6d2e3;
  --muted: #8fa0ba;
  --primary: #1be4e6;
  --primary-2: #4f8cff;
  --success: #4ade80;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 26px 56px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 16px 28px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--bg-accent), transparent 24%),
    radial-gradient(circle at top right, rgba(79, 140, 255, 0.09), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
}

body {
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

img,
svg {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.login-page,
.modern-admin-page {
  min-height: 100vh;
}

.modern-admin-page {
  background:
    radial-gradient(circle at top center, rgba(18, 207, 226, 0.08), transparent 22%),
    radial-gradient(circle at top right, rgba(79, 140, 255, 0.08), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
}

.login-page {
  background:
    radial-gradient(circle at 10% 15%, rgba(18, 207, 226, 0.18), transparent 26%),
    radial-gradient(circle at 90% 10%, rgba(79, 140, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #07111f 0%, #0a172a 44%, #081728 100%);
  color: #eff6ff;
}

.login-shell {
  width: min(1220px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
}

.login-side,
.login-card,
.card,
.sidebar,
.modal-card {
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-side {
  position: relative;
  overflow: hidden;
  padding: 48px;
  border-radius: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(18, 207, 226, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
}

.login-side::before,
.login-side::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(18, 207, 226, 0.12), rgba(79, 140, 255, 0.04));
}

.login-side::before {
  width: 240px;
  height: 240px;
  right: -70px;
  top: -80px;
}

.login-side::after {
  width: 180px;
  height: 180px;
  left: -60px;
  bottom: -70px;
}

.pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7faff;
  font-size: 13px;
  font-weight: 700;
}

.login-side h1 {
  position: relative;
  z-index: 1;
  margin: 20px 0 14px;
  font-size: 54px;
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.login-side p,
.login-side li,
.muted {
  position: relative;
  z-index: 1;
  color: rgba(226, 232, 240, 0.74);
}

.login-preview {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.login-preview-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e9f6ff;
  font-size: 13px;
}

.login-card {
  padding: 34px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 20, 35, 0.82);
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 30px rgba(18, 207, 226, 0.22);
}

.brand-title {
  font-size: 21px;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.login-form,
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-form h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.field,
.checkbox-field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
}

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

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .login-card {
  background: rgba(16, 28, 43, 0.95);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(79, 140, 255, 0.4);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.input-addon-wrap {
  display: flex;
  align-items: stretch;
}

.input-addon-wrap input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-addon {
  min-width: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-left: 0;
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
  background: var(--panel-soft);
  color: var(--muted);
}

.switch-field {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.switch-wrap {
  display: flex;
  align-items: center;
}

.switch-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.switch-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 30px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.switch-slider {
  position: relative;
  width: 52px;
  min-width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  transition: 0.2s ease;
}

.switch-slider::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  transition: 0.2s ease;
}

.switch-input:checked + .switch-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.switch-input:checked + .switch-slider::after {
  transform: translateX(22px);
}

.switch-input:focus-visible + .switch-slider {
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
}

.switch-text {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.switch-text::before {
  content: attr(data-off);
}

.switch-input:checked ~ .switch-text::before {
  content: attr(data-on);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 14px 28px rgba(42, 133, 255, 0.2);
}

.ghost-btn {
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-btn {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.16);
}

.icon-btn {
  background: var(--panel-soft);
  color: var(--text-soft);
  border: 1px solid var(--line);
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn.active,
.chart-tab.active {
  background: linear-gradient(135deg, rgba(18, 207, 226, 0.12), rgba(79, 140, 255, 0.12));
  border-color: rgba(18, 207, 226, 0.2);
  color: var(--text);
}

.live-mode-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.live-mode-btn.active {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(18, 207, 226, 0.3), rgba(79, 140, 255, 0.3));
  border-color: rgba(79, 140, 255, 0.55);
  color: var(--text);
  box-shadow: 0 14px 28px rgba(79, 140, 255, 0.2);
}

.live-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.live-mode-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.live-mode-check::before {
  content: "✓";
  font-size: 12px;
  font-weight: 900;
}

html[data-theme="dark"] .live-mode-btn.active {
  color: #f8fbff;
}

.live-mode-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
}

.live-mode-status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
}

.live-mode-status.is-store::before {
  background: var(--warning);
}

.live-mode-status.is-config::before {
  background: var(--success);
}

.live-mode-status.is-empty::before {
  background: var(--muted);
}

.wide {
  width: 100%;
  text-align: center;
}

.mini {
  padding: 8px 12px;
  font-size: 12px;
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.alert.error {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 8px;
}

.sidebar-search {
  display: block;
}

.nav-groups {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
}

.nav-group {
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
}

.nav-group-single {
  border: 0;
}

.nav-group-toggle,
.nav-link,
.nav-direct {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 18px;
  cursor: pointer;
}

.nav-group-toggle {
  justify-content: space-between;
}

.nav-group-toggle:hover,
.nav-link:hover,
.nav-direct:hover {
  background: rgba(18, 207, 226, 0.06);
  border-color: rgba(18, 207, 226, 0.08);
}

.nav-link.active,
.nav-direct.active {
  background: linear-gradient(135deg, rgba(18, 207, 226, 0.12), rgba(79, 140, 255, 0.1));
  border-color: rgba(18, 207, 226, 0.16);
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.nav-group-meta,
.nav-group-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-group-badge,
.nav-link-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 207, 226, 0.08);
  color: var(--primary-2);
  flex-shrink: 0;
}

.nav-icon-svg {
  width: 18px;
  height: 18px;
}

.nav-group-label,
.nav-link-title,
.nav-direct-text {
  font-size: 15px;
  font-weight: 700;
}

.nav-group-count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-group-arrow {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.nav-group:not(.expanded) .nav-group-arrow {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: none;
  padding: 6px 0 2px 12px;
  margin-left: 18px;
  border-left: 1px solid var(--line);
}

.nav-group.expanded .nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link-text {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-action {
  justify-content: flex-start;
  gap: 12px;
}

.sidebar-action-icon {
  width: 18px;
  text-align: center;
}

.main-panel {
  min-width: 0;
  padding: 22px 24px 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--topbar);
  box-shadow: var(--shadow-soft);
}

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

.topbar-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  margin: 6px 0 4px;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.page-description:empty {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text-soft);
  font-weight: 700;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 22px;
}

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

.dashboard-primary-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, var(--card-accent-strong) 0%, transparent 42%),
    linear-gradient(180deg, var(--panel-strong), var(--panel-soft));
  box-shadow: var(--shadow-soft);
}

.dashboard-primary-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--card-accent), transparent 80%);
}

.dashboard-primary-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-primary-icon,
.dashboard-chip-icon,
.chart-summary-icon,
.meta-pill-icon,
.activity-item-icon,
.quick-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-primary-icon {
  background: var(--card-accent-soft, rgba(79, 140, 255, 0.12));
  color: var(--card-accent, var(--primary-2));
}

.card-icon-svg,
.summary-icon-svg {
  width: 20px;
  height: 20px;
}

.dashboard-primary-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

.dashboard-primary-value {
  margin-top: 20px;
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.dashboard-primary-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.dashboard-chip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel-soft));
  box-shadow: var(--shadow-soft);
}

.dashboard-chip-icon {
  background: var(--fact-accent-soft, rgba(79, 140, 255, 0.1));
  color: var(--fact-accent, var(--primary-2));
}

.dashboard-chip-copy {
  min-width: 0;
}

.dashboard-chip-copy small,
.chart-summary-card small,
.meta-pill-copy small,
.activity-item-copy span,
.quick-action-copy small {
  display: block;
  color: var(--muted);
}

.dashboard-chip-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.dashboard-chip-copy span {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
}

.dashboard-toolbar-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.app-admin-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.app-admin-tab {
  min-height: 48px;
  padding: 12px 18px;
  font-weight: 800;
}

.app-admin-panel[hidden] {
  display: none;
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.meta-pill-icon {
  width: 38px;
  height: 38px;
  background: rgba(18, 207, 226, 0.1);
  color: var(--primary-2);
}

.meta-pill-copy strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.dashboard-bottom {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.dashboard-panel {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title,
.section-head h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.section-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.chart-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.donut-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-svg {
  width: 220px;
  height: 220px;
}

.donut-track {
  stroke: rgba(148, 163, 184, 0.18);
}

.donut-total {
  fill: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.donut-label {
  fill: var(--muted);
  font-size: 12px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.legend-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
}

.legend-row-head strong {
  margin-left: auto;
  color: var(--text);
}

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

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.chart-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.chart-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.chart-summary-icon,
.activity-item-icon,
.quick-action-icon {
  background: rgba(18, 207, 226, 0.1);
  color: var(--primary-2);
}

.chart-summary-card strong {
  display: block;
  margin-top: 2px;
  font-size: 24px;
}

.trend-chart-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel-soft));
  padding: 14px 10px 8px;
}

.trend-svg {
  width: 100%;
  min-width: 680px;
  height: 320px;
}

.trend-grid-line line {
  stroke: rgba(148, 163, 184, 0.28);
  stroke-dasharray: 4 6;
}

.trend-grid-line text,
.trend-point text {
  fill: var(--muted);
  font-size: 11px;
}

.trend-line {
  fill: none;
  stroke: var(--primary-2);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 18px rgba(79, 140, 255, 0.16));
}

.trend-point circle {
  fill: var(--panel-strong);
  stroke: var(--primary-2);
  stroke-width: 2;
}

.activity-list,
.quick-actions,
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item,
.quick-action,
.file-item,
.stack-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel-soft));
  color: var(--text);
}

.activity-item-copy,
.quick-action-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-item-copy strong,
.quick-action-copy strong {
  font-size: 15px;
}

.activity-item-value {
  margin-left: auto;
  color: var(--success);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.quick-action {
  justify-content: flex-start;
  text-align: left;
}

.quick-action-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input,
.select-input {
  min-width: 180px;
  max-width: 240px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.data-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel-soft);
}

.data-table td {
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.data-table tbody tr:hover td {
  background: rgba(18, 207, 226, 0.04);
}

.actions-col {
  width: 170px;
  white-space: nowrap;
}

.user-table .actions-col {
  width: 110px;
  white-space: normal;
}

.user-table {
  width: 100%;
  min-width: 1260px;
  table-layout: fixed;
}

.user-table .user-col-check {
  width: 3%;
}

.user-table .user-col-account {
  width: 9%;
}

.user-table .user-col-device {
  width: 16%;
}

.user-table .user-col-login,
.user-table .user-col-expire {
  width: 10%;
}

.user-table .user-col-location {
  width: 13%;
}

.user-table .user-col-remark {
  width: 10%;
}

.user-table .user-col-package {
  width: 17%;
}

.user-table .user-col-action {
  width: 12%;
}

.user-table th,
.user-table td {
  vertical-align: middle;
}

.user-table th {
  padding: 10px 10px;
  text-align: center;
  border-right: 1px solid var(--line);
  letter-spacing: 0;
  text-transform: none;
}

.user-table td {
  padding: 10px 10px;
  border-right: 1px solid var(--line);
}

.user-table th:last-child,
.user-table td:last-child {
  border-right: 0;
}

.user-table tbody tr:nth-child(odd) td {
  background: rgba(18, 207, 226, 0.045);
}

.user-table .datetime-col {
  text-align: center;
}

.user-table .package-col {
  text-align: center;
}

.user-table .remark-col {
  text-align: center;
}

.user-table .location-col {
  text-align: center;
}

.user-table .account-col {
  text-align: left;
}

.user-table .device-col {
  text-align: center;
}

.user-table .link-btn {
  color: var(--text-soft);
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.kami-table {
  min-width: 1380px;
}

.kami-table .kami-col-check {
  width: 3%;
}

.kami-table .kami-col-id {
  width: 5%;
}

.kami-table .kami-col-code {
  width: 9%;
}

.kami-table .kami-col-package {
  width: 9%;
}

.kami-table .kami-col-user {
  width: 14%;
}

.kami-table .kami-col-time {
  width: 10%;
}

.kami-table .kami-col-state {
  width: 7%;
}

.kami-table .kami-col-note {
  width: 12%;
}

.kami-table .kami-col-action {
  width: 17%;
}

.kami-table th,
.kami-table td {
  text-align: center;
}

.kami-table td:nth-child(3),
.kami-table td:nth-child(9) {
  text-align: left;
}

.kami-table .actions-col {
  width: auto;
}

.kami-table .user-action-cell {
  gap: 8px;
}

.kami-table .user-action-cell .mini {
  min-width: 58px;
}

.kami-user-stack {
  align-items: center;
}

.kami-user-stack strong,
.kami-user-stack span {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.state-pill.success {
  color: #35d08a;
  background: rgba(34, 197, 94, 0.12);
}

.state-pill.danger {
  color: #ff6b7d;
  background: rgba(239, 68, 68, 0.12);
}

.check-col {
  width: 44px;
  text-align: center !important;
}

.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.user-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.user-device span {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.user-device .user-ip-location {
  color: var(--text-soft);
}

.user-device .user-ip-address {
  color: var(--muted);
}

.user-location-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.user-location-stack strong {
  color: var(--text-soft);
  font-weight: 900;
  line-height: 1.25;
}

.user-location-stack span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  word-break: break-all;
}

.user-location-stack.muted strong,
.user-location-stack.muted span {
  color: var(--muted);
}

.detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-device strong,
.detail-item strong {
  color: var(--text-soft);
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.user-batch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.status-filter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-filter-btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
}

.batch-summary {
  color: var(--muted);
  font-weight: 800;
}

.user-batch-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-batch-card.hidden {
  display: none;
}

.user-batch-card {
  padding: 14px 16px;
}

.user-batch-card .batch-summary {
  min-width: 136px;
}

.batch-action-select {
  width: 160px;
  min-width: 160px;
}

.batch-extra-control {
  width: 190px;
  min-width: 190px;
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text-soft);
  font-weight: 800;
}

.checkbox-pill input {
  width: auto;
  min-width: 16px;
  height: 16px;
  padding: 0;
  flex: 0 0 auto;
}

.checkbox-pill span {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
}

.ordered-checkbox-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-source-list {
  max-height: 190px;
}

.selected-order-panel {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.selected-order-title {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.selected-order-list {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(42, 133, 255, 0.06);
  overflow-x: auto;
}

.selected-order-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(42, 133, 255, 0.28);
  border-radius: 8px;
  background: rgba(42, 133, 255, 0.12);
  color: var(--text-soft);
  cursor: grab;
  font-weight: 800;
}

.selected-order-chip.dragging {
  opacity: 0.55;
}

.selected-order-chip .drag-handle {
  color: var(--muted);
  font-weight: 900;
  line-height: 1;
}

.order-remove-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

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

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.detail-log-section {
  padding: 14px;
}

.compact-table {
  min-width: 720px;
}

.datetime-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  text-align: center;
}

.datetime-stack strong,
.datetime-stack span {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

.datetime-stack strong {
  color: var(--text-soft);
  font-weight: 900;
}

.datetime-stack span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.datetime-stack.success span {
  color: #35d08a;
}

.datetime-stack.warning span {
  color: #ffbd4a;
}

.datetime-stack.danger span {
  color: #ff6b7d;
}

.datetime-stack.muted strong,
.datetime-stack.muted span {
  color: var(--muted);
}

.mini-select,
.mini-input {
  min-width: 132px;
  width: 132px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.user-package-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.user-package-cell .row-package-select,
.user-package-cell .row-auth-days {
  width: 100%;
  max-width: 146px;
  min-width: 0;
  height: 36px;
}

.user-table .row-remark {
  width: 100%;
  max-width: 108px;
  min-width: 0;
  height: 36px;
}

.user-action-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  white-space: nowrap;
}

.user-action-cell .mini {
  min-width: 52px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
}

.package-table {
  min-width: 1040px;
  table-layout: fixed;
}

.package-table th,
.package-table td {
  vertical-align: middle;
  word-break: normal;
  overflow-wrap: normal;
}

.package-table .package-col-id {
  width: 56px;
  text-align: center;
}

.package-table .package-col-name {
  width: 112px;
}

.package-table .package-col-live_source_ids {
  width: 150px;
}

.package-table .package-col-storehouse_ids {
  width: auto;
}

.package-table .package-col-status {
  width: 86px;
  text-align: center;
}

.package-table .package-col-updated_at {
  width: 118px;
  text-align: center;
}

.package-table .actions-col {
  width: 130px;
  text-align: center;
}

.package-name {
  display: block;
  color: var(--text-soft);
  white-space: normal;
  overflow-wrap: anywhere;
}

.package-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.package-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 900;
}

.status-pill.success {
  background: rgba(45, 207, 143, 0.16);
  color: #35d08a;
}

.status-pill.danger {
  background: rgba(255, 107, 125, 0.14);
  color: #ff6b7d;
}

.muted-text {
  color: var(--muted);
  font-weight: 800;
}

.empty.compact {
  padding: 10px;
}

.pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

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

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

.metric-card {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.metric-card.highlight {
  border-color: rgba(45, 207, 143, 0.42);
  background: rgba(45, 207, 143, 0.08);
}

.metric-card .metric-label,
.metric-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.notice-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
}

.notice-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.package-form-section {
  gap: 18px;
}

.package-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.package-name-field {
  min-width: 0;
}

.package-status-field {
  width: 168px;
  min-width: 168px;
}

.package-status-field .switch-field {
  height: 100%;
  min-height: 82px;
  justify-content: center;
  padding: 12px 14px;
}

.package-status-field .switch-wrap {
  justify-content: flex-start;
}

.package-source-block {
  width: 100%;
  min-width: 0;
}

.package-source-block > .field {
  width: 100%;
}

.package-form .checkbox-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: 220px;
}

.package-form .checkbox-source-list {
  max-height: 230px;
}

.package-form .selected-order-list {
  flex-wrap: wrap;
  overflow-x: visible;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.max-compact {
  max-width: 760px;
}

.code-editor,
.code-view {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.55);
  background: #0d1727;
  color: #deebfb;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code-view {
  white-space: pre-wrap;
  overflow: auto;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 30px 16px;
}

.file-item small,
.stack-item small {
  color: var(--muted);
}

.file-item.active {
  border-color: rgba(18, 207, 226, 0.18);
  box-shadow: var(--shadow-soft);
}

.live-manual-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.live-manual-topbar,
.live-manual-strip,
.live-manual-sidebar,
.live-manual-editor-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 255, 0.95));
}

.live-manual-topbar {
  position: relative;
  overflow: hidden;
}

.live-manual-topbar::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #389fff, #59c7ff);
}

.live-manual-topbar-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-manual-mode-row,
.live-manual-strip-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-manual-row-label {
  min-width: 76px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.live-manual-inline-input {
  width: 184px;
  max-width: 100%;
  border-radius: 12px;
  background: #fff;
  padding: 10px 14px;
}

.live-manual-action {
  border-radius: 10px;
  padding: 10px 14px;
  border: 2px solid #dbe7f2;
  background: #fff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}

.live-manual-action-blue {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.52);
}

.live-manual-action-red {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.48);
}

.live-manual-action-dark {
  color: #1f2937;
  border-color: rgba(31, 41, 55, 0.42);
}

.live-manual-action-cyan {
  color: #06b6d4;
  border-color: rgba(6, 182, 212, 0.44);
}

.live-manual-action-amber {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.52);
}

.live-manual-group-btn {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.94);
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}

.live-manual-group-btn.active {
  border-color: #389fff;
  color: #389fff;
}

.live-manual-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.live-manual-panel-title,
.live-manual-editor-title {
  color: #475569;
  font-size: 15px;
  font-weight: 800;
}

.live-manual-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.live-manual-category-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.9);
  color: #334155;
  cursor: pointer;
}

.live-manual-category-item.active {
  border-color: #389fff;
}

.live-manual-category-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-manual-category-check {
  width: 18px;
  height: 18px;
  margin: 0;
}

.live-manual-category-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.live-manual-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.live-manual-save-btn {
  min-width: 92px;
}

.live-manual-editor {
  width: 100%;
  min-height: 590px;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  background: #fff;
  color: #64748b;
  padding: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.75;
  resize: vertical;
}

.live-manual-editor:focus {
  border-color: rgba(56, 159, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(56, 159, 255, 0.12);
}

.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 10, 18, 0.48);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.modal-card {
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.modal-header h3 {
  margin: 0;
}

.modal-body {
  padding: 22px;
  overflow: auto;
  max-height: calc(100vh - 140px);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  min-width: 220px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 18, 29, 0.95);
  color: #eff6ff;
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.24);
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  color: #fecaca;
  border-color: rgba(251, 113, 133, 0.22);
}

.sidebar-collapsed .shell {
  grid-template-columns: 94px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar-collapsed .brand {
  justify-content: center;
}

.sidebar-collapsed .brand > div:last-child,
.sidebar-collapsed .sidebar-search,
.sidebar-collapsed .nav-group-label,
.sidebar-collapsed .nav-group-count,
.sidebar-collapsed .nav-group-arrow,
.sidebar-collapsed .nav-link-text,
.sidebar-collapsed .sidebar-action-label {
  display: none !important;
}

.sidebar-collapsed .nav-group-items {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.sidebar-collapsed .nav-group-toggle,
.sidebar-collapsed .nav-link,
.sidebar-collapsed .nav-direct,
.sidebar-collapsed .sidebar-action {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar-collapsed .sidebar-footer > .sidebar-actions > a:last-child {
  display: none;
}

@media (max-width: 1360px) {
  .dashboard-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .dashboard-split,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .shell,
  .sidebar-collapsed .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-collapsed .brand > div:last-child,
  .sidebar-collapsed .sidebar-search,
  .sidebar-collapsed .nav-group-label,
  .sidebar-collapsed .nav-group-count,
  .sidebar-collapsed .nav-group-arrow,
  .sidebar-collapsed .nav-link-text,
  .sidebar-collapsed .sidebar-action-label,
  .sidebar-collapsed .sidebar-footer > .sidebar-actions > a:last-child {
    display: initial !important;
  }

  .sidebar-collapsed .nav-group-items {
    margin-left: 18px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
  }

  .sidebar-collapsed .nav-group-toggle,
  .sidebar-collapsed .nav-link,
  .sidebar-collapsed .nav-direct,
  .sidebar-collapsed .sidebar-action {
    justify-content: flex-start;
    padding-left: 14px;
    padding-right: 14px;
  }

  .main-panel {
    padding: 18px;
  }

  .topbar,
  .dashboard-toolbar,
  .toolbar,
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .meta-pills {
    justify-content: flex-start;
  }

  .live-manual-topbar-grid,
  .live-manual-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .login-shell {
    width: min(100%, calc(100% - 24px));
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 0;
  }

  .login-side,
  .login-card,
  .card,
  .topbar {
    padding: 20px;
  }

  .login-side h1 {
    font-size: 42px;
  }

  .page-title {
    font-size: 30px;
  }

  .dashboard-primary-grid,
  .dashboard-chip-grid,
  .chart-summary,
  .grid.two,
  .donut-layout {
    grid-template-columns: 1fr;
  }

  .search-input,
  .select-input {
    width: 100%;
    max-width: none;
  }

  .live-manual-inline-input {
    width: 100%;
  }

  .data-table {
    min-width: 680px;
  }
}

/* 2026 admin redesign: quieter operations UI with clearer hierarchy. */
:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-end: #eef3f8;
  --bg-accent: rgba(15, 118, 110, 0.08);
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #f7f9fc;
  --sidebar: #ffffff;
  --topbar: #ffffff;
  --line: #d9e2ec;
  --line-strong: #c5d1dd;
  --text: #17202a;
  --text-soft: #405166;
  --muted: #748397;
  --primary: #0f766e;
  --primary-2: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 18px 38px rgba(25, 39, 52, 0.08);
  --shadow-soft: 0 10px 24px rgba(25, 39, 52, 0.06);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111418;
  --bg-end: #0d1014;
  --bg-accent: rgba(45, 212, 191, 0.08);
  --panel: #181d23;
  --panel-strong: #1c2229;
  --panel-soft: #151a20;
  --sidebar: #14191f;
  --topbar: #181d23;
  --line: #28323c;
  --line-strong: #36424e;
  --text: #edf2f7;
  --text-soft: #c1ccd7;
  --muted: #8492a3;
  --primary: #2dd4bf;
  --primary-2: #60a5fa;
  --success: #4ade80;
  --danger: #fb7185;
  --warning: #f59e0b;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 12px 26px rgba(0, 0, 0, 0.2);
}

html,
body,
.modern-admin-page {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 300px),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-end) 100%);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .modern-admin-page {
  background:
    linear-gradient(180deg, rgba(34, 41, 49, 0.32), rgba(13, 16, 20, 0) 320px),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-end) 100%);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

.shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  gap: 20px;
  padding: 26px 18px 20px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  box-shadow: 8px 0 28px rgba(35, 48, 62, 0.04);
  backdrop-filter: none;
}

html[data-theme="dark"] .sidebar {
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.18);
}

.brand {
  padding: 2px 4px 10px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
  box-shadow: none;
  font-size: 15px;
}

.brand-title {
  font-size: 19px;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
}

.sidebar-search input,
input,
textarea,
select {
  border-radius: 12px;
  border-color: var(--line);
  background: var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .login-card {
  background: var(--panel-soft);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.58);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.nav-groups {
  gap: 6px;
}

.nav-group {
  border-radius: 12px;
}

.nav-group-toggle,
.nav-link,
.nav-direct {
  min-height: 48px;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-soft);
}

.nav-group-toggle:hover,
.nav-link:hover,
.nav-direct:hover {
  background: var(--panel-soft);
  border-color: var(--line);
}

.nav-link.active,
.nav-direct.active {
  background: #17202a;
  border-color: #17202a;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 32, 42, 0.16);
}

html[data-theme="dark"] .nav-link.active,
html[data-theme="dark"] .nav-direct.active {
  background: #e8f2ef;
  border-color: #e8f2ef;
  color: #101418;
  box-shadow: none;
}

.nav-group-badge,
.nav-link-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e7f3f1;
  color: var(--primary);
}

html[data-theme="dark"] .nav-group-badge,
html[data-theme="dark"] .nav-link-icon {
  background: rgba(45, 212, 191, 0.11);
  color: var(--primary);
}

.nav-link.active .nav-link-icon,
.nav-direct.active .nav-link-icon {
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
}

html[data-theme="dark"] .nav-link.active .nav-link-icon,
html[data-theme="dark"] .nav-direct.active .nav-link-icon {
  background: rgba(16, 20, 24, 0.1);
}

.nav-group-label,
.nav-link-title,
.nav-direct-text {
  font-size: 14px;
  font-weight: 800;
}

.nav-group-count {
  height: 22px;
  min-width: 22px;
  border: 0;
  background: var(--panel-soft);
}

.nav-group-items {
  margin-left: 16px;
  padding: 6px 0 3px 12px;
}

.sidebar-actions {
  gap: 8px;
}

.sidebar-action,
.ghost-btn,
.primary-btn,
.danger-btn,
.icon-btn {
  border-radius: 12px;
}

.primary-btn {
  background: #17202a;
  box-shadow: 0 12px 24px rgba(23, 32, 42, 0.16);
}

html[data-theme="dark"] .primary-btn {
  background: #e8f2ef;
  color: #101418;
  box-shadow: none;
}

.ghost-btn,
.icon-btn {
  background: var(--panel-strong);
  border-color: var(--line);
}

.ghost-btn.active,
.chart-tab.active {
  background: #e7f3f1;
  border-color: rgba(15, 118, 110, 0.24);
  color: #0f4f49;
}

html[data-theme="dark"] .ghost-btn.active,
html[data-theme="dark"] .chart-tab.active {
  background: rgba(45, 212, 191, 0.13);
  color: #b8fff3;
}

.main-panel {
  padding: 28px 30px 34px;
}

.topbar {
  align-items: center;
  margin-bottom: 24px;
  padding: 22px 26px;
  border-radius: 18px;
  background: var(--topbar);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.topbar-eyebrow {
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.page-title {
  margin-top: 8px;
  font-size: 34px;
  letter-spacing: 0;
}

.page-description {
  color: var(--text-soft);
}

.user-chip {
  border-radius: 12px;
  background: var(--panel-soft);
}

.content {
  gap: 16px;
}

.card,
.dashboard-primary-card,
.dashboard-chip,
.meta-pill,
.chart-summary-card,
.activity-item,
.quick-action,
.file-item,
.stack-item,
.form-section,
.table-wrap,
.trend-chart-wrap {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 20px;
  border-radius: 16px;
}

.dashboard-primary-grid {
  gap: 14px;
}

.dashboard-primary-card {
  min-height: 158px;
  padding: 20px;
  border-radius: 16px;
  background: var(--panel);
}

.dashboard-primary-card::after {
  height: 3px;
  background: var(--card-accent, var(--primary));
}

.dashboard-primary-icon,
.dashboard-chip-icon,
.chart-summary-icon,
.meta-pill-icon,
.activity-item-icon,
.quick-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.dashboard-primary-icon {
  background: var(--card-accent-soft, rgba(15, 118, 110, 0.12));
}

.dashboard-primary-label,
.dashboard-chip-copy small,
.chart-summary-card small,
.meta-pill-copy small,
.activity-item-copy span,
.quick-action-copy small {
  color: var(--muted);
}

.dashboard-primary-value {
  margin-top: 22px;
  font-size: 38px;
  letter-spacing: 0;
}

.dashboard-primary-note {
  color: var(--text-soft);
}

.dashboard-chip-grid {
  gap: 14px;
}

.dashboard-chip {
  min-height: 104px;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel);
}

.dashboard-toolbar {
  padding: 18px 20px;
}

.meta-pill {
  border-radius: 14px;
  box-shadow: none;
}

.dashboard-split {
  gap: 16px;
}

.section-title,
.section-head h3 {
  letter-spacing: 0;
}

.section-head h3 {
  font-size: 17px;
}

.chart-subtitle {
  color: var(--muted);
}

.donut-svg {
  width: 210px;
  height: 210px;
}

.progress-track {
  height: 7px;
  background: var(--panel-soft);
}

.chart-summary-card,
.activity-item,
.quick-action {
  border-radius: 14px;
  box-shadow: none;
}

.trend-chart-wrap {
  background: var(--panel-soft);
  box-shadow: none;
}

.trend-line {
  stroke: var(--primary);
  filter: none;
}

.trend-point circle {
  stroke: var(--primary);
}

.data-table th {
  background: var(--panel-soft);
  color: var(--text-soft);
  letter-spacing: 0.03em;
}

.data-table tbody tr:hover td {
  background: #f0f6f4;
}

html[data-theme="dark"] .data-table tbody tr:hover td {
  background: rgba(45, 212, 191, 0.06);
}

.modal-card {
  border-radius: 18px;
  background: var(--panel);
}

.modal-header {
  background: var(--panel-soft);
}

.toast {
  border-radius: 12px;
}

.login-page {
  background: linear-gradient(135deg, #17202a 0%, #21313b 54%, #123f3a 100%);
}

.login-side,
.login-card {
  border-radius: 20px;
}

.login-side h1 {
  letter-spacing: 0;
}

.login-side::before,
.login-side::after {
  display: none;
}

.live-manual-topbar,
.live-manual-strip,
.live-manual-sidebar,
.live-manual-editor-card,
.live-manual-group-btn,
.live-manual-category-item,
.live-manual-editor {
  background: var(--panel);
}

.live-manual-topbar::before {
  background: var(--primary);
}

@media (max-width: 1080px) {
  .main-panel {
    padding: 20px;
  }

  .sidebar {
    box-shadow: none;
  }
}

@media (max-width: 860px) {
  .page-title {
    font-size: 28px;
  }

  .topbar,
  .card {
    padding: 18px;
  }
}

/* Compact operations console refresh. */
:root {
  --bg: #f5f6f8;
  --bg-end: #eceff3;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #f3f5f8;
  --sidebar: #fbfcfd;
  --topbar: rgba(255, 255, 255, 0.88);
  --line: #dfe5ec;
  --line-strong: #c9d3dd;
  --text: #17202a;
  --text-soft: #3f4c5c;
  --muted: #748194;
  --primary: #0f766e;
  --primary-2: #3164d8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 20px 45px rgba(20, 30, 42, 0.08);
  --shadow-soft: 0 1px 2px rgba(20, 30, 42, 0.05), 0 10px 24px rgba(20, 30, 42, 0.06);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

html[data-theme="dark"] {
  --bg: #0f1216;
  --bg-end: #11161b;
  --panel: #191f25;
  --panel-strong: #1e252c;
  --panel-soft: #141a20;
  --sidebar: #12171d;
  --topbar: rgba(25, 31, 37, 0.9);
  --line: #2a343f;
  --line-strong: #3a4652;
  --text: #edf2f7;
  --text-soft: #c7d0dc;
  --muted: #8a96a6;
  --primary: #2dd4bf;
  --primary-2: #74a8ff;
  --success: #4ade80;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.18), 0 12px 28px rgba(0, 0, 0, 0.18);
}

html,
body,
.modern-admin-page {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .modern-admin-page {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-end) 100%);
}

.modern-admin-page {
  min-width: 320px;
}

.shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  gap: 18px;
  padding: 22px 16px 18px;
  background: var(--sidebar);
  box-shadow: none;
}

html[data-theme="dark"] .sidebar {
  box-shadow: none;
}

.brand {
  padding: 0 4px 4px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  font-size: 14px;
}

html[data-theme="dark"] .brand-mark {
  background: #f0fdfa;
  color: #111827;
}

.brand-title {
  font-size: 18px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 12px;
}

.sidebar-search input {
  height: 42px;
  padding: 10px 12px;
}

input,
textarea,
select,
.ghost-btn,
.primary-btn,
.danger-btn,
.icon-btn,
.live-mode-status,
.live-manual-action,
.live-manual-group-btn,
.live-manual-category-item {
  border-radius: 8px;
}

.nav-groups {
  gap: 4px;
  scrollbar-width: thin;
}

.nav-group-toggle,
.nav-link,
.nav-direct {
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-group-badge,
.nav-link-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
}

html[data-theme="dark"] .nav-group-badge,
html[data-theme="dark"] .nav-link-icon {
  background: transparent;
  color: var(--muted);
}

.nav-group-toggle:hover,
.nav-link:hover,
.nav-direct:hover {
  background: var(--panel-soft);
  border-color: transparent;
}

.nav-link.active,
.nav-direct.active {
  background: #17202a;
  border-color: #17202a;
  color: #fff;
  box-shadow: none;
}

html[data-theme="dark"] .nav-link.active,
html[data-theme="dark"] .nav-direct.active {
  background: #e8f2ef;
  border-color: #e8f2ef;
  color: #101418;
}

.nav-link.active .nav-link-icon,
.nav-direct.active .nav-link-icon {
  color: inherit;
  background: transparent;
}

.nav-group-label,
.nav-link-title,
.nav-direct-text {
  font-size: 13px;
  font-weight: 760;
}

.nav-group-count {
  height: auto;
  min-width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.nav-group-arrow {
  font-size: 11px;
}

.nav-group-items {
  gap: 4px;
  margin: 3px 0 4px 15px;
  padding: 3px 0 3px 8px;
}

.sidebar-actions {
  gap: 8px;
}

.sidebar-action,
.sidebar-actions > .ghost-btn {
  min-height: 42px;
  padding: 10px 12px;
}

.main-panel {
  padding: 22px 24px 30px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  margin: -22px -24px 20px;
  padding: 16px 24px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: var(--topbar);
  backdrop-filter: blur(16px);
  box-shadow: none;
}

.topbar-eyebrow {
  color: var(--muted);
  font-size: 11px;
}

.page-title {
  margin: 3px 0 2px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 820;
}

.page-description {
  color: var(--muted);
  font-size: 13px;
}

.user-chip {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.content {
  gap: 14px;
}

.card,
.dashboard-primary-card,
.dashboard-chip,
.meta-pill,
.chart-summary-card,
.activity-item,
.quick-action,
.file-item,
.stack-item,
.form-section,
.table-wrap,
.trend-chart-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.card {
  padding: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 152px;
  padding: 24px 26px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(49, 100, 216, 0.06) 42%, transparent 72%),
    var(--panel);
}

html[data-theme="dark"] .dashboard-hero {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(116, 168, 255, 0.08) 45%, transparent 76%),
    var(--panel);
}

.dashboard-hero-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-hero h2 {
  margin: 10px 0 8px;
  font-size: 34px;
  line-height: 1.12;
}

.dashboard-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--text-soft);
}

.dashboard-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(104px, auto));
  gap: 20px;
}

.hero-stat {
  min-width: 112px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.hero-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.hero-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.18;
}

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

.dashboard-primary-card {
  min-height: 132px;
  padding: 18px;
}

.dashboard-primary-card::after {
  height: 2px;
}

.dashboard-primary-head {
  gap: 10px;
}

.dashboard-primary-icon,
.dashboard-chip-icon,
.chart-summary-icon,
.meta-pill-icon,
.activity-item-icon,
.quick-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.dashboard-primary-value {
  margin-top: 18px;
  font-size: 34px;
}

.dashboard-primary-label,
.dashboard-primary-note,
.dashboard-chip-copy small,
.dashboard-chip-copy span,
.chart-summary-card small,
.meta-pill-copy small,
.activity-item-copy span,
.quick-action-copy small {
  font-size: 12px;
}

.dashboard-toolbar {
  padding: 14px 16px;
}

.dashboard-toolbar-block {
  gap: 10px;
}

.section-title {
  font-size: 13px;
}

.tabs {
  gap: 8px;
}

.chart-tab {
  min-width: 88px;
  padding: 9px 12px;
}

.ghost-btn.active,
.chart-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--panel);
}

html[data-theme="dark"] .ghost-btn.active,
html[data-theme="dark"] .chart-tab.active {
  background: #e8f2ef;
  border-color: #e8f2ef;
  color: #101418;
}

.meta-pills {
  gap: 8px;
}

.meta-pill {
  padding: 9px 11px;
  background: transparent;
}

.meta-pill-icon {
  width: 30px;
  height: 30px;
  background: var(--panel-soft);
}

.meta-pill-copy strong {
  font-size: 14px;
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.58fr);
  gap: 14px;
}

.dashboard-split,
.dashboard-bottom {
  gap: 14px;
}

.dashboard-bottom {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.section-head {
  margin-bottom: 14px;
}

.section-head h3 {
  font-size: 16px;
  line-height: 1.25;
}

.chart-subtitle {
  display: none;
}

.chart-panel {
  gap: 12px;
}

.chart-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chart-summary-card {
  gap: 10px;
  padding: 13px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.chart-summary-card:last-child {
  border-right: 0;
}

.chart-summary-card strong {
  font-size: 22px;
}

.trend-chart-wrap {
  padding: 10px 8px 6px;
  background: var(--panel-soft);
}

.trend-svg {
  min-width: 620px;
  height: 260px;
}

.donut-layout {
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
}

.donut-svg {
  width: 170px;
  height: 170px;
}

.donut-total {
  font-size: 22px;
}

.donut-legend {
  gap: 12px;
}

.legend-row {
  gap: 7px;
}

.progress-track {
  height: 6px;
}

.activity-list,
.quick-actions,
.list-stack {
  gap: 8px;
}

.activity-item,
.quick-action {
  min-height: 66px;
  padding: 13px 14px;
}

.activity-item-value {
  color: var(--text);
  font-size: 23px;
}

.quick-action-arrow {
  font-size: 22px;
}

.dashboard-chip-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-chip {
  min-height: 96px;
  padding: 14px;
  align-items: center;
}

.dashboard-chip-copy strong {
  font-size: 24px;
}

.toolbar {
  gap: 12px;
  padding: 2px 0;
}

.data-table {
  min-width: 900px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
}

.data-table th {
  font-size: 11px;
}

.modal-card {
  border-radius: 8px;
}

.toast {
  border-radius: 8px;
}

.login-shell {
  max-width: 1060px;
}

.login-page .login-shell {
  width: min(440px, calc(100% - 32px));
  grid-template-columns: 1fr;
  justify-content: center;
  align-content: center;
}

.login-page .login-card {
  width: 100%;
}

.login-side,
.login-card {
  border-radius: 8px;
}

.login-side {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(116, 168, 255, 0.08)),
    rgba(255, 255, 255, 0.06);
}

.login-preview-chip,
.pill {
  border-radius: 8px;
}

.sidebar-collapsed .shell {
  grid-template-columns: 78px minmax(0, 1fr);
}

/* Final PHP admin page polish: keep legacy-management pages compact and readable. */
.php-admin-page .topbar {
  justify-content: flex-start;
}

.php-admin-page .topbar-copy {
  flex: 1 1 auto;
  margin-right: auto;
  text-align: left;
}

.php-admin-page .content {
  align-items: stretch;
}

.php-admin-page .panel-card,
.php-admin-page .table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.php-admin-page .table-card {
  padding: 14px 16px 16px;
}

.php-admin-page .table-scroll {
  width: 100%;
  overflow-x: auto;
}

.php-admin-page .data-table th,
.php-admin-page .data-table td {
  vertical-align: middle;
  word-break: normal;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.php-admin-page .data-table th {
  white-space: nowrap;
}

.php-admin-page .data-table .actions-cell {
  white-space: nowrap;
}

.php-admin-page .data-table .actions-cell .ghost-btn,
.php-admin-page .data-table .actions-cell .primary-btn,
.php-admin-page .data-table .actions-cell .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 38px;
  margin: 0 3px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.php-admin-page .inline-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.php-admin-page .php-filter-form {
  align-items: center;
}

.php-admin-page .php-filter-form .primary-btn,
.php-admin-page .status-filter .ghost-btn,
.php-admin-page .status-filter .primary-btn,
.php-admin-page .php-batch-form .primary-btn,
.php-admin-page .php-batch-form .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.php-admin-page .php-record-form {
  max-width: 1120px;
}

.route-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
}

.route-table th,
.route-table td {
  padding: 12px 12px;
}

.route-table .bulk-check-col {
  width: 48px;
  text-align: center;
}

.route-table .field-col-id {
  width: 64px;
  text-align: center;
}

.route-table .field-col-appid,
.route-table .field-col-adm,
.route-table .field-col-status,
.route-table .field-col-state,
.route-table .field-col-type,
.route-table .field-col-time,
.route-table .field-col-o_time,
.route-table .field-col-p_time,
.route-table .field-col-updated_at {
  width: 108px;
  text-align: center;
  white-space: nowrap;
}

.route-table .field-col-name,
.route-table .field-col-user,
.route-table .field-col-uid,
.route-table .field-col-gid,
.route-table .field-col-order {
  width: 130px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.route-table .field-col-content,
.route-table .field-col-url,
.route-table .field-col-api,
.route-table .field-col-data,
.route-table .field-col-packet_detect_last_detail {
  text-align: left;
  white-space: normal;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.route-table .actions-cell {
  width: 148px;
  text-align: center;
}

.route-app_notice {
  min-width: 1120px;
}

.route-app_notice .field-col-id {
  width: 58px;
}

.route-app_notice .field-col-appid {
  width: 92px;
}

.route-app_notice .field-col-adm {
  width: 96px;
}

.route-app_notice .field-col-time {
  width: 136px;
}

.route-app_notice .actions-cell {
  width: 148px;
}

.notice-config-card,
.admin-account-card {
  width: min(100%, 1120px);
}

.notice-config-card .php-record-form,
.admin-account-form {
  max-width: none;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.notice-config-card .actions.full-row,
.admin-account-form .actions.full-row {
  justify-content: flex-start;
}

.admin-account-table {
  min-width: 640px;
  table-layout: fixed;
}

.admin-account-table th,
.admin-account-table td {
  text-align: center;
  white-space: nowrap;
}

.package-admin-form .package-form-section {
  display: grid;
  gap: 18px;
}

.package-admin-form .package-source-block {
  width: 100%;
}

.package-admin-form .ordered-checkbox-field {
  display: grid;
  gap: 14px;
  width: 100%;
}

.package-admin-form .checkbox-source-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
}

.package-admin-form .checkbox-pill {
  display: inline-flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  white-space: normal;
}

.package-admin-form .checkbox-pill span {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.package-admin-form .selected-order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 64px;
}

.package-admin-form .selected-order-chip {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .notice-config-card .php-record-form,
  .admin-account-form,
  .package-admin-form .checkbox-source-list {
    grid-template-columns: 1fr;
  }
}

/* Final PHP admin page polish: keep legacy-management pages compact and readable. */
.php-admin-page .topbar {
  justify-content: flex-start;
}

.php-admin-page .topbar-copy {
  flex: 1 1 auto;
  margin-right: auto;
  text-align: left;
}

.php-admin-page .content {
  align-items: stretch;
}

.php-admin-page .panel-card,
.php-admin-page .table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.php-admin-page .table-card {
  padding: 14px 16px 16px;
}

.php-admin-page .table-scroll {
  width: 100%;
  overflow-x: auto;
}

.php-admin-page .data-table th,
.php-admin-page .data-table td {
  vertical-align: middle;
  word-break: normal;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.php-admin-page .data-table th {
  white-space: nowrap;
}

.php-admin-page .data-table .actions-cell {
  white-space: nowrap;
}

.php-admin-page .data-table .actions-cell .ghost-btn,
.php-admin-page .data-table .actions-cell .primary-btn,
.php-admin-page .data-table .actions-cell .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 38px;
  margin: 0 3px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.php-admin-page .inline-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.php-admin-page .php-filter-form {
  align-items: center;
}

.php-admin-page .php-filter-form .primary-btn,
.php-admin-page .status-filter .ghost-btn,
.php-admin-page .status-filter .primary-btn,
.php-admin-page .php-batch-form .primary-btn,
.php-admin-page .php-batch-form .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.php-admin-page .php-record-form {
  max-width: 1120px;
}

.route-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
}

.route-table th,
.route-table td {
  padding: 12px 12px;
}

.route-table .bulk-check-col {
  width: 48px;
  text-align: center;
}

.route-table .field-col-id {
  width: 64px;
  text-align: center;
}

.route-table .field-col-appid,
.route-table .field-col-adm,
.route-table .field-col-status,
.route-table .field-col-state,
.route-table .field-col-type,
.route-table .field-col-time,
.route-table .field-col-o_time,
.route-table .field-col-p_time,
.route-table .field-col-updated_at {
  width: 108px;
  text-align: center;
  white-space: nowrap;
}

.route-table .field-col-name,
.route-table .field-col-user,
.route-table .field-col-uid,
.route-table .field-col-gid,
.route-table .field-col-order {
  width: 130px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.route-table .field-col-content,
.route-table .field-col-url,
.route-table .field-col-api,
.route-table .field-col-data,
.route-table .field-col-packet_detect_last_detail {
  text-align: left;
  white-space: normal;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.route-table .actions-cell {
  width: 148px;
  text-align: center;
}

.route-app_notice {
  min-width: 1120px;
}

.route-app_notice .field-col-id {
  width: 58px;
}

.route-app_notice .field-col-appid {
  width: 92px;
}

.route-app_notice .field-col-adm {
  width: 96px;
}

.route-app_notice .field-col-time {
  width: 136px;
}

.route-app_notice .actions-cell {
  width: 148px;
}

.notice-config-card,
.admin-account-card {
  width: min(100%, 1120px);
}

.notice-config-card .php-record-form,
.admin-account-form {
  max-width: none;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.notice-config-card .actions.full-row,
.admin-account-form .actions.full-row {
  justify-content: flex-start;
}

.admin-account-table {
  min-width: 640px;
  table-layout: fixed;
}

.admin-account-table th,
.admin-account-table td {
  text-align: center;
  white-space: nowrap;
}

.package-admin-form .package-form-section {
  display: grid;
  gap: 18px;
}

.package-admin-form .package-source-block {
  width: 100%;
}

.package-admin-form .ordered-checkbox-field {
  display: grid;
  gap: 14px;
  width: 100%;
}

.package-admin-form .checkbox-source-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
}

.package-admin-form .checkbox-pill {
  display: inline-flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  white-space: normal;
}

.package-admin-form .checkbox-pill span {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.package-admin-form .selected-order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 64px;
}

.package-admin-form .selected-order-chip {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .notice-config-card .php-record-form,
  .admin-account-form,
  .package-admin-form .checkbox-source-list {
    grid-template-columns: 1fr;
  }
}

.route-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.route-table th,
.route-table td {
  padding: 13px 12px;
  vertical-align: middle;
}

.route-table th {
  white-space: nowrap;
  word-break: keep-all;
}

.route-table .bulk-check-col {
  width: 46px;
  text-align: center;
}

.route-table .field-col-id {
  width: 64px;
  text-align: center;
  white-space: nowrap;
}

.route-table .field-col-appid,
.route-table .field-col-adm,
.route-table .field-col-status,
.route-table .field-col-state,
.route-table .field-col-time {
  width: 110px;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
}

.route-table .field-col-content,
.route-table .field-col-url,
.route-table .field-col-data {
  text-align: left;
  line-height: 1.55;
  white-space: normal;
}

.route-table .actions-cell {
  width: 150px;
  text-align: center;
  white-space: nowrap;
}

.route-table .actions-cell .ghost-btn,
.route-table .actions-cell .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 38px;
  margin: 0 3px;
  padding: 0 12px;
  border-radius: 8px;
}

.route-app_notice {
  min-width: 1180px;
}

.route-app_notice .field-col-id {
  width: 56px;
}

.route-app_notice .field-col-appid {
  width: 96px;
}

.route-app_notice .field-col-adm {
  width: 92px;
}

.route-app_notice .field-col-time {
  width: 132px;
}

.route-app_notice .actions-cell {
  width: 150px;
}

.admin-account-card {
  max-width: 1100px;
}

.admin-account-table {
  min-width: 640px;
  table-layout: fixed;
}

.admin-account-table th,
.admin-account-table td {
  text-align: center;
  white-space: nowrap;
}

.admin-account-form {
  max-width: 980px;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.admin-account-form .actions.full-row,
.notice-config-card .actions.full-row {
  justify-content: flex-start;
}

.notice-config-card {
  max-width: 1100px;
}

.notice-config-card .php-record-form {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.route-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}

.route-table th,
.route-table td {
  padding: 13px 12px;
  vertical-align: middle;
}

.route-table th {
  white-space: nowrap;
  word-break: keep-all;
}

.route-table td {
  overflow-wrap: anywhere;
}

.route-table .field-col-id {
  width: 64px;
  text-align: center;
  white-space: nowrap;
}

.route-table .field-col-appid,
.route-table .field-col-adm,
.route-table .field-col-status,
.route-table .field-col-state,
.route-table .field-col-time {
  width: 110px;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
}

.route-table .field-col-content,
.route-table .field-col-url,
.route-table .field-col-data {
  text-align: left;
  line-height: 1.55;
  white-space: normal;
}

.route-table .actions-cell {
  width: 150px;
  text-align: center;
  white-space: nowrap;
}

.route-table .actions-cell .ghost-btn,
.route-table .actions-cell .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 38px;
  margin: 0 3px;
  padding: 0 12px;
  border-radius: 8px;
}

.route-app_notice {
  min-width: 1180px;
}

.route-app_notice .field-col-id {
  width: 56px;
}

.route-app_notice .field-col-appid {
  width: 96px;
}

.route-app_notice .field-col-adm {
  width: 92px;
}

.route-app_notice .field-col-time {
  width: 132px;
}

.route-app_notice .actions-cell {
  width: 150px;
}

.admin-account-card {
  max-width: 1100px;
}

.admin-account-table {
  min-width: 640px;
  table-layout: fixed;
}

.admin-account-table th,
.admin-account-table td {
  text-align: center;
  white-space: nowrap;
}

.admin-account-form {
  max-width: 980px;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.admin-account-form .actions.full-row {
  justify-content: flex-start;
}

.notice-config-card {
  max-width: 1100px;
}

.notice-config-card .php-record-form {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.notice-config-card .actions.full-row {
  justify-content: flex-start;
}

.sidebar-collapsed .brand-mark {
  width: 40px;
  height: 40px;
}

@media (max-width: 1480px) {
  .dashboard-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 1180px) {
  .dashboard-hero,
  .dashboard-workspace,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .dashboard-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .topbar {
    position: static;
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .main-panel {
    padding: 18px;
  }

  .sidebar {
    padding: 16px;
  }
}

@media (max-width: 860px) {
  .dashboard-hero {
    padding: 20px;
  }

  .dashboard-hero h2 {
    font-size: 28px;
  }

  .dashboard-hero-stats,
  .dashboard-primary-grid,
  .dashboard-chip-grid,
  .chart-summary,
  .donut-layout {
    grid-template-columns: 1fr;
  }

  .hero-stat {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }

  .chart-summary-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chart-summary-card:last-child {
    border-bottom: 0;
  }

  .donut-layout {
    justify-items: center;
  }
}

/* PHP pages: final interaction overrides. */
.app-route-tabbar {
  display: none !important;
}

.app-admin-form {
  display: block;
}

.app-admin-panel.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}

.app-admin-panel[hidden] {
  display: none !important;
}

.package-admin-form {
  display: grid;
  gap: 18px;
}

.package-admin-form .package-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: end;
  gap: 18px;
}

.package-admin-form .package-source-module {
  width: 100%;
}

.package-admin-form .ordered-checkbox-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.package-admin-form .checkbox-source-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

.package-admin-form .checkbox-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-soft);
  font-weight: 900;
  line-height: 1.25;
}

.package-admin-form .checkbox-pill input {
  flex: 0 0 auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.package-admin-form .checkbox-pill span {
  display: block;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.package-admin-form .selected-order-panel {
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(42, 133, 255, 0.04);
}

.package-admin-form .selected-order-list {
  display: flex;
  gap: 10px;
  min-height: 66px;
  flex-wrap: wrap;
  align-items: flex-start;
  overflow-x: visible;
}

.package-admin-form .selected-order-chip {
  min-height: 44px;
  color: var(--text);
}

.package-admin-form .order-remove-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.package-table {
  min-width: 860px;
  table-layout: fixed;
}

.package-table .package-col-id {
  width: 64px;
  text-align: center;
}

.package-table .package-col-name {
  width: 150px;
}

.package-table .package-col-live_source_ids {
  width: 260px;
  text-align: left;
}

.package-table .package-col-storehouse_ids {
  text-align: left;
}

.package-table .package-col-status {
  width: 96px;
  text-align: center !important;
}

.package-table .actions-cell {
  width: 148px;
  text-align: center;
}

.package-table .package-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.package-table .package-tag {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.package-table .status-pill {
  min-width: 58px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
}

.package-edit-card {
  overflow: visible;
}

.package-admin-form .package-form-section {
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
}

.package-admin-form .section-title {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.package-admin-form .package-source-block > .field {
  width: 100%;
}

.package-admin-form .package-source-block > .field > span {
  display: block;
  margin-bottom: 2px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 900;
}

@media (max-width: 980px) {
  .app-admin-panel.form-grid,
  .package-admin-form .package-top-row,
  .package-admin-form .checkbox-source-list {
    grid-template-columns: 1fr;
  }
}

.sidebar-toggle {
  justify-content: center;
}

.sidebar-toggle .sidebar-action-icon {
  font-size: 18px;
  line-height: 1;
}

.sidebar-top-toggle {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar {
  gap: 14px;
  justify-content: flex-start;
}

.topbar-copy {
  margin-right: auto;
  text-align: left;
}

.sidebar-collapsed .nav-group-items {
  display: none !important;
}

.user-admin-table {
  min-width: 1280px;
  table-layout: fixed;
}

.user-admin-table .user-col-check {
  width: 44px;
}

.user-admin-table .user-col-account {
  width: 120px;
}

.user-admin-table .user-col-device {
  width: 185px;
}

.user-admin-table .user-col-login,
.user-admin-table .user-col-expire {
  width: 130px;
}

.user-admin-table .user-col-location {
  width: 165px;
}

.user-admin-table .user-col-remark {
  width: 130px;
}

.user-admin-table .user-col-package {
  width: 190px;
}

.user-admin-table .user-col-action {
  width: 180px;
}

.user-admin-table th,
.user-admin-table td {
  padding: 12px 8px;
  vertical-align: middle;
}

.user-admin-table .check-col {
  text-align: center;
}

.user-admin-table .account-col {
  text-align: left;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-text-link {
  color: inherit;
  text-decoration: none;
}

.table-text-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.user-admin-table .device-col,
.user-admin-table .time-col,
.user-admin-table .location-col {
  text-align: center;
}

.user-admin-table .device-col span,
.user-admin-table .location-col span,
.user-admin-table .location-col strong {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.user-admin-table .remark-col input {
  width: 100%;
  min-width: 0;
  height: 38px;
  font-size: 13px;
}

.user-admin-table .package-edit-col {
  width: auto;
}

.user-admin-table .package-edit-col select,
.user-admin-table .package-edit-col input {
  width: 100%;
  min-width: 0;
  height: 36px;
  font-size: 13px;
}

.user-admin-table .package-edit-col input {
  margin-top: 6px;
}

.user-admin-table .actions-cell {
  display: table-cell;
  text-align: center;
  white-space: nowrap;
  min-width: 0;
}

.user-admin-table .actions-cell form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.user-admin-table .actions-cell .primary-btn,
.user-admin-table .actions-cell .ghost-btn,
.user-admin-table .actions-cell .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 36px;
  margin: 0 2px;
  padding: 0 10px;
  font-size: 13px;
  vertical-align: middle;
}

.php-batch-form .danger-btn {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.34);
  color: #ff8da1;
}

.shell {
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar-collapsed .shell {
  grid-template-columns: 78px minmax(0, 1fr);
}
/* Final PHP admin page polish: keep legacy-management pages compact and readable. */
.php-admin-page .topbar {
  justify-content: flex-start;
}

.php-admin-page .topbar-copy {
  flex: 1 1 auto;
  margin-right: auto;
  text-align: left;
}

.php-admin-page .content {
  align-items: stretch;
}

.php-admin-page .panel-card,
.php-admin-page .table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}

.php-admin-page .table-card {
  padding: 14px 16px 16px;
}

.php-admin-page .table-scroll {
  width: 100%;
  overflow-x: auto;
}

.php-admin-page .data-table th,
.php-admin-page .data-table td {
  vertical-align: middle;
  word-break: normal;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.php-admin-page .data-table th {
  white-space: nowrap;
}

.php-admin-page .data-table .actions-cell {
  white-space: nowrap;
}

.php-admin-page .data-table .actions-cell .ghost-btn,
.php-admin-page .data-table .actions-cell .primary-btn,
.php-admin-page .data-table .actions-cell .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 38px;
  margin: 0 3px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.php-admin-page .inline-form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.php-admin-page .php-filter-form {
  align-items: center;
}

.php-admin-page .php-filter-form .primary-btn,
.php-admin-page .status-filter .ghost-btn,
.php-admin-page .status-filter .primary-btn,
.php-admin-page .php-batch-form .primary-btn,
.php-admin-page .php-batch-form .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.php-admin-page .php-record-form {
  max-width: 1120px;
}

.route-table {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
}

.route-table th,
.route-table td {
  padding: 12px 12px;
}

.route-table .bulk-check-col {
  width: 48px;
  text-align: center;
}

.route-table .field-col-id {
  width: 64px;
  text-align: center;
}

.route-table .field-col-appid,
.route-table .field-col-adm,
.route-table .field-col-status,
.route-table .field-col-state,
.route-table .field-col-type,
.route-table .field-col-time,
.route-table .field-col-o_time,
.route-table .field-col-p_time,
.route-table .field-col-updated_at {
  width: 108px;
  text-align: center;
  white-space: nowrap;
}

.route-table .field-col-name,
.route-table .field-col-user,
.route-table .field-col-uid,
.route-table .field-col-gid,
.route-table .field-col-order {
  width: 130px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.route-table .field-col-content,
.route-table .field-col-url,
.route-table .field-col-api,
.route-table .field-col-data,
.route-table .field-col-packet_detect_last_detail {
  text-align: left;
  white-space: normal;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.route-table .actions-cell {
  width: 148px;
  text-align: center;
}

.route-app_notice {
  min-width: 1120px;
}

.route-app_notice .field-col-id {
  width: 58px;
}

.route-app_notice .field-col-appid {
  width: 92px;
}

.route-app_notice .field-col-adm {
  width: 96px;
}

.route-app_notice .field-col-time {
  width: 136px;
}

.route-app_notice .actions-cell {
  width: 148px;
}

.notice-config-card,
.admin-account-card {
  width: min(100%, 1120px);
}

.notice-config-card .php-record-form,
.admin-account-form {
  max-width: none;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.notice-config-card .actions.full-row,
.admin-account-form .actions.full-row {
  justify-content: flex-start;
}

.admin-account-table {
  min-width: 640px;
  table-layout: fixed;
}

.admin-account-table th,
.admin-account-table td {
  text-align: center;
  white-space: nowrap;
}

.package-admin-form .package-form-section {
  display: grid;
  gap: 18px;
}

.package-admin-form .package-source-block {
  width: 100%;
}

.package-admin-form .ordered-checkbox-field {
  display: grid;
  gap: 14px;
  width: 100%;
}

.package-admin-form .checkbox-source-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-height: 240px;
  overflow: auto;
  padding: 12px;
}

.package-admin-form .checkbox-pill {
  display: inline-flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  white-space: normal;
}

.package-admin-form .checkbox-pill span {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

.package-admin-form .selected-order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 64px;
}

.package-admin-form .selected-order-chip {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .notice-config-card .php-record-form,
  .admin-account-form,
  .package-admin-form .checkbox-source-list {
    grid-template-columns: 1fr;
  }
}
.user-admin-table {
  min-width: 1200px;
}

.user-admin-table .user-col-account {
  width: 112px;
}

.user-admin-table .user-col-device {
  width: 172px;
}

.user-admin-table .user-col-login,
.user-admin-table .user-col-expire {
  width: 122px;
}

.user-admin-table .user-col-location {
  width: 158px;
}

.user-admin-table .user-col-remark {
  width: 122px;
}

.user-admin-table .user-col-package {
  width: 178px;
}

.user-admin-table .user-col-action {
  width: 160px;
}

.user-admin-table .actions-cell .primary-btn,
.user-admin-table .actions-cell .ghost-btn,
.user-admin-table .actions-cell .danger-btn {
  min-width: 46px;
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  margin: 0 2px;
}

/* Final broad page cleanup for converted PHP modules. */
.php-admin-page .panel-card {
  padding: 18px 20px;
}

.php-admin-page .php-form-card h2,
.php-admin-page .table-card h2 {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.php-admin-page .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
}

.php-admin-page .section-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.php-admin-page .section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-account-card {
  width: min(100%, 1180px);
}

.admin-account-table {
  min-width: 760px;
}

.admin-account-table .actions-cell {
  width: 120px;
}

.admin-account-form {
  max-width: 1080px;
  align-items: end;
}

.admin-account-form .field input[readonly] {
  color: var(--muted);
}

.admin-account-head .primary-btn {
  min-width: 92px;
}

.php-admin-page .php-form-card > .php-filter-form {
  width: min(100%, 520px);
  margin-bottom: 14px;
}

.php-admin-page .php-form-card > .php-filter-form select {
  flex: 1 1 260px;
}

.php-admin-page .code-editor {
  display: block;
  min-height: 560px;
  margin-top: 10px;
  border-radius: 8px;
  line-height: 1.65;
  font-size: 14px;
}

.php-admin-page .php-form-card .actions {
  margin-top: 14px;
  justify-content: flex-start;
}

.abnormal-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
}

.abnormal-table th,
.abnormal-table td {
  padding: 12px 9px;
  vertical-align: middle;
}

.abnormal-table .abnormal-col-check {
  width: 46px;
}

.abnormal-table .abnormal-col-id {
  width: 62px;
}

.abnormal-table .abnormal-col-user,
.abnormal-table .abnormal-col-name {
  width: 115px;
}

.abnormal-table .abnormal-col-device {
  width: 150px;
}

.abnormal-table .abnormal-col-score {
  width: 78px;
}

.abnormal-table .abnormal-col-type,
.abnormal-table .abnormal-col-time,
.abnormal-table .abnormal-col-ban {
  width: 125px;
}

.abnormal-table .abnormal-col-action {
  width: 220px;
}

.abnormal-table .account-col,
.abnormal-table .name-col,
.abnormal-table .device-col {
  overflow-wrap: anywhere;
  word-break: normal;
}

.abnormal-table .type-col {
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.45;
}

.abnormal-table .check-col,
.abnormal-table .score-col,
.abnormal-table .time-col,
.abnormal-table .ban-col {
  text-align: center;
}

.abnormal-table .actions-cell {
  text-align: center;
  white-space: nowrap;
}

.abnormal-table .actions-cell form {
  display: inline-flex;
  margin: 0;
  vertical-align: middle;
}

.abnormal-table .actions-cell .primary-btn,
.abnormal-table .actions-cell .ghost-btn,
.abnormal-table .actions-cell .danger-btn {
  min-width: 50px;
  height: 36px;
  margin: 0 2px;
  padding: 0 10px;
  font-size: 13px;
}

.abnormal-batch-card .php-batch-form {
  grid-template-columns: minmax(150px, auto) minmax(180px, 240px) auto;
}

.packet-detail-table {
  min-width: 1080px;
  table-layout: fixed;
}

.packet-detail-table th:nth-child(1),
.packet-detail-table td:nth-child(1) {
  width: 70px;
  text-align: center;
}

.packet-detail-table th:nth-child(2),
.packet-detail-table td:nth-child(2) {
  width: 150px;
  text-align: center;
}

.packet-detail-table th:nth-child(3),
.packet-detail-table td:nth-child(3) {
  width: 140px;
}

.packet-detail-table th:nth-child(4),
.packet-detail-table td:nth-child(4) {
  width: 80px;
  text-align: center;
}

.packet-detail-table th:nth-child(6),
.packet-detail-table td:nth-child(6) {
  width: 170px;
  text-align: center;
}

.packet-detail-table th:nth-child(7),
.packet-detail-table td:nth-child(7) {
  width: 180px;
}

.packet-detail-table .detail-text {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.55;
}

.packet-detail-table .ip-col {
  display: table-cell;
  white-space: normal;
}

.packet-detail-table .ip-col strong,
.packet-detail-table .ip-col span {
  display: block;
}
