/* =====================================================
   Timeline Container
===================================================== */

.timeline-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--slate-200);
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.timeline-header {
    display: grid;
    grid-template-columns: 240px 1fr;
    border-bottom: 1px solid var(--slate-100);
    background: var(--slate-50);
}

.timeline-header>div {
    padding: var(--space-4);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-700);
}

.timeline-header .legend {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--slate-600);
}

.timeline-header .legend span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.timeline-header .legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.timeline-header .legend .dot.purple {
    background: var(--purple);
}

.timeline-header .legend .dot.amber {
    background: var(--amber);
}

.timeline-header .legend .dot.teal {
    background: var(--teal);
}

.timeline-header .legend .dot.rose {
    background: var(--rose);
}

.timeline-body {
    flex: 1;
    overflow-y: auto;
}

/* Staff Row */
.staff-row {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 140px;
    border-bottom: 1px solid var(--slate-100);
}

.staff-row:last-child {
    border-bottom: none;
}

.staff-row.is-me {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
}

/* Staff Profile */
.staff-profile {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-right: 1px solid var(--slate-100);
}

.staff-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.staff-avatar {
    position: relative;
}

.staff-avatar img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    border: 1px solid var(--slate-200);
}

.staff-avatar .me-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: white;
}

.staff-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--slate-800);
}

.staff-role {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-500);
    background: var(--slate-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-top: 2px;
    display: inline-block;
}

/* Performance Box */
.performance-box {
    background: var(--slate-50);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
}

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--space-1);
}

.performance-header .label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.performance-header .value {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-700);
}

.performance-header .value.complete {
    color: var(--success);
}

.performance-bar {
    height: 6px;
    background: var(--slate-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.performance-bar .fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.7s ease;
}

.performance-bar .fill.complete {
    background: var(--success);
}

.performance-footer {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-1);
    font-size: 0.5625rem;
    color: var(--slate-400);
}

/* Tasks Column */
.tasks-column {
    padding: var(--space-4);
    overflow-x: auto;
    display: flex;
    align-items: center;
}

.tasks-list {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    min-width: max-content;
    height: 100%;
}

/* Task Card */
.task-card {
    flex-shrink: 0;
    width: 256px;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.task-card.jobdesk {
    background: var(--purple-bg);
    border-color: #ddd6fe;
}

.task-card.request {
    background: var(--rose-bg);
    border-color: #fecdd3;
}

.task-card.tambahan {
    background: var(--amber-bg);
    border-color: #fde68a;
}

.task-card.inisiatif {
    background: var(--teal-bg);
    border-color: #99f6e4;
}

.task-card.done {
    opacity: 0.6;
    background: var(--success-bg);
    border-color: #a7f3d0;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-2);
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    border: 1px solid;
}

.category-badge svg {
    width: 10px;
    height: 10px;
}

.category-badge.jobdesk {
    background: var(--purple-bg);
    color: var(--purple);
    border-color: #ddd6fe;
}

.category-badge.request {
    background: var(--rose-bg);
    color: var(--rose);
    border-color: #fecdd3;
}

.category-badge.tambahan {
    background: var(--amber-bg);
    color: var(--amber);
    border-color: #fde68a;
}

.category-badge.inisiatif {
    background: var(--teal-bg);
    color: var(--teal);
    border-color: #99f6e4;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    border: 1px solid;
}

.status-badge svg {
    width: 10px;
    height: 10px;
}

.status-badge.todo {
    background: var(--slate-100);
    color: var(--slate-500);
    border-color: var(--slate-200);
}

.status-badge.in-progress {
    background: var(--info-bg);
    color: var(--info);
    border-color: #bfdbfe;
}

.status-badge.done {
    background: var(--success-bg);
    color: var(--success);
    border-color: #a7f3d0;
}

.task-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--slate-800);
    margin-bottom: var(--space-1);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-time {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.625rem;
    color: var(--slate-500);
    margin-bottom: var(--space-2);
}

