/* ==========================================================================
   GRAND.ANALYTICS CSS DESIGN SYSTEM (Premium Dark Theme with HSL Tokens)
   ========================================================================== */

:root {
    --bg-base: #070a13;
    --bg-surface: #0e1322;
    --bg-card: rgba(20, 26, 45, 0.65);
    --border-card: rgba(255, 255, 255, 0.055);
    --border-active: rgba(139, 92, 246, 0.4);
    
    /* Harmonious Curated Colors */
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --primary-grad: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    
    --accent-cyan: #06b6d4;
    --accent-cyan-hover: #0891b2;
    --accent-cyan-glow: rgba(6, 182, 212, 0.3);
    --accent-cyan-grad: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    
    --green: #10b981;
    --green-light: #34d399;
    --green-glow: rgba(16, 185, 129, 0.2);
    
    --amber: #f59e0b;
    --red: #ef4444;
    
    /* Text Tokens */
    --text-main: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* App Container Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* 1. SIDEBAR STYLING */
.app-sidebar {
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--border-card);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.accent-dot {
    color: var(--accent-cyan);
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 12px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-item svg {
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.nav-item:hover svg {
    color: var(--primary);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-main);
    box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item.active svg {
    color: var(--primary);
}

.badge {
    background: var(--primary);
    color: white;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
}

.badge.secondary {
    background: var(--accent-cyan);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-card);
    background: rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    box-shadow: 0 0 10px var(--primary-glow);
}

.details {
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 2. MAIN WORKSPACE HEADER */
.app-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.app-header {
    height: 80px;
    border-bottom: 1px solid var(--border-card);
    background-color: rgba(14, 19, 34, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.active-file-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.active-file-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px dashed rgba(6, 182, 212, 0.25);
    margin-left: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid var(--border-card);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--green);
    box-shadow: 0 0 8px var(--green);
    display: inline-block;
}

.online .indicator-dot {
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 12px var(--green); }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* 3. BUTTON SYSTEM */
.btn-primary {
    background: var(--primary-grad);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-demo {
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-demo:hover {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

.btn-pill {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

/* 4. VIEWPORT SCREENS */
.content-viewport {
    padding: 32px;
    flex-grow: 1;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 5. DASHBOARD STYLINGS */
.welcome-banner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.06), transparent 70%);
    border-radius: 16px;
    border: 1px solid var(--border-card);
    padding: 32px;
}

.banner-text h1 {
    font-size: 2rem;
    margin-bottom: 12px;
    background: linear-gradient(to right, #ffffff, #93c5fd, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.banner-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Upload Dropzone */
.upload-dropzone {
    background: rgba(13, 17, 30, 0.5);
    border: 2px dashed rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-dropzone:hover {
    background: rgba(139, 92, 246, 0.04);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

.dropzone-icon {
    margin-bottom: 12px;
    transition: var(--transition-bounce);
}

.upload-dropzone:hover .dropzone-icon {
    transform: translateY(-4px) scale(1.05);
}

.upload-dropzone h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.dropzone-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.demo-files-container {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

.demo-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: var(--transition-bounce);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-active);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.08);
}

.metric-card.highlight {
    background: linear-gradient(135deg, rgba(20, 26, 45, 0.8) 0%, rgba(16, 185, 129, 0.04) 100%);
}

.metric-card.highlight:hover {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.08);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.metric-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.val-blue { background: rgba(56, 189, 248, 0.08); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.15); }
.val-purple { background: rgba(139, 92, 246, 0.08); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.15); }
.val-cyan { background: rgba(6, 182, 212, 0.08); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.15); }
.val-green { background: rgba(16, 185, 129, 0.08); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.15); }

.metric-value {
    font-size: 1.85rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    margin-bottom: 8px;
}

.text-green {
    color: var(--green-light) !important;
}

.metric-footer {
    font-size: 0.78rem;
}

.text-muted { color: var(--text-muted); }
.text-accent-cyan { color: var(--accent-cyan); font-weight: 500;}
.text-green-light { color: var(--green-light); opacity: 0.9; }

/* 6. LAYOUT GRIDS */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Glassmorphism Cards */
.card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.card-header {
    margin-bottom: 20px;
    position: relative;
}

.card-header h3 {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

.card-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.bg-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.bg-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.bg-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.bg-orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.chart-widget {
    min-height: 380px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Activity Logs Widget */
.logs-widget {
    display: flex;
    flex-direction: column;
    height: 380px;
}

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

.status-live {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-weight: 700;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 30px;
    margin-left: auto;
}

.animate-pulse {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { opacity: 0.6; }
    50% { opacity: 1; box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
    100% { opacity: 0.6; }
}

.logs-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    max-height: 280px;
}

.log-item {
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid;
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.01);
    transition: var(--transition-smooth);
}

.log-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(2px);
}

.log-item.info { border-left-color: var(--primary); border-color: rgba(139, 92, 246, 0.06); }
.log-item.success { border-left-color: var(--green); border-color: rgba(16, 185, 129, 0.06); }
.log-item.warning { border-left-color: var(--amber); border-color: rgba(245, 158, 11, 0.06); }
.log-item.error { border-left-color: var(--red); border-color: rgba(239, 68, 68, 0.06); }

.log-time {
    color: var(--text-muted);
    font-family: monospace;
    font-weight: 500;
}

.log-text {
    color: var(--text-secondary);
}

.log-item.success .log-text {
    color: var(--text-main);
}

/* 7. TABLES SYSTEM */
.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table th {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--border-card);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-card);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr.row-subtotal {
    background: rgba(139, 92, 246, 0.02);
    font-weight: 600;
}

.data-table tbody tr.row-subtotal td {
    border-bottom: 2px double var(--border-card);
}

.data-table tbody tr.row-material {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.005);
}

.data-table tbody tr.row-material td:nth-child(3) {
    padding-left: 32px;
    position: relative;
}

.data-table tbody tr.row-material td:nth-child(3)::before {
    content: "↳";
    position: absolute;
    left: 16px;
    color: var(--text-muted);
}

/* Badge/Statuses inside tables */
.status-pill {
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    display: inline-block;
}

.status-pill.pending { background: rgba(245, 158, 11, 0.08); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-pill.sent { background: rgba(56, 189, 248, 0.08); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.2); }
.status-pill.received { background: rgba(16, 185, 129, 0.08); color: var(--green-light); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-pill.empty { background: rgba(255, 255, 255, 0.03); color: var(--text-muted); }

/* Compact Tables */
.mini-table-holder {
    overflow-x: auto;
    max-height: 240px;
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.compact-table th {
    padding: 10px 12px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-card);
    background: rgba(255, 255, 255, 0.01);
    font-weight: 600;
    text-transform: uppercase;
}

.compact-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-card);
    color: var(--text-main);
}

