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

:root {
    --primary: #18181b;
    --primary-dark: #09090b;
    --secondary: #71717a;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #6b7280;
    --light: #fafafa;
    --dark: #18181b;
    --border: #e4e4e7;
    --muted: #a1a1aa;
    --accent: #27272a;
    --surface: #ffffff;
    --surface-hover: #f4f4f5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f4f4f5;
    color: var(--dark);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(180deg, #18181b 0%, #27272a 50%, #3f3f46 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    padding: 48px 40px;
    border: 1px solid var(--border);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-large {
    font-size: 3.5rem;
    margin-bottom: 16px;
    filter: grayscale(100%);
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--muted);
    font-size: 0.95rem;
}

.login-form {
    margin: 32px 0;
}

.login-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.demo-note {
    font-size: 0.875rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
}

/* Header */
header {
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.025em;
}

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

.user-badge {
    padding: 8px 16px;
    background: var(--dark);
    color: white;
    border-radius: 100px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.user-name {
    font-weight: 600;
}

.user-role {
    opacity: 0.7;
    font-size: 0.8rem;
}

/* Navigation */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.nav-link {
    padding: 14px 20px;
    text-decoration: none;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-block;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--dark);
    background: var(--surface-hover);
}

.nav-link.active {
    color: var(--dark);
    border-bottom-color: var(--dark);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
    letter-spacing: -0.015em;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--dark);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: #18181b;
    color: white;
}

.btn-success:hover {
    background: #09090b;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border: 1px solid var(--border);
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: var(--danger);
}

.btn-secondary {
    background: var(--surface);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--muted);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface-hover);
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr:hover {
    background: var(--surface-hover);
}

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

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: var(--surface-hover) !important;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

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

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

label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark);
    font-size: 0.875rem;
}

input, select, textarea {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
    background: var(--surface);
    color: var(--dark);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--dark);
    box-shadow: 0 0 0 3px rgba(24,24,27,0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--muted);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    border: 1px solid var(--border);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--surface-hover);
}

.close-btn {
    background: var(--surface-hover);
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: var(--dark);
    background: var(--border);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--muted);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.025em;
}

.stat-label {
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 6px;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Checkbox List */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-hover);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-item:hover {
    background: var(--surface);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--dark);
}

/* Alert */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: var(--surface-hover);
    color: var(--dark);
    border: 1px solid var(--border);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

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

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

.badge-info {
    background: var(--surface-hover);
    color: var(--dark);
}

/* Project Details */
.project-header {
    background: linear-gradient(135deg, #18181b 0%, #27272a 50%, #3f3f46 100%);
    color: white;
    padding: 36px;
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid #52525b;
}

.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.project-info-item {
    opacity: 0.95;
}

.project-info-label {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.project-info-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    background: var(--surface-hover);
    padding: 4px;
    border-radius: 10px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--muted);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--dark);
    background: var(--surface);
}

.tab-btn.active {
    color: var(--dark);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tab-content {
    display: none;
}

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

/* Summary Cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--surface);
    padding: 24px;
    border-radius: 12px;
    border-left: 4px solid var(--dark);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.summary-card h4 {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.summary-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.025em;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--dark);
    border-radius: 100px;
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-content {
        padding: 0 12px;
    }
    
    .container {
        padding: 16px;
    }
    
    .modal-content {
        max-height: 95vh;
        margin: 12px;
    }
    
    .login-card {
        padding: 32px 24px;
    }
    
    .project-header {
        padding: 24px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

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

/* Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Focus States */
*:focus-visible {
    outline: 2px solid var(--dark);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--dark);
    color: white;
}
