/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========== APP LAYOUT ========== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-container {
    display: flex;
    flex: 1;
}

/* ========== NAVBAR ========== */
.navbar {
    background: #ffffff;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: -0.5px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem 0;
    min-height: calc(100vh - 64px);
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-nav {
    list-style: none;
    padding: 0 0.75rem;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #64748b;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
    gap: 0.75rem;
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-nav li a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.sidebar-nav li.active a {
    background: #2563eb;
    color: #ffffff;
}

.sidebar-nav li.active a i {
    color: #ffffff;
}

/* ========== CONTENT ========== */
.content {
    flex: 1;
    padding: 2rem;
    max-width: calc(1400px - 240px);
    margin: 0 auto;
    width: 100%;
}

/* ========== PAGE HEADER ========== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header p {
    color: #64748b;
    margin-top: 0.25rem;
}

.page-header .btn {
    float: right;
    margin-top: -2.5rem;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    flex-shrink: 0;
}

.stat-icon i {
    color: #ffffff;
}

.stat-card.bg-blue .stat-icon { background: #2563eb; }
.stat-card.bg-red .stat-icon { background: #ef4444; }
.stat-card.bg-green .stat-icon { background: #22c55e; }
.stat-card.bg-yellow .stat-icon { background: #eab308; }
.stat-card.bg-purple .stat-icon { background: #8b5cf6; }
.stat-card.bg-orange .stat-icon { background: #f97316; }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-info p {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

/* ========== CARDS ========== */
.card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ========== PROJECT ITEMS ========== */
.project-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.project-item:last-child {
    border-bottom: none;
}

.project-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.project-info h4 a:hover {
    color: #2563eb;
}

.project-info p {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.1rem;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.project-meta .progress {
    width: 100px;
}

.project-percent {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    min-width: 40px;
    text-align: right;
}

/* ========== SWITCH ITEMS ========== */
.switch-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.switch-item:last-child {
    border-bottom: none;
}

.switch-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.switch-info .fa-arrow-right {
    color: #94a3b8;
    font-size: 0.8rem;
}

.switch-from {
    color: #ef4444;
}

.switch-to {
    color: #22c55e;
}

.switch-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.switch-thought {
    font-size: 0.85rem;
    color: #475569;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    font-style: italic;
}

.switch-thought .fa-quote-left {
    color: #94a3b8;
    margin-right: 0.25rem;
    font-size: 0.7rem;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ========== PROGRESS ========== */
.progress {
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.progress-section .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-success {
    background: #22c55e;
    color: #ffffff;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.form-group label .required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ========== PROJECT CARDS (Grid) ========== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.project-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.project-card-header h3 a:hover {
    color: #2563eb;
}

.project-card-body {
    padding: 1rem 1.25rem;
}

.project-card-body .project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.project-card-body .meta-item {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.project-goal {
    font-size: 0.85rem;
    color: #475569;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.project-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 0.5rem;
}

/* ========== ALERTS ========== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ========== EMPTY STATES ========== */
.empty-state {
    color: #94a3b8;
    text-align: center;
    padding: 2rem 0;
}

.empty-state-full {
    text-align: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.empty-state-full i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state-full h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.empty-state-full p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* ========== WARNING CARD ========== */
.warning-card {
    border-left: 4px solid #eab308;
}

.warning-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.warning-content i {
    font-size: 2rem;
    color: #eab308;
}

.warning-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.warning-content p {
    font-size: 0.875rem;
    color: #475569;
}

.warning-content .hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.1rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 200;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .content {
        padding: 1rem;
        max-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .project-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .project-meta {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .page-header .btn {
        float: none;
        display: inline-block;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-info h3 {
        font-size: 1.1rem;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}