:root {
    --bg: #f3f6fb;
    --bg-elevated: #ffffff;
    --bg-subtle: #eef3f8;
    --line: #d9e2ec;
    --line-strong: #c0cddb;
    --text: #111827;
    --text-soft: #4b5563;
    --text-muted: #6b7280;
    --primary: #1e40af;
    --primary-soft: #e7efff;
    --accent: #f59e0b;
    --success: #0f9d72;
    --danger: #d14343;
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.05);
    --container: 1480px;
    --z-sticky: 20;
    --z-modal: 50;
    --font-ui: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    --font-code: "Fira Code", "SFMono-Regular", monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(30, 64, 175, 0.06), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
    color: var(--text);
    font-family: var(--font-ui);
}

[hidden] {
    display: none !important;
}

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

button {
    border: 0;
}

.auth-shell,
.app-shell {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

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

.auth-card,
.topbar,
.panel,
.modal-content,
.admin-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.auth-card {
    width: min(100%, 1160px);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
    gap: 0;
    padding: 0;
    border-radius: 34px;
    overflow: hidden;
    border-color: rgba(148, 163, 184, 0.18);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.09);
}

.auth-copy h1,
.workspace-copy h1,
.panel-header h3,
.modal-header h2,
.admin-card-header h4 {
    font-family: var(--font-ui);
    letter-spacing: -0.03em;
}

.auth-copy h1 {
    margin-top: 12px;
    max-width: 10ch;
    font-size: clamp(2rem, 3.1vw, 3.3rem);
    line-height: 1.04;
    color: #0f172a;
}

.auth-copy p:last-child {
    margin-top: 14px;
    color: rgba(15, 23, 42, 0.72);
    line-height: 1.85;
    max-width: 34rem;
}

.auth-showcase {
    min-height: 720px;
    padding: 40px 38px 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(circle at top right, rgba(30, 64, 175, 0.1), transparent 26%),
        radial-gradient(circle at bottom left, rgba(15, 23, 42, 0.05), transparent 24%),
        linear-gradient(180deg, #f9fbff 0%, #eef4fb 100%);
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.auth-showcase::after {
    content: "";
    position: absolute;
    inset: auto -10% -16% auto;
    width: 360px;
    height: 360px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(30, 64, 175, 0.16)),
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.24) 0,
            rgba(255, 255, 255, 0.24) 1px,
            transparent 1px,
            transparent 10px
        );
    transform: rotate(-10deg);
    pointer-events: none;
}

.auth-showcase-top {
    position: relative;
    z-index: 1;
}

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

.auth-brand-mark {
    width: min(260px, 62%);
}

.auth-brand-mark img {
    width: 100%;
    display: block;
}

.auth-brand-badge {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.7);
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.auth-feature-list {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 26px;
}

.auth-feature-card {
    display: grid;
    gap: 6px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.04);
}

.auth-feature-card strong {
    color: #0f172a;
    font-size: 1rem;
}

.auth-feature-card span {
    color: rgba(15, 23, 42, 0.68);
    line-height: 1.65;
    font-size: 0.92rem;
}

.auth-feature-card:last-child {
    grid-column: 1 / -1;
}

.auth-brand-footer {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    color: rgba(15, 23, 42, 0.62);
    font-size: 0.92rem;
    line-height: 1.7;
}

.auth-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 42px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.auth-panel-brand {
    margin-bottom: 28px;
}

.auth-panel-brand strong {
    display: block;
    margin-top: 6px;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--text);
}

.auth-panel-subtitle {
    display: block;
    margin-top: 10px;
    color: var(--text-soft);
    line-height: 1.7;
}

.auth-tabs,
.input-tabs,
.board-tabs {
    display: inline-flex;
    gap: 8px;
    padding: 5px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
}

.auth-tabs {
    margin-top: 0;
    align-self: flex-start;
    background: #f3f7fb;
}

