/* ===== Layout: Login Page ===== */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-app);
}

.login-brand-section {
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 50%, #8B5CF6 100%);
    color: white;
    padding: var(--space-12) var(--space-16);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.login-brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-brand-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.login-brand-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.login-brand-logo {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.login-brand-name {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
}

.login-brand-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    max-width: 480px;
}

.login-brand-headline {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: white;
}

.login-brand-subhead {
    font-size: 15px;
    font-weight: 500;
    opacity: 0.85;
    letter-spacing: 0.05em;
}

.login-brand-description {
    font-size: 15px;
    line-height: 1.7;
    opacity: 0.92;
    font-weight: 400;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.login-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--t-base);
}

.login-feature:hover {
    background: rgba(255,255,255,0.14);
    transform: translateX(4px);
}

.login-feature-icon {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.login-brand-bottom {
    position: relative;
    z-index: 1;
    font-size: 12px;
    opacity: 0.7;
}

.login-form-section {
    padding: var(--space-16);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 520px;
}

.login-form-header {
    margin-bottom: var(--space-10);
}

.login-form-eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-3);
}

.login-form-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}

.login-form-sub {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.login-form .input {
    height: 48px;
    font-size: 15px;
}

.login-form .btn {
    height: 48px;
    font-size: 15px;
    font-weight: 700;
}

.login-checkbox-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.login-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

.login-form-error {
    display: none;
    padding: var(--space-3) var(--space-4);
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-md);
    color: #991B1B;
    font-size: 13px;
    font-weight: 500;
}

.login-form-error.show { display: block; }

.login-footer {
    margin-top: var(--space-10);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; }
    .login-brand-section { padding: var(--space-8); min-height: 320px; }
    .login-brand-headline { font-size: 2.5rem; }
    .login-form-section { padding: var(--space-8); max-width: 100%; }
}

/* ===== Layout: App ===== */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
    transition: grid-template-columns 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.app-layout.sidebar-collapsed {
    grid-template-columns: 0 1fr;
}

/* サイドバー折りたたみトグル */
.sidebar-toggle {
    position: fixed;
    top: 16px;
    left: var(--sidebar-w);
    z-index: 100;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: left 240ms cubic-bezier(0.16, 1, 0.3, 1), background var(--t-fast);
    transform: translateX(-50%);
}
.sidebar-toggle:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}
.app-layout.sidebar-collapsed .sidebar-toggle {
    left: 0;
    transform: translateX(0);
}

/* Sidebar */
.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: var(--space-6) var(--space-4);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-layout.sidebar-collapsed .sidebar {
    width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-2);
    margin-bottom: var(--space-8);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 8px -2px rgb(79 70 229 / 0.4);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.sidebar-brand-sub {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
    border: 1px solid transparent;
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    font-weight: 600;
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Main content */
.main {
    padding: var(--space-6) var(--space-6);
    max-width: 100%;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.main-header {
    margin-bottom: var(--space-8);
}

.main-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

.main-breadcrumb-sep {
    color: var(--border-strong);
}

.main-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
}

.main-title-block { flex: 1; }

.main-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}

.main-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.main-actions {
    display: flex;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* Page sections */
.section {
    margin-bottom: var(--space-10);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.005em;
}

.section-link {
    font-size: 13px;
    color: var(--brand-primary);
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--t-fast);
}
.section-link:hover { opacity: 0.7; }

/* Empty state */
.empty-state {
    padding: var(--space-12);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 14px;
    border: 1.5px dashed var(--border-default);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.empty-state-icon {
    font-size: 32px;
    margin-bottom: var(--space-3);
    opacity: 0.4;
}

/* Progress bar */
.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5 0%, #8B5CF6 100%);
    border-radius: var(--radius-full);
    transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-8);
    background: var(--bg-card);
    text-align: center;
    transition: all var(--t-base);
    cursor: pointer;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
}

.dropzone-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    transition: all var(--t-base);
}