.compact-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 8. RFQ PREVIEW SYSTEM */
.rfq-template-preview {
    background: #ffffff;
    color: #1e293b;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    border: 1px solid #e2e8f0;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.template-header {
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.template-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.02em;
}

.template-meta {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
}

.template-body p {
    margin-bottom: 8px;
    line-height: 1.4;
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.75rem;
}

.mini-table th {
    background: #f1f5f9;
    color: #1e293b;
    padding: 8px;
    border: 1px solid #cbd5e1;
    font-weight: 600;
}

.mini-table td {
    padding: 8px;
    border: 1px solid #cbd5e1;
}

.template-note {
    font-size: 0.7rem;
    color: #64748b;
    font-style: italic;
}

/* Contractor Match List in UI */
.contractor-matching-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.matched-contractor-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 16px;
    transition: var(--transition-smooth);
}

.matched-contractor-card:hover {
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.03);
}

.mcc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.mcc-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.mcc-rating {
    color: var(--amber);
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mcc-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mcc-action-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed var(--border-card);
    padding-top: 10px;
}

.price-tag {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--accent-cyan);
}

.price-tag.best {
    color: var(--green-light);
}

/* 9. SUPPLIERS GROUP LISTS */
.supplier-list-mini {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.supplier-mini-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-card);
    transition: var(--transition-smooth);
}

