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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2rem;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.login-input-wrapper {
    position: relative;
}

.login-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.login-form-group input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-primary);
}

.login-form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.login-error.active {
    display: flex;
}

.login-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.login-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.login-help strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.user-info-badge {
    background: linear-gradient(135deg, var(--primary), var(--info));
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: white;
    font-weight: 500;
}

.logout-btn {
    background: var(--danger);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Hidden by default */
.app-container {
    display: none;
}

.app-container.active {
    display: block;
}

/* Navigation */
.navbar {
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand i {
    font-size: 1.5rem;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
}

.hamburger:hover {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

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

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Goals Container */
.goals-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.goal-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
}

.goal-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.goal-title {
    flex: 1;
}

.goal-title h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.goal-number {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.goal-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.goal-body {
    padding: 1.5rem;
}

.goal-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.progress-section {
    margin-bottom: 1.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.progress-label {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-value {
    font-weight: 700;
    color: var(--primary);
}

.progress-bar-container {
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--info));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.activities-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
}

.activity-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-stat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.activity-stat-header i {
    font-size: 1.25rem;
}

.activity-stat.not-started .activity-stat-header i { color: var(--secondary); }
.activity-stat.ongoing .activity-stat-header i { color: var(--warning); }
.activity-stat.completed .activity-stat-header i { color: var(--success); }
.activity-stat.blocked .activity-stat-header i { color: var(--danger); }

.activity-stat-text {
    display: flex;
    flex-direction: column;
}

.activity-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.activity-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.activity-list-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    margin-left: 2rem;
    background: var(--bg-primary);
    border-radius: 4px;
    cursor: default;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.activity-list-item:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* Activities Page */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.activities-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.activity-group {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
}

.activity-group-header {
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border);
}

.activity-group-header h3 {
    font-size: 1.1rem;
    color: var(--primary);
}

.activity-list {
    padding: 0.5rem;
}

.activity-item {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--bg-primary);
}

.activity-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.activity-item.completed .activity-checkbox {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.activity-info {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.activity-item.completed .activity-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.activity-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.activity-owner {
    font-size: 0.85rem;
    color: var(--primary);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.activity-owner i {
    font-size: 0.75rem;
}

.activity-status {
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.activity-status.not-started {
    background: #f1f5f9;
    color: #64748b;
}

.activity-status.ongoing {
    background: #fef3c7;
    color: #d97706;
}

.activity-status.completed {
    background: #dcfce7;
    color: #16a34a;
}

.activity-status.blocked {
    background: #fee2e2;
    color: #dc2626;
}

/* KPIs Page */
.kpis-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.kpi-group {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
}

.kpi-group-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.kpi-group-header h3 {
    font-size: 1.15rem;
}

.kpi-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kpi-item {
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.kpi-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px var(--shadow);
}

.kpi-info {
    flex: 1;
}

.kpi-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.kpi-values {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
}

.kpi-target {
    color: var(--text-secondary);
}

.kpi-target strong {
    color: var(--text-primary);
}

.kpi-current {
    color: var(--text-secondary);
}

.kpi-current strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Timeline Page */
.timeline-container {
    max-width: 900px;
    margin: 0 auto;
}

.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 70px;
    margin-bottom: 2rem;
}

.timeline-marker {
    position: absolute;
    left: 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-primary);
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.timeline-action {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-user {
    font-size: 0.85rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.timeline-user i {
    font-size: 0.75rem;
}

.timeline-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group select[multiple] {
    min-height: 120px;
    padding: 0.5rem;
}

.form-group select[multiple] option {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.form-group select[multiple] option:checked {
    background: var(--primary);
    color: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group input[readonly] {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        height: auto;
        padding: 1rem;
    }
    
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: var(--bg-secondary);
        box-shadow: -4px 0 12px var(--shadow);
        flex-direction: column;
        align-items: stretch;
        padding: 5rem 1.5rem 2rem;
        transition: right 0.3s ease-in-out;
        z-index: 99;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .user-info-badge {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 0.5rem;
        padding: 1rem;
    }
    
    .logout-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        margin-top: 0.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .goal-header {
        flex-direction: column;
        gap: 1rem;
    }

    .activities-summary {
        grid-template-columns: 1fr;
    }

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

    .activity-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .kpi-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .modal-content {
        width: 95%;
    }
    
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}
