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

:root {
    --qc-bg: #f7fafc;
    --qc-bg-soft: #f0f7ff;
    --qc-panel: #ffffff;
    --qc-panel-alt: #f8fbff;
    --qc-border: #e2e8f0;
    --qc-border-strong: #cfd8e6;
    --qc-text: #243244;
    --qc-text-soft: #64748b;
    --qc-title: #1a1a2e;
    --qc-primary: #0066cc;
    --qc-primary-deep: #004c99;
    --qc-primary-soft: #e6f0fa;
    --qc-success: #10b981;
    --qc-success-soft: #e8faf3;
    --qc-warning: #f59e0b;
    --qc-warning-soft: #fff7e8;
    --qc-danger: #ef4444;
    --qc-danger-soft: #fff1f2;
    --qc-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    --qc-shadow-strong: 0 18px 42px rgba(15, 23, 42, .12);
    --qc-radius: 8px;
    --qc-radius-sm: 6px;
    --qc-radius-lg: 18px;
    --qc-space-1: 4px;
    --qc-space-2: 8px;
    --qc-space-3: 12px;
    --qc-space-4: 16px;
    --qc-space-5: 24px;
    --qc-space-6: 32px;
    --qc-header-height: 64px;
    --qc-sidebar-width: 240px;
    --qc-sidebar-bg: linear-gradient(180deg, #111827 0%, #172554 100%);
    --qc-sidebar-border: rgba(255, 255, 255, .08);
    --qc-sidebar-text: rgba(226, 232, 240, .82);
    --qc-sidebar-text-strong: #ffffff;
    --qc-stage-shadow: 0 24px 60px rgba(15, 23, 42, .08);
}

.admin-regenerate-dialog {
    width: min(520px, calc(100vw - 32px));
    max-width: 100%;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 1px solid #d8e1ec;
    border-radius: 8px;
    color: #263342;
    background: #fff;
    box-shadow: 0 18px 48px rgba(24, 39, 58, 0.24);
}

.admin-regenerate-dialog::backdrop {
    background: rgba(22, 31, 43, 0.46);
}

.admin-regenerate-form {
    display: grid;
    gap: 14px;
    padding: 20px;
    overflow: auto;
}

.admin-regenerate-form h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: 0;
}

.admin-regenerate-help {
    margin: 0;
    color: #526170;
    line-height: 1.6;
}

.admin-regenerate-label {
    display: grid;
    gap: 8px;
    color: #344454;
    font-weight: 600;
}

.admin-regenerate-label textarea {
    width: 100%;
    min-height: 120px;
    box-sizing: border-box;
    resize: vertical;
    font: inherit;
    font-weight: 400;
}

.admin-regenerate-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.admin-regenerate-actions .btn-secondary {
    border-color: #cbd7e4;
    background: #eef3f8;
    color: #344454;
}

@media (max-width: 520px) {
    .admin-regenerate-form {
        padding: 16px;
    }

    .admin-regenerate-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .admin-regenerate-actions button {
        min-width: 0;
        white-space: normal;
    }
}

body {
    min-height: 100vh;
    font-family: Inter, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background: linear-gradient(180deg, #eef4fb 0%, #f7fafc 100%);
    color: var(--qc-text);
}
body.nav-open {
    overflow: hidden;
}
body.nav-open .container > * {
    position: relative;
    z-index: 0 !important;
}
body.nav-open .workspace-kicker-row,
body.nav-open .workspace-kicker,
body.nav-open .user-group-badge-inline,
body.nav-open .workspace-actions,
body.nav-open .workspace-action-block,
body.nav-open .workspace-action-note,
body.nav-open #btn-generate-all,
body.nav-open #btn-approve-all {
    position: relative;
    z-index: 0 !important;
}

/* ── Navbar ── */
.navbar {
    background: var(--qc-sidebar-bg);
    color: var(--qc-sidebar-text);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 18px 16px 20px;
    width: var(--qc-sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    border-right: 1px solid var(--qc-sidebar-border);
    box-shadow: 16px 0 40px rgba(15, 23, 42, .22);
    overflow: visible;
}
.navbar-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 18px;
    width: 100%;
    position: relative;
    z-index: 104;
}
.brand-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
}
.nav-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 106;
    flex: 0 0 auto;
}
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .04);
}
.lang-switch a {
    color: rgba(226, 232, 240, .72);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
}
.lang-switch a.active {
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
    box-shadow: none;
}
.navbar .brand {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px 12px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--qc-sidebar-text-strong);
    text-decoration: none;
    min-width: 0;
}
.brand-logo {
    width: min(160px, 100%);
    max-width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
    filter: brightness(0) invert(1);
}
.brand-caption {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.brand-version {
    font-size: 11px;
    line-height: 1.4;
    font-weight: 500;
    color: #cbd5e1;
    white-space: nowrap;
}
.brand-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--qc-sidebar-text-strong);
    white-space: normal;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.user-group-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .14);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, .24);
    font-size: 12px;
    font-weight: 700;
}
.navbar .user-group-badge {
    align-self: flex-start;
    background: rgba(59, 130, 246, .16);
    color: #dbeafe;
    border-color: rgba(96, 165, 250, .22);
}
.navbar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    flex-wrap: nowrap;
    justify-content: flex-start;
}
.nav-links {
    width: 100%;
    height: 100%;
}
.nav-section-title {
    margin: 14px 0 6px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, .52);
}
.nav-footer-item {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.nav-user-card {
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
}
.nav-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}
.nav-user-role {
    margin-top: 3px;
    color: rgba(226, 232, 240, .66);
    font-size: 12px;
}
.mobile-nav-meta {
    display: none;
}
.mobile-nav-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.mobile-nav-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--qc-title);
    line-height: 1.35;
}
.mobile-nav-user {
    margin-top: 4px;
    color: var(--qc-text-soft);
    font-size: 12px;
    line-height: 1.4;
}
.navbar ul a,
.navbar .logout-button {
    color: var(--qc-sidebar-text);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    display: flex;
    align-items: center;
    min-height: 42px;
    border: 1px solid transparent;
    font-weight: 600;
}
.navbar ul a.active,
.navbar .logout-button.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, .2), rgba(255, 255, 255, .05));
    color: var(--qc-sidebar-text-strong);
    border-color: rgba(96, 165, 250, .2);
    box-shadow: inset 3px 0 0 #60a5fa;
}
.navbar .logout-form { margin: 0; }
.navbar .logout-button {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
}
.navbar ul a:hover,
.navbar .logout-button:hover {
    background: rgba(255, 255, 255, .06);
    color: var(--qc-sidebar-text-strong);
    border-color: rgba(255, 255, 255, .08);
    text-decoration: none;
}
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .24);
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
    z-index: 101;
}
.nav-drawer {
    position: static;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}
