/* Task Management System - Styles V3.07 - ApplyEasy Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f5f5; min-width: fit-content; }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #cefad0;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    width: 400px;
    max-width: 90%;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.login-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
}

.login-box input:focus {
    outline: none;
    border-color: #43A047;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #43A047;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.2s;
    cursor: pointer;
}

.forgot-password-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #43A047;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.captcha-container {
    margin: 20px 0;
    padding: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
}

.captcha-question {
    font-size: 18px;
    font-weight: bold;
    color: #374151;
    margin-bottom: 10px;
}

.captcha-input {
    width: 100px;
    padding: 8px;
    border: 2px solid #43A047;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

.back-to-login {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.back-to-login:hover {
    color: #43A047;
}

.login-box button:hover {
    background: #388E3C;
}

.login-box .error {
    background: #FFEBEE;
    color: #C62828;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.login-box .success {
    background: #E8F5E9;
    color: #1B5E20;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.login-box .info {
    margin-top: 20px;
    padding: 15px;
    background: #f0faf0;
    border-radius: 8px;
    font-size: 13px;
}

.login-box .info strong {
    display: block;
    margin-bottom: 5px;
}

/* Main App */
.header {
    background: #ffffff;
    color: #333;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header h1 { font-size: 20px; color: #333; font-weight: 700; }

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 1000;
}

.user-dropdown-item {
    padding: 12px 16px;
    color: #374151;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background: #f0faf0;
}

.user-badge {
    background: #388E3C;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
}

.admin-badge {
    background: #dc2626;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: #dc2626;
}

.container { margin: 20px auto; padding: 0 25px; width: 100%; max-width: 1600px; }

.actions {
    background: white;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    border: 1px solid #e5e7eb;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    margin-right: 5px;
    transition: all 0.2s;
}

