:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --border: #e3e6ec;
    --text: #1a1d27;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --warn: #d97706;
    --success: #16a34a;
    --rarity-ssr: #d97706;
    --rarity-sr: #9333ea;
    --rarity-r: #2563eb;
    --rarity-n: #6b7280;
}

* { box-sizing: border-box; padding: 0; margin: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Hiragino Sans", "Yu Gothic UI", -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ===== Login ===== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-main { width: 100%; }
.login-card {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 32px 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.login-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}
.login-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 24px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.password-input-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    overflow: hidden;
}
.password-input-wrap input {
    border: none !important;
    border-radius: 0 !important;
    padding-right: 8px;
}
.password-input-wrap:focus-within {
    border-color: var(--primary);
}
.password-toggle-btn {
    border: none;
    border-left: 1px solid var(--border);
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 0 12px;
    height: 100%;
    min-height: 38px;
}
.password-toggle-btn:hover {
    color: var(--text);
    background: #f1f5f9;
}

/* ===== Layout ===== */
.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: #1a1d27;
    color: #ededed;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
}
.brand {
    font-weight: 700;
    margin-bottom: 24px;
    font-size: 14px;
    color: #cbd5e1;
}
.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.nav-link {
    display: block;
    padding: 9px 12px;
    color: #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}
.nav-link:hover {
    background: rgba(255,255,255,0.06);
    text-decoration: none;
    color: #fff;
}
.nav-link.is-active {
    background: rgba(37, 99, 235, 0.2);
    color: #fff;
}
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: #cbd5e1;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    width: 100%;
    text-align: center;
}
.btn-logout:hover { color: #fff; border-color: #cbd5e1; }
.me { display: block; word-break: break-all; }
.role-note {
    display: inline-flex;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.25);
}

.main {
    padding: 32px 36px;
    overflow-x: auto;
}

/* ===== Common ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}
.page-title { font-size: 20px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }
.field-error { color: var(--danger); font-size: 12px; }
.field-help { color: var(--muted); font-size: 12px; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-primary:hover {
    background: var(--primary-hover);
    text-decoration: none;
}
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
}
.btn-secondary:hover { border-color: var(--muted); }
.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warn {
    background: var(--surface);
    color: var(--warn);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.btn-warn:hover { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0;
    font-size: 13px;
}
.btn-link:hover { text-decoration: underline; }

.flash {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid;
}
.flash-success { background: #ecfdf5; color: var(--success); border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: var(--danger); border-color: #fecaca; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}
.kpi-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}
.kpi-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}
.mono-cell {
    max-width: 320px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.badge-payment-paid { background: #dcfce7; color: #166534; }
.badge-payment-pending { background: #fef3c7; color: #92400e; }
.badge-payment-failed { background: #fee2e2; color: #991b1b; }

.badge-wallet-purchase { background: #dcfce7; color: #166534; }
.badge-wallet-grant { background: #dbeafe; color: #1d4ed8; }
.badge-wallet-consume { background: #fee2e2; color: #b91c1c; }
.badge-wallet-point_back { background: #d1fae5; color: #047857; }
.badge-wallet-refund { background: #f3e8ff; color: #7e22ce; }

@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 760px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

.detail-list {
    display: grid;
    gap: 0;
}
.detail-row {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}
.detail-row dd {
    margin: 0;
    font-size: 14px;
}
@media (max-width: 640px) {
    .detail-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Wallet transaction detail */
.tx-detail-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.tx-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.tx-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
}
.tx-summary-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.tx-summary-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.tx-summary-unit {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-left: 2px;
}
.tx-summary-hint {
    margin-top: 8px;
    font-size: 12px;
}
.tx-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.tx-panel { margin-bottom: 0; }
.tx-panel-muted {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}
.info-item dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}
.info-item dd {
    font-size: 14px;
    line-height: 1.5;
}
.info-item-full { grid-column: 1 / -1; }
.tx-gacha-link {
    font-weight: 600;
    font-size: 15px;
}
.tx-item-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.tx-empty-note {
    font-size: 14px;
    line-height: 1.6;
}
.tx-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.tx-section-desc {
    font-size: 13px;
}
.tx-section-total {
    font-size: 13px;
    white-space: nowrap;
    text-align: right;
}
.tx-section-total strong {
    display: block;
    font-size: 20px;
    margin-top: 4px;
}
.tx-num-col {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.tx-results-table tfoot .tx-table-foot td {
    background: #f9fafb;
    font-weight: 700;
    border-top: 2px solid var(--border);
}
.is-negative { color: var(--danger); }
.is-positive { color: var(--success); }
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}
.table-kv th {
    width: 160px;
    background: #f9fafb;
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: none;
    vertical-align: top;
}
.table-kv td {
    font-size: 14px;
}
.table-summary th,
.table-summary td {
    text-align: center;
    font-size: 14px;
}
.table-summary thead th {
    font-size: 12px;
    text-transform: none;
}
.table-summary tbody td {
    font-size: 20px;
    font-weight: 700;
    padding-top: 14px;
    padding-bottom: 14px;
}
.tx-inline-note {
    display: block;
    font-size: 12px;
    font-weight: 400;
    margin-top: 4px;
}
.tx-gacha-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tx-thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 64px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}
.tx-row-highlight td {
    background: #eff6ff;
}
@media (max-width: 1100px) {
    .tx-summary-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 760px) {
    .tx-detail-grid,
    .info-grid { grid-template-columns: 1fr; }
    .tx-summary-grid { grid-template-columns: 1fr; }
    .tx-section-header { flex-direction: column; }
    .tx-section-total { text-align: left; }
}