.supplier-mini-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.smc-row-1 {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.smc-row-2 {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* 10. INN SEARCH & AUTOMATION VIEW */
.inn-search-box {
    margin-bottom: 24px;
}

.form-group-inline {
    display: flex;
    gap: 12px;
}

.form-group-inline input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition-smooth);
}

.form-group-inline input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.inn-quick-presets {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inn-quick-presets span {
    font-size: 0.72rem;
}

.inn-results-panel {
    border-top: 1px dashed var(--border-card);
    padding-top: 20px;
    min-height: 150px;
}

.hidden {
    display: none !important;
}

/* Spinner */
.loading-spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 30px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

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

.inn-data-card {
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

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

.inn-company-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: white;
}

.inn-legal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    font-size: 0.8rem;
}

.ilg-item h5 {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ilg-item p {
    color: var(--text-secondary);
}

.financial-indicator {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.72rem;
}

.financial-indicator.good { background: rgba(16, 185, 129, 0.1); color: var(--green-light); }
.financial-indicator.neutral { background: rgba(245, 158, 11, 0.1); color: var(--amber); }

/* Coverage panel */
.db-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-big-num {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-big-num span:first-child {
    font-size: 2.2rem;
    font-weight: 700;
    display: block;
    font-family: 'Outfit', sans-serif;
    color: var(--accent-cyan);
}

.stat-big-num span.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
}

.category-coverage h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.coverage-bar-group {
    margin-bottom: 12px;
}

.coverage-bar-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}

.progress-container {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 11. TENDER OPTIMIZER STYLING */
.optimizer-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.control-label-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.range-val-indicator {
    font-weight: 700;
    color: var(--accent-cyan);
    font-size: 1.05rem;
    background: rgba(6, 182, 212, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-cyan-glow);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-helper {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.calculation-summary-box {
    background: rgba(16, 185, 129, 0.03);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 12px;
    padding: 20px;
}

.calculation-summary-box h4 {
    font-size: 0.88rem;
    margin-bottom: 12px;
    color: var(--green-light);
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    padding-bottom: 8px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.calc-row.divider {
    height: 1px;
    background: rgba(16, 185, 129, 0.15);
    margin: 12px 0;
}

.font-lg {
    font-size: 1.25rem !important;
}

/* Toast System styling */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    background: rgba(14, 19, 34, 0.9);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 16px;
    min-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-main);
    backdrop-filter: blur(12px);
    animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--primary);
}

.toast.toast-success { border-left-color: var(--green); }
.toast.toast-info { border-left-color: var(--accent-cyan); }
.toast.toast-warning { border-left-color: var(--amber); }

.toast-message {
    font-size: 0.8rem;
    line-height: 1.4;
    flex-grow: 1;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Helpers */
.text-center { text-align: center; }
.margin-top-lg { margin-top: 32px; }
.margin-top-md { margin-top: 20px; }
.pad-lg { padding: 32px; }
.pad-sm { padding: 12px; }

/* 12. RESPONSIVENESS AND SMALL UTILITIES */
.workflow-explainer {
    margin-bottom: 24px;
}

.workflow-explainer h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.steps-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.step-node {
    flex: 1;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-grad);
    color: white;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
}

.step-node h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.step-node p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.step-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Estimate Selector Dropdown */
.estimate-select-dropdown {
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-left: 12px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.estimate-select-dropdown:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--accent-cyan);
}
.estimate-select-dropdown option {
    background-color: var(--bg-surface);
    color: var(--text-main);
}