.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--qc-border);
    border-radius: 10px;
    background: var(--qc-panel-alt);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 107;
    touch-action: manipulation;
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    background: #475569;
    border-radius: 999px;
    transition: transform .18s ease, opacity .18s ease;
}

/* ── Layout ── */
.container {
    position: relative;
    isolation: isolate;
    max-width: none;
    margin: 0 28px 36px calc(var(--qc-sidebar-width) + 28px);
    padding: 28px 0 0;
}
.container::before {
    content: "";
    position: absolute;
    inset: 14px -14px -14px -14px;
    border: 1px solid rgba(203, 213, 225, .88);
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(0, 102, 204, .08), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(245, 248, 252, .98));
    box-shadow: var(--qc-stage-shadow);
    z-index: -1;
}
.container > h2:first-child {
    margin-bottom: 10px;
}
.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--qc-primary);
    font-weight: 600;
}

.page-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 24px 26px 20px;
    border: 1px solid var(--qc-border);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .99), rgba(247, 250, 252, .98)),
        linear-gradient(135deg, rgba(0, 102, 204, .05), transparent 58%);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .06);
}
.page-header::before,
.workspace-head::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--qc-primary), rgba(96, 165, 250, .16));
}
.page-header-copy {
    max-width: 820px;
}
.page-header .sync-note {
    margin-top: 0;
}

h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 8px 0 14px;
    color: var(--qc-title);
}
h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 18px 0 10px;
    color: var(--qc-title);
}

