/* VIS RFQ — Shared Components */

/* ── Chips (filter tags) ─────────────────────────────────── */

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-1) var(--sp-3);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
}

.chip.active {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}

/* ── Filters bar ─────────────────────────────────────────── */

.filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
    gap: var(--sp-3);
}

.filter-chips {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

.filter-sort select {
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-sm);
    border-radius: 16px;
    width: auto;
}

/* ── Status indicators ───────────────────────────────────── */

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-new        { background: var(--c-status-new); }
.status-classified { background: var(--c-status-new); }
.status-extracting { background: var(--c-status-extracting); }
.status-extracted  { background: var(--c-status-extracted); }
.status-quoting    { background: var(--c-status-extracting); }
.status-quoted     { background: var(--c-status-quoted); }
.status-review     { background: var(--c-status-extracting); }
.status-approved   { background: var(--c-status-approved); }
.status-sent           { background: var(--c-status-approved); }
.status-pending_review { background: var(--c-status-new); }
.status-ready_to_send  { background: var(--c-status-quoted); }
.status-rejected       { background: var(--c-status-rejected); }
.status-archived       { background: var(--c-status-archived); }

.status-badge {
    display: inline-flex;
    padding: var(--sp-1) var(--sp-3);
    border-radius: 12px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge.status-new        { background: rgba(52,152,219,0.12); color: var(--c-status-new); }
.status-badge.status-extracted  { background: rgba(155,89,182,0.12); color: var(--c-status-extracted); }
.status-badge.status-quoted     { background: rgba(46,204,113,0.12); color: var(--c-status-quoted); }
.status-badge.status-approved   { background: rgba(39,174,96,0.12); color: var(--c-status-approved); }
.status-badge.status-rejected       { background: rgba(231,76,60,0.12); color: var(--c-status-rejected); }
.status-badge.status-extracting     { background: rgba(243,156,18,0.12); color: var(--c-status-extracting); }
.status-badge.status-sent           { background: rgba(39,174,96,0.12); color: var(--c-status-approved); }
.status-badge.status-pending_review { background: rgba(52,152,219,0.12); color: var(--c-status-new); }
.status-badge.status-ready_to_send  { background: rgba(46,204,113,0.12); color: var(--c-status-quoted); }

/* ── Confidence indicators ───────────────────────────────── */

.conf-high    { color: var(--c-conf-high); }
.conf-medium  { color: var(--c-conf-medium); }
.conf-low     { color: var(--c-conf-low); }
.conf-unknown { color: var(--c-text-muted); }

.confidence-display {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--border-radius-sm);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

.confidence-display.conf-high    { background: rgba(39,174,96,0.1); }
.confidence-display.conf-medium  { background: rgba(243,156,18,0.1); }
.confidence-display.conf-low     { background: rgba(231,76,60,0.1); }

.confidence-display .material-icons-round {
    font-size: 16px;
}

.confidence-mini {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    margin-left: var(--sp-1);
}

.level-badge {
    font-size: var(--fs-xs);
    background: var(--c-bg);
    padding: 0 var(--sp-2);
    border-radius: 8px;
    margin-left: var(--sp-2);
    color: var(--c-text-secondary);
}

/* ── Classification badges ───────────────────────────────── */

.classification {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    padding: 1px 6px;
    border-radius: 4px;
}

.cls-rfq        { background: rgba(52,152,219,0.12); color: #2980b9; }
.cls-info       { background: rgba(149,165,166,0.12); color: #7f8c8d; }
.cls-spam       { background: rgba(231,76,60,0.12); color: #c0392b; }
.cls-doubtful    { background: rgba(243,156,18,0.12); color: #e67e22; }
.cls-not_rfq     { background: rgba(149,165,166,0.12); color: #7f8c8d; }
.cls-blacklisted { background: rgba(0,0,0,0.08); color: #2c3e50; }
.cls-unknown     { background: rgba(149,165,166,0.12); color: #95a5a6; }

/* ── Document type badges ────────────────────────────────── */

.badge-small {
    font-size: var(--fs-xs);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: var(--fw-medium);
}

.type-technical_drawing { background: rgba(52,152,219,0.12); color: #2980b9; }
.type-specification     { background: rgba(155,89,182,0.12); color: #8e44ad; }
.type-bom               { background: rgba(243,156,18,0.12); color: #e67e22; }
.type-certificate       { background: rgba(39,174,96,0.12); color: #27ae60; }
.type-photo             { background: rgba(149,165,166,0.12); color: #7f8c8d; }
.type-other             { background: rgba(149,165,166,0.12); color: #95a5a6; }

/* ── Tabs ────────────────────────────────────────────────── */

.tab-bar {
    display: flex;
    gap: var(--sp-1);
    border-bottom: 2px solid var(--c-border-light);
    margin-bottom: var(--sp-4);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--c-text-secondary);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: all var(--transition);
}

.tab:hover {
    color: var(--c-text);
}

.tab.active {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
}

.tab .material-icons-round {
    font-size: 18px;
}

.tab-count {
    background: var(--c-bg);
    padding: 0 6px;
    border-radius: 8px;
    font-size: var(--fs-xs);
}

/* ── Empty state ─────────────────────────────────────────── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-12);
    color: var(--c-text-muted);
}

.empty-state .material-icons-round {
    font-size: 48px;
    margin-bottom: var(--sp-3);
}

.empty-state p {
    font-size: var(--fs-md);
    margin-bottom: var(--sp-4);
}

/* ── Loading ─────────────────────────────────────────────── */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--sp-8);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--sp-3);
}

/* ── Modal ───────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--c-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-6);
    border-bottom: 1px solid var(--c-border);
}

.modal-header h3 {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: var(--sp-4);
}

.file-viewer-modal {
    width: 80vw;
    height: 80vh;
}

.file-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Toasts ──────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: var(--sp-6);
    right: var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-primary-dark);
    color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    font-size: var(--fs-sm);
}

.toast .material-icons-round {
    font-size: 18px;
}

.toast-success { background: var(--c-success); }
.toast-error   { background: var(--c-error); }
.toast-warning { background: var(--c-warning); }
.toast-info    { background: var(--c-info); }

/* ── Login Overlay ───────────────────────────────────────── */

.login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #1a1f36 0%, #2d3250 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.login-card {
    background: var(--c-surface);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: var(--sp-8);
    width: 100%;
    max-width: 380px;
}

.login-logo {
    text-align: center;
    margin-bottom: var(--sp-6);
}

.login-logo-text {
    display: block;
    font-size: 2rem;
    font-weight: var(--fw-bold);
    color: var(--c-primary);
    letter-spacing: 0.1em;
}

.login-logo-sub {
    display: block;
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    margin-top: var(--sp-1);
}

.login-field {
    margin-bottom: var(--sp-4);
}

.login-field label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--c-text-secondary);
    margin-bottom: var(--sp-1);
}

.login-field input {
    width: 100%;
    padding: var(--sp-3);
    font-size: var(--fs-base);
    border: 1px solid var(--c-border);
    border-radius: var(--border-radius);
    background: var(--c-bg);
    box-sizing: border-box;
}

.login-field input:focus {
    border-color: var(--c-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.login-error {
    color: var(--c-error);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-3);
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: var(--sp-3);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-logout {
    opacity: 0.6;
}

.btn-logout:hover {
    opacity: 1;
}

/* ── Placeholder ─────────────────────────────────────────── */

.placeholder-text {
    color: var(--c-text-muted);
    font-size: var(--fs-md);
    text-align: center;
    padding: var(--sp-12);
}
