:root {
    --sidebar-width: 200px;
    --topbar-height: 60px;
    --navy: #1d2953;
    --navy-light: #2a3a6c;
    --navy-mid: #1d2953;
    --navy-accent: #1d2953;
    --primary: #1877f2;
    --primary-dark: #166fe5;
    --bg: #f0f2f5;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

body {
    background: var(--bg);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
}

/* ─── AUTH / LOGIN ─── */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1d2953;
}

.auth-container {
    background: rgba(255,255,255,0.92);
    padding: 44px 40px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    width: 400px;
    max-width: 92vw;
    animation: fadeInUp 0.6s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.15);
}

.auth-brand {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo {
    display: inline-block;
    max-width: 100%;
    width: 340px;
    height: auto;
}

.auth-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    color: #002d5b;
    margin: 0 0 4px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.auth-subtitle {
    text-align: center;
    font-size: 14px;
    color: #6b7a8f;
    margin: 0 0 28px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2953;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-icon-wrap {
    position: relative;
    width: 100%;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    z-index: 2;
    font-size: 14px;
}

.input-icon-wrap .form-control {
    padding-left: 42px;
    border: 2px solid #dce3ed;
    border-radius: 10px;
    background: #fafcff;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.input-icon-wrap .form-control:focus {
    border-color: #1d2953;
    box-shadow: 0 0 0 3px rgba(29,41,83,0.12);
    background: #fff;
}


.auth-btn {
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #002d5b 0%, #1d2953 100%);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
    margin-top: 4px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0,45,91,0.3);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(29,41,83,0.35);
}

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

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #999;
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}
.auth-divider span {
    padding: 0 12px;
}

.trimble-btn:hover {
    background: #f5f5f5 !important;
    border-color: #999 !important;
    transform: translateY(-2px);
}

.error {
    color: #d32f2f;
    background: #fce4ec;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    text-align: center;
    border: 1px solid #f5c6cb;
}

.success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #dee2e6;
    z-index: 100;
}
body.sidebar-anim .sidebar {
    transition: var(--transition);
}

.sidebar-brand {
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.sidebar .nav-link {
    color: #495057;
    padding: 12px 20px;
    border-radius: 0;
    transition: var(--transition);
    font-size: 14px;
}

.sidebar .nav-link:hover {
    background: #e9ecef;
    color: var(--primary);
    padding-left: 24px;
}

.sidebar .nav-link.active {
    background: #e9ecef !important;
    color: var(--primary) !important;
    font-weight: 600;
    border-right: 3px solid var(--primary);
}

.sidebar .nav-link.active i {
    color: var(--primary) !important;
}

.sidebar .nav-link i {
    width: 22px;
    margin-right: 4px;
}


.sidebar .nav-sidebar {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
}
.sidebar .nav-sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar .nav-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.sidebar-section-label {
    padding: 14px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9ca3af;
}
.sidebar.collapsed .sidebar-section-label {
    display: none;
}
.sidebar.collapsed .nav-sidebar {
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-collapse-btn {
    position: relative;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: var(--transition);
}
.sidebar-collapse-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1d2953;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 200;
    pointer-events: none;
}
.sidebar-collapse-btn:hover::after {
    opacity: 1;
    visibility: visible;
}
.sidebar-collapse-btn:hover {
    background: #e9ecef;
    color: var(--primary);
}

.sidebar.collapsed {
    width: 70px;
}
.sidebar.collapsed .sidebar-brand {
    padding: 0;
    justify-content: center;
}
.sidebar.collapsed .sidebar-logo {
    display: none;
}
.sidebar-logo-collapsed {
    display: none;
}
.sidebar.collapsed .sidebar-logo-collapsed {
    display: block;
    max-height: 70px;
    max-width: 100%;
}
.sidebar.collapsed .sidebar-collapse-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 4px 6px;
    font-size: 13px;
    background: none;
    border: none;
}
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
    font-size: 0;
    position: relative;
}
.sidebar.collapsed .nav-link span {
    display: none;
}
.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 18px;
    width: auto;
}
.sidebar.collapsed .nav-link:hover {
    padding-left: 12px;
}
.sidebar.collapsed .mt-auto {
    padding: 12px 0 !important;
}
.sidebar.collapsed .mt-auto .nav-link {
    padding: 12px;
}