/* ── Stat cards ── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.card {
    position: relative;
    overflow: hidden;
    background: var(--qc-panel);
    border-radius: 20px;
    padding: 16px 18px 14px;
    text-align: left;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .14), 0 4px 10px rgba(15, 23, 42, .08);
    border: 1px solid var(--qc-border);
    border-top: 0;
}
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--qc-primary);
}
.card.bad::before  { background: var(--qc-danger); }
.card.good::before { background: var(--qc-success); }
.card.warn::before { background: var(--qc-warning); }
.card .num   { display: block; font-size: 28px; line-height: 1.05; font-weight: 700; color: var(--qc-title); }
.card .label { display: block; font-size: 12px; color: var(--qc-text-soft); margin-top: 6px; line-height: 1.45; }

/* ── Tables ── */
table {
    width: 100%;
    background: var(--qc-panel);
    border-radius: var(--qc-radius);
    border-collapse: collapse;
    box-shadow: var(--qc-shadow);
    border: 1px solid var(--qc-border);
    overflow: hidden;
    margin-bottom: 20px;
}
th {
    background: #f8fafc;
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--qc-border);
}
td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fbfcfe; }
a { color: var(--qc-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Status badges ── */
[class^="status-"] {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.status-replied  { background: #d4edda; color: #155724; }
.status-notified { background: #fff3cd; color: #856404; }
.status-pending  { background: #cce5ff; color: #004085; }
.status-drafted  { background: #e8f1ff; color: #1d4e89; }
.status-approved { background: #e7f7ed; color: #146c43; }
.status-failed   { background: #f8d7da; color: #842029; }
.status-ignored  { background: #e2e3e5; color: #383d41; }
.status-archived { background: #e7e2f8; color: #432874; }
.status-queued   { background: #e8f1ff; color: #1d4e89; }
.status-running  { background: #fff3cd; color: #856404; }
.status-done     { background: #d4edda; color: #155724; }
.status-cancelled { background: #e2e3e5; color: #383d41; }

.generation-queue { margin: 20px 0; padding: 20px 0; border-top: 1px solid #d9e1e8; border-bottom: 1px solid #d9e1e8; }
.generation-queue-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.generation-queue-heading h3 { margin: 0; font-size: 17px; }
.generation-task-list { list-style: none; margin: 12px 0 0; padding: 0; }
.generation-task-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid #e4e9ee; }
.generation-task-main { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.generation-task-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
@media (max-width: 600px) {
    .generation-task-list li { align-items: flex-start; flex-direction: column; gap: 8px; }
    .generation-task-actions { justify-content: flex-start; }
}

.red   { color: var(--qc-danger); font-weight: 600; }
.green { color: var(--qc-success); font-weight: 600; }
.warn  { color: var(--qc-warning); font-weight: 600; }

/* ── Filter bar ── */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    background: var(--qc-panel);
    box-shadow: var(--qc-shadow);
}
.filter-bar select,
.filter-bar input,
.filter-bar button,
.filter-bar a,
.filter-bar .store-filter-picker {
    width: 100%;
    min-width: 0;
}
.filter-bar select, .filter-bar input {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--qc-border-strong);
    border-radius: 10px;
    font-size: 13px;
    color: var(--qc-text);
    background: var(--qc-panel);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .02);
}
.store-filter-picker {
    position: relative;
    min-width: 0;
    max-width: 100%;
}
.store-filter-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--qc-border-strong);
    border-radius: 10px;
    background: var(--qc-panel);
    color: var(--qc-text);
    font-size: 13px;
    cursor: pointer;
    list-style: none;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .02);
}
.store-filter-picker[open] summary {
    border-color: rgba(0, 102, 204, .35);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, .08);
}
.store-filter-picker summary::-webkit-details-marker {
    display: none;
}
.store-filter-caret {
    color: var(--qc-text-soft);
    font-weight: 700;
    transition: transform .18s ease;
}
.store-filter-picker[open] .store-filter-caret {
    transform: rotate(180deg);
}
.store-filter-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 0;
    width: min(420px, calc(100vw - 64px));
    max-height: 360px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--qc-border);
    border-radius: 14px;
    background: var(--qc-panel);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
}
.store-filter-help {
    margin: 2px 4px 10px;
    color: var(--qc-text-soft);
    font-size: 12px;
    line-height: 1.5;
}
.store-filter-menu label {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 34px;
    padding: 7px 8px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
}
.store-filter-menu label span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.store-filter-menu label:hover {
    background: var(--qc-panel-alt);
}
.store-filter-menu input {
    min-height: auto;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
}
.filter-bar select:focus, .filter-bar input:focus,
#reply-form textarea:focus, .card-approve-form textarea:focus,
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, .5);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}
.filter-bar button, button {
    min-height: 40px;
    padding: 9px 16px;
    background: var(--qc-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .2);
    transition: background .15s, transform .15s, box-shadow .15s;
}
.filter-bar button:hover, button:hover {
    background: var(--qc-primary-deep);
    box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
    transform: translateY(-1px);
}
.filter-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--qc-border);
    background: var(--qc-panel-alt);
    color: var(--qc-text-soft);
    text-decoration: none;
    font-weight: 600;
}
.filter-bar a:hover {
    background: #eef4ff;
    color: var(--qc-primary-deep);
    border-color: rgba(37, 99, 235, .18);
    text-decoration: none;
}

/* ── Pagination ── */
.pagination { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pagination a {
    display: inline-block;
    padding: 7px 12px;
    border: 1px solid var(--qc-border);
    border-radius: 10px;
    color: var(--qc-primary);
    background: var(--qc-panel);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.pagination a.active { background: var(--qc-primary); color: #fff; border-color: var(--qc-primary); }
.pagination a:hover  { background: #eef4ff; text-decoration: none; }

/* ── Detail table ── */
.detail-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.detail-table th {
    width: 160px;
}

/* ── Draft box ── */
.draft-box {
    background: var(--qc-panel-alt);
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    padding: 16px;
    margin-bottom: 16px;
    white-space: pre-wrap;
    line-height: 1.6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

/* ── Reply form ── */
#reply-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d3e2;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}
.btn-group { display: flex; gap: 10px; }
#btn-ai-draft { background: #858796; }
#btn-ai-draft:hover { background: #717384; }
.admin-form {
    background: var(--qc-panel);
    border: 1px solid var(--qc-border);
    padding: 18px;
    border-radius: var(--qc-radius);
    margin: 14px 0 24px;
    box-shadow: var(--qc-shadow);
}
.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--qc-text);
    font-weight: 600;
}
.admin-form input,
.admin-form select,
.admin-form textarea {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--qc-border-strong);
    border-radius: 10px;
    font: inherit;
}
.small-muted {
    color: var(--qc-text-soft);
    font-size: 12px;
}
.admin-stack {
    display: grid;
    gap: 18px;
}
.admin-form,
.manager-form {
    background: var(--qc-panel);
    border: 1px solid var(--qc-border);
    padding: 18px;
    border-radius: var(--qc-radius);
    margin: 14px 0 24px;
    box-shadow: var(--qc-shadow);
}
.admin-form label,
.manager-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--qc-text);
    font-weight: 600;
}
.admin-form input,
.admin-form select,
.admin-form textarea,
.manager-form input,
.manager-form textarea {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--qc-border-strong);
    border-radius: 10px;
    font: inherit;
}
.store-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin: 10px 0 14px;
}
.store-checks label {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--qc-border);
    border-radius: 10px;
    background: var(--qc-panel-alt);
    font-size: 13px;
    font-weight: 500;
}
.store-checks input {
    min-height: auto;
    padding: 0;
}
.table-shell {
    background: var(--qc-panel);
    border: 1px solid var(--qc-border);
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .05);
    overflow-x: auto;
}
.table-shell table {
    margin-bottom: 0;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

.flash-message {
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--qc-shadow-sm);
    font-size: 14px;
    line-height: 1.6;
}

.flash-message.green {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.08);
    color: #0d7a56;
}

.flash-message.red {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.08);
    color: #b42318;
}
#reply-msg { margin-top: 10px; font-weight: 600; }
#reply-msg.ok  { color: #1cc88a; }
#reply-msg.err { color: #e74a3b; }