.auth-tab-btn,
.tab-btn,
.library-tab-btn {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.auth-tab-btn:hover,
.auth-tab-btn.active,
.tab-btn:hover,
.tab-btn.active,
.library-tab-btn:hover,
.library-tab-btn.active {
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.auth-panel {
    display: none;
    margin-top: 22px;
}

.auth-panel.active {
    display: grid;
    gap: 10px;
}

.auth-submit {
    margin-top: 8px;
    min-height: 52px;
    border-radius: 16px;
}

.field-label,
.section-kicker,
.toolbar-note,
.helper-copy,
.user-chip-label,
.status-chip {
    color: var(--text-muted);
}

.field-label {
    display: inline-block;
    margin-bottom: 2px;
    font-size: 0.84rem;
    font-weight: 600;
}

.section-kicker {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    font-family: var(--font-code);
}

.auth-input,
.url-input,
.batch-textarea,
.toolbar-search-input,
.sort-controls select {
    width: 100%;
    min-height: 48px;
    padding: 13px 15px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: #f9fbfd;
    color: var(--text);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.auth-input:focus,
.url-input:focus,
.batch-textarea:focus,
.toolbar-search-input:focus,
.sort-controls select:focus,
.btn:focus-visible,
.btn-small:focus-visible,
.tab-btn:focus-visible,
.auth-tab-btn:focus-visible,
.library-tab-btn:focus-visible,
.modal-close:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

.app-shell {
    padding: 18px 0 32px;
}

.topbar {
    position: sticky;
    top: 10px;
    z-index: var(--z-sticky);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 18px;
}

.topbar-left,
.topbar-right,
.brand-logo,
.input-group,
.batch-buttons,
.sort-controls,
.status-chip,
.user-chip,
.panel-header-row,
.board-tabs,
.import-preview-head,
.action-buttons {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 14px;
}

.topbar-right {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.brand-logo {
    gap: 10px;
}

.brand-logo-mark {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.brand-logo-mark svg {
    width: 56px;
    height: 56px;
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 0.88;
    font-family: "Fira Sans", sans-serif;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.brand-line-top {
    font-size: clamp(1.18rem, 1.5vw, 1.7rem);
}

.brand-line-bottom {
    font-size: clamp(1.12rem, 1.45vw, 1.62rem);
}

.brand-star {
    margin-left: 3px;
    font-size: 0.6em;
    vertical-align: top;
}

.brand-logo-dark .brand-logo-mark {
    background: #0b0b0b;
}

.brand-logo-dark rect {
    fill: #0b0b0b;
}

.brand-logo-dark path {
    fill: #ffffff;
}

.brand-logo-dark .brand-line {
    color: #0b0b0b;
}

.workspace-copy h1 {
    font-size: 1.08rem;
    line-height: 1.1;
}

.workspace-subtitle {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-family: var(--font-code);
}

.status-chip,
.user-chip {
    gap: 10px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    font-size: 0.88rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.role-badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.role-badge,
.status-admin {
    background: rgba(30, 64, 175, 0.12);
    color: var(--primary);
}

.status-member {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-soft);
}

.status-active {
    background: rgba(15, 157, 114, 0.12);
    color: var(--success);
}

.status-paused {
    background: rgba(209, 67, 67, 0.12);
    color: var(--danger);
}

.sync-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.08) 0%, rgba(59, 130, 246, 0.06) 100%);
    border: 1px solid rgba(30, 64, 175, 0.16);
}

.sync-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sync-banner-copy strong {
    font-size: 0.95rem;
}

.sync-banner-copy span {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.sync-banner-progress {
    min-width: 240px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-banner-track,
.progress-bar {
    flex: 1 1 auto;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.26);
}

.sync-banner-fill,
.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary) 0%, #3b82f6 100%);
    transition: width 220ms ease;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 14px;
}

.panel,
.admin-card {
    padding: 18px;
    border-radius: 18px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.panel-header h3 {
    margin-top: 6px;
    font-size: 1.24rem;
    line-height: 1.08;
}

.workspace-toolbar {
    display: grid;
    gap: 14px;
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.94) 100%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

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

.workspace-toolbar-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 2px;
}

.workspace-toolbar-meta {
    display: grid;
    gap: 10px;
    min-width: 320px;
}

.workspace-toolbar-searchbar {
    flex: 1 1 640px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.column-selector {
    position: relative;
    flex: 0 0 auto;
}

.column-selector-trigger {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.column-selector-trigger-icon {
    position: relative;
    min-width: 38px;
    min-height: 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    gap: 0;
    border-radius: 12px;
}

.column-selector-trigger-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.column-selector.is-open .column-selector-trigger {
    border-color: rgba(30, 64, 175, 0.28);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.08), 0 10px 24px rgba(148, 163, 184, 0.14);
}

.column-selector-count {
    min-width: 18px;
    min-height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font-size: 0.64rem;
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
    position: absolute;
    top: -6px;
    right: -6px;
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.column-selector-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, 82vw);
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    z-index: calc(var(--z-sticky) + 1);
    backdrop-filter: blur(16px);
}

.actions-header-cell {
    overflow: visible;
}

.actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.column-selector-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.column-selector-options {
    display: grid;
    gap: 8px;
}

.column-selector-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
}

.column-selector-option input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.search-shell {
    flex: 1 1 520px;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.search-shell:focus-within,
.search-shell.search-shell-active {
    border-color: rgba(30, 64, 175, 0.28);
    box-shadow:
        0 0 0 4px rgba(30, 64, 175, 0.08),
        0 10px 24px rgba(148, 163, 184, 0.14);
}

.search-shell-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex: 0 0 auto;
}

.search-shell-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

.toolbar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: auto;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    font-size: 0.95rem;
}

