/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #f8fafc;
}

/* ==========================================
   TAB NAVIGATION
   ========================================== */
.tab-navigation {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #2563eb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 500;
}

.tab-content {
    display: none;
}

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

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

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

.btn-outline {
    background: white;
    color: #475569;
    border-color: #cbd5e1;
}

.btn-outline:hover {
    background: #f8fafc;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.icon-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

.badge-small {
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    margin-left: auto;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
}

.card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 5rem;
}

.page-container {
    padding: 2rem 5rem;
}

/* ==========================================
   LANDING PAGE - HEADER
   ========================================== */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 56px;
    z-index: 100;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.25rem;
}

.logo svg {
    width: 32px;
    height: 32px;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
}

.main-nav a:hover {
    color: #2563eb;
}

/* ==========================================
   LANDING PAGE - HERO
   ========================================== */
.hero {
    border-bottom: 1px solid #e2e8f0;
    padding: 5rem 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.badges {
    display: flex;
    gap: 0.75rem;
}

.dashboard-mock {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    background: #f8fafc;
}

.mock-chart {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.mock-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.mock-graph {
    height: 8rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.kpi-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.kpi-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
}

.kpi-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ==========================================
   SECTIONS
   ========================================== */
.section {
    padding: 4rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.section-alt {
    background: #f8fafc;
}

.section-title {
    font-size: 1.875rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* ==========================================
   PROCUREMENT FLOW
   ========================================== */
.flow-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flow-step {
    display: flex;
    align-items: center;
    flex: 1;
}

.flow-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    flex: 1;
}

.flow-arrow {
    padding: 0 0.5rem;
    color: #94a3b8;
}

/* ==========================================
   MODULES GRID
   ========================================== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.module-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.module-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.module-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.module-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.module-card p {
    font-size: 0.875rem;
    color: #64748b;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    background: #1e293b;
    color: white;
    padding: 3rem 0;
}

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

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    color: #cbd5e1;
}

.footer-tagline {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* ==========================================
   PAGE HEADER
   ========================================== */
.page-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 0;
}

.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: #64748b;
}

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

/* ==========================================
   STEPPER
   ========================================== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    z-index: -1;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stepper-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: white;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #94a3b8;
}

.stepper-step.active .stepper-circle {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.stepper-label {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
}

.stepper-step.active .stepper-label {
    color: #1e293b;
}

.stepper-line {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
}

/* ==========================================
   FORMS
   ========================================== */
.form-card {
    margin-bottom: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    padding: 0.625rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.875rem;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==========================================
   DOCUMENTS UPLOAD
   ========================================== */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.upload-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-item {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-item:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.upload-item span {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.upload-item small {
    font-size: 0.75rem;
    color: #64748b;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* ==========================================
   DASHBOARD LAYOUT
   ========================================== */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 16rem;
    background: white;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.vendor-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vendor-avatar {
    width: 2rem;
    height: 2rem;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.logo-small {
    font-size: 1.5rem;
}

.vendor-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.vendor-role {
    font-size: 0.75rem;
    color: #64748b;
}

.sidebar-nav {
    padding: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 6px;
    text-decoration: none;
    color: #475569;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #f8fafc;
}

.nav-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.alert-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #ef4444;
    border-radius: 50%;
}

/* ==========================================
   DASHBOARD MAIN
   ========================================== */
.dashboard-main {
    flex: 1;
    background: #f8fafc;
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header h1 {
    font-size: 1.25rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.dashboard-content {
    padding: 2rem;
}

/* ==========================================
   KPI STATS
   ========================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.kpi-stat {
    padding: 1.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.stat-meta.success {
    color: #10b981;
}

.stat-meta.info {
    color: #2563eb;
}

.stat-meta.danger {
    color: #ef4444;
}

.stat-meta.warning {
    color: #f59e0b;
}

/* ==========================================
   LIST ITEMS
   ========================================== */
.list-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:hover {
    background: #f8fafc;
}

.item-content {
    flex: 1;
}

.item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.item-meta {
    font-size: 0.875rem;
    color: #64748b;
}

/* ==========================================
   TABLES
   ========================================== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #475569;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.progress-bar {
    display: inline-block;
    width: 100px;
    height: 0.5rem;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
    margin-right: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 9999px;
}

/* ==========================================
   RFQ DETAIL LAYOUT
   ========================================== */
.rfq-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

.rfq-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.info-value {
    font-weight: 500;
}

.criteria-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.criteria-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

/* ==========================================
   EVALUATION TABLE
   ========================================== */
.evaluation-table .rank-badge {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    text-align: center;
    line-height: 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.rank-1 {
    background: #fef3c7;
    color: #92400e;
}

.rank-2 {
    background: #f1f5f9;
    color: #475569;
}

.rank-3 {
    background: #fed7aa;
    color: #9a3412;
}

.highlight-row {
    background: #eff6ff !important;
}

.score-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 0.25rem;
}

.score-bar {
    width: 60px;
    height: 0.375rem;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: #2563eb;
    border-radius: 9999px;
}

.text-muted {
    color: #64748b;
}

.mono {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
}

.truncate {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================
   RECOMMENDATION BOX
   ========================================== */
.recommendation-box {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.recommendation-content h4 {
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.recommendation-content p {
    font-size: 0.875rem;
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.recommendation-content ul {
    font-size: 0.875rem;
    color: #1e40af;
    margin-left: 1.25rem;
}

.recommendation-content li {
    margin-bottom: 0.25rem;
}

/* ==========================================
   APPROVAL FLOW
   ========================================== */
.approval-flow {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.approval-step {
    display: flex;
    gap: 1rem;
}

.approval-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.approval-icon.approved {
    background: #2563eb;
}

.approval-icon.pending {
    background: #f59e0b;
}

.approval-icon.inactive {
    background: #cbd5e1;
}

.approval-card {
    flex: 1;
    border: 2px solid;
    border-radius: 8px;
    padding: 1rem;
}

.approval-card.approved {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.approval-card.pending {
    border-color: #fcd34d;
    background: #fef3c7;
}

.approval-card.inactive {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.approval-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.approval-detail {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.approval-timestamp {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.approval-note {
    font-size: 0.875rem;
    font-style: italic;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.approval-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.approval-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: #94a3b8;
    padding: 0.5rem 0;
}

.approval-arrow.inactive {
    color: #cbd5e1;
}

/* ==========================================
   AUDIT LOG
   ========================================== */
.search-card {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.audit-table .timestamp {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #64748b;
}

.info-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.info-card h4 {
    color: #1e40af;
    margin-bottom: 0.75rem;
}

.info-card ul {
    font-size: 0.875rem;
    color: #1e40af;
    list-style: none;
}

.info-card li {
    margin-bottom: 0.5rem;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rfq-layout {
        grid-template-columns: 1fr;
    }

    .docs-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .tab-navigation {
        overflow-x: auto;
        padding: 0 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}
