:root {
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active: #0f3460;
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --primary: #4e73df;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --sidebar-width: 250px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fc;
    min-height: 100vh;
}

#wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: margin-left 0.3s;
}

.sidebar-brand {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-user {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user-info strong { display: block; color: #fff; font-size: 0.9rem; }
.sidebar-user-info small { font-size: 0.75rem; }

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
}

.sidebar-nav .nav-link {
    padding: 0.7rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-nav .nav-link i { width: 24px; margin-right: 10px; }

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

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    border-right: 3px solid var(--primary);
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.5rem 1rem;
}

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    width: 100%;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 999;
}

.main-content {
    padding: 1.5rem;
}

#menu-toggle {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
}

.avatar-circle, .avatar-circle-sm, .avatar-circle-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-circle { width: 38px; height: 38px; font-size: 0.85rem; }
.avatar-circle-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-circle-lg { width: 80px; height: 80px; font-size: 1.8rem; }

.stat-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-body {
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-icon { font-size: 2.5rem; opacity: 0.4; }
.stat-number { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; text-transform: uppercase; opacity: 0.8; }

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e3e6f0;
    padding: 0.9rem 1.2rem;
}

.card-header h6 { font-size: 0.9rem; font-weight: 700; color: #333; }

.project-card { transition: transform 0.2s; }
.project-card:hover { transform: translateY(-3px); }

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--sidebar-active) 100%);
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-logo { margin-bottom: 1rem; }

.notif-dropdown {
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.progress { border-radius: 10px; }

.table th {
    font-size: 0.78rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(78,115,223,0.15);
}

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

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

@media (min-width: 992px) {
    .sidebar { margin-left: 0 !important; }
    #page-content-wrapper { margin-left: var(--sidebar-width); }
}

@media (max-width: 991.98px) {
    .sidebar {
        margin-left: -280px;
        width: 280px;
        transition: margin-left 0.3s ease;
    }
    .sidebar.show {
        margin-left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .sidebar-backdrop.show { display: block; }
    #page-content-wrapper { margin-left: 0; }
    .main-content { padding: 1rem; }
    .topbar .navbar-text { font-size: 0.9rem; }
    .stat-card .stat-number { font-size: 1.4rem; }
    .stat-card .stat-icon { font-size: 2rem; }
    .card-body { padding: 0.9rem; }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 0.45rem 0.5rem; white-space: nowrap; }
    .modal-dialog { margin: 0.5rem; }
    .project-card { margin-bottom: 0.75rem; }
}

@media (max-width: 575.98px) {
    .main-content { padding: 0.75rem; }
    .topbar .navbar-text { display: none; }
    .stat-card .stat-body { padding: 0.8rem; }
    .stat-card .stat-number { font-size: 1.2rem; }
    .stat-card .stat-label { font-size: 0.7rem; }
    .card-body { padding: 0.75rem; }
    .table { font-size: 0.75rem; }
    .table th, .table td { padding: 0.35rem 0.4rem; }
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-wrap: wrap; gap: 0.5rem;
    }
    .d-flex.justify-content-between.align-items-center.mb-3 > * {
        width: 100%; text-align: center;
    }
    .d-flex.justify-content-between.align-items-center.mb-3 .btn {
        width: 100%;
    }
    .nav-tabs .nav-link {
        font-size: 0.8rem; padding: 0.4rem 0.6rem;
    }
    .nav-tabs { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
    h5, h6 { font-size: 0.95rem !important; }
    .modal-dialog { margin: 0.25rem; }
    .modal-content { border-radius: 8px; }
    .modal-body { padding: 0.75rem; }
    .modal-header { padding: 0.75rem; }
    .modal-footer { padding: 0.75rem; }
    .list-group-item { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
}

@media (max-width: 400px) {
    .col-md-6.col-lg-4.mb-4 { padding-left: 0; padding-right: 0; }
    .stat-card .stat-body { flex-direction: column; text-align: center; gap: 0.3rem; }
    .stat-card .stat-icon { display: none; }
}

.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 2.5rem;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: #4e73df;
    background: #f0f4ff;
}

pre {
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.75rem;
}

.table-success td {
    background-color: #f0fff4 !important;
}
