/* CSS Variables for Theming */
:root {
    /* Light Theme */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9f9;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #007aff;
    --accent-hover: #0051d5;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    --border: #d2d2d7;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-lg: rgba(0, 0, 0, 0.15);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --notification-bg: #ffffff;
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --success: #30d158;
    --warning: #ff9f0a;
    --danger: #ff453a;
    --border: #38383a;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
    --card-bg: #1c1c1e;
    --input-bg: #2c2c2e;
    --notification-bg: #2c2c2e;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.login-card {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
}

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

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-icon-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    position: relative;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.nav-icon-btn:hover {
    background: var(--bg-tertiary);
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* iOS Style Logout Button */
.user-menu .btn-small {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 400;
    border-radius: 6px;
    background: rgba(0, 122, 255, 0.1);
    border: none;
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .user-menu .btn-small {
    background: rgba(10, 132, 255, 0.15);
    color: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.user-menu .btn-small:hover {
    background: rgba(0, 122, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .user-menu .btn-small:hover {
    background: rgba(10, 132, 255, 0.2);
}

.user-menu .btn-small:active {
    background: rgba(0, 122, 255, 0.2);
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .user-menu .btn-small:active {
    background: rgba(10, 132, 255, 0.25);
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 70px;
    right: 20px;
    background: var(--notification-bg);
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--shadow-lg);
    width: 350px;
    max-height: 500px;
    overflow: hidden;
    z-index: 200;
    border: 1px solid var(--border);
    animation: slideDown 0.3s ease;
}

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

.notification-dropdown.hidden {
    display: none;
}

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

.notification-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: rgba(0, 122, 255, 0.08);
    position: relative;
    font-weight: 500;
}

[data-theme="dark"] .notification-item.unread {
    background: rgba(10, 132, 255, 0.15);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
}

.notification-item.unread .notification-message {
    color: var(--text-primary);
    font-weight: 500;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.notification-message {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.notification-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Main Container */
.main-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    display: none;
}

@media (min-width: 768px) {
    .sidebar {
        display: block;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
    border-radius: 10px;
    border: 1px solid transparent;
    margin: 0 12px;
}

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

.nav-link.active {
    background: var(--bg-tertiary);
    border-left-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
    border-color: rgba(0, 0, 0, 0.08);
}

.nav-link:active,
.nav-link:focus-visible {
    border-color: rgba(0, 0, 0, 0.16);
}

.nav-link .icon {
    font-size: 16px;
}

.nav-link .nav-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.points-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: auto;
    font-size: 11px;
    opacity: 0.8;
}

.points-summary small {
    display: block;
    line-height: 1.3;
}

.admin-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.section-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.admin-section.hidden {
    display: none;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
    box-shadow: 0 -2px 10px var(--shadow);
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    transition: color 0.2s;
    flex: 1;
    min-width: 0;
    border-radius: 12px;
    border: 1px solid transparent;
}

.bottom-nav-link.active {
    color: var(--accent);
    background: var(--bg-tertiary);
    border-color: rgba(0, 0, 0, 0.08);
}

.bottom-nav-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--border);
}

.bottom-nav-link:active,
.bottom-nav-link:focus-visible {
    border-color: rgba(0, 0, 0, 0.16);
}

.bottom-nav-link .icon {
    font-size: 16px;
}

.bottom-nav-link .nav-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Content Area */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    padding-bottom: 80px;
}

@media (min-width: 768px) {
    .content {
        padding-bottom: 20px;
    }
}

.page {
    display: none;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.page-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-primary);
}

.page-header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-lg);
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tasks List */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-card {
    background: var(--card-bg);
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 3px solid var(--accent);
}

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

.task-card.completed {
    opacity: 0.7;
    border-left-color: var(--success);
}

.task-card.status-completed {
    background-color: rgba(52, 199, 89, 0.12);
}

[data-theme="dark"] .task-card.status-completed {
    background-color: rgba(48, 209, 88, 0.18);
}

.task-card.high-priority {
    border-left-color: #0f8a1f;
}

.task-card.medium-priority {
    border-left-color: #28a745;
}

.task-card.low-priority {
    border-left-color: #9adf9a;
}

.task-card.failed-overdue {
    background-color: #ffe5e5;
}

[data-theme="dark"] .task-card.failed-overdue {
    background-color: rgba(255, 59, 48, 0.15);
}