/* Tooltip for collapsed sidebar nav items (rendered via JS at body level,
   since .nav-sidebar's overflow-y:auto forces overflow-x to clip too,
   which would hide an in-place ::after tooltip) */
.nav-tooltip {
    position: fixed;
    background: #1d2953;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 500;
    pointer-events: none;
}
.nav-tooltip.show {
    opacity: 1;
    visibility: visible;
}

.main-content.sidebar-collapsed {
    margin-left: 70px;
    width: calc(100% - 70px);
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 99;
    animation: slideDown 0.3s ease;
}

.content-body {
    padding: 24px;
    flex: 1;
    animation: fadeIn 0.4s ease;
}

.content-body > .row {
    margin-left: 0;
    margin-right: 0;
}

.content-body > .row > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-info h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.stat-info span {
    color: #6c757d;
    font-size: 13px;
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

.project-card {
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.table th {
    font-weight: 600;
    font-size: 13px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

/* ─── ICON-ONLY BUTTONS ───
   32×32 square helper for buttons that render an icon only (no text
   label). Accessibility is preserved via title="..." + aria-label.
   The dropdown caret is suppressed via .dropdown-toggle::after override
   so a single icon button can act as the trigger. */
.btn-icon-square {
    width: 32px;
    height: 32px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}
.btn-icon-square i { line-height: 1; }
.btn-icon-square.dropdown-toggle::after { display: none; }
.btn-icon-square.dropdown-toggle.show::after { display: none; }

.form-control {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 10px 12px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    border-radius: 12px 12px 0 0;
}

.badge {
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 500;
}

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

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

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

.sidebar-toggle {
    display: none;
}
.sidebar-overlay {
    display: none;
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 200;
        transition: transform 0.3s ease;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: inline-block;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* ─── AUTOCOMPLETE ─── */
.autocomplete-wrap {
    position: relative;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1050;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s ease;
}

.autocomplete-item:hover {
    background: #e9ecef;
}

.autocomplete-item strong {
    color: var(--primary);
}

.autocomplete-item.disabled {
    color: #999;
    cursor: default;
}

.autocomplete-item.disabled:hover {
    background: none;
}

.sidebar-overlay.show {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 150;
}

.glass-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(0,0,0,0.1);
}

.card-title-sm {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    color: #1a1a2e;
}

/* Loading cursor overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    cursor: wait;
    background: transparent;
    pointer-events: none;
}
body.is-loading .loading-overlay {
    display: block;
}
body.is-loading {
    cursor: wait;
}

/* ─── TIMETRACKER PAGE ─── */
.app-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .app-grid { grid-template-columns: 1fr; }
}

.tracker-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tracker-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.tracker-form select,
.tracker-form .autocomplete-wrap .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: #1a1a2e;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.tracker-form .autocomplete-dropdown {
    border-radius: 0 0 12px 12px;
    border: 1px solid #d1d5db;
    border-top: none;
}

.tracker-form select option {
    background: #ffffff;
    color: #1a1a2e;
}

.tracker-form select:hover,
.tracker-form .autocomplete-wrap .form-control:hover { border-color: #9ca3af; }
.tracker-form select:focus,
.tracker-form .autocomplete-wrap .form-control:focus { border-color: var(--primary); }

/* Big Clock Button */
.btn-clock {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    box-shadow: 0 10px 30px rgba(16,185,129,0.25);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    z-index: 1;
}

.btn-clock::after {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(16,185,129,0.4);
    animation: spin 20s linear infinite;
    pointer-events: none;
    transition: var(--transition);
}

.btn-clock.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 30px rgba(239,68,68,0.25);
}

.btn-clock.active::after {
    border-color: rgba(239,68,68,0.4);
    animation: spin 10s linear infinite;
}

.btn-clock:hover { transform: scale(1.05); }
.btn-clock:active { transform: scale(0.98); }
.btn-clock:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: default;
}
.btn-clock:disabled::after { border-color: rgba(156,163,175,0.4); }
.btn-clock:disabled:hover { transform: none; }
.btn-clock svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; }

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