.btn-primary { background: #43A047; color: white; }
.btn-secondary { background: #6b7280; color: white; }
.btn-success { background: #43A047; color: white; }
.btn-warning { background: #f59e0b; color: white; }
.btn-danger { background: #ef4444; color: white; }

.btn-primary:hover { background: #388E3C; }
.btn-secondary:hover { background: #4b5563; }
.btn-success:hover { background: #388E3C; }
.btn-warning:hover { background: #d97706; }
.btn-danger:hover { background: #dc2626; }



.table-row button {
    flex-shrink: 0;
}

.card {
    background: white;
    border-radius: 10px;
    margin-bottom: 20px;
    width: 100%;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    font-weight: 600;
    font-size: 16px;
}

.card-header-primary { background: #43A047; color: white; }
.card-header-secondary { background: #6b7280; color: white; }

.table-row {
    display: grid;
    grid-template-columns: 100px 190px 300px 120px 100px 150px 120px 60px 60px 100px;
    gap: 10px;
    padding: 14px 15px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

/* Completed tasks table with Date Completed column */
.completed-table-row {
    display: grid;
    grid-template-columns: 100px 150px 250px 100px 100px 100px 120px 120px 60px 60px 100px;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid #e5e7eb;
    align-items: center;
    color: #374151;
}

.completed-table-row div {
    color: #374151;
}

.completed-table-header {
    display: grid;
    grid-template-columns: 100px 150px 250px 100px 100px 100px 120px 120px 60px 60px 100px;
    gap: 10px;
    padding: 10px 15px;
    background: #f3f4f6;
    font-weight: bold;
    font-size: 14px;
    align-items: center;
    text-align: center;
    color: #888 !important;  /* Darker text for header */
}

.completed-table-header div {
    color: #888 !important;  /* Ensure all header cells have visible text */
}

.completed-table-row > div:nth-child(9),
.completed-table-row > div:nth-child(10),
.completed-table-row > div:nth-child(11) {
    margin-left: -8px;
}

.completed-table-header > div:nth-child(9),
.completed-table-header > div:nth-child(10),
.completed-table-header > div:nth-child(11) {
    margin-left: -8px;
}

.completed-table-row:hover { background: #f8faf8; }

.table-row > div:nth-child(8),
.table-row > div:nth-child(9),
.table-row > div:nth-child(10) {
    margin-left: -8px;
}

.table-row:hover { background: #f8faf8; }

/* Task Hierarchy Styles */
.task-with-deps {
    border-left: 5px solid #43A047;
    background: linear-gradient(to right, #f0faf0 0%, transparent 100%);
    padding-left: 10px;
}

.task-subtask {
    position: relative;
    background: #f9fafb;
}

.task-subtask.depth-1 {
    padding-left: 40px;
}

.task-subtask.depth-2 {
    padding-left: 80px;
}

.task-subtask.depth-3 {
    padding-left: 120px;
}

.task-subtask::before {
    content: "└─";
    position: absolute;
    left: 10px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}

.task-subtask.depth-2::before {
    left: 50px;
}

.task-subtask.depth-3::before {
    left: 90px;
}

/* Hover effects for hierarchy */
.task-with-deps:hover {
    background: linear-gradient(to right, #E8F5E9 0%, #f9fafb 100%);
}

.task-subtask:hover {
    background: #f3f4f6;
}

/* Optional: Vertical connecting lines for deeper hierarchy */
.task-subtask.depth-2::after,
.task-subtask.depth-3::after {
    content: "";
    position: absolute;
    left: 10px;
    top: -10px;
    bottom: 50%;
    width: 1px;
    background: #d1d5db;
}

.task-subtask.depth-3::after {
    left: 50px;
}

.table-header {
    display: grid;
    grid-template-columns: 100px 190px 300px 120px 100px 150px 120px 60px 60px 100px;
    gap: 10px;
    padding: 12px 15px;
    background: #fafafa;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-items: center;
    text-align: center;
    color: #888;
}

.table-header > div:nth-child(8),
.table-header > div:nth-child(9),
.table-header > div:nth-child(10) {
    margin-left: -8px;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

input, select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #43A047;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

.table-row input,
.table-row select {
    padding: 6px 8px;
    font-size: 14px;
}

.table-row input[type="date"] {
    text-align: center;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    min-width: 130px; /* Increased by 10% from 120px */
    padding: 6px 10px;
}

/* Global date input styling */
input[type="date"] {
    font-family: inherit;
    cursor: pointer;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* Complete removal of calendar icon */
input[type="date"] {
    position: relative;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
    display: none;
}

input[type="date"]::-moz-calendar-picker-indicator {
    opacity: 0;
}

input[type="date"]::-webkit-datetime-edit {
    text-align: center;
}

/* Filter date input - compact */
.filter-date-input {
    width: 140px;
    padding: 6px 10px;
    font-size: 14px;
    text-align: center;
}

.table-row > div {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.table-header > div {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.table-header > div:hover {
    background: #e5e7eb;
    border-radius: 4px;
}

.sort-indicator {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.6;
}

.empty { padding: 40px; text-align: center; color: #9ca3af; }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 900px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-content.large {
    width: 1200px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    font-size: 18px;
    font-weight: 600;
}

.modal-body { padding: 20px 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

/* Stats Modal Styles */
.stats-tabs {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.stats-tab {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #e5e7eb;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
}

.stats-tab.active {
    background: #43A047;
    color: white;
}

.stats-content {
    padding: 20px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card.green {
    background: linear-gradient(135deg, #66BB6A 0%, #43A047 100%);
}

.stat-card.blue {
    background: linear-gradient(135deg, #43A047 0%, #43A047 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-top: 20px;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.chart-label {
    width: 120px;
    font-weight: 500;
    color: #374151;
}

.chart-bar-bg {
    flex: 1;
    height: 30px;
    background: #e5e7eb;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #43A047 0%, #43A047 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: bold;
}

.month-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.month-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.month-btn:hover {
    background: #f3f4f6;
}

.month-btn.active {
    background: #43A047;
    color: white;
    border-color: #43A047;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input:not([type="checkbox"]),
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.form-group input[type="checkbox"] {
    width: auto;
    padding: 0;
    border: initial;
    border-radius: initial;
    cursor: pointer;
}

/* User Management */
.user-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.user-table th,
.user-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.user-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    position: sticky;
    top: 0;
}

.user-table tr:hover {
    background: #f8faf8;
}

.user-table td:nth-child(3) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-table .actions-cell {
    white-space: nowrap;
}

.user-table .actions-cell button {
    margin-right: 5px;
    margin-bottom: 5px;
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.role-admin { background: #FFEBEE; color: #C62828; }
.role-user { background: #E8F5E9; color: #2E7D32; }

.status-active { color: #43A047; font-weight: bold; }
.status-inactive { color: #ef4444; font-weight: bold; }

/* Urgency Color Coding */
.urgency-high {
    background: #FFEBEE;
    color: #C62828;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.urgency-medium {
    background: #FFF3E0;
    color: #E65100;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.urgency-low {
    background: #FFF8E1;
    color: #F57F17;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* Notes Section */
.notes-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.note-item {
    background: #f9fafb;
    border-left: 3px solid #43A047;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: #6b7280;
}

.note-author {
    font-weight: bold;
    color: #43A047;
}

.note-timestamp {
    font-style: italic;
}

.note-content {
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
}

.no-notes {
    text-align: center;
    color: #9ca3af;
    padding: 40px;
    font-style: italic;
}

.note-input {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
}

.notes-badge {
    background: #43A047;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 5px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}
.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
}

.alert-success {
    background: #E8F5E9;
    color: #1B5E20;
    border: 1px solid #A5D6A7;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}


.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    font-size: 14px;
}

.indicator-badge {
    display: inline-block;
    margin-left: 4px;
    font-size: 14px;
    cursor: help;
}

/* Dependency Management */
.dependency-section {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.dependency-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.dependency-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 8px 0;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-ongoing {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-complete {
    background: #E8F5E9;
    color: #1B5E20;
}

.status-pending {
    background: #FFF8E1;
    color: #F57F17;
}

.status-on-hold {
    background: #FFEBEE;
    color: #C62828;
}