.workspace-head {
    position: relative;
    overflow: hidden;
    display: inline-grid;
    width: fit-content;
    max-width: 100%;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 10px;
    padding: 14px 16px 12px;
    border: 1px solid var(--qc-border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .96)),
        linear-gradient(135deg, rgba(37, 99, 235, .05), transparent 55%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .06);
}
.workspace-head-top {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    gap: 14px;
}
.workspace-head h2 {
    margin-top: 2px;
    margin-bottom: 2px;
    font-size: 18px;
    line-height: 1.2;
}
.workspace-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}
.workspace-head-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.workspace-head-metrics {
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 0;
    border-top: 0;
    background: transparent;
}
.workspace-kicker-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.workspace-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid #e2e8f0;
}
.workspace-kicker-muted {
    background: #f8fafc;
    color: #94a3b8;
}
.user-group-badge-inline {
    position: relative;
    top: 0;
}
.sync-note {
    margin-top: 0;
    color: var(--qc-text-soft);
    font-size: 12px;
    line-height: 1.3;
}
.sync-stale-warning {
    display: inline;
    margin-top: 0;
    margin-left: 6px;
    color: #b45309;
    font-weight: 600;
}
.workspace-actions {
    display: inline-flex;
    align-items: center;
    padding: 6px;
    border: 1px solid #dde6f2;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(248, 251, 255, .95), rgba(255, 255, 255, .92));
}
.workspace-actions > a,
.workspace-action-block > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: var(--qc-radius-sm);
    border: 1px solid var(--qc-border);
    background: var(--qc-panel-alt);
    color: var(--qc-primary-deep);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}