.task-card.status-failed {
    background-color: #ffe5e5;
}

[data-theme="dark"] .task-card.status-failed {
    background-color: rgba(255, 69, 58, 0.2);
}

.task-card.status-pending {
    background-color: var(--card-bg);
}

.task-card.failed-overdue.failed {
    border-left-color: var(--danger);
}

.task-card.failed-overdue.overdue {
    border-left-color: var(--warning);
}

.task-card.disabled-task {
    opacity: 0.6;
    background: var(--bg-tertiary);
    border-left-color: var(--text-secondary);
}

.task-card.disabled-task .task-title {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-number-badge {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.task-status {
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
}

.task-status.completed {
    color: var(--success);
    background-color: rgba(52, 199, 89, 0.1);
}

.countdown-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 8px;
    font-size: 13px;
}

.countdown-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.countdown-value {
    color: #000000; /* Default black color for 5 hours or more */
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.task-card.failed .countdown-value {
    color: var(--danger);
}

/* Remaining time color classes */
.countdown-timer.remaining-time-red .countdown-value {
    color: #dc3545; /* Red color for less than 2 hours */
}

.countdown-timer.remaining-time-orange .countdown-value {
    color: #fd7e14; /* Orange color for 2-5 hours */
}

/* End time display in countdown timer */
.countdown-end-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding-left: 8px;
    border-left: 1px solid var(--border);
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.countdown-end-icon {
    font-size: 10px;
    line-height: 1;
}

.countdown-end-text {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.task-status.failed {
    color: var(--danger);
    background-color: rgba(255, 59, 48, 0.1);
}

.task-status.overdue {
    color: var(--danger);
    background-color: rgba(255, 59, 48, 0.1);
}

[data-theme="dark"] .task-status.completed {
    background-color: rgba(48, 209, 88, 0.2);
}

[data-theme="dark"] .task-status.failed,
[data-theme="dark"] .task-status.overdue {
    background-color: rgba(255, 69, 58, 0.2);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.task-title-section {
    flex: 1;
}

.task-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.3;
}

.task-title .completed-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    vertical-align: text-bottom;
}

.task-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

.task-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.task-meta-item.negative-value {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.task-priority {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.task-priority.high {
    background: rgba(15, 138, 31, 0.25);
    color: #0f8a1f;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.task-priority.medium {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.task-priority.low {
    background: rgba(154, 223, 154, 0.3);
    color: #6fa86f;
}

.task-timer {
    background: var(--bg-tertiary);
    padding: 10px 15px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin: 10px 0;
    display: inline-block;
}

.task-timer.warning {
    color: var(--warning);
}

.task-timer.danger {
    color: var(--danger);
}

.task-description {
    color: var(--text-secondary);
    margin: 8px 0;
    line-height: 1.5;
    font-size: 12px;
}

.disable-reason-box {
    margin: 15px 0;
    padding: 12px 14px;
    background: rgba(255, 59, 48, 0.08);
    border-left: 3px solid var(--danger);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.disable-reason-box:hover {
    background: rgba(255, 59, 48, 0.12);
}

.disable-reason-box .reason-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.disable-reason-box .reason-header strong {
    font-size: 13px;
    color: var(--danger);
    font-weight: 600;
}

.disable-reason-box .reason-text {
    font-size: 13px;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    word-wrap: break-word;
}

[data-theme="dark"] .disable-reason-box {
    background: rgba(255, 69, 58, 0.15);
}

[data-theme="dark"] .disable-reason-box:hover {
    background: rgba(255, 69, 58, 0.2);
}

.task-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 8px;
}

.task-status-completed {
    color: var(--success);
    font-weight: 600;
    font-size: 13px;
}

.task-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
    padding-top: 8px;
    margin-top: 8px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

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

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

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

.btn-success:hover {
    background: #28a745;
}

.btn-complete {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-complete:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
}

.btn-info:hover {
    background-color: #138496;
}

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

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

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

/* Filter Buttons */
.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn, .period-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.filter-btn:hover, .period-btn:hover {
    background: var(--bg-tertiary);
}

.filter-btn.active, .period-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.period-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Progress Page */
.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.progress-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
    overflow: visible;
}

.progress-card h3 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.progress-ring {
    transform: rotate(-90deg);
    display: block;
    overflow: visible;
}

.progress-ring-circle {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.progress-ring-circle.progress {
    stroke: var(--accent);
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.5s;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-bar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-primary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.5s;
}

.progress-fill.completed-fill {
    background: var(--success);
}

.progress-fill.in-progress-fill {
    background: var(--warning);
}

.progress-fill.pending-fill {
    background: var(--danger);
}

.period-info {
    margin-top: 10px;
    padding: 10px 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.period-info #periodDateRange {
    font-weight: 500;
    color: var(--text-primary);
}

.progress-summary {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.summary-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.points-breakdown {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.breakdown-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 8px;
}

.breakdown-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}

.breakdown-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.breakdown-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.breakdown-value.highlight {
    color: var(--accent);
    font-size: 20px;
}

.breakdown-value.negative {
    color: var(--danger);
}

.breakdown-value.highlight.negative {
    color: var(--danger);
    font-size: 20px;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
    border-left: 4px solid var(--accent);
    transition: background-color 0.3s ease;
}

.history-item.history-status-completed {
    background-color: #d4edda;
    border-left-color: var(--success);
}

[data-theme="dark"] .history-item.history-status-completed {
    background-color: rgba(48, 209, 88, 0.15);
}

.history-item.history-status-failed {
    background-color: #f8d7da;
    border-left-color: var(--danger);
}

[data-theme="dark"] .history-item.history-status-failed {
    background-color: rgba(255, 69, 58, 0.15);
}

.history-item.history-status-pending {
    background-color: var(--card-bg);
    border-left-color: var(--accent);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-completed {
    background-color: var(--success);
    color: white;
}

.status-badge.status-failed {
    background-color: var(--danger);
    color: white;
}

.status-badge.status-pending {
    background-color: var(--accent);
    color: white;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-title {
    font-weight: 600;
    font-size: 16px;
}

.history-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-details {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Points Page */
.points-display-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.points-display-card {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 30px var(--shadow-lg);
}

.points-display-card.task-points {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.points-display-card.quality-points {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.points-large {
    color: white;
}

.points-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.points-large h2 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 5px;
}

.points-large p {
    font-size: 16px;
    opacity: 0.9;
}

.points-breakdown {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
}

.points-breakdown h2 {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item.total {
    font-weight: 700;
    font-size: 18px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.breakdown-item .negative {
    color: var(--danger);
}

/* Admin Pages */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
    text-align: center;
}

.admin-stat-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.admin-stat-card p {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-section-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
    margin-bottom: 20px;
}

.admin-section-card h2 {
    margin-bottom: 20px;
    font-size: 17px;
    font-weight: 600;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    margin-bottom: 0;
    font-size: 17px;
    font-weight: 600;
}

/* iOS-style Select Dropdown */
.ios-select-wrapper {
    position: relative;
    min-width: 160px;
    max-width: 200px;
    flex-shrink: 0;
}

.ios-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 10px 40px 10px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    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='%2386868b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.ios-select:hover {
    border-color: var(--accent);
    background-color: var(--bg-tertiary);
}

.ios-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

[data-theme="dark"] .ios-select {
    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='%2398989d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.performance-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.performance-item {
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.performance-info h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.performance-info p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.performance-stats {
    text-align: right;
}

.performance-stats .stat-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.performance-stats .stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 2px;
}

/* Users List */
.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.user-card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.user-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.user-card.admin-card {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05) 0%, var(--card-bg) 100%);
    border: 1px solid rgba(0, 122, 255, 0.2);
}

[data-theme="dark"] .user-card.admin-card {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.1) 0%, var(--card-bg) 100%);
    border: 1px solid rgba(10, 132, 255, 0.3);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.user-role {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-role.admin {
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent);
}

.user-role.user {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
}

.user-info-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
}

.user-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 9px 0;
    border-bottom: 0.5px solid var(--border);
    min-height: 34px;
}

.user-info-item:last-child {
    border-bottom: none;
}

.user-info-label {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 12.5px;
    min-width: 120px;
    padding-right: 12px;
    letter-spacing: -0.1px;
    line-height: 1.4;
}

.user-info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 12.5px;
    flex: 1;
    text-align: right;
    word-break: break-word;
    letter-spacing: -0.1px;
    line-height: 1.4;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.password-display {
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    letter-spacing: 1.5px;
    font-size: 11.5px;
    color: var(--text-primary);
    font-weight: 500;
}

.password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

.password-toggle:hover {
    background: var(--bg-tertiary);
}

.password-toggle:active {
    transform: scale(0.95);
}

.eye-icon {
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
}

.password-toggle:hover .eye-icon {
    opacity: 1;
}

.leave-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
}

.leave-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(255, 149, 0, 0.12);
    color: var(--warning);
    border: 0.5px solid rgba(255, 149, 0, 0.3);
    letter-spacing: -0.1px;
}

.leave-badge.today {
    background: rgba(255, 59, 48, 0.12);
    color: var(--danger);
    border-color: rgba(255, 59, 48, 0.3);
    font-weight: 600;
}

.user-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.user-stat-label {
    color: var(--text-secondary);
}

.user-stat-value {
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    padding: 0;
    line-height: 1.5;
}

.form-group label strong {
    font-weight: 600;
    padding: 0 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.form-group textarea {
    resize: vertical;
}

.form-group select[multiple] {
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.image-preview {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--bg-secondary);
}

.image-preview button {
    align-self: flex-start;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Skip Days Container */
.skip-days-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-tertiary);
}

.skip-day-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 14px;
    color: var(--text-primary);
}