.toolbar-search-input:focus {
    border: none;
    box-shadow: none;
}

.search-clear-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-subtle);
    color: var(--text-soft);
    cursor: pointer;
    white-space: nowrap;
}

.search-clear-btn svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: currentColor;
}

.toolbar-reset-btn {
    min-width: 106px;
    flex: 0 0 auto;
}

.sort-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1.15fr) minmax(220px, 1.2fr) minmax(220px, 1.2fr) minmax(220px, 1.2fr) minmax(140px, 0.9fr) minmax(124px, 0.7fr);
    gap: 10px;
    width: 100%;
}

.toolbar-filter {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.toolbar-filter-multiselect {
    position: relative;
}

.toolbar-filter-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.multi-select-trigger {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.toolbar-filter-multiselect.is-open .multi-select-trigger,
.toolbar-filter-multiselect.has-selection .multi-select-trigger {
    border-color: rgba(30, 64, 175, 0.22);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

.multi-select-summary {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-select-count {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.1);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 700;
}

.multi-select-caret {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex: 0 0 auto;
}

.multi-select-caret svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

.toolbar-filter-multiselect.is-open .multi-select-caret {
    color: var(--primary);
    transform: rotate(180deg);
}

.multi-select-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 20;
    width: min(360px, 100%);
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
}

.multi-select-menu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.multi-select-menu-head strong {
    font-size: 0.88rem;
}

.multi-select-clear {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg-subtle);
    color: var(--text-soft);
    font-weight: 700;
    cursor: pointer;
}

.multi-select-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.multi-select-option {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: #ffffff;
    cursor: pointer;
}

.multi-select-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.multi-select-option span {
    font-size: 0.88rem;
    color: var(--text);
}

.sort-controls select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding-block: 10px;
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.toolbar-mini-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.toolbar-mini-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.range-separator {
    color: var(--text-muted);
    font-weight: 700;
}

.tab-content {
    display: none;
    margin-top: 14px;
}

.tab-content.active {
    display: block;
}

.input-group {
    gap: 10px;
}

.batch-input-group {
    display: grid;
    gap: 10px;
}

.batch-textarea {
    min-height: 156px;
    resize: vertical;
    line-height: 1.6;
}

.batch-buttons {
    gap: 10px;
}

.helper-copy {
    margin-top: 10px;
    font-size: 0.84rem;
    line-height: 1.55;
}

.import-preview {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
}

.import-preview-head {
    gap: 8px;
    font-size: 0.9rem;
}

.import-preview-head strong {
    font-size: 1rem;
    color: var(--text);
}

.import-preview-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    list-style: none;
}

.import-preview-list li {
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 0.83rem;
    word-break: break-all;
}

.btn {
    min-width: 112px;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.btn:hover,
.btn-small:hover,
.modal-close:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--text);
    color: #ffffff;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: #1f2937;
}

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

.btn-secondary:hover,
.btn-ghost:hover {
    background: #e7edf5;
}

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

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.btn:disabled,
.btn-small:disabled {
    cursor: not-allowed;
    opacity: 0.66;
    transform: none;
}

.toolbar-note {
    line-height: 1.55;
    font-size: 0.84rem;
    max-width: 640px;
}

.results-summary,
.active-filter-summary {
    font-size: 0.84rem;
    line-height: 1.5;
}

.results-summary {
    font-weight: 700;
    color: var(--text);
}

.active-filter-summary {
    color: var(--text-soft);
}

.tab-badge {
    min-width: 24px;
    padding: 0 8px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text);
    font-size: 0.76rem;
}

