:root {
  --bg-1: #010204;
  --bg-2: #050913;
  --panel: rgba(6, 10, 18, 0.96);
  --panel-alt: rgba(4, 7, 13, 0.99);
  --line: rgba(30, 144, 255, 0.2);
  --text: #edf5ff;
  --muted: #90a3c4;
  --accent: #00bfff;
  --accent-2: #2563eb;
  --accent-soft: rgba(0, 191, 255, 0.14);
  --success: #6be6b5;
  --success-soft: rgba(107, 230, 181, 0.12);
  --warn: #ffca5c;
  --warn-soft: rgba(255, 202, 92, 0.14);
  --danger: #ff7c7c;
  --danger-soft: rgba(255, 124, 124, 0.16);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Aptos, "Segoe UI Variable", "Trebuchet MS", sans-serif;
  color-scheme: dark;
  background:
    radial-gradient(circle at top left, rgba(0, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at top right, rgba(30, 144, 255, 0.12), transparent 22%),
    radial-gradient(circle at 50% -10%, rgba(59, 130, 246, 0.1), transparent 28%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
}

a {
  color: #9ed3ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: Consolas, "Courier New", monospace;
  color: #d8ecff;
  font-size: 0.92em;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 13, 24, 0.82);
  backdrop-filter: blur(20px);
}

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

.brand.compact {
  margin-bottom: 18px;
}

.brand h1 {
  margin: 0;
  font-size: 1.45rem;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.05);
}

.brand-logo.large {
  width: 72px;
  height: 72px;
}

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

.user-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.88rem;
  background: var(--accent-soft);
  color: #d9ecff;
}

.badge.warn {
  background: var(--warn-soft);
  color: #ffe3a5;
}

.badge.success {
  background: var(--success-soft);
  color: #d8ffef;
}

.badge.danger {
  background: var(--danger-soft);
  color: #ffd0d0;
}

.badge.muted-badge {
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

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

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

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 93px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(7, 13, 24, 0.46);
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-nav a {
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 700;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}

.content {
  padding: 28px;
}

.page-header {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
}

.toggle-pill:hover {
  text-decoration: none;
  color: var(--text);
  border-color: rgba(0, 191, 255, 0.35);
}

.toggle-pill.active {
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.22), rgba(37, 99, 235, 0.28));
  color: var(--text);
  border-color: rgba(0, 191, 255, 0.45);
}

.page-header h2 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.page-header p,
.muted,
.muted-inline {
  color: var(--muted);
}

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

.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.panel,
.mini-card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card strong {
  font-size: 1.8rem;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.panel-head,
.mini-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.panel h3,
.mini-card h4 {
  margin: 0;
}

.table-wrap,
.slot-table-wrap {
  overflow-x: auto;
}

.scroll-limit {
  max-height: min(74vh, 760px);
  overflow-y: auto;
}

.series-scroll-limit {
  max-height: min(82vh, 1480px);
}

.series-card-grid.lelang-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 240px));
  gap: 14px;
  justify-content: start;
  justify-items: stretch;
}

.lelang-compact-card {
  padding: 10px;
  gap: 8px;
  width: 240px;
  min-width: 0;
  max-width: 240px;
  justify-self: stretch;
}

.lelang-compact-card .series-card-cover {
  border-radius: 14px;
}

.lelang-compact-card .series-cover-large {
  aspect-ratio: 2 / 3;
  height: auto;
  max-height: 290px;
  border-radius: 14px;
}

.lelang-compact-card .series-card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.lelang-compact-card h4 {
  font-size: 0.9rem;
  line-height: 1.3;
  min-height: 2.35em;
  max-height: 2.35em;
  overflow: hidden;
}

.lelang-compact-card .muted-inline {
  font-size: 0.72rem;
}

.lelang-compact-card .badge {
  font-size: 0.62rem;
  padding: 4px 7px;
}

.compact-slot-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lelang-compact-card .series-card-actions {
  margin-top: 4px;
}

