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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-back {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-back:hover {
    background: #667eea;
    color: white;
}

.btn-logout {
    background: #dc3545;
    color: white;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.btn-upload {
    background: #28a745;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}

.btn-upload:hover {
    background: #218838;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.help-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.help-text a {
    color: #667eea;
    text-decoration: none;
    margin: 0 0.5rem;
}

/* Dashboard */
.dashboard {
    min-height: 100vh;
    background: #f5f5f5;
}

.navbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    color: #667eea;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links button {
    background: transparent;
    color: #666;
    padding: 0.5rem 1rem;
}

.nav-links button.active {
    background: #667eea;
    color: white;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user span {
    color: #666;
    font-size: 0.9rem;
}

.dashboard-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    color: #333;
}

/* Tender List */
.tender-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.tender-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tender-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.tender-card h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.tender-title {
    color: #333;
    font-weight: 500;
    margin-bottom: 1rem;
    min-height: 40px;
}

.tender-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.tender-location,
.tender-date {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.badge {
    background: #e7f3ff;
    color: #0066cc;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Tender Detail */
.tender-info {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.tender-info h3 {
    margin-bottom: 1rem;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-grid div {
    font-size: 0.95rem;
}

.info-grid strong {
    color: #666;
    font-weight: 600;
}

/* BOQ Section */
.boq-section {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
}

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

.section-header h3 {
    color: #333;
}

.boq-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox input {
    cursor: pointer;
}

/* BOQ Table */
.boq-table {
    overflow-x: auto;
}

.boq-table table {
    width: 100%;
    border-collapse: collapse;
}

.boq-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

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

.boq-table tr:hover {
    background: #f8f9fa;
}

.boq-table .pipe-row {
    background: #e7f3ff;
}

.boq-table .description {
    max-width: 500px;
    font-size: 0.9rem;
}

.pipe-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pipe-specs .spec {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* Documentation */
.documentation {
    background: white;
    padding: 2rem;
    border-radius: 10px;
}

.documentation h2 {
    margin-bottom: 2rem;
}

.doc-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doc-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.doc-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
}

.doc-card h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.doc-card p {
    color: #666;
    font-size: 0.95rem;
}

/* Tender Form */
.tender-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
}

.tender-form form {
    max-width: 800px;
}

.tender-form button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

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

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

    .dashboard-content {
        padding: 1rem;
    }
}