.task-time svg {
    width: 10px;
    height: 10px;
}

/* Progress Bar */
.task-progress {
    margin-top: auto;
}

.task-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}

.task-progress-bar .fill {
    height: 100%;
    transition: width 0.3s ease;
}

.task-card.jobdesk .task-progress-bar .fill {
    background: var(--purple);
}

.task-card.request .task-progress-bar .fill {
    background: var(--rose);
}

.task-card.tambahan .task-progress-bar .fill {
    background: var(--amber);
}

.task-card.inisiatif .task-progress-bar .fill {
    background: var(--teal);
}

.task-card.done .task-progress-bar .fill {
    background: var(--success);
}

.task-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.5625rem;
    color: var(--slate-400);
}

.task-readonly {
    position: absolute;
    bottom: var(--space-2);
    right: var(--space-2);
    color: var(--slate-300);
}

/* Add Task Button */
.add-task-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px dashed var(--slate-300);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--slate-400);
    transition: var(--transition-fast);
    align-self: center;
    margin-left: var(--space-2);
}

.add-task-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.add-task-btn svg {
    width: 20px;
    height: 20px;
}

/* Task Connector */
.task-connector {
    width: 16px;
    height: 2px;
    background: var(--slate-200);
    align-self: center;
    flex-shrink: 0;
}

/* Empty State */
.tasks-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    color: var(--slate-400);
    font-size: 0.75rem;
    font-style: italic;
    width: 100%;
    height: 100%;
    min-width: 200px;
    opacity: 0.5;
}

.tasks-empty svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   Modals
===================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1040;
    transition: opacity 0.25s var(--ease-smooth);
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 500px;
    max-height: 92vh;
    overflow: hidden;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s var(--ease-spring);
}

.modal.modal-large {
    max-width: 800px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal.modal-top {
    top: 10%;
    transform: translateX(-50%);
    animation: modalInTop 0.3s var(--ease-spring);
}

@keyframes modalInTop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-16px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1060;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--slate-800);
    letter-spacing: -0.01em;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    border: none;
    cursor: pointer;
    color: var(--slate-500);
    transition: all 0.25s var(--ease-smooth);
}

.modal-close:hover {
    background: var(--slate-200);
    color: var(--slate-700);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    flex: 1;
}

/* Alert */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.78rem;
    margin-bottom: var(--space-4);
    font-weight: 500;
    line-height: 1.5;
}

.alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-rose {
    background: var(--rose-bg);
    color: #be123c;
    border: 1px solid #fecdd3;
}

.alert-amber {
    background: var(--amber-bg);
    color: #b45309;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-bg);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

/* Task Detail Modal Specifics */
.task-detail-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--slate-100);
}

.task-detail-badges {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.task-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: var(--space-2);
}

.task-detail-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 0.875rem;
    color: var(--slate-500);
}

.task-detail-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.task-detail-meta span.staff {
    background: var(--slate-100);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.task-detail-meta svg {
    width: 14px;
    height: 14px;
}

/* Checklist Section */
.checklist-section {
    background: rgba(248, 250, 252, 0.5);
    padding: var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-100);
    margin-bottom: var(--space-4);
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.checklist-header h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-700);
}

.checklist-header .progress {
    font-size: 0.75rem;
    color: var(--slate-400);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: white;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    cursor: pointer;
    transition: var(--transition-fast);
}

.checklist-item:hover {
    border-color: var(--primary-light);
}

.checklist-item.disabled {
    cursor: default;
    opacity: 0.8;
}

.checklist-item.disabled:hover {
    border-color: var(--slate-200);
}

.checklist-item .checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--slate-300);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.checklist-item.checked .checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.checklist-item .checkbox svg {
    width: 14px;
    height: 14px;
}

.checklist-item .text {
    font-size: 0.875rem;
    color: var(--slate-700);
}

