/* ==========================================================================
   VARIABLES & DESIGN TOKENS (Modern SaaS Style)
   ========================================================================== */
:root {
    /* Color Palette */
    --primary-navy: #0F172A;     /* Dark Navy Blue - Main */
    --primary-blue: #2563EB;     /* Action Blue */
    --bg-gray: #F8FAFC;          /* Background Gray */
    --card-white: #FFFFFF;       /* Card White */
    
    /* Text Colors */
    --text-dark: #1E293B;
    --text-muted: #64748B;
    
    /* Priority & Status Colors */
    --status-urgent: #EF4444;    /* Red */
    --status-high: #F59E0B;      /* Orange */
    --status-med: #3B82F6;       /* Blue */
    --status-low: #10B981;       /* Green */
    
    /* Shadows & Border Radius */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
    /* For main layout with sidebar */
    display: flex; 
    margin: 0;
}

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

/* ==========================================================================
   GLOBAL COMPONENTS
   ========================================================================== */
/* Cards */
.card {
    background-color: var(--card-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid #E2E8F0;
    transition: box-shadow 0.3s ease;
}

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

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    background-color: #1D4ED8;
}

.btn-secondary {
    background-color: #94A3B8;
}

.btn-secondary:hover {
    background-color: #64748B;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 14px; /* Ketebalan progress bar */
    background-color: #E2E8F0; /* Warna abu-abu muda sebagai dasar */
    border-radius: 999px; /* Membuat ujungnya sangat bulat (pill shape) */
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* Sedikit bayangan ke dalam */
}

/* Isi Progress Bar & Animasi */
.progress-bar {
    height: 100%;
    border-radius: 999px;
    background-color: var(--primary-blue, #3B82F6); /* Warna utama */
    
    /* 1. Animasi mulus saat width (%) berubah dari database/javascript */
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 2. Efek visual garis-garis miring ala "loading" */
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    
    /* 3. Menjalankan animasi garis miring terus menerus */
    animation: progress-stripes 1.5s linear infinite;
}

/* Keyframes agar garisnya terlihat bergerak dari kanan ke kiri */
@keyframes progress-stripes {
    0% {
        background-position: 20px 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Alerts */
.alert-error {
    background-color: #FEE2E2;
    color: var(--status-urgent);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: #D1FAE5;
    color: var(--status-low);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-blue);
}

/* Utilities */
.text-center {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.text-danger {
    color: #FCA5A5 !important;
}

/* ==========================================================================
   AUTHENTICATION PAGES (Login & Register)
   ========================================================================== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    width: 100%;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-navy);
}

.boss-info {
    background-color: var(--bg-gray);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    text-align: center;
    border: 1px dashed #CBD5E1;
}

.boss-info strong {
    color: var(--primary-blue);
    font-size: 18px;
    display: block;
    margin-top: 5px;
}

/* ==========================================================================
   MAIN LAYOUT (Sidebar & Topbar)
   ========================================================================== */
.sidebar {
    width: 260px;
    background-color: var(--primary-navy);
    color: #fff;
    min-height: 100vh;
    position: fixed;
    left: 0; 
    top: 0;
    display: flex; 
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

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

.sidebar-header h3 {
    margin: 0;
    font-size: 20px;
}

.team-badge {
    margin-top: 8px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.sidebar-nav {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    flex: 1; /* Pushes bottom items down if needed */
}

.sidebar-nav a {
    color: #CBD5E1;
    text-decoration: none;
    padding: 12px 24px;
    display: block;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
}

.sidebar-nav a:hover, 
.sidebar-nav a.active {
    background-color: rgba(255,255,255,0.05);
    color: #fff;
    border-left: 4px solid var(--primary-blue);
}

.sidebar-nav a.text-danger {
    margin-top: auto; /* Pushes logout button to the bottom */
}

.main-wrapper {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.topbar {
    background: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: none; /* Hidden on desktop */
    color: var(--text-dark);
}

.user-profile-top {
    margin-left: auto; /* Pushes profile to the right */
}

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

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

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid #E2E8F0;
}

.stat-card h4 {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-navy);
}

/* ==========================================================================
   CUSTOM WYSIWYG EDITOR & TASK DETAIL
   ========================================================================== */
.custom-editor-toolbar {
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-bottom: none;
    padding: 8px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.custom-editor-toolbar button {
    background: #fff;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-dark);
    transition: background-color 0.2s;
}

.custom-editor-toolbar button:hover {
    background: var(--bg-gray);
}

.custom-editor-content {
    min-height: 150px;
    border: 1px solid #CBD5E1;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 12px;
    background: #fff;
    outline: none;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
}

/* Timeline / Report Discussion */
.report-timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 30px;
}

.report-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #E2E8F0;
}

.report-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 20px;
}

.report-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--primary-blue);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-blue);
}

/* ==========================================================================
   RESPONSIVE DESIGN (Tablets & Mobile)
   ========================================================================== */
@media (max-width: 768px) {
    /* Auth Layout */
    .auth-card {
        padding: 30px 20px;
    }

    /* Main Layout */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .menu-btn {
        display: block;
    }

    /* General Cards */
    .card {
        padding: 16px;
    }

    /* Task Detail Grid */
    div[style*="grid-template-columns: 2fr 1fr;"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Settings Grid */
    div[style*="display: flex; gap: 30px;"] {
        flex-direction: column;
        gap: 20px !important;
    }
}

.detail-tugas-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin-top: 10px;
    display: block;
}

/* Styling Slider On/Off ala iOS untuk Checklist */
.checklist-item {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 24px;
    background-color: #E9E9EA; /* Warna abu-abu saat OFF */
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
    outline: none;
    flex-shrink: 0; /* Mencegah slider gepeng dalam flexbox */
    margin: 0;
}

/* Bulatan/Knob di dalam Slider */
.checklist-item::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #FFFFFF;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.06);
}

/* Efek saat di-tarik/geser (Aktif/Checked) */
.checklist-item:checked {
    background-color: #34C759; /* Warna hijau khas iOS saat ON */
}

/* Menggeser bulatan ke kanan saat di-checked */
.checklist-item:checked::before {
    transform: translateX(18px);
}

/* Tampilan saat tombol dinonaktifkan (misal: tampilan untuk Boss yang di-disabled) */
.checklist-item:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}