.lelang-compact-chapter {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.lelang-compact-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lelang-compact-card .slot-chip {
  min-height: 50px;
  padding: 7px 9px;
  justify-content: center;
}

.lelang-compact-card .slot-chip small {
  font-size: 0.68rem;
  line-height: 1.3;
}

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

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.series-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 205px));
  gap: 12px;
  align-items: start;
  justify-content: start;
  justify-items: stretch;
}

.series-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  height: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--panel);
  box-shadow: var(--shadow);
  width: 205px;
  max-width: 205px;
}

.series-card-cover {
  width: 100%;
  overflow: hidden;
  border-radius: 18px;
}

.series-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.series-card-body h4 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  max-height: 2.5em;
}

.series-card .muted-inline {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.series-card .badge-row {
  gap: 5px;
}

.series-card .badge {
  font-size: 0.63rem;
  padding: 4px 7px;
}

.series-card-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.series-card-meta div {
  min-width: 0;
  word-break: break-word;
}

.series-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.74rem;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.series-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.series-card-actions form,
.series-card-actions .table-action {
  width: 100%;
}

.series-card-actions form {
  display: flex;
}

.series-card-actions button {
  width: 100%;
}

.series-cover-large {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  height: auto;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.series-cover-large.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
}

.dashboard-cards {
  margin-bottom: 18px;
}

.mini-card {
  padding: 18px;
}

.mini-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.mini-grid dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.mini-grid dd {
  margin: 6px 0 0;
  font-weight: 700;
}

.claims-box {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px;
}

.claim-line + .claim-line {
  margin-top: 8px;
}

.claim-line small,
.list-meta small {
  color: var(--muted);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scroll-limit-list {
  max-height: min(72vh, 640px);
  overflow-y: auto;
  padding-right: 6px;
}

.system-log-stream {
  max-height: min(76vh, 760px);
}

.gdrive-scroll-limit {
  max-height: min(78vh, 860px);
}

.staff-scroll-limit {
  max-height: min(76vh, 820px);
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.list-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.empty {
  margin: 0;
  color: var(--muted);
  padding: 12px 4px;
}

.empty.small {
  padding: 0;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-row {
  display: flex;
  gap: 6px;
}

.action-row .table-action,
.action-row .inline-form {
  flex: 1;
  min-width: 0;
}

.action-row .inline-form {
  display: flex;
}

.action-row .inline-form button {
  width: 100%;
}

.action-row .table-action {
  text-align: center;
  font-size: 0.82rem;
  padding: 8px 10px;
}

.action-stack .full-width {
  width: 100%;
}

.action-stack .inline-form {
  width: 100%;
}

.action-stack .inline-form button.full-width {
  font-size: 0.82rem;
  padding: 8px 10px;
}

.table-search {
  min-width: 260px;
  width: 100%;
}

/* Staff panel head */
.staff-panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.staff-panel-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.staff-panel-title h3 {
  margin: 0;
}

.staff-panel-head .table-search {
  max-width: 320px;
  margin-left: auto;
}

/* Staff table improvements */
.staff-scroll-limit table th,
.staff-scroll-limit table td {
  padding: 10px 8px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.staff-scroll-limit table th:first-child,
.staff-scroll-limit table td:first-child {
  min-width: 200px;
  white-space: normal;
}

.staff-scroll-limit table th:last-child,
.staff-scroll-limit table td:last-child {
  min-width: 160px;
}

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

.picker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
}

.picker-item {
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 700;
}

.picker-item.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #f4faff;
}

.picker-empty {
  color: var(--muted);
  padding: 8px 2px;
}

.table-action,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.danger-button {
  background: var(--danger-soft);
  color: #ffd1d1;
}

.success-button {
  background: rgba(46, 204, 113, 0.18);
  color: #d8ffef;
  border-color: rgba(46, 204, 113, 0.3);
}

.alert.success {
  background: var(--success-soft);
  color: #d8ffef;
}

.settings-form,
.stacked-form {
  display: grid;
  gap: 16px;
}

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

.compact-form {
  max-width: 980px;
}

.auto-claim-bulk-row,
.auto-claim-bulk-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.auto-claim-bulk-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-form label,
.triple-grid label,
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

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

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

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  color-scheme: dark;
  appearance: auto;
}

select,
option {
  background: #101722;
  color: #eef6ff;
}

option {
  background-color: #101722;
  color: #eef6ff;
}

select[multiple],
select[size] {
  min-height: 280px;
  max-height: 340px;
  padding: 8px;
}

select[size] option {
  padding: 10px 12px;
  border-radius: 10px;
}

.slot-user-select {
  min-height: 360px;
  max-height: 420px;
}

button:hover,
.link-button:hover,
.table-action:hover {
  box-shadow: 0 0 0 1px rgba(0, 191, 255, 0.18), 0 12px 28px rgba(29, 78, 216, 0.18);
  text-decoration: none;
}

.five-up {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.six-up {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

select:focus,
input:focus {
  outline: 2px solid rgba(78, 163, 255, 0.35);
  border-color: rgba(78, 163, 255, 0.4);
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #f4faff;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.alert.error {
  background: var(--danger-soft);
  color: #ffd0d0;
}

.login-divider {
  position: relative;
  text-align: center;
  margin: 18px 0;
}

.login-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid var(--line);
}

.login-divider span {
  position: relative;
  padding: 0 12px;
  background: var(--panel);
  color: var(--muted);
}

.discord-button {
  width: 100%;
  background: linear-gradient(135deg, #5865f2 0%, #3e49c7 100%);
}

.mini-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mini-avatar.placeholder,
.cover-thumb.placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(78, 163, 255, 0.5) 0%, rgba(43, 109, 231, 0.92) 100%);
}

.user-cell-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.user-cell-link:hover {
  text-decoration: none;
}

.user-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-wrap {
  flex-shrink: 0;
}

.user-avatar {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.user-avatar.placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  font-size: 1.8rem;
  font-weight: 800;
}

.role-list {
  margin-bottom: 12px;
}

.inline-form {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.inline-form.stacked-form,
.role-manager {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.role-badge {
  border: 0;
  cursor: pointer;
  gap: 10px;
}

.remove-role {
  background: var(--danger-soft);
  color: #ffd7d7;
}

.role-remove-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  font-weight: 900;
}

.cover-thumb {
  width: 52px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.cover-thumb.large {
  width: 92px;
  height: 130px;
  border-radius: 24px;
}

.slot-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 24px;
}

.slot-series-rail {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  align-items: start;
}

.slot-series-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.slot-series-meta h3 {
  margin: 0;
}

.slot-series-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot-panel-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 220px;
  gap: 12px;
}

.slot-panel-side .badge-row {
  justify-content: flex-end;
}

.slot-panel-side form {
  display: flex;
  justify-content: flex-end;
}

.slot-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.slot-table th,
.slot-table td {
  min-width: 160px;
}

.slot-table th,
.slot-table td {
  padding: 14px 16px;
}

.slot-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  min-height: 58px;
}

.slot-chip:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.slot-chip.open {
  background: rgba(34, 49, 72, 0.9);
  color: #d5e8ff;
}

.slot-chip.occupied {
  background: rgba(255, 202, 92, 0.16);
  color: #ffe6b2;
}

.slot-chip.reported {
  background: rgba(255, 202, 92, 0.14);
  color: #ffe9bf;
  border-color: rgba(255, 202, 92, 0.22);
}

.slot-chip.approved {
  background: rgba(107, 230, 181, 0.16);
  color: #dffff0;
  border-color: rgba(107, 230, 181, 0.26);
}

.slot-chip.idle {
  background: rgba(255, 255, 255, 0.05);
}

.slot-chip.disabled {
  opacity: 0.5;
}

.manage-slot-modal {
  width: min(100%, 760px);
}

.manage-slot-modal .current-worker-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 18px;
}

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