.table-container,
.admin-table-wrap {
    margin-top: 12px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #ffffff;
}

.pagination-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
}

.pagination-meta {
    min-width: 152px;
    display: grid;
    gap: 2px;
    text-align: center;
}

.pagination-meta strong {
    font-size: 0.94rem;
}

.pagination-meta span {
    font-size: 0.8rem;
    color: var(--text-soft);
}

.pagination-btn {
    min-width: 96px;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 0.84rem;
    white-space: nowrap;
}

.pagination-size label {
    font-weight: 600;
}

.pagination-size-select {
    min-width: 84px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    outline: none;
}

.pagination-size-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.products-table,
.admin-table {
    width: 100%;
    min-width: 1320px;
    border-collapse: collapse;
}

.products-table {
    table-layout: fixed;
}

.products-table .col-product-name {
    width: 26%;
}

.products-table .col-category {
    width: 7%;
}

.products-table .col-price {
    width: 6.5%;
}

.products-table .col-sales-total {
    width: 7%;
}

.products-table .col-sales-daily,
.products-table .col-sales-growth,
.products-table .col-shop-daily {
    width: 6.5%;
}

.products-table .col-gmv-daily,
.products-table .col-shop-total {
    width: 7%;
}

.products-table .col-created,
.products-table .col-updated {
    width: 8%;
}

.products-table .col-actions {
    width: 8%;
}

.products-table th,
.products-table td,
.admin-table th,
.admin-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #edf1f5;
    vertical-align: middle;
}

.products-table th,
.admin-table th {
    background: #f9fbfd;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: "Fira Code", monospace;
}