.skip-day-checkbox:hover {
    background: var(--bg-secondary);
}

.skip-day-checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.skip-day-checkbox input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    padding: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
}

.modal form {
    padding: 28px;
}

.modal-content > .form-group {
    padding: 0 28px;
    margin-bottom: 20px;
}

.modal-content > .form-group:first-of-type {
    padding-top: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding: 20px 28px 24px 28px;
    border-top: 1px solid var(--border);
}

/* Reports */
.reports-filter-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

/* iOS-style Select */
.ios-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.ios-select {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.ios-select:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px var(--shadow-md);
}

.ios-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.ios-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.ios-select-wrapper:hover::after {
    color: var(--primary);
}

/* Custom Date Range */
.custom-date-range {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ios-date-input {
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--shadow);
    flex: 1;
    min-width: 140px;
}

.ios-date-input:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 10px var(--shadow-md);
}

.ios-date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.date-separator {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.reports-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.report-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 15px var(--shadow);
}

.report-card h3 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

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

.report-table th,
.report-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.report-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
}

.report-table td {
    font-size: 14px;
}

.report-table tr:last-child td {
    border-bottom: none;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.negative-value {
    color: #ff3b30;
    font-weight: 500;
}

@media (max-width: 768px) {
    .reports-filter-container {
        gap: 12px;
    }
    
    .ios-select-wrapper {
        max-width: 100%;
    }
    
    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ios-date-input {
        width: 100%;
    }
    
    .date-separator {
        display: none;
    }
    
    .report-table {
        font-size: 12px;
    }
    
    .report-table th,
    .report-table td {
        padding: 8px;
    }
    
    .table-responsive {
        overflow-x: scroll;
    }
}

/* Task Notes & Attachments */
.task-notes {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.task-attachments {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-size: 13px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .navbar {
        padding: 12px 15px;
    }

    .nav-title {
        font-size: 18px;
    }

    .user-menu {
        font-size: 14px;
    }

    .content {
        padding: 15px;
    }

    .page-header h1 {
        font-size: 24px;
    }

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

    .notification-dropdown {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }

    .modal-content {
        max-width: 100%;
    }

    .task-header {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Admin Stats Grid - 2x2 on mobile */
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .admin-stat-card {
        padding: 18px;
    }

    .admin-stat-card h3 {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .admin-stat-card p {
        font-size: 24px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ios-select-wrapper {
        width: 100%;
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* User Dashboard Redesign Styles */
.dashboard-page {
    --dash-blue: #2f80ed;
    --dash-purple: #9b51e0;
    --dash-pink: #eb5757;
    --dash-teal: #00b894;
    --dash-orange: #f2994a;
}

.dashboard-page .content {
    background: linear-gradient(180deg, rgba(47, 128, 237, 0.08) 0%, rgba(155, 81, 224, 0.04) 35%, transparent 70%);
    border-top-left-radius: 18px;
    margin-bottom: 100px;
}

.dashboard-page .page-header {
    padding: 16px 18px;
    border-radius: 18px;
    background: #283bbf;
    border: 1px solid rgba(40, 59, 191, 0.55);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .dashboard-page .page-header {
    background: #283bbf;
    border-color: rgba(40, 59, 191, 0.6);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.dashboard-page .page-header h1,
.dashboard-page .page-header .page-subtitle {
    color: #ffffff;
}

.dashboard-page .page-subtitle {
    font-weight: 500;
}

.dashboard-page .date-range-inline {
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .dashboard-page .date-range-inline {
    background: rgba(28, 28, 30, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
}

.dashboard-page .points-metric-card,
.dashboard-page .today-stat-card {
    border: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .dashboard-page .points-metric-card,
[data-theme="dark"] .dashboard-page .today-stat-card {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}

.dashboard-page .points-metric-card.task-points {
    background: linear-gradient(135deg, #27ae60, var(--dash-teal));
    color: #fff;
}

.dashboard-page .points-metric-card.lost-task-points {
    background: linear-gradient(135deg, var(--dash-pink), var(--dash-orange));
    color: #fff;
}

.dashboard-page .points-metric-card.quality-points {
    background: linear-gradient(135deg, var(--dash-purple), #bb6bd9);
    color: #fff;
}

.dashboard-page .points-metric-card.lost-quality-points {
    background: linear-gradient(135deg, #f2c94c, var(--dash-orange));
    color: #fff;
}

.dashboard-page .points-metric-card .metric-info p,
.dashboard-page .points-metric-card .metric-info h3,
.dashboard-page .today-stat-card .today-stat-info p,
.dashboard-page .today-stat-card .today-stat-info h3 {
    color: inherit;
}

.dashboard-page .metric-icon,
.dashboard-page .today-stat-icon {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.dashboard-page .today-stats-grid .today-stat-card:nth-child(1) {
    background: linear-gradient(135deg, var(--dash-blue), #56ccf2);
    color: #fff;
}

.dashboard-page .today-stats-grid .today-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f2c94c, var(--dash-orange));
    color: #fff;
}

.dashboard-page .today-stats-grid .today-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #27ae60, var(--dash-teal));
    color: #fff;
}

.dashboard-page .pending-tasks-section h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(47, 128, 237, 0.12);
    border: 1px solid rgba(47, 128, 237, 0.2);
}

[data-theme="dark"] .dashboard-page .pending-tasks-section h2 {
    background: rgba(47, 128, 237, 0.22);
    border-color: rgba(47, 128, 237, 0.35);
}

.dashboard-page .task-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    background: var(--card-bg);
}

[data-theme="dark"] .dashboard-page .task-card {
    border-color: rgba(255, 255, 255, 0.08);
    background: var(--card-bg);
}

.dashboard-page .task-card.high-priority {
    border-left-color: #27ae60;
}

.dashboard-page .task-card.medium-priority {
    border-left-color: #f2994a;
}

.dashboard-page .task-card.low-priority {
    border-left-color: #56ccf2;
}

.dashboard-page .task-card.failed-overdue,
.dashboard-page .task-card.status-failed {
    background: rgba(235, 87, 87, 0.1);
}

[data-theme="dark"] .dashboard-page .task-card.failed-overdue,
[data-theme="dark"] .dashboard-page .task-card.status-failed {
    background: rgba(235, 87, 87, 0.2);
}

.dashboard-page .progress-bar-wrapper {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}
.date-range-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-input-inline {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 11px;
    font-family: inherit;
    transition: border-color 0.2s;
    height: 24px;
}

.date-input-inline:focus {
    outline: none;
    border-color: var(--accent);
}

.date-separator {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
}

.points-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.points-metric-card {
    background: var(--card-bg);
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 3px solid var(--accent);
}

.points-metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.points-metric-card.task-points {
    border-left-color: var(--success);
}

.points-metric-card.lost-task-points {
    border-left-color: var(--danger);
}

.points-metric-card.quality-points {
    border-left-color: var(--warning);
}

.points-metric-card.lost-quality-points {
    border-left-color: #ff9500;
}

.metric-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 10px;
    flex-shrink: 0;
}

.metric-info {
    flex: 1;
    min-width: 0;
}

.metric-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.metric-info h3.negative-value {
    color: var(--danger);
}

.metric-info p {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
}

.today-stats-section {
    margin-bottom: 20px;
}

.today-stats-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 16px;
    flex-wrap: nowrap;
}

.today-stats-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.today-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

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

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

.today-stat-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 10px;
    flex-shrink: 0;
}

.today-stat-info {
    flex: 1;
    min-width: 0;
}

.today-stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.today-stat-info p {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
}

.progress-section-inline {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.progress-bar-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.progress-label {
    display: flex;
    justify-content: flex-end;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 45px;
}

.progress-bar-wrapper {
    height: 8px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    flex: 1;
    min-width: 0;
}

[data-theme="dark"] .progress-bar-wrapper {
    background: rgba(255, 255, 255, 0.15);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success) 0%, var(--accent) 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.pending-tasks-section {
    margin-bottom: 20px;
}

.pending-tasks-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.task-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-select,
.filter-date {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    transition: border-color 0.2s;
    min-width: 120px;
}

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

.filter-date {
    min-width: 140px;
}

.task-countdown {
    background: var(--bg-tertiary);
    padding: 6px 10px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    display: inline-block;
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.task-countdown.warning {
    color: var(--warning);
    background: rgba(255, 149, 0, 0.1);
}

.task-countdown.danger {
    color: var(--danger);
    background: rgba(255, 59, 48, 0.1);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@media (max-width: 767px) {
    .page-header-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-range-inline {
        width: 100%;
        justify-content: flex-start;
    }

    .date-input-inline {
        flex: 1;
        min-width: 0;
    }

    .points-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .points-metric-card {
        padding: 12px;
    }
    
    .today-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .today-stat-card {
        padding: 12px;
        gap: 0;
        text-align: center;
        justify-content: center;
    }
    
    .today-stat-icon {
        display: none;
    }
    
    .today-stat-info {
        text-align: center;
    }

    .today-stats-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .progress-section-inline {
        min-width: 200px;
        width: 100%;
    }

    .task-filters {
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filter-group {
        flex: 1;
        min-width: 0;
        gap: 4px;
    }

    .filter-group label {
        font-size: 10px;
        white-space: nowrap;
    }

    .filter-select,
    .filter-date {
        min-width: 0;
        width: 100%;
        font-size: 11px;
        padding: 5px 8px;
    }

    .filter-date {
        min-width: 0;
    }

    /* Progress Page Mobile Styles */
    .period-selector {
        gap: 6px;
        margin-top: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .period-selector::-webkit-scrollbar {
        height: 4px;
    }

    .period-btn {
        padding: 6px 10px;
        font-size: 11px;
        flex: 0 0 auto;
        min-width: fit-content;
        white-space: nowrap;
    }

    .period-info {
        margin-top: 8px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .progress-stats {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .progress-card {
        padding: 20px 15px;
        overflow: visible;
    }

    .progress-card h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .progress-circle {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
        margin: 10px auto;
    }

    .progress-ring {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
    }

    .progress-ring-circle {
        stroke-width: 7;
    }

    .progress-ring-circle.progress {
        stroke-width: 7;
    }

    .progress-percentage {
        font-size: 22px;
    }

    .progress-summary {
        margin-top: 15px;
        padding-top: 15px;
        gap: 10px;
    }

    .summary-item {
        gap: 4px;
    }

    .summary-label {
        font-size: 11px;
    }

    .summary-value {
        font-size: 18px;
    }

    .points-breakdown {
        gap: 12px;
    }

    .breakdown-item {
        padding: 10px;
        gap: 12px;
    }

    .breakdown-icon {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }

    .breakdown-label {
        font-size: 12px;
    }

    .breakdown-value {
        font-size: 16px;
    }

    .breakdown-value.highlight {
        font-size: 18px;
    }

    .points-history-section {
        margin-top: 20px;
    }

    .points-history-section h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .history-item {
        padding: 15px;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .history-title {
        font-size: 14px;
    }

    .history-time {
        font-size: 11px;
    }

    .history-details {
        font-size: 12px;
        margin-top: 8px;
    }
}

/* Custom Toast/Alert Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 100%;
}

.toast {
    background: var(--card-bg) !important;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
    min-width: 300px;
    max-width: 400px;
    color: var(--text-primary) !important;
}

.toast.success {
    border-left-color: var(--success);
    background: var(--card-bg);
    border-left-width: 4px;
}

.toast.error {
    border-left-color: var(--danger);
    background: var(--card-bg);
    border-left-width: 4px;
}

.toast.info {
    border-left-color: var(--accent);
    background: var(--card-bg);
    border-left-width: 4px;
}

.toast.warning {
    border-left-color: var(--warning);
    background: var(--card-bg);
    border-left-width: 4px;
}

/* Ensure text is always visible */
.toast * {
    color: inherit;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.info .toast-icon {
    color: var(--accent);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-content {
    flex: 1;
    padding: 0;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin: 0 0 4px 0;
    padding: 0;
    color: var(--text-primary) !important;
    line-height: 1.4;
}

.toast-message {
    font-size: 14px;
    margin: 0;
    padding: 0;
    color: var(--text-primary) !important;
    line-height: 1.5;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
    line-height: 1;
    opacity: 0.7;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    opacity: 1;
}

/* iOS Style Confirmation Modal */
#iosConfirmModal .ios-modal-content {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    background: var(--bg-secondary);
}

#iosConfirmModal .ios-confirm-header {
    background: var(--bg-secondary);
}

#iosConfirmModal .ios-confirm-body {
    background: var(--bg-secondary);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#iosConfirmModal .ios-confirm-actions {
    background: var(--bg-secondary);
}

#iosConfirmModal .ios-confirm-btn {
    transition: background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

#iosConfirmModal .ios-confirm-btn:active {
    background-color: var(--bg-tertiary);
}

#iosConfirmModal .ios-confirm-cancel {
    color: var(--accent);
}

#iosConfirmModal .ios-confirm-ok {
    color: var(--danger);
}

[data-theme="dark"] #iosConfirmModal .ios-modal-content {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOutRight 0.3s ease-in forwards;
}

@media (max-width: 768px) {
    .toast-container {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Clickable Count Styling */
.clickable-count {
    cursor: pointer;
    color: var(--accent) !important;
    font-weight: 600 !important;
    transition: all 0.2s;
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-block;
}

.clickable-count:hover {
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.05);
}

.clickable-count:active {
    transform: scale(0.98);
}

[data-theme="dark"] .clickable-count {
    color: var(--accent) !important;
}

[data-theme="dark"] .clickable-count:hover {
    background: rgba(10, 132, 255, 0.15);
}

/* iOS Style Modal */
.ios-modal .modal-content {
    max-width: 500px;
    width: 90%;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

.ios-modal-header {
    padding: 20px 24px;
    border-bottom: 0.5px solid var(--border);
    background: var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ios-modal-header h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    letter-spacing: -0.2px;
    flex: 1;
}

.ios-modal-toolbar {
    padding: 12px 20px;
    border-bottom: 0.5px solid var(--border);
    background: var(--bg-secondary);
}

.ios-date-picker-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ios-date-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ios-date-input {
    flex: 1;
    padding: 8px 12px;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s;
    min-width: 0;
}

.ios-date-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.ios-clear-date-btn {
    padding: 6px 10px;
    border: 0.5px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
    min-width: 32px;
    text-align: center;
}

.ios-clear-date-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent);
}

.ios-clear-date-btn:active {
    transform: scale(0.95);
}

.ios-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px 0 18px;
    background: var(--bg-primary);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ios-modal-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.ios-task-item {
    background: var(--card-bg);
    margin: 0 16px 12px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.ios-task-item.ios-task-item-completed {
    background: rgba(52, 199, 89, 0.12) !important;
    border: 1px solid rgba(52, 199, 89, 0.4);
}

.ios-task-item.ios-task-item-completed:hover {
    background: rgba(52, 199, 89, 0.16) !important;
}

.ios-task-complete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 6px;
}

.ios-task-item:last-child {
    border-bottom: none;
}

.ios-task-item:hover {
    background: var(--bg-tertiary);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.ios-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}

.ios-task-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ios-task-status {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 0.5px solid;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-icon {
    font-size: 11px;
    font-weight: 700;
}

.ios-task-completed {
    opacity: 0.85;
}

.ios-task-completed .ios-task-name {
    text-decoration: line-through;
    opacity: 0.7;
}

.ios-task-name {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    flex: 1;
    line-height: 1.3;
}

.ios-task-priority {
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 0.5px solid;
    flex-shrink: 0;
}

.ios-task-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    padding: 0;
    line-height: 1.5;
    letter-spacing: -0.1px;
}

.ios-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.ios-task-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.ios-meta-icon {
    font-size: 13px;
    opacity: 0.7;
}

.ios-task-points {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.ios-point-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 0.5px solid var(--border);
}

.ios-empty-state {
    padding: 60px 24px;
    text-align: center;
}

.ios-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ios-empty-state h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px 0;
    padding: 0;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.ios-empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

.loading-spinner {
    padding: 60px 24px;
    text-align: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
}

/* Tasks Search and Filters */
.tasks-search-filters {
    margin-bottom: 20px;
}

.search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 0.5px solid var(--border);
}

.search-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.search-group input[type="text"] {
    padding: 10px 14px;
    border: 0.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.2s;
    width: 100%;
}

.search-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-group input[type="text"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Tasks Filters */
.tasks-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 0.5px solid var(--border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Task Card Item */
.task-card-item {
    transition: opacity 0.2s;
}

.task-card-item[style*="display: none"] {
    display: none !important;
}

/* iOS Task Detail Styles */
.ios-task-detail {
    padding: 0;
}

/* Modern iOS Task Detail Hero Section */
.ios-task-detail-hero {
    padding: 24px 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--card-bg) 100%);
    border-bottom: 0.5px solid var(--border);
}

.ios-task-badge-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ios-task-type-badge {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ios-task-number {
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: inline-block;
}

/* Modern iOS Detail Sections */
.ios-detail-section {
    margin-top: 8px;
}

.ios-detail-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 20px 8px;
    background: var(--bg-secondary);
}

.ios-detail-item {
    background: var(--card-bg);
    border-bottom: 0.5px solid var(--border);
    transition: background-color 0.2s ease;
}

.ios-detail-item:last-child {
    border-bottom: none;
}

.ios-detail-item-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    min-height: 44px;
}

.ios-detail-icon {
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.ios-detail-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ios-detail-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.3;
}

.ios-detail-value {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

.ios-point-value {
    font-weight: 600;
    color: var(--accent);
    font-size: 17px;
}

.ios-notes-content {
    padding: 16px 20px;
    background: var(--bg-secondary);
}

.ios-notes-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* Dark mode adjustments */
[data-theme="dark"] .ios-task-detail-hero {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
}

[data-theme="dark"] .ios-task-type-badge,
[data-theme="dark"] .ios-task-number {
    background: rgba(255, 255, 255, 0.08);
}

.ios-modal-actions {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 0.5px solid var(--border);
    background: var(--bg-secondary);
    justify-content: flex-end;
}

/* Task Stats (Completed/Pending Counts) - iOS Style */
.ios-task-stats {
    display: flex;
    gap: 10px;
    padding: 12px 16px 6px;
    background: var(--bg-secondary);
}

.ios-stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 0.5px solid var(--border);
    transition: all 0.2s;
}

.ios-stat-item.completed {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.08) 0%, rgba(52, 199, 89, 0.03) 100%);
    border-color: rgba(52, 199, 89, 0.25);
}

.ios-stat-item.pending {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.08) 0%, rgba(255, 149, 0, 0.03) 100%);
    border-color: rgba(255, 149, 0, 0.25);
}

.ios-stat-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.ios-stat-item.completed .ios-stat-icon {
    background: rgba(52, 199, 89, 0.15);
    color: #34c759;
}

.ios-stat-item.pending .ios-stat-icon {
    background: rgba(255, 149, 0, 0.15);
    color: #ff9500;
}

.ios-stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.ios-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1.2;
}

.ios-stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.ios-stat-item.completed .ios-stat-value {
    color: #34c759;
}

.ios-stat-item.pending .ios-stat-value {
    color: #ff9500;
}

[data-theme="dark"] .ios-stat-item.completed {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.12) 0%, rgba(52, 199, 89, 0.05) 100%);
    border-color: rgba(52, 199, 89, 0.3);
}

[data-theme="dark"] .ios-stat-item.pending {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.12) 0%, rgba(255, 149, 0, 0.05) 100%);
    border-color: rgba(255, 149, 0, 0.3);
}

[data-theme="dark"] .ios-stat-item.completed .ios-stat-icon {
    background: rgba(52, 199, 89, 0.2);
}

[data-theme="dark"] .ios-stat-item.pending .ios-stat-icon {
    background: rgba(255, 149, 0, 0.2);
}