.chapter-picker-card {
  gap: 14px;
}

.chapter-picker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.worker-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.worker-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.worker-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

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

.danger-zone {
  border-color: rgba(255, 124, 124, 0.2);
}

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

.danger-actions form {
  display: flex;
}

.danger-actions button {
  width: 100%;
}

.danger-actions button[disabled],
.inline-form button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.log-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-entry {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
}

.log-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.chapter-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.chapter-details summary {
  cursor: pointer;
  color: #b8d6ff;
  font-weight: 700;
  margin-bottom: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(3, 8, 16, 0.74);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(100%, 1080px);
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(10, 18, 31, 0.98), rgba(7, 13, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
  padding: 24px;
}

.modal-head {
  align-items: flex-start;
}

.close-icon {
  font-size: 1.8rem;
  line-height: 1;
}

@media (max-width: 1700px) {
  .series-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(195px, 195px));
  }

  .series-card-grid.lelang-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 235px));
  }

  .series-card {
    width: 195px;
    max-width: 195px;
  }
}

@media (max-width: 1460px) {
  .series-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 185px));
  }

  .series-card-grid.lelang-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(205px, 225px));
  }

  .series-card {
    width: 185px;
    max-width: 185px;
  }
}

@media (max-width: 1180px) {
  .stats-grid,
  .compact-grid,
  .three-column,
  .two-column,
  .shell,
  .manage-grid,
  .chapter-picker-grid {
    grid-template-columns: 1fr;
  }

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

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

  .series-card-grid.lelang-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lelang-compact-card {
    width: 100%;
    max-width: none;
  }

  .series-card {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 860px) {
  .topbar,
  .page-header,
  .list-item,
  .user-hero-main {
    flex-direction: column;
    align-items: stretch;
  }

  .list-meta {
    align-items: flex-start;
  }

  .settings-form,
  .triple-grid,
  .danger-actions,
  .chapter-picker-actions {
    grid-template-columns: 1fr;
  }

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

  .header-actions,
  .slot-panel-head,
  .slot-series-rail,
  .slot-series-head {
    flex-direction: column;
    align-items: stretch;
  }

  .slot-panel-head,
  .slot-series-rail {
    grid-template-columns: 1fr;
  }

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

  .series-card-grid.lelang-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .series-card-actions,
  .series-card-meta {
    grid-template-columns: 1fr;
  }

  .table-search {
    min-width: 0;
  }

  .lelang-compact-card {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .series-card-grid,
  .series-card-grid.lelang-card-grid,
  .series-card-actions,
  .series-card-meta {
    grid-template-columns: 1fr;
  }

  .lelang-compact-card {
    max-width: none;
  }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 18, 31, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  pointer-events: all;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s, transform 0.3s;
}

.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-color: rgba(107, 230, 181, 0.3);
  background: rgba(10, 30, 22, 0.95);
}

.toast-error {
  border-color: rgba(255, 124, 124, 0.3);
  background: rgba(30, 10, 10, 0.95);
}

.toast-info {
  border-color: rgba(0, 191, 255, 0.3);
  background: rgba(10, 18, 31, 0.95);
}

.toast-warn {
  border-color: rgba(255, 202, 92, 0.3);
  background: rgba(30, 25, 10, 0.95);
}

.toast-message {
  flex: 1;
}

.toast-close {
  all: unset;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.6;
  padding: 4px;
}

.toast-close:hover {
  opacity: 1;
  box-shadow: none;
}

/* Stuck Reports Alert Banner */
.alert-banner {
  margin: 1rem 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 1px solid;
}

.alert-banner.warning {
  background: rgba(230, 126, 34, 0.08);
  border-color: rgba(230, 126, 34, 0.4);
}

.alert-banner .alert-header {
  margin-bottom: 0.4rem;
  color: #e67e22;
  font-size: 0.95rem;
}

.alert-banner p {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.stuck-reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stuck-report-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.stuck-report-item .stuck-user {
  font-weight: 600;
  min-width: 100px;
}

.stuck-report-item .stuck-detail {
  color: #7289da;
  min-width: 120px;
}

.stuck-report-item .stuck-series {
  opacity: 0.7;
  flex: 1;
  min-width: 140px;
}

.stuck-report-item .stuck-age {
  color: #e67e22;
  font-weight: 500;
  min-width: 80px;
}

.stuck-report-item .stuck-reason {
  color: #e74c3c;
  font-size: 0.78rem;
  opacity: 0.9;
}