.products-table th {
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.products-table tbody tr:hover,
.admin-table tbody tr:hover {
    background: #f8fbff;
}

.table-empty {
    text-align: center;
    padding: 56px 24px;
    color: #6b7280;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.product-thumb-link {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #f3f6fb;
    flex: 0 0 auto;
    display: block;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-thumb-link:hover,
.product-link:hover {
    transform: translateY(-1px);
}

.product-thumb-link:hover {
    border-color: rgba(30, 64, 175, 0.24);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.product-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-thumb-fallback {
    display: grid;
    place-items: center;
    color: var(--text-soft);
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(135deg, #eef3f8 0%, #e1e9f5 100%);
}

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

.product-link {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: var(--text);
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-link:hover {
    color: var(--primary);
}

.product-meta {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.action-buttons {
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.btn-small {
    min-width: 58px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
}

.table-action-btn {
    min-width: auto;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 0.8rem;
    line-height: 1;
}

.products-table td[data-col="price"],
.products-table td[data-col="product_total_sales"],
.products-table td[data-col="daily_product_sales"],
.products-table td[data-col="daily_product_sales_growth"],
.products-table td[data-col="daily_gmv"],
.products-table td[data-col="shop_total_sales"],
.products-table td[data-col="daily_shop_sales"],
.products-table td[data-col="created_at"],
.products-table td[data-col="last_update"] {
    white-space: nowrap;
}

.products-table td:last-child {
    padding-right: 14px;
}

.is-column-hidden {
    display: none;
}

.btn-info:hover {
    background: var(--primary-soft);
    border-color: rgba(30, 64, 175, 0.24);
}

.btn-danger:hover {
    background: #fff2f2;
    border-color: rgba(209, 67, 67, 0.22);
}

.btn-primary-soft {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(30, 64, 175, 0.16);
}

.btn-primary-soft:hover {
    background: #dbe7ff;
}

.btn-selected {
    background: rgba(15, 157, 114, 0.1);
    color: var(--success);
    border-color: rgba(15, 157, 114, 0.18);
}

.positive {
    color: var(--success);
    font-weight: 700;
}

.negative {
    color: var(--danger);
    font-weight: 700;
}

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

.batch-progress {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
}

.progress-text {
    margin-top: 8px;
    color: var(--text-soft);
}

.admin-board {
    margin-top: 14px;
}

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

.admin-card-wide {
    grid-column: 1 / -1;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.admin-card-header h4 {
    margin-top: 6px;
    font-size: 1.12rem;
}

.admin-card-side {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.admin-card-note {
    max-width: 460px;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.55;
    text-align: right;
}

.admin-status-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.admin-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 0.8fr auto;
    gap: 10px;
    margin-top: 14px;
}

.admin-product-cell {
    min-width: 360px;
}

.admin-category-select {
    width: 100%;
    min-width: 180px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
    color: var(--text);
    outline: none;
}

.admin-category-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.inline-code {
    font-family: "Fira Code", monospace;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.06);
    padding: 6px 8px;
    border-radius: 8px;
}

.current-user-tag {
    display: inline-flex;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.08);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 700;
}

.status-queued {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.status-processing {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.status-completed {
    background: rgba(15, 157, 114, 0.12);
    color: var(--success);
}

.status-manual {
    background: rgba(30, 64, 175, 0.12);
    color: var(--primary);
}

.status-failed {
    background: rgba(209, 67, 67, 0.12);
    color: var(--danger);
}

.status-rule-only {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-soft);
}

.loading {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    background: rgba(243, 246, 251, 0.72);
    backdrop-filter: blur(8px);
}

.spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(30, 64, 175, 0.14);
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.message {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 45;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.message.success {
    border-color: rgba(15, 157, 114, 0.28);
}

.message.error {
    border-color: rgba(209, 67, 67, 0.28);
}

.message.warning,
.message.info {
    border-color: rgba(30, 64, 175, 0.2);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.36);
    backdrop-filter: blur(8px);
}

.modal-content {
    width: min(100%, 1080px);
    max-height: 92vh;
    overflow: auto;
    border-radius: 24px;
}

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

.modal-body {
    padding: 20px 22px 24px;
}

.modal-close {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    cursor: pointer;
}

.chart-container {
    height: 390px;
}

.trend-info {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
}

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

.stat-item {
    padding: 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.stat-value {
    display: block;
    margin-top: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

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

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

    .admin-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-card-side {
        justify-items: start;
    }

    .admin-card-note {
        text-align: left;
    }

    .admin-status-summary {
        justify-content: flex-start;
    }

    .workspace-toolbar-top,
    .workspace-toolbar-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .workspace-toolbar-searchbar {
        justify-content: stretch;
    }

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

    .workspace-toolbar-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 820px) {
    .auth-shell,
    .app-shell {
        width: min(calc(100% - 20px), var(--container));
    }

    .auth-card {
        grid-template-columns: 1fr;
        padding: 0;
        border-radius: 24px;
    }

    .auth-showcase {
        min-height: auto;
        padding: 24px 20px;
    }

    .auth-brand-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-brand-mark {
        width: min(240px, 74%);
    }

    .auth-feature-list {
        grid-template-columns: 1fr;
    }

    .auth-form-panel {
        padding: 24px 20px 22px;
    }

    .auth-panel-brand {
        margin-bottom: 22px;
    }

    .app-shell {
        padding-top: 12px;
    }

    .topbar,
    .sync-banner,
    .input-group,
    .batch-buttons,
    .topbar-right,
    .board-tabs,
    .input-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-tabs {
        width: 100%;
        align-self: stretch;
    }

    .topbar-left {
        align-items: flex-start;
    }

    .sync-banner-progress {
        min-width: 0;
        width: 100%;
    }

    .workspace-toolbar-searchbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-controls {
        grid-template-columns: 1fr;
    }

    .multi-select-menu {
        position: static;
        width: 100%;
        margin-top: 10px;
    }

    .multi-select-options {
        grid-template-columns: 1fr;
    }

    .workspace-toolbar-foot,
    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-size {
        justify-content: space-between;
    }

    .status-chip,
    .user-chip,
    .btn,
    .btn-small,
    .sort-controls select,
    .auth-tab-btn,
    .library-tab-btn,
    .tab-btn {
        width: 100%;
    }

    .search-shell {
        max-width: none;
        width: 100%;
    }

    .toolbar-filter,
    .toolbar-filter-compact {
        width: 100%;
    }

    .search-clear-btn {
        width: 34px;
    }

    .pagination-meta {
        text-align: left;
    }

    .brand-logo-mark,
    .brand-logo-mark svg {
        width: 52px;
        height: 52px;
    }

    .message {
        left: 10px;
        right: 10px;
        min-width: 0;
        max-width: none;
    }

    .chart-container {
        height: 300px;
    }

    .product-cell {
        min-width: 220px;
        align-items: flex-start;
    }

    .product-link {
        max-width: 220px;
    }

    .trend-stats {
        grid-template-columns: 1fr;
    }

    .auth-copy h1 {
        font-size: 2rem;
    }
}