/* Timer Display */
.timer-display {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1a1a2e;
    margin: 1rem 0 0.5rem;
    font-variant-numeric: tabular-nums;
    transition: var(--transition);
}

.timer-display.active {
    color: #10b981;
    text-shadow: 0 0 30px rgba(16,185,129,0.25);
}

/* Category Checkboxes */
.category-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.category-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.category-checkbox {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
}

.custom-checkmark {
    height: 20px;
    width: 20px;
    border: 2px solid #6b7280;
    border-radius: 6px;
    margin-right: 0.75rem;
    position: relative;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-checkmark::after {
    content: "";
    position: absolute;
    display: none;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.category-checkbox:checked ~ .custom-checkmark::after {
    display: block;
}

.category-checkbox:checked ~ .custom-checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(24,119,242,0.2);
}

.category-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    transition: var(--transition);
    flex: 1;
}

.category-checkbox:checked ~ .category-label {
    color: #1a1a2e;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-item[data-cat="general"] .category-checkbox:checked ~ .custom-checkmark { background-color: #6366f1; border-color: #6366f1; box-shadow: 0 0 10px rgba(99,102,241,0.4); }
.category-item[data-cat="general"] .category-dot { background: #6366f1; }
.category-item[data-cat="development"] .category-checkbox:checked ~ .custom-checkmark { background-color: #10b981; border-color: #10b981; box-shadow: 0 0 10px rgba(16,185,129,0.4); }
.category-item[data-cat="development"] .category-dot { background: #10b981; }
.category-item[data-cat="design"] .category-checkbox:checked ~ .custom-checkmark { background-color: #f59e0b; border-color: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,0.4); }
.category-item[data-cat="design"] .category-dot { background: #f59e0b; }
.category-item[data-cat="meeting"] .category-checkbox:checked ~ .custom-checkmark { background-color: #06b6d4; border-color: #06b6d4; box-shadow: 0 0 10px rgba(6,182,212,0.4); }
.category-item[data-cat="meeting"] .category-dot { background: #06b6d4; }
.category-item[data-cat="research"] .category-checkbox:checked ~ .custom-checkmark { background-color: #8b5cf6; border-color: #8b5cf6; box-shadow: 0 0 10px rgba(139,92,246,0.4); }
.category-item[data-cat="research"] .category-dot { background: #8b5cf6; }
.category-item[data-cat="documentation"] .category-checkbox:checked ~ .custom-checkmark { background-color: #ec4899; border-color: #ec4899; box-shadow: 0 0 10px rgba(236,72,153,0.4); }
.category-item[data-cat="documentation"] .category-dot { background: #ec4899; }
.category-item[data-cat="testing"] .category-checkbox:checked ~ .custom-checkmark { background-color: #f97316; border-color: #f97316; box-shadow: 0 0 10px rgba(249,115,22,0.4); }
.category-item[data-cat="testing"] .category-dot { background: #f97316; }
.category-item[data-cat="maintenance"] .category-checkbox:checked ~ .custom-checkmark { background-color: #14b8a6; border-color: #14b8a6; box-shadow: 0 0 10px rgba(20,184,166,0.4); }
.category-item[data-cat="maintenance"] .category-dot { background: #14b8a6; }
.category-item[data-cat="drafting"] .category-checkbox:checked ~ .custom-checkmark { background-color: #6366f1; border-color: #6366f1; box-shadow: 0 0 10px rgba(99,102,241,0.4); }
.category-item[data-cat="drafting"] .category-dot { background: #6366f1; }

/* Analytics */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
    border-radius: 14px;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Activity Log */
.log-section { margin-top: 1.5rem; }

/* My Task */
.app-right-col { display: flex; flex-direction: column; gap: 1.5rem; }
.my-task-section { flex: 1; min-height: 0; }
.my-task-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}
.my-task-card {
    background: #fafbfc;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.my-task-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.10); }
.my-task-card { cursor: grab; }
.my-task-card.dragging { opacity: 0.4; cursor: grabbing; }
.my-task-title { font-weight: 600; font-size: 0.92rem; color: #1a1a2e; margin-bottom: 0.5rem; }
.my-task-project { font-size: 0.78rem; color: #6b7280; display: flex; align-items: center; gap: 4px; }
.my-task-project i { width: 14px; text-align: center; }
.tracker-card.drop-target-active {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.35), 0 6px 16px rgba(0,0,0,0.10);
    transition: box-shadow 0.15s ease;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.log-table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 0.5rem;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.log-table th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #6b7280;
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
}

.log-table tr:last-child td { border-bottom: none; }
.log-table tr:hover td { background: rgba(0,0,0,0.015); }

.badge-active {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.25);
    color: #10b981;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

/* Alerts (timetracker page) */
.tt-alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tt-alert-success {
    border-color: rgba(16,185,129,0.3);
    color: #065f46;
    background: #ecfdf5;
}

.tt-alert-danger {
    border-color: rgba(239,68,68,0.3);
    color: #991b1b;
    background: #fef2f2;
}

.tt-alert .btn-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    padding: 0 0 0 1rem;
}

.tt-alert .btn-close:hover { opacity: 1; }

/* Form Labels */
.tt-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.35rem;
    text-align: left;
}

/* Day Breakdown */
.day-section { margin-bottom: 1.5rem; }
.day-section:last-child { margin-bottom: 0; }

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f3f4f6;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: #1a1a2e;
}

.day-header .day-total {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

/* Clock Out Modal */
.modal-overlay {
    position: fixed; top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
    z-index: 9999; display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 18px; padding: 2rem 2rem 1.5rem;
    width: 400px; max-width: 94vw; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box h2 { margin: 0 0 1.25rem; font-size: 1.15rem; font-weight:700; }
.modal-box .option-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0; border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.modal-box .option-row:last-child { border-bottom: none; }
.modal-box .option-row input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer;
}
.modal-box .option-row label { cursor: pointer; font-size: 0.95rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; justify-content: flex-end; }
.modal-actions button {
    padding: 0.6rem 1.5rem; border-radius: 10px; border: none; font-weight: 600;
    font-size: 0.9rem; cursor: pointer;
}
.modal-actions .btn-cancel { background: #f0f0f0; color: #555; }
.modal-actions .btn-confirm { background: var(--primary); color: #fff; }
.modal-actions .btn-confirm:hover { opacity: 0.9; }

/* ─── LOADING BAR ─── */
.loading-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 3px; background: var(--primary); z-index: 99999; overflow: hidden;
}
.loading-bar-inner {
    height: 100%; width: 40%;
    background: linear-gradient(90deg, transparent, var(--primary), #fff, var(--primary), transparent);
    animation: loadSlide 1s infinite linear; position: absolute;
}
@keyframes loadSlide { 0% { left: -40%; } 100% { left: 100%; } }

/* ─── SYNC LOADER ─── */
.sync-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.85);
    z-index: 99999;
    display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 16px;
}
.sync-overlay .loader {
    height: 60px;
    aspect-ratio: 2;
    border-bottom: 3px solid #0000;
    background:
        linear-gradient(90deg,#524656 50%,#0000 0)
        -25% 100%/50% 3px repeat-x border-box;
    position: relative;
    animation: l3-0 .75s linear infinite;
}
.sync-overlay .loader:before {
    content: "";
    position: absolute;
    inset: auto 42.5% 0;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #CF4647;
    animation: l3-1 .75s cubic-bezier(0,900,1,900) infinite;
}
@keyframes l3-0 {
    to { background-position: -125% 100%; }
}
@keyframes l3-1 {
    0%,2% { bottom: 0%; }
    98%,to { bottom: .1%; }
}

/* ─── TOAST NOTIFICATIONS ─── */
.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 99999;
    display: flex; flex-direction: column; gap: 10px;
}
.toast-msg {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15); backdrop-filter: blur(10px);
    animation: toastIn .3s ease; min-width: 280px; max-width: 420px; cursor: pointer;
}
.toast-msg.toast-out { animation: toastOut .3s ease forwards; }
.toast-msg.success { background: #ecfdf5; color: #065f46; border: 1px solid rgba(16,185,129,0.3); }
.toast-msg.success .toast-icon { color: #10b981; }
.toast-msg.error { background: #fef2f2; color: #991b1b; border: 1px solid rgba(239,68,68,0.3); }
.toast-msg.error .toast-icon { color: #ef4444; }
.toast-msg.info { background: #eff6ff; color: #1e40af; border: 1px solid rgba(59,130,246,0.3); }
.toast-msg.info .toast-icon { color: #3b82f6; }
.toast-msg .toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg .toast-close {
    margin-left: auto; background: none; border: none; color: inherit;
    opacity: .5; font-size: 16px; cursor: pointer; padding: 0;
}
.toast-msg .toast-close:hover { opacity: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ─── PROJECT TABLE SELECTION (OneDrive-style) ─── */
.project-select-check {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.project-row:hover .project-select-check,
.project-select-check.checked {
    opacity: 1;
}

.project-select-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #9ca3af;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.project-select-circle svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.project-row:hover .project-select-circle {
    border-color: #6b7280;
}

.project-select-check.checked .project-select-circle {
    background: var(--primary);
    border-color: var(--primary);
}

.project-select-check.checked .project-select-circle svg {
    opacity: 1;
    transform: scale(1);
}

.project-select-check:hover .project-select-circle {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.1);
}

.project-select-all {
    cursor: pointer;
}

.project-select-all .project-select-circle {
    width: 20px;
    height: 20px;
}

.project-select-all.all-checked .project-select-circle {
    background: var(--primary);
    border-color: var(--primary);
}

.project-select-all.all-checked .project-select-circle svg {
    opacity: 1;
    transform: scale(1);
}

.project-select-all.some-checked .project-select-circle {
    background: var(--primary);
    border-color: var(--primary);
}

.project-select-all.some-checked .project-select-circle .check-icon {
    display: none;
}

.project-select-all.some-checked .project-select-circle .dash-icon {
    display: block !important;
}

.dash-icon {
    display: none;
}

/* Selected row highlight */
.project-row.selected {
    background: rgba(24, 119, 242, 0.04) !important;
}

.project-row.selected td {
    border-bottom-color: rgba(24, 119, 242, 0.1);
}

/* ─── 3-DOTS MENU ─── */
.dots-menu {
    position: relative;
    display: inline-flex;
    z-index: 100;
}

.dots-menu:hover {
    z-index: 200;
}

.dots-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    letter-spacing: 1px;
    font-weight: 700;
    line-height: 1;
}

/* Keep row actions unobtrusive until their entry is targeted. */
.ts-entry-row .dots-menu-btn,
.project-row .dots-menu-btn {
    opacity: 0;
    pointer-events: none;
}

.ts-entry-row:hover .dots-menu-btn,
.ts-entry-row:focus-within .dots-menu-btn,
.project-row:hover .dots-menu-btn,
.project-row:focus-within .dots-menu-btn {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: none) {
    .ts-entry-row .dots-menu-btn,
    .project-row .dots-menu-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

.dots-menu-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.dots-menu-btn.active {
    background: #e5e7eb;
    color: #1f2937;
}

.dots-dropdown {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    min-width: 180px;
    z-index: 99999;
    padding: 6px;
    animation: dotsDropdownIn 0.15s ease;
}

.dots-dropdown.show {
    display: block;
}

@keyframes dotsDropdownIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dots-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    white-space: nowrap;
}

.dots-dropdown-item:hover {
    background: #f3f4f6;
}

.dots-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}

.dots-dropdown-item.text-danger {
    color: #dc2626;
}

.dots-dropdown-item.text-danger:hover {
    background: #fef2f2;
}

.dots-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 6px;
}

/* Paste float widget */
.paste-float-widget {
    position: fixed;
    z-index: 99998;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    padding: 6px 14px;
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    animation: fadeInUp 0.15s ease;
    white-space: nowrap;
}
.paste-float-widget.show {
    display: flex;
}
.paste-float-widget i {
    color: #10b981;
}
.paste-float-widget:hover {
    background: #f0fdf4;
    border-color: #10b981;
}
.paste-float-widget .pfw-close {
    margin-left: 4px;
    color: #9ca3af;
    font-size: 11px;
    padding: 2px 4px;
}
.paste-float-widget .pfw-close:hover {
    color: #ef4444;
}

/* Selection toolbar */
.selection-toolbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 16px;
    animation: fadeInUp 0.2s ease;
}

.selection-toolbar.show {
    display: flex;
}

.selection-toolbar .sel-count {
    font-weight: 600;
    font-size: 14px;
}

.selection-toolbar .sel-clear {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-left: auto;
}

.selection-toolbar .sel-clear:hover {
    background: rgba(255,255,255,0.35);
}

/* ─── TIMESHEET STICKY HEADER ─── */
.ts-sticky-header {
    position: sticky;
    top: var(--topbar-height);
    z-index: 90;
    background: #f4f6f9;
    padding-top: 4px;
    padding-bottom: 4px;
    transition: box-shadow 0.2s ease;
}
.ts-sticky-header.scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ─── TIMESHEET MANAGER VIEW ─── */

/* ─── DATE RANGE PILLS ─── */
.ts-range-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

.ts-range-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(24, 119, 242, 0.04);
}

.ts-range-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.25);
}

.ts-range-pill.active:hover {
    background: var(--primary-dark);
    color: #fff;
}
.ts-emp-group {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--transition);
}

.ts-emp-group:last-child {
    margin-bottom: 0;
}

.ts-emp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.ts-emp-header:hover {
    background: #f3f4f6;
}

.ts-group-chevron {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.ts-emp-group.collapsed .ts-group-chevron {
    transform: rotate(-90deg);
}

.ts-group-body {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 1;
}

.ts-emp-group.collapsed .ts-group-body {
    max-height: 0;
    opacity: 0;
}

.ts-group-body .table {
    margin-bottom: 0;
}

.ts-group-body .table thead {
    background: #fafbfc;
}

.ts-group-body .table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.ts-group-body .table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid #f9fafb;
}

.ts-group-body .table tr:last-child td {
    border-bottom: none;
}

.ts-group-body .table tr:hover td {
    background: rgba(24, 119, 242, 0.02);
}

.ts-hours-bar-wrap {
    width: 80px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.ts-hours-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ts-dur-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Selection toolbar (timesheet) */
.ts-selection-toolbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 12px;
    animation: fadeInUp 0.2s ease;
}

.ts-selection-toolbar.show {
    display: flex;
}

/* Responsive for timesheet groups */
@media (max-width: 768px) {
    .ts-emp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .ts-hours-bar-wrap {
        width: 100%;
    }
}

/* Responsive overrides for timetracker */
@media (max-width: 768px) {
    .app-grid { grid-template-columns: 1fr; }
    .timer-display { font-size: 2.5rem; }
    .btn-clock { width: 110px; height: 110px; }
    .btn-clock svg { width: 26px; height: 26px; }
}

/* ─── TIMESHEET MONTH LOCK ─── */
.ts-monthlock-list-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 8px;
}
.ts-monthlock-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ts-monthlock-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.ts-monthlock-chip-x {
    border: none;
    background: transparent;
    color: #b91c1c;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.ts-monthlock-chip-x:hover {
    opacity: 1;
    color: #7f1d1d;
}
.ts-monthlock-chip-x:focus-visible {
    outline: 2px solid #b91c1c;
    outline-offset: 2px;
    border-radius: 4px;
}


