/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding-top: 70px;
}

a {
    color: #3b82f6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    color: white;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 100;
}

.nav-brand a {
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
}

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

.nav-links a {
    color: white;
    opacity: 0.8;
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 1;
    text-decoration: none;
}

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

.nav-user span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card h3 {
    margin-top: 0;
}

.card-meta {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

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

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

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-closed {
    background: #e5e7eb;
    color: #374151;
}

.badge-pending {
    background: #fed7aa;
    color: #9a3412;
}

.badge-accepted {
    background: #d1fae5;
    color: #065f46;
}

.badge-rejected {
    background: #fecaca;
    color: #991b1b;
}

.badge-paid {
    background: #a7f3d0;
    color: #047857;
}

.badge-submitted {
    background: #e9d5ff;
    color: #6b21a8;
}

.badge-approved {
    background: #bfdbfe;
    color: #1d4ed8;
}

.badge-withdrawn {
    background: #e5e7eb;
    color: #6b7280;
}

/* Stars */
.stars {
    display: inline-flex;
    gap: 2px;
}

.star {
    color: #d1d5db;
    font-size: 1.2rem;
}

.star.filled {
    color: #f59e0b;
}

.star-input .star {
    cursor: pointer;
    font-size: 1.5rem;
}

.star-input .star:hover {
    color: #f59e0b;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    border: none;
    color: white;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
}

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

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: #000;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-secondary {
    background: #6b7280;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row > * {
    flex: 1;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal {
    background: white;
    max-width: 500px;
    width: 90%;
    border-radius: 12px;
    padding: 2rem;
}

.modal h2 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 8px;
    color: white;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #ef4444;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
}

.tab.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

.tab-content {
    display: none;
    padding-top: 1rem;
}

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

/* Empty States */
.empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 3rem;
    font-size: 1.1rem;
}

/* Filters */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

.filter-bar input,
.filter-bar select {
    width: auto;
    min-width: 150px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    font-size: 2rem;
    color: #3b82f6;
    margin: 0;
}

.stat-card p {
    color: #6b7280;
    margin: 0.5rem 0 0;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    font-weight: 600;
}

tr:hover {
    background: #f9fafb;
}

/* Misc */
.avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    background: #eef2ff;
    color: #4338ca;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.featured-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

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

.page-header h1 {
    margin: 0;
}

.bid-card {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.milestone-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

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

/* Auth Page */
.auth-container {
    max-width: 400px;
    margin: 100px auto;
    text-align: center;
}

.auth-container .card {
    padding: 2rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    cursor: pointer;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-size: 1rem;
}

.auth-tab.active {
    border-bottom-color: #3b82f6;
    color: #3b82f6;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.role-selection {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.role-option input[type="radio"] {
    display: none;
}

.role-option label {
    padding: 10px 20px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
    width: auto;
}

.role-option input:checked + label {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

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

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }

    .modal {
        width: 95%;
    }

    .navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 1rem;
    }

    .form-row {
        flex-direction: column;
    }
}