.workspace-actions > a:hover,
.workspace-action-block > a:hover {
    background: var(--qc-primary-soft);
    text-decoration: none;
}
.workspace-action-block {
    display: grid;
    gap: 4px;
    justify-items: stretch;
    min-width: 0;
    min-width: 228px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.workspace-action-note {
    color: var(--qc-text-soft);
    font-size: 11px;
    line-height: 1.25;
    padding: 0 2px;
}
.workspace-approve-consent {
    margin-top: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #ffffff;
    border-color: #dbe7f6;
    color: var(--qc-text-soft);
}
.dashboard-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding: 10px 14px;
    border: 1px solid #d8e8ff;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7fbff, #eef6ff);
}
.dashboard-alert-compact .dashboard-alert-main {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-alert-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.dashboard-alert-main strong {
    font-size: 13px;
    color: var(--qc-primary-deep);
}
.dashboard-alert-copy {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: #425466;
    font-size: 12px;
    line-height: 1.4;
}
.dashboard-alert-copy span {
    min-width: 0;
}
.dashboard-alert-close {
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: #5b6b7f;
    box-shadow: none;
}
.dashboard-alert-close:hover {
    background: rgba(0, 102, 204, .08);
    color: var(--qc-primary-deep);
    transform: none;
    box-shadow: none;
}
.metric-bar,
.metric-bar-inline {
    display: flex;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    white-space: normal;
}
.metric-bar-inline {
    gap: 8px;
}
.metric-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    padding: 6px 10px;
    border: 1px solid #e6edf6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .025);
    white-space: normal;
}
.metric-pill-primary {
    background: linear-gradient(180deg, #eef5ff, #f6f9ff);
    border-color: #d9e7ff;
}
.metric-pill-primary .metric-label,
.metric-pill-primary strong {
    color: var(--qc-primary-deep);
}
.metric-label {
    color: var(--qc-text-soft);
    font-size: 10px;
    line-height: 1;
}
.metric-pill strong {
    font-size: 18px;
    line-height: 1;
    color: var(--qc-title);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.dashboard-job-strip {
    display: grid;
    gap: 4px;
    margin: 0 0 10px;
    padding: 10px 14px;
    border: 1px solid var(--qc-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    box-shadow: none;
}
.dashboard-job-strip-compact {
    background: #fbfdff;
}
.dashboard-job-strip-head,
.dashboard-job-strip-body {
    display: flex;
    align-items: center;
    gap: 6px 12px;
    flex-wrap: wrap;
    min-width: 0;
}
.dashboard-job-strip-head {
    color: var(--qc-title);
    font-size: 12px;
}
.dashboard-job-strip-body {
    color: var(--qc-text-soft);
    font-size: 12px;
    line-height: 1.4;
}
.workspace-toolbar {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 10px;
}
.filter-bar-merged {
    margin-bottom: 0;
    display: grid;
    grid-template-columns: auto auto;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    gap: 8px 10px;
    padding: 8px 10px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .035);
}
.filter-bar-main-inline {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    align-items: center;
}
.filter-inline-field {
    display: grid;
    grid-template-columns: 54px minmax(180px, auto);
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.filter-inline-field-wide {
    min-width: 0;
}
.filter-inline-label {
    color: var(--qc-text-soft);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.filter-inline-field .store-filter-picker,
.filter-inline-field select {
    min-width: 0;
    width: auto;
}
.filter-inline-field select {
    width: 180px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 9px;
}
.filter-bar-merged .store-filter-picker summary {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 9px;
}
.filter-bar-merged button,
.filter-bar-merged a {
    width: auto;
    min-height: 34px;
    padding: 0 16px;
}
.toolbar-bulk-panel {
    display: grid;
    gap: 6px;
    width: fit-content;
    min-width: 300px;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--qc-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(251, 253, 255, .98), rgba(246, 250, 255, .96));
}
.toolbar-bulk-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}
.toolbar-bulk-actions {
    justify-self: stretch;
    width: auto;
}
.toolbar-bulk-actions .workspace-action-block {
    min-width: 0;
    width: auto;
}
.toolbar-bulk-actions #btn-approve-all {
    min-width: 180px;
}
.toolbar-bulk-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 12px;
    flex-wrap: wrap;
}
.toolbar-bulk-label {
    color: var(--qc-title);
    font-size: 12px;
    font-weight: 700;
}
.toolbar-bulk-copy {
    color: var(--qc-text-soft);
    font-size: 12px;
    line-height: 1.35;
}
.toolbar-bulk-sep {
    display: inline-block;
    margin: 0 6px;
    color: #9aa8ba;
}
.toolbar-approve-consent {
    margin-top: 0;
    padding: 6px 10px;
    background: #fff;
}
.filter-bar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}
.filter-bar-actions .btn-toolbar-primary,
.filter-bar-actions .btn-toolbar-secondary {
    min-width: 82px;
}
.filter-bar-summary {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    margin-right: 2px;
    border-radius: 999px;
    background: #f5f8fd;
    border: 1px solid #e2eaf5;
    color: var(--qc-title);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
button:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.inline-msg {
    min-height: 20px;
    margin: 6px 0;
    color: #666;
}
.inline-msg:empty {
    display: none;
}
.inline-msg.ok, .card-msg.ok { color: #1cc88a; }
.inline-msg.err, .card-msg.err { color: #e74a3b; }
.review-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.review-card {
    position: relative;
    overflow: hidden;
    background: var(--qc-panel);
    border: 1px solid var(--qc-border);
    border-radius: 20px;
    padding: 14px 14px 12px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, .16), 0 5px 12px rgba(15, 23, 42, .08);
}
.review-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--qc-primary), rgba(96, 165, 250, .16));
}
.review-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 8px;
    margin-bottom: 8px;
}
.review-card-head > div:first-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
}
.review-meta {
    color: var(--qc-text-soft);
    line-height: 1.45;
    font-size: 12px;
}
.review-score {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    align-self: flex-start;
    flex-wrap: wrap;
}
.stars {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 0;
}
.review-section {
    margin-bottom: 0;
}
.review-section h3 {
    margin: 0 0 6px;
    color: var(--qc-title);
    font-size: 13px;
}
.review-text {
    white-space: pre-wrap;
    line-height: 1.55;
    color: var(--qc-text);
    background: linear-gradient(180deg, #fcfdff, #f8fafd);
    border: 1px solid #e7edf5;
    border-radius: 12px;
    padding: 9px 11px;
    max-height: 120px;
    overflow: auto;
}
.review-text-empty {
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 2px 0 0;
    border: 0;
    background: transparent;
    max-height: none;
    overflow: visible;
}
.empty-review-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5edf6;
    color: #64748b;
    font-size: 12px;
    font-style: normal;
}
.reply-label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}
.card-approve-form {
    display: grid;
    gap: 8px;
}
.card-approve-form textarea {
    width: 100%;
    min-height: 96px;
    max-height: 180px;
    padding: 9px 11px;
    border: 1px solid var(--qc-border-strong);
    border-radius: 12px;
    font: inherit;
    resize: vertical;
    background: var(--qc-panel);
    line-height: 1.5;
}
.card-actions {
    display: flex;
    align-items: center;
    gap: 6px 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.card-actions > a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
}
.card-actions > button,
.card-actions > a,
.card-actions > label {
    flex: 0 0 auto;
}
.review-card-main {
    display: grid;
    gap: 14px;
}
.review-section-editor {
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid #dbe4ee;
}
.publish-consent,
.global-approve-consent {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--qc-border);
    border-radius: 12px;
    background: var(--qc-panel-alt);
    color: var(--qc-text-soft);
    font-size: 12px;
    line-height: 1.45;
}
.publish-consent input,
.global-approve-consent input {
    margin-top: 2px;
}
.btn-ignore {
    background: #6b7280;
}
.btn-ignore:hover {
    background: #4b5563;
}
.card-msg {
    margin-top: 6px;
    min-height: 16px;
    font-weight: 600;
    font-size: 12px;
}

