/* AdminHall — internal admin UI */

:root {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --border: #e2e6ea;
    --text: #1a1d21;
    --text-muted: #5c6570;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #ffffff;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1.5rem 0;
}

.admin-brand {
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.admin-brand a {
    color: var(--sidebar-active);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.admin-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-nav a {
    display: block;
    padding: 0.65rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    border-left: 3px solid transparent;
}

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

.admin-nav a.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-active);
    border-left-color: var(--primary);
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.admin-page-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
}

.admin-user {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-content {
    padding: 1.5rem 2rem 2.5rem;
    flex: 1;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.card-link {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.card-link:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
    text-decoration: none;
}

.card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.card-value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: 0.35rem;
    color: var(--primary);
}

.card-detail {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.card-stat {
    padding: 1.35rem 1.5rem;
}

/* Dashboard */
.dashboard-welcome {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.dashboard-welcome strong {
    color: var(--text);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.dashboard-panel {
    padding: 1.25rem 1.5rem;
}

.dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-panel-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.dashboard-panel-link {
    font-size: 0.85rem;
    font-weight: 500;
}

.dashboard-actions {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-actions li {
    margin-bottom: 0.5rem;
}

.dashboard-actions li:last-child {
    margin-bottom: 0;
}

.dashboard-actions a {
    font-weight: 500;
}

.dashboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.15rem 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dashboard-list li:first-child {
    padding-top: 0;
}

.dashboard-list-title {
    grid-column: 1;
    grid-row: 1;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.dashboard-list-title:hover {
    color: var(--primary);
    text-decoration: none;
}

.dashboard-list-meta {
    grid-column: 1;
    grid-row: 2;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dashboard-list .badge {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: start;
}

.dashboard-live-link {
    grid-column: 1 / -1;
    grid-row: 3;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--primary);
}

.dashboard-live-link:hover {
    text-decoration: underline;
}

.dashboard-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem !important;
}

code {
    font-size: 0.85em;
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2em 0.55em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    text-transform: capitalize;
}

.badge-active,
.badge-published,
.badge-ready {
    background: #dcfce7;
    color: #166534;
}

.badge-paused,
.badge-content,
.badge-draft {
    background: #fef3c7;
    color: #92400e;
}

.badge-archived {
    background: #f1f5f9;
    color: #475569;
}

/* Forms */
.form {
    max-width: 100%;
}

.form-wide {
    max-width: 900px;
}

.form-section {
    border: none;
    margin: 0 0 1.75rem;
    padding: 0;
}

.form-section legend {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding: 0;
    color: var(--text);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--surface);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    color: var(--text);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}

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

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1.25rem;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: -0.5rem 0 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.page-meta-id {
    font-weight: 600;
    color: var(--text);
}

.page-meta-sep {
    opacity: 0.5;
}

.page-meta-hint {
    font-size: 0.8rem;
}

.review-page-url {
    font-size: 0.8rem;
    word-break: break-all;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.review-preview {
    padding: 1.5rem;
}

.review-preview-hero img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.review-preview-header h2 {
    margin: 0 0 0.35rem;
}

.review-preview-short-name,
.review-preview-slug {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.review-preview-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.review-preview-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.review-preview-content {
    line-height: 1.6;
}

.review-preview-content img {
    max-width: 100%;
    height: auto;
}

.review-preview-empty {
    margin: 0;
    color: var(--text-muted);
    font-style: italic;
}

.review-preview-plain {
    margin: 0;
    white-space: pre-wrap;
}

.review-preview-seo p {
    margin: 0.35rem 0 0;
}

.site-logo-preview {
    margin-bottom: 0.75rem;
}

.site-logo-preview-img {
    max-height: 80px;
    width: auto;
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    background: #fff;
}

.site-logo-cell {
    width: 56px;
}

.site-logo-thumb {
    max-height: 36px;
    max-width: 48px;
    width: auto;
    display: block;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: -0.5rem 0 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.page-meta-id {
    font-weight: 600;
    color: var(--text);
}

.page-meta-sep {
    opacity: 0.5;
}

.page-meta-hint {
    font-size: 0.8rem;
}

.review-page-url {
    font-size: 0.8rem;
    word-break: break-all;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.review-preview {
    padding: 1.5rem;
}

.review-preview-hero img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.review-preview-header h2 {
    margin: 0 0 0.35rem;
}

.review-preview-short-name,
.review-preview-slug {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.review-preview-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.review-preview-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.review-preview-content {
    line-height: 1.6;
}

.review-preview-content img {
    max-width: 100%;
    height: auto;
}

.review-preview-empty {
    margin: 0;
    color: var(--text-muted);
    font-style: italic;
}

.review-preview-plain {
    margin: 0;
    white-space: pre-wrap;
}

.review-preview-seo p {
    margin: 0.35rem 0 0;
}

/* Product shopping guides (admin) */
.product-guide-slots-title {
    margin: 2rem 0 0.35rem;
    font-size: 1.15rem;
}

.product-guide-slots-hint {
    margin: 0 0 1.25rem;
}

.product-guide-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.product-guide-slot {
    padding: 1.25rem;
}

.product-guide-slot-head {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.readonly-field {
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-actions-sticky {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    z-index: 2;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.ai-warning-list {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.ai-warning-list li {
    margin-bottom: 0.25rem;
}

.ai-character-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.ai-character-ref-item h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.ai-character-row legend {
    font-weight: 600;
    padding: 0 0.25rem;
}

/* Login */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    text-align: center;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

/* Reports */
.report-slug {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.report-description {
    color: var(--text-muted);
    margin: 0 0 1.25rem;
}

.report-section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.report-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.report-params-form {
    margin-bottom: 0;
}

.report-sql-editor {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.45;
}

.report-sql-preview {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.report-sql-preview summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
}

.report-sql-code {
    margin: 0.5rem 0 0;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.report-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
}

.report-results-card {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.table-scroll {
    overflow-x: auto;
}

.report-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.report-results-table {
    margin: 0;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    font-size: 12px;
    line-height: 1.25;
}

.report-results-table th,
.report-results-table td {
    padding: 4px 6px;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.report-results-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    background: #f1f5f9;
    white-space: nowrap;
}

.report-results-table tbody tr:hover {
    background: #f8fafc;
}

.report-results-table .report-col-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    max-width: 28rem;
}

.report-results-table .report-col-compact {
    white-space: nowrap;
}

.report-view-page {
    margin-top: 0;
}

.report-view-page .report-view-actions {
    margin: 0 0 0.5rem;
    gap: 0.5rem;
}

.report-view-page .report-view-params {
    margin: 0 0 0.5rem;
}

.report-view-page .report-params-form .form-group {
    margin-bottom: 0.5rem;
}

.report-view-page .report-params-form .form-group label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.report-view-page .report-params-form input[type="text"] {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.report-view-page .report-params-grid {
    gap: 0.5rem 0.75rem;
}

.report-view-page .form-actions {
    margin-top: 0.35rem;
}

.report-view-page .report-section-title {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.report-view-page .report-meta {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
}

.report-view-page .report-bulk-actions {
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
}

.report-view-page .report-view-results {
    margin-top: 0.25rem;
}

.report-view-page .report-view-details {
    margin: 0 0 0.5rem;
}

.report-view-page .report-sql-preview {
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.report-view-page .report-placeholder-hint {
    margin: 0.35rem 0 0;
}

.report-view-page .report-empty-hint {
    margin: 0.35rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.report-view-page .alert-compact {
    padding: 0.4rem 0.65rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.report-debug-collapsible {
    margin-bottom: 0.5rem;
}

.report-debug-collapsible summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.82rem;
}

.report-debug-panel {
    margin-top: 0.35rem;
    padding: 0.5rem 0.65rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
}

.report-debug-inner .report-debug-item {
    margin-bottom: 0.35rem;
}

.report-debug-inner .report-debug-item:last-child {
    margin-bottom: 0;
}

.required {
    color: #dc2626;
    font-weight: 600;
}

.required {
    color: #dc2626;
    font-weight: 600;
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: auto;
}

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

/* AI queue */
.ai-batch-card {
    margin-bottom: 1.25rem;
}

.ai-batch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.ai-batch-actions form {
    margin: 0;
}

.ai-filter-form {
    margin-bottom: 0;
}

.ai-row-actions {
    white-space: nowrap;
}

.ai-inline-form {
    display: inline;
    margin: 0;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

.ai-pagination {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.ai-readonly {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    resize: vertical;
}

.ai-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem 1.25rem;
    font-size: 0.9rem;
}

.ai-detail-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 600;
}

.ai-job-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 0.5rem;
}

.ai-job-panel-hidden {
    display: none;
}

.ai-result-image-card {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.ai-job-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin-bottom: 0.5rem;
}

.ai-job-panel-hidden {
    display: none;
}

.ai-result-image-card {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.ai-preview-image {
    max-width: 100%;
    max-height: 480px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.ai-result-hero {
    display: block;
    max-height: 640px;
    margin: 0 auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.ai-result-hero {
    display: block;
    max-height: 640px;
    margin: 0 auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.ai-collapsible {
    margin-bottom: 1.25rem;
}

.ai-collapsible summary {
    cursor: pointer;
    padding: 1rem 1.5rem;
    list-style: none;
}

.ai-collapsible summary::-webkit-details-marker {
    display: none;
}

.ai-collapsible textarea {
    margin: 0 1.5rem 1.5rem;
    width: calc(100% - 3rem);
}

/* Report action buttons */
.report-build-tag {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    padding: 0.35rem 0.6rem;
    border: 1px dashed var(--border);
    border-radius: 6px;
}

.report-build-tag {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    padding: 0.35rem 0.6rem;
    border: 1px dashed var(--border);
    border-radius: 6px;
}

.report-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.report-bulk-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.report-action-form {
    display: inline-block;
    margin: 0;
}

.report-pill {
    display: inline-block;
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    line-height: 1.2;
}

.report-pill:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

.report-pill-btn {
    cursor: pointer;
    font-family: inherit;
}

.report-pill-btn:hover {
    filter: brightness(1.08);
}

.report-debug-panel {
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.report-debug-panel .report-section-title {
    color: #92400e;
}

.report-pill-btn {
    cursor: pointer;
    font-family: inherit;
}

.report-pill-btn:hover {
    filter: brightness(1.08);
}

.report-debug-panel {
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.report-debug-panel .report-section-title {
    color: #92400e;
}

.report-pill-fuchsia { background: #c026d3; }
.report-pill-orange { background: #ea580c; }
.report-pill-blue { background: #2563eb; }
.report-pill-green { background: #16a34a; }
.report-pill-gray { background: #64748b; }
.report-pill-red { background: #dc2626; }

.report-action-cell {
    white-space: nowrap;
}

.report-action-cell .report-action-form {
    margin-right: 0.35rem;
}

.report-row-done {
    background: #f0fdf4;
    opacity: 0.85;
}

.report-row-done td {
    color: var(--text-muted);
}

.report-action-block {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: #fafbfc;
}

.report-action-block-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.form-check-inline {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 900px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        padding: 1rem 0;
    }

    .admin-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0 0.5rem;
    }

    .admin-nav a {
        padding: 0.5rem 0.85rem;
        border-left: none;
        border-radius: 6px;
    }

    .admin-nav a.is-active {
        border-left: none;
    }

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

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .admin-content {
        padding: 1rem;
    }

    .admin-topbar {
        padding: 1rem;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

.ai-async-status {
    margin-bottom: 1rem;
}

.ai-async-status-label {
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.ai-async-progress {
    height: 8px;
    background: var(--border, #e2e8f0);
    border-radius: 4px;
    overflow: hidden;
}

.ai-async-progress-bar {
    height: 100%;
    background: var(--primary, #2563eb);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.ai-queue-health-panel {
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--primary, #2563eb);
}

.ai-queue-health-panel.ai-queue-health-ok {
    border-left-color: #16a34a;
}

.ai-queue-health-panel.ai-queue-health-busy {
    border-left-color: #d97706;
    background: #fffbeb;
}

.ai-queue-health-panel.ai-queue-health-critical,
.ai-queue-health-panel.ai-queue-health-unavailable {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.ai-queue-health-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.ai-queue-health-head .report-section-title {
    margin: 0;
}

.ai-queue-polled-at {
    margin: 0;
}

.ai-queue-health-message {
    margin: 0 0 1rem;
    font-weight: 500;
}

.ai-queue-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.ai-queue-metric-label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted, #64748b);
    margin-bottom: 0.15rem;
}

.ai-queue-metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
