:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #e0e7ff;
    --sidebar-bg: #1e1e2e;
    --sidebar-text: #cdd6f4;
    --sidebar-hover: #313244;
    --sidebar-active: #4f46e5;
    --sidebar-active-text: #fff;
    --body-bg: #f8f9fc;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --transition: all 0.25s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-dark);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
a:hover { color: var(--primary); }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--sidebar-text);
    flex-shrink: 0;
}

.user-info { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); }

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-nav .nav-item { margin: 2px 8px; }

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: white;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-nav .mt-auto { margin-top: auto; }

.content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.top-navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-toggle:hover { background: var(--body-bg); color: var(--primary); }

.main-content { padding: 28px 24px; flex: 1; }

.portal-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--text-dark); margin: 0 0 4px 0; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    font-weight: 600;
}

.card-body { padding: 20px; }

.stats-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.stats-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 4px;
}

.bg-primary-soft { background: #e0e7ff; }
.bg-success-soft { background: #d1fae5; }
.bg-danger-soft { background: #fee2e2; }
.bg-warning-soft { background: #fef3c7; }
.bg-info-soft { background: #dbeafe; }

.stats-value { font-size: 26px; font-weight: 700; color: var(--text-dark); line-height: 1; }
.stats-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.project-card { transition: var(--transition); cursor: pointer; }
.project-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.project-hero-card { border: none; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.project-hero-card * { color: white !important; }
.project-hero-card .text-muted { color: rgba(255,255,255,0.75) !important; }
.project-hero-card .progress { background: rgba(255,255,255,0.2); }
.project-hero-card .progress-bar { background: white !important; }
.project-title { font-size: 22px; font-weight: 700; }

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-pending { background: #f3f4f6; color: #6b7280; }
.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.status-revision { background: #fef3c7; color: #d97706; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-on_hold { background: #fee2e2; color: #991b1b; }

.progress { height: 8px; border-radius: 50px; background: #f3f4f6; overflow: hidden; }
.progress-lg { height: 12px; }
.progress-bar { border-radius: 50px; transition: width 0.6s ease; }

.task-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}

.task-item:last-child { border-bottom: none; }
.task-item.task-done .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-title { font-size: 14px; font-weight: 500; }
.task-desc { font-size: 12px; }

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.file-item:last-child { border-bottom: none; }

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12px; }

.payment-summary { display: flex; flex-direction: column; gap: 8px; }
.payment-row { display: flex; justify-content: space-between; align-items: center; }
.payment-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.chat-area {
    height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.message-item { display: flex; }
.message-own { justify-content: flex-end; }
.message-other { justify-content: flex-start; }

.message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    background: #f3f4f6;
}

.message-own .message-bubble {
    background: var(--primary);
    color: white;
}

.message-sender { font-size: 11px; font-weight: 600; margin-bottom: 4px; opacity: 0.7; }
.message-text { font-size: 14px; }
.message-time { font-size: 10px; opacity: 0.6; margin-top: 4px; text-align: right; }

.auth-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container { width: 100%; max-width: 420px; }

.auth-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    padding: 40px;
}

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

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    margin: 0 auto 16px;
}

.auth-title { font-size: 24px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin: 0; }
.auth-footer { text-align: center; margin-top: 24px; }

.form-label { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.form-control { border-radius: 8px; border: 1px solid var(--border-color); font-size: 14px; padding: 10px 14px; transition: var(--transition); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); outline: none; }
.input-group-text { background: #f8f9fc; border: 1px solid var(--border-color); color: var(--text-muted); }

.btn { border-radius: 8px; font-size: 14px; font-weight: 500; padding: 8px 18px; transition: var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.4;
}

.empty-state h4 { color: var(--text-dark); margin-bottom: 8px; }

.table { font-size: 14px; }
.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); background: #f8f9fc; border-bottom: 1px solid var(--border-color); padding: 12px 16px; }
.table td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid var(--border-color); }
.table-hover tbody tr:hover { background: #f8f9fc; }

.user-avatar-lg {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .content-wrapper {
        margin-left: 0 !important;
    }
    .main-content { padding: 16px; }
    .top-navbar { padding: 12px 16px; }
}