@media (min-width: 1900px) {
    .review-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ── Weekly report ── */
.weekly-report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 16px 0;
    padding: 16px 18px;
    background: var(--qc-panel);
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow);
}
.weekly-report-head h3 {
    margin-bottom: 4px;
    color: var(--qc-title);
}
.weekly-report-cache {
    color: var(--qc-text-soft);
    font-size: 12px;
    white-space: nowrap;
}
.weekly-report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0;
}
.weekly-report-panel {
    background: var(--qc-panel);
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    box-shadow: var(--qc-shadow);
    padding: 16px;
}
.weekly-report-panel h3 {
    margin-bottom: 12px;
    color: var(--qc-title);
}
.weekly-report-panel .detail-table {
    min-width: 0;
    width: 100%;
    box-shadow: none;
    border: 1px solid var(--qc-border);
}
.weekly-report-panel .detail-table th {
    width: 46%;
}
.weekly-report-trend {
    margin-top: 16px;
}
.empty-state {
    text-align: center;
    color: var(--qc-text-soft);
    background: var(--qc-panel);
    border: 1px dashed var(--qc-border-strong);
    border-radius: 16px;
    padding: 36px 24px;
    box-shadow: var(--qc-shadow);
}
.error-box {
    background: var(--qc-danger-soft);
    color: #9f1239;
    border: 1px solid #fecdd3;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.failure-guidance strong {
    display: block;
    margin-bottom: 6px;
}
.failure-guidance p {
    margin: 6px 0 0;
    line-height: 1.55;
}
.guidance-box {
    background: #f8fbff;
    color: var(--qc-text);
    border: 1px solid #cfe0f7;
    border-left: 4px solid var(--qc-primary);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 14px 0;
}
.guidance-box h3 {
    margin: 0 0 8px;
    font-size: 16px;
}
.guidance-box p {
    margin: 6px 0 0;
    line-height: 1.6;
}
.guidance-box--compact {
    margin-top: 12px;
}
pre {
    white-space: pre-wrap;
    background: #f8fafc;
    border: 1px solid var(--qc-border);
    border-radius: 10px;
    padding: 10px;
    max-width: 520px;
    overflow-wrap: anywhere;
}
.toolbar,
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.toolbar {
    margin: 14px 0 16px;
    padding: 14px;
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    background: linear-gradient(180deg, #ffffff, #fafcff);
    box-shadow: var(--qc-shadow);
}
.tag-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.tag-grid--wide > div,
.insight-panel,
.analysis-section {
    border: 1px solid var(--qc-border);
    border-radius: var(--qc-radius);
    background: var(--qc-panel);
    box-shadow: var(--qc-shadow);
}
.tag-grid--wide > div {
    padding: 16px;
    overflow-x: auto;
}
.tag-grid--wide h3,
.insight-panel h3,
.analysis-section h3 {
    margin-top: 0;
}
.analysis-section {
    margin-top: 18px;
    padding: 16px;
    overflow-x: auto;
}
.analysis-section-muted {
    background: #fbfcff;
}
.analysis-category-card {
    padding: 12px 0;
    border-top: 1px solid var(--qc-border);
}
.analysis-category-card:first-child {
    border-top: none;
    padding-top: 0;
}
.analysis-category-card header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--qc-title);
}
.action-grid {
    display: grid;
    gap: 12px;
}
.action-card {
    padding: 14px 0;
}
.action-recommendation {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--qc-title);
    line-height: 1.6;
}
.summary-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--qc-title);
    line-height: 1.7;
}
.summary-list li + li {
    margin-top: 6px;
}
.action-trends {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--qc-text-soft);
}
.review-excerpts {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.review-excerpts blockquote {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid rgba(37, 99, 235, .35);
    border-radius: 8px;
    background: var(--qc-panel-alt);
}
.review-excerpts p {
    margin: 0;
    color: var(--qc-text);
    line-height: 1.55;
}
.review-excerpts footer {
    margin-top: 6px;
    color: var(--qc-text-soft);
    font-size: 12px;
}
.insight-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .7fr);
    gap: 18px;
    margin: 16px 0;
    padding: 16px;
}
.insight-panel p {
    margin: 8px 0 0;
    color: var(--qc-text-soft);
    line-height: 1.65;
}
.insight-panel strong {
    color: var(--qc-title);
}
.coverage-meter {
    height: 12px;
    margin: 12px 0 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eef7;
}
.coverage-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--qc-primary), #16a34a);
}
.store-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 10px;
    border: 1px solid var(--qc-border);
    border-radius: 999px;
    background: var(--qc-panel-alt);
    color: var(--qc-title);
    font-size: 12px;
    overflow-wrap: anywhere;
}
.tag-chip small {
    color: #666;
    font-size: 11px;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Login ── */
body.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .16), transparent 34%),
        linear-gradient(135deg, #f0f5ff 0%, #eef4ff 38%, #dbeafe 100%);
    padding: 32px 20px;
}
.login-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    min-height: calc(100vh - 64px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
    gap: 28px;
    align-items: center;
}
.login-brand-panel {
    color: var(--qc-title);
}
.login-brand-card {
    max-width: 620px;
}
.login-brand-logo {
    width: min(100%, 520px);
    height: auto;
    display: block;
    margin-bottom: 22px;
    filter: drop-shadow(0 20px 35px rgba(15, 23, 42, .22));
}
.login-brand-kicker,
.login-box-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.login-brand-kicker {
    color: var(--qc-primary-deep);
    margin-bottom: 10px;
}
.login-brand-card h1 {
    font-size: 38px;
    line-height: 1.15;
    margin-bottom: 14px;
    color: var(--qc-title);
}
.login-brand-copy {
    max-width: 540px;
    color: #334155;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 18px;
}
.login-brand-points {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.login-brand-points li {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(37, 99, 235, .12);
    color: var(--qc-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.login-box {
    background: rgba(255, 255, 255, .98);
    border-radius: 18px;
    padding: 32px 28px;
    width: 100%;
    box-shadow: 0 28px 60px rgba(15, 23, 42, .14);
    border: 1px solid rgba(219, 228, 240, .82);
}
.login-box-lang {
    display: none;
    margin-bottom: 16px;
    justify-content: flex-end;
}
.login-box-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.login-box-logo {
    width: 76px;
    height: auto;
    flex: 0 0 auto;
}
.login-box h2 {
    margin: 2px 0 0;
    font-size: 24px;
    color: #0f172a;
}
.login-box-kicker {
    color: #2563eb;
}
.login-box-note {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 18px;
}
.login-form {
    display: grid;
    gap: 14px;
}
.login-box label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: #475569;
}
.login-box input {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}
.login-box input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.login-box button {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
    font-size: 15px;
    background: #2563eb;
}
.login-box button:hover {
    background: #1d4ed8;
}
.login-box .error {
    color: #b91c1c;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: left;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 12px;
}

@media (max-width: 1080px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .login-brand-card {
        max-width: none;
    }
}

@media (max-width: 760px) {
    body {
        padding-top: 74px;
    }
    .container {
        margin: 0 auto 28px;
        padding: 12px 12px 0;
    }
    .container::before {
        display: none;
    }
    body.nav-open {
        overflow: hidden;
    }
    .nav-overlay {
        display: none;
        inset: 0;
        position: fixed;
        background: rgba(15, 23, 42, .42);
        opacity: 0;
        pointer-events: none;
        z-index: 2147483000;
    }
    .navbar.is-open .nav-overlay {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    .login-brand-panel {
        display: none;
    }
    .login-box-lang {
        display: inline-flex;
    }
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        flex-direction: row;
        padding: 12px 16px;
        align-items: center;
        justify-content: space-between;
        min-height: 74px;
        background: rgba(255, 255, 255, .94);
        color: var(--qc-text);
        backdrop-filter: blur(18px);
        z-index: 2147483001;
        isolation: isolate;
        border-right: 0;
        border-bottom: 1px solid rgba(215, 223, 235, .85);
        box-shadow: 0 4px 20px rgba(15, 23, 42, .04);
    }
    .navbar.is-open {
        z-index: 2147483001;
    }
    .brand-wrap {
        flex-direction: row;
        flex: 1 1 auto;
        gap: 10px;
        min-width: 0;
        align-items: center;
        max-width: none;
    }
    .navbar-top {
        flex-direction: row;
        align-items: center;
    }
    .nav-controls {
        gap: 10px;
        margin-left: auto;
    }
    .lang-switch {
        flex: 0 0 auto;
    }
    .nav-controls .lang-switch {
        display: none;
    }
    .navbar .brand {
        flex-direction: row;
        align-items: center;
        min-width: 0;
        flex: 1 1 auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
    }
    .brand-logo {
        width: 104px;
        flex: 0 0 auto;
        filter: none;
    }
    .brand-title {
        font-size: 13px;
    }
    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        flex: 0 0 auto;
        margin-left: auto;
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .navbar > .brand-wrap > .user-group-badge,
    .navbar-top .brand-wrap > .user-group-badge {
        display: none;
    }
    .nav-drawer {
        position: fixed;
        top: 86px;
        left: 12px;
        right: 12px;
        width: auto;
        min-width: 0;
        max-width: none;
        height: auto;
        max-height: calc(100vh - 100px);
        max-height: calc(100dvh - 100px);
        border: 1px solid rgba(215, 223, 235, .95);
        border-radius: 20px;
        background: #ffffff;
        box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
        overflow-y: auto;
        overflow-x: hidden;
        isolation: isolate;
        z-index: 2147483002;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px) scale(.98);
        transform-origin: top right;
        transition: transform .24s ease, opacity .18s ease, visibility .18s ease;
        min-height: 0;
    }
    .nav-drawer ul {
        width: 100%;
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
        margin-top: 0;
        padding: 14px;
        max-width: none;
        overflow-y: auto;
        overflow-x: hidden;
        max-height: calc(100dvh - 100px);
        border: 0;
        border-radius: 0;
        background: #ffffff;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: none;
        position: relative;
        z-index: 1;
    }
    .workspace-head {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 16px 16px;
    }
    .workspace-side {
        gap: 12px;
    }
    .workspace-actions {
        grid-template-columns: 1fr;
    }
    .nav-section-title {
        margin: 4px 0 0;
        padding: 2px 2px 0;
        color: #94a3b8;
    }
    .nav-footer-item {
        margin-top: 4px;
        padding-top: 10px;
        border-top-color: var(--qc-border);
    }
    .nav-user-card {
        background: #f8fbff;
        border-color: var(--qc-border);
    }
    .nav-user-name {
        color: var(--qc-title);
    }
    .nav-user-role {
        color: var(--qc-text-soft);
    }
    .nav-drawer ul li {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }
    .navbar.is-open .nav-drawer {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }
    .navbar.is-open .nav-drawer ul {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .navbar.is-open .nav-toggle span:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }
    .navbar.is-open .nav-toggle span:nth-child(2) {
        opacity: 0;
    }
    .navbar.is-open .nav-toggle span:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg);
    }
    .navbar ul a,
    .navbar .logout-button {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        padding: 10px 14px;
        border-radius: 12px;
        background: #f8fafc;
        border: 1px solid rgba(226, 232, 240, .9);
        color: #243244;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
        font-size: 14px;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }
    .navbar ul a:hover,
    .navbar .logout-button:hover {
        background: #eef4ff;
        border-color: rgba(37, 99, 235, .18);
    }
    .mobile-nav-meta {
        display: block;
        padding: 0 2px 14px;
        margin-bottom: 6px;
        border-bottom: 1px solid rgba(215, 223, 235, .9);
    }
    .mobile-nav-head {
        gap: 10px;
        align-items: flex-start;
        flex-direction: column;
    }
    .mobile-nav-title {
        font-size: 16px;
        line-height: 1.35;
        max-width: 100%;
    }
    .mobile-nav-user {
        margin-top: 4px;
        font-size: 13px;
    }
    .mobile-nav-meta .user-group-badge {
        min-height: 24px;
        width: auto;
        max-width: 100%;
        padding: 0 10px;
        font-size: 11px;
    }
    .brand-logo {
        width: 80px;
        flex: 0 0 auto;
    }
    .brand-title {
        font-size: 14px;
        line-height: 1.2;
        color: #243244;
    }
    .brand-version {
        color: #64748b;
    }
    .container {
        width: 100%;
        margin: 14px auto 28px;
        padding: 0 10px;
    }
    .filter-bar {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
        padding: 12px;
        align-items: stretch;
    }
    .filter-bar > * {
        min-width: 0;
        max-width: 100%;
    }
    .store-filter-menu {
        position: static;
        width: 100%;
        max-height: 280px;
        margin-top: 8px;
        box-shadow: none;
    }
    .filter-bar button,
    .filter-bar a {
        justify-content: center;
        padding-left: 12px;
        padding-right: 12px;
    }
    h2 {
        font-size: 25px;
        margin: 6px 0 10px;
    }
    .stat-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .card {
        padding: 12px 12px 10px;
        border-radius: 12px;
    }
    .card .num {
        font-size: 24px;
    }
    .workspace-head {
        display: grid;
        width: auto;
        gap: 10px;
        margin-bottom: 12px;
        padding: 14px 12px;
        border-radius: 14px;
        align-items: stretch;
    }
    .workspace-head-top {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
    }
    .workspace-head h2 {
        font-size: 25px;
    }
    .workspace-head-metrics {
        order: 3;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-top: 8px;
        border-top: 1px solid #edf2f8;
    }
    .workspace-side {
        display: grid;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 12px;
        border-radius: 14px;
    }
    .flash-message {
        padding: 11px 14px;
        border-radius: 14px;
    }
    .workspace-kicker {
        min-height: 24px;
        padding: 0 9px;
        font-size: 11px;
    }
    .sync-note {
        font-size: 12px;
    }
    .workspace-guide {
        margin-top: 10px;
        padding: 11px 12px;
        border-radius: 11px;
        font-size: 12px;
    }
    .workspace-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: flex-start;
        gap: 8px;
        width: 100%;
        padding: 0;
        border: 0;
        background: transparent;
    }
    .workspace-action-block {
        justify-items: start;
        width: 100%;
        min-width: 0;
        padding: 10px 12px;
        border-radius: 12px;
        border: 1px solid #dde6f2;
        background: #f8fbff;
    }
    .workspace-action-note {
        width: 100%;
    }
    .job-status-note {
        margin: 4px 0 10px;
        padding: 10px 11px;
    }
    .review-list {
        gap: 10px;
        margin-top: 10px;
        grid-template-columns: 1fr;
    }
    .review-card {
        padding: 13px 12px 12px;
        border-radius: 14px;
    }
    .review-card-head {
        grid-template-columns: 1fr;
        gap: 10px;
        padding-bottom: 10px;
        margin-bottom: 12px;
    }
    .review-card-head > div:first-child {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .review-score {
        width: 100%;
        justify-content: space-between;
    }
    .review-text {
        padding: 11px 12px;
        border-radius: 10px;
    }
    .card-approve-form textarea {
        min-height: 104px;
        padding: 10px;
        border-radius: 10px;
    }
    .card-actions {
        gap: 8px;
        margin-top: 10px;
    }
    .card-actions > * {
        flex: 1 1 100%;
    }
    .metric-bar,
    .metric-bar-inline {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        white-space: normal;
    }
    .metric-pill {
        display: grid;
        gap: 2px;
        padding: 8px 10px;
        border-radius: 12px;
        background: #fff;
        border: 1px solid #e5edf6;
    }
    .metric-pill strong {
        font-size: 18px;
    }
    .dashboard-alert {
        padding: 10px 12px;
        border-radius: 12px;
    }
    .dashboard-alert-compact .dashboard-alert-main {
        display: grid;
        align-items: start;
        gap: 4px;
    }
    .dashboard-alert-copy {
        display: grid;
        gap: 4px;
    }
    .dashboard-job-strip {
        padding: 10px 12px;
        border-radius: 12px;
    }
    .workspace-toolbar {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
    .filter-bar-merged {
        grid-template-columns: 1fr;
        width: auto;
    }
    .filter-bar-main-inline {
        grid-template-columns: 1fr;
    }
    .filter-inline-field {
        grid-template-columns: 1fr;
        gap: 6px;
        align-items: stretch;
    }
    .filter-inline-field select,
    .filter-inline-field .store-filter-picker,
    .filter-inline-field .store-filter-picker summary {
        width: 100%;
    }
    .toolbar-bulk-top {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .toolbar-bulk-panel {
        width: auto;
        min-width: 0;
    }
    .toolbar-bulk-actions,
    .toolbar-bulk-actions .workspace-action-block,
    .toolbar-bulk-actions #btn-approve-all {
        width: 100%;
        min-width: 0;
    }
    .tag-grid {
        grid-template-columns: 1fr;
    }
    .insight-panel {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }
    .weekly-report-head {
        flex-direction: column;
        padding: 14px 12px;
    }
    .weekly-report-cache {
        white-space: normal;
    }
    .weekly-report-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .weekly-report-panel {
        padding: 12px;
    }
    .detail-table,
    .weekly-report-panel .detail-table {
        table-layout: auto;
    }
    .detail-table th,
    .detail-table td {
        display: block;
        width: 100%;
    }
    .detail-table th {
        padding-bottom: 4px;
        border-bottom: 0;
    }
    .detail-table td {
        padding-top: 0;
    }
    .login-box {
        padding: 24px 20px;
    }
    .login-box-head {
        align-items: flex-start;
    }
    .login-box-logo {
        width: 64px;
    }
}