.checklist-item.checked .text {
    color: var(--slate-400);
    text-decoration: line-through;
}

/* Attachments Section */
.attachments-section {
    margin-bottom: var(--space-4);
}

.attachments-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: var(--space-2);
}

.attachments-section h4 svg {
    width: 16px;
    height: 16px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--info-bg);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    text-decoration: none;
    transition: var(--transition-fast);
}

.attachment-item:hover {
    background: #dbeafe;
}

.attachment-icon {
    width: 36px;
    height: 36px;
    background: #bfdbfe;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--info);
}

.attachment-item:hover .attachment-icon {
    background: white;
}

.attachment-icon svg {
    width: 16px;
    height: 16px;
}

.attachment-info {
    flex: 1;
    overflow: hidden;
}

.attachment-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
}

.attachment-url {
    font-size: 0.75rem;
    color: var(--info);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-arrow {
    color: #93c5fd;
}

.attachment-arrow svg {
    width: 14px;
    height: 14px;
}

/* Add Attachment Form */
.add-attachment-form {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.add-attachment-form input {
    flex: 1;
    padding: var(--space-2);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
}

.add-attachment-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.add-attachment-form button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-800);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.add-attachment-form button:hover {
    background: var(--slate-900);
}

.add-attachment-form button svg {
    width: 16px;
    height: 16px;
}

/* Comments Section */
.comments-section {
    border-top: 1px solid var(--slate-100);
    padding-top: var(--space-4);
}

.comments-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: var(--space-3);
}

.comments-section h4 svg {
    width: 16px;
    height: 16px;
}

.comments-list {
    max-height: 192px;
    overflow-y: auto;
    margin-bottom: var(--space-4);
    padding-right: var(--space-1);
}

.comment-item {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    flex-shrink: 0;
}

.comment-content {
    background: var(--slate-50);
    padding: var(--space-3);
    border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-1);
}

.comment-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-700);
}

.comment-time {
    font-size: 0.625rem;
    color: var(--slate-400);
}

.comment-text {
    font-size: 0.875rem;
    color: var(--slate-600);
}

/* Comment Input */
.comment-input {
    display: flex;
    gap: var(--space-2);
}

.comment-input input {
    flex: 1;
    padding: var(--space-3);
    border: 1px solid var(--slate-300);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
}

.comment-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.comment-input button {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
}

.comment-input button:hover {
    background: var(--primary-dark);
}

.comment-input button svg {
    width: 18px;
    height: 18px;
}

/* Routine Options */
.routine-options {
    background: var(--purple-bg);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid #ddd6fe;
    margin-bottom: var(--space-4);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--purple);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--purple);
}

.routine-days {
    margin-top: var(--space-3);
}

.routine-days .label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--purple);
    margin-bottom: var(--space-1);
    display: block;
}

.day-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.day-btn {
    padding: 4px 8px;
    font-size: 0.625rem;
    font-weight: 600;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--slate-500);
    cursor: pointer;
    transition: var(--transition-fast);
}

.day-btn.active {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
}

.template-select {
    margin-top: var(--space-3);
    padding-top: var(--space-2);
    border-top: 1px solid #ddd6fe;
}

.template-select select {
    width: 100%;
    margin-top: var(--space-2);
    padding: var(--space-2);
    border: 1px solid #ddd6fe;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    background: white;
}

/* Users Table */
.users-header {
    margin-bottom: var(--space-4);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--slate-100);
}

.users-table th {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--slate-50);
}

.users-table td {
    font-size: 0.875rem;
}

.users-table .user-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.users-table .user-info img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--slate-100);
}

.users-table .actions {
    display: flex;
    gap: var(--space-2);
}

.users-table .status-active {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px 8px;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.users-table .status-active.active {
    background: var(--success-bg);
    color: var(--success);
}

.users-table .status-active.inactive {
    background: var(--slate-100);
    color: var(--slate-500);
}