.dropzone:hover .dropzone-icon {
    background: white;
    transform: scale(1.05);
}

.dropzone-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.dropzone-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.dropzone-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

.dropzone-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Supplier card (extract result) */
.supplier-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--t-fast);
}

.supplier-pill:hover {
    border-color: var(--brand-primary);
}

.supplier-pill.active {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.supplier-pill .count {
    background: rgba(255,255,255,0.25);
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
}

.supplier-pill:not(.active) .count {
    background: var(--bg-muted);
}

/* ===== Review page: スプレッドシート型レイアウト ===== */
.sheet-layout {
    display: block;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 400px;
    margin-top: var(--space-4);
}
.sheet-layout.with-pdf {
    display: grid;
    grid-template-columns: minmax(420px, 40vw) 1fr;
    gap: 0;
}

.sheet-main {
    display: block;
    background: var(--bg-card);
}

.sheet-layout.with-pdf .sheet-main {
    border-left: 1px solid var(--border-default);
    overflow: hidden;
}

/* スプレッドシート用ツールバー */
.sheet-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-default);
    flex-wrap: wrap;
}

.sheet-toolbar-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.sheet-toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-default);
}

.sheet-toolbar-spacer { flex: 1; }

/* ページコントロール（◀ ▶ + シークバー） */
.page-control {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 320px;
}

.page-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-default);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 700;
    transition: all var(--t-fast);
}
.page-btn:hover:not(:disabled) {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.page-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-default);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}
.page-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--brand-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79,70,229,0.4);
    transition: transform var(--t-fast);
}
.page-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.page-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--brand-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.page-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 72px;
    text-align: center;
    font-feature-settings: "tnum";
}

/* スプレッドシートテーブル */
.sheet-table-wrap {
    flex: 1;
    overflow: auto;
    background: var(--bg-card);
}

.sheet-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    table-layout: fixed;
}

.sheet-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-muted);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
    font-weight: 700;
    padding: var(--space-2) var(--space-2);
    text-align: left;
    border-bottom: 1px solid var(--border-default);
    border-right: 1px solid var(--border-light);
    white-space: nowrap;
}

.sheet-table thead th:last-child { border-right: none; }

.sheet-table tbody td {
    padding: 0;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    vertical-align: middle;
    background: var(--bg-card);
}
.sheet-table tbody td:last-child { border-right: none; }

.sheet-table tbody tr:hover td { background: var(--bg-hover); }

.sheet-cell-input {
    width: 100%;
    height: 32px;
    padding: 0 var(--space-2);
    border: 0;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    transition: background var(--t-fast);
}
.sheet-cell-input:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
    background: white;
    border-radius: 2px;
}
.sheet-cell-input:hover:not(:focus) { background: rgba(0,0,0,0.02); }

.sheet-cell-select {
    width: 100%;
    height: 32px;
    padding: 0 var(--space-1);
    border: 0;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
}
.sheet-cell-select:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: -2px;
    background: white;
}

.sheet-cell-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
}

.sheet-cell-text {
    padding: 0 var(--space-2);
    height: 32px;
    display: flex;
    align-items: center;
    font-size: 13px;
}
.sheet-cell-text.text-right { justify-content: flex-end; }
.sheet-cell-text.text-center { justify-content: center; }
.sheet-cell-text.text-mono { font-family: 'JetBrains Mono', Menlo, monospace; }

.sheet-table tr.row-disabled td { opacity: 0.4; }
.sheet-table tr.row-warn td { background: rgba(245, 158, 11, 0.06); }

/* セクションヘッダ（加工指示などの間に挟む） */
.sheet-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-muted));
    border-bottom: 1px solid var(--border-default);
    border-top: 1px solid var(--border-default);
    position: sticky;
    top: 0;
    z-index: 1;
}
.sheet-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* PDF パネル（左側） */
.sheet-pdf {
    background: #1F2937;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #111827;
}