.table-wrap { overflow-x: auto; }
table.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.table th, .table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}
.table th {
    background: #f9fafb;
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-status-draft   { background: #e5e7eb; color: #374151; }
.badge-status-active  { background: #dcfce7; color: #16a34a; }
.badge-status-soldout { background: #fed7aa; color: #c2410c; }
.badge-status-closed  { background: #fee2e2; color: #b91c1c; }

.badge-rarity-SSR { background: #fef3c7; color: var(--rarity-ssr); }
.badge-rarity-SR  { background: #ede9fe; color: var(--rarity-sr); }
.badge-rarity-R   { background: #dbeafe; color: var(--rarity-r); }
.badge-rarity-N   { background: #f3f4f6; color: var(--rarity-n); }

.badge-user-active { background: #dcfce7; color: #16a34a; }
.badge-user-banned { background: #fee2e2; color: #b91c1c; }

.badge-shipping-pending { background: #fef3c7; color: #92400e; }
.badge-shipping-processing { background: #dbeafe; color: #1d4ed8; }
.badge-shipping-shipped { background: #dcfce7; color: #166534; }
.badge-shipping-cancelled { background: #f3f4f6; color: #6b7280; }

.is-active-filter {
    border-color: var(--primary);
    color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.form-grid .field-full { grid-column: 1 / -1; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input[type="number"] {
    width: 80px;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid var(--border);
    font-size: 13px;
}
.inline-form select {
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid var(--border);
    font-size: 13px;
    background: #fff;
}
.inline-form .btn-secondary { padding: 5px 10px; font-size: 13px; }

.muted { color: var(--muted); font-size: 13px; }
.section-title {
    margin: 14px 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.04em;
}
.role-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border);
    background: #fff;
}
.role-chip-admin {
    color: #3730a3;
    background: #eef2ff;
    border-color: #c7d2fe;
}
.role-chip-user {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.role-badge {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}
.role-badge-super_admin {
    color: #312e81;
    background: #e0e7ff;
    border-color: #c7d2fe;
}
.role-badge-ops_admin {
    color: #92400e;
    background: #fef3c7;
    border-color: #fde68a;
}
.role-badge-support_admin {
    color: #14532d;
    background: #dcfce7;
    border-color: #bbf7d0;
}
.empty {
    padding: 32px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 10px;
}

/* Gacha form — tags & unlock timing */
.gacha-tags-fieldset,
.gacha-unlock-fieldset {
    margin-top: 4px;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--border);
}
.gacha-tags-fieldset legend,
.gacha-unlock-fieldset legend {
    padding: 0 4px;
    font-weight: 600;
    font-size: 15px;
}
.gacha-section-intro {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
}
.tag-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}
.tag-chip-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.tag-chip-label {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
}
.tag-chip:hover .tag-chip-label {
    border-color: #93c5fd;
    background: #f8fbff;
}
.tag-chip-input:focus-visible + .tag-chip-label {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.tag-chip-input:checked + .tag-chip-label {
    color: #fff;
    border-color: var(--primary);
    background: linear-gradient(180deg, #2d73f6, #0c50d8);
    box-shadow: 0 2px 6px rgba(12, 80, 216, 0.25);
}
.tag-manage-hint {
    margin: 12px 0 0;
}
.tag-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #fafbfc;
    text-align: center;
}
.tag-empty-text {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}
.unlock-callout {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    font-size: 13px;
    line-height: 1.65;
    color: #1e3a8a;
}
.unlock-callout p { margin: 0; }
.unlock-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 720px) {
    .unlock-inputs { grid-template-columns: 1fr; }
}
.unlock-input-card {
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fafbfc;
}
.unlock-input-card--sr {
    border-color: #ddd6fe;
    background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
}
.unlock-input-card--ssr {
    border-color: #fde68a;
    background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}
.unlock-input-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.unlock-input-card input[type="number"] {
    font-size: 16px;
    font-weight: 600;
}
.unlock-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
}
.unlock-status-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.04em;
}
.unlock-progress {
    font-size: 13px;
    color: var(--text);
}
.unlock-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}
.unlock-badge--open {
    color: #065f46;
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.unlock-badge--locked {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

/* Signup campaign toggle (gacha form) */
.gacha-signup-field {
    justify-content: flex-start;
}
.signup-campaign-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    margin: 0;
    transition: border-color 0.15s, background 0.15s;
}
.signup-campaign-toggle:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}
.signup-campaign-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.signup-campaign-toggle-ui {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.15s;
}
.signup-campaign-toggle-ui::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s;
}
.signup-campaign-toggle input:checked + .signup-campaign-toggle-ui {
    background: var(--primary);
}
.signup-campaign-toggle input:checked + .signup-campaign-toggle-ui::after {
    transform: translateX(18px);
}
.signup-campaign-toggle input:focus-visible + .signup-campaign-toggle-ui {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.signup-campaign-toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.badge-signup-campaign {
    margin-left: 6px;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.gacha-winners-card {
    margin-top: 16px;
}

.gacha-winners-table th,
.gacha-winners-table td {
    font-size: 13px;
    vertical-align: middle;
}

/* Gacha thumbnail (admin) */
.thumbnail-fieldset {
    margin-top: 20px;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--border);
}
.thumbnail-fieldset legend {
    padding: 0 4px;
    font-weight: 600;
    font-size: 15px;
}
.thumbnail-intro {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
}
.thumbnail-grid {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 720px) {
    .thumbnail-grid { grid-template-columns: 1fr; }
}
.thumbnail-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.thumbnail-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f3f4f6;
}
.item-table-thumb {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: block;
}
.thumbnail-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 2px dashed var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
    background: #fafbfc;
    text-align: center;
}
.thumbnail-placeholder span {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.thumbnail-placeholder small {
    font-size: 11px;
    line-height: 1.4;
}
.thumbnail-caption {
    text-align: center;
    margin: 0;
    font-size: 11px;
}
.thumbnail-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.thumbnail-remove {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
.thumbnail-remove input { width: auto; }

/* Gacha draw videos (admin — table UI) */
.draw-video-fieldset {
    margin-top: 20px;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--border);
}
.draw-video-fieldset legend {
    padding: 0 4px;
    font-weight: 600;
    font-size: 15px;
}
.draw-video-intro {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
}
.draw-video-intro code {
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 4px;
    background: #f3f4f6;
    border: 1px solid var(--border);
}
.draw-video-wrap { margin-bottom: 4px; }
table.table.draw-video-table thead th {
    text-transform: none;
    letter-spacing: normal;
    font-size: 13px;
    vertical-align: top;
}
.draw-video-table .draw-video-head-hint {
    display: block;
    font-weight: 500;
    font-size: 11px;
    color: var(--muted);
    text-transform: none;
    letter-spacing: normal;
    margin-top: 4px;
    line-height: 1.35;
}
.draw-video-table .rarity-col { width: 64px; }
.draw-video-table .reset-col {
    width: 110px;
    text-align: center;
}
.draw-video-badge-cell {
    text-align: center;
    vertical-align: top;
}
.draw-video-now {
    min-width: 200px;
    max-width: 280px;
    vertical-align: top;
    line-height: 1.45;
}
.draw-video-tag {
    display: inline-block;
    margin: 0 0 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}
.draw-video-tag--default {
    background: #eef2ff;
    color: #3730a3;
}
.draw-video-tag--url {
    background: #ecfdf5;
    color: #047857;
}
.draw-video-tag--file {
    background: #fef3c7;
    color: #b45309;
}
.draw-video-sub {
    margin: 0 0 8px;
    font-size: 12px;
}
.draw-video-url-line {
    margin: 0 0 2px;
    font-size: 13px;
}
.draw-video-url-muted {
    margin: 0;
    word-break: break-all;
    font-size: 11px;
}
.draw-video-input {
    vertical-align: top;
    min-width: 160px;
}
.draw-video-reset {
    vertical-align: middle;
    text-align: center;
}
.draw-video-reset-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--muted);
    max-width: 96px;
    line-height: 1.3;
}
.draw-video-reset-label input {
    width: auto;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.checkbox-row input { width: auto; }
.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}
.checkbox-line input {
    width: auto;
    margin-top: 3px;
}

/* Laravel pagination (tailwind view) */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}
.admin-pagination-meta {
    color: var(--muted);
}
.admin-pagination-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.admin-pagination-item a,
.admin-pagination-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
    background: var(--surface);
}
.admin-pagination-item a:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.admin-pagination-item.is-active span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.admin-pagination-item.is-disabled span {
    color: #9ca3af;
    background: #f9fafb;
}

@media (max-width: 760px) {
    .admin-pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Front settings tabs */
.settings-shell {
    padding: 18px 20px 20px;
}

.settings-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

a.settings-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

a.settings-tab:hover,
a.settings-tab:focus {
    text-decoration: none;
    border-color: #93c5fd;
    color: var(--primary);
    background: #eff6ff;
}

a.settings-tab.is-active,
a.settings-tab.is-active:hover,
a.settings-tab.is-active:focus {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.settings-tab-panel {
    margin-top: 0;
}

.settings-tab-header {
    margin-bottom: 16px;
    align-items: flex-start;
}

.settings-tab-header .settings-tab-desc {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    max-width: 640px;
}

@media (max-width: 760px) {
    .settings-tabs {
        grid-template-columns: 1fr;
    }
}