@media (max-width: 1024px) {
    .sheet-layout.with-pdf {
        grid-template-columns: 1fr;
    }
    .sheet-pdf {
        position: static;
        height: 60vh;
        border-right: 0;
        border-bottom: 1px solid #111827;
    }
}
.sheet-pdf-header {
    padding: var(--space-3) var(--space-4);
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    border-bottom: 1px solid #374151;
    flex-wrap: wrap;
}
.sheet-pdf-title {
    font-size: 12px;
    font-weight: 600;
    color: #E5E7EB;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.sheet-pdf-tools {
    display: flex;
    gap: var(--space-1);
    align-items: center;
}
.sheet-pdf-btn {
    background: #374151;
    color: white;
    border: 0;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast);
}
.sheet-pdf-btn:hover:not(:disabled) { background: #4B5563; }
.sheet-pdf-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.sheet-pdf-canvas-wrap {
    flex: 1;
    overflow: auto;
    background: #4B5563;
    padding: var(--space-3);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.sheet-pdf-canvas {
    background: white;
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 取引先フィルタピル（既存のsupplier-pillをそのまま使う） */

/* 集計ボックス */
.summary-box {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-app);
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
    flex-wrap: wrap;
}
.summary-box strong { color: var(--text-primary); font-weight: 700; }
.summary-box .text-subtle { color: var(--text-tertiary); }

/* 見積結果ミニ */
.estimate-result-box {
    background: var(--bg-app);
    border-top: 1px solid var(--border-default);
    padding: var(--space-4) var(--space-5);
}
.estimate-summary-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    align-items: stretch;
}
@media (max-width: 1280px) {
    .estimate-summary-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 720px) {
    .estimate-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.estimate-summary-item {
    background: var(--bg-card);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.estimate-summary-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.estimate-summary-value {
    font-size: 15px;
    font-weight: 700;
    font-family: 'JetBrains Mono', Menlo, monospace;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.estimate-summary-item.total {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}
.estimate-summary-item.total .estimate-summary-label,
.estimate-summary-item.total .estimate-summary-value {
    color: white;
}
.estimate-summary-item.total .estimate-summary-value {
    font-size: 17px;
}

/* 全体アクション */
.sheet-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-app);
    border-top: 1px solid var(--border-default);
    flex-wrap: wrap;
}

.page-pill {
    background: var(--brand-primary-light);
    color: var(--brand-primary);
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
}

.item-editor {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.item-editor table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.item-editor thead {
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-default);
}

.item-editor th {
    padding: var(--space-3) var(--space-3);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.item-editor td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.item-editor tbody tr:last-child td { border-bottom: none; }

.item-editor input[type="text"],
.item-editor input[type="number"],
.item-editor select {
    width: 100%;
    height: 32px;
    padding: 0 var(--space-2);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: all var(--t-fast);
}

.item-editor input:hover,
.item-editor select:hover {
    background: var(--bg-hover);
    border-color: var(--border-default);
}

.item-editor input:focus,
.item-editor select:focus {
    outline: none;
    background: var(--bg-card);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgb(79 70 229 / 0.1);
}

.item-editor input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
}

.item-editor tr.row-confirmed { background: transparent; }
.item-editor tr.row-unconfirmed { opacity: 0.5; }

/* Loading spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

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

/* Stagger animations */
.fade-in {
    animation: fadeInUp 400ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.fade-in:nth-child(1) { animation-delay: 50ms; }
.fade-in:nth-child(2) { animation-delay: 100ms; }
.fade-in:nth-child(3) { animation-delay: 150ms; }
.fade-in:nth-child(4) { animation-delay: 200ms; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Number counter animation */
.counter {
    display: inline-block;
}

/* Visualizations - mini bar */
.mini-bar-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.mini-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-muted);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.mini-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5 0%, #818CF8 100%);
    border-radius: var(--radius-full);
    transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.mini-bar-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    min-width: 48px;
    text-align: right;
}
