:root {
    --primary-hue: 250;
    --primary-color: hsl(var(--primary-hue), 85%, 60%);
    --primary-hover: hsl(var(--primary-hue), 85%, 50%);
    --primary-light: hsl(var(--primary-hue), 85%, 96%);
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-color: #334155;
    --text-heading: #1e293b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --radius: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #cbd5e1;
    --text-heading: #f1f5e9;
    --text-muted: #94a3b8;
    --border-color: #334155;

    --primary-light: hsl(var(--primary-hue), 30%, 20%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Specific overrides for Dark Mode elements to ensure visibility */
body.dark-mode .card,
body.dark-mode .nav-link,
body.dark-mode .form-input,
body.dark-mode .modal-content {
    background-color: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

body.dark-mode .bg-white {
    background-color: var(--surface-color) !important;
}

body.dark-mode .bg-gray-50 {
    background-color: #1e293b !important;
}

/* Surface + 1 */
body.dark-mode .text-gray-600 {
    color: #cbd5e1 !important;
}

body.dark-mode .border-gray-100 {
    border-color: var(--border-color) !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--text-heading);
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 288px 1fr;
    min-height: 100vh;
}

.main-content {
    padding: 2.5rem 3rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.p-6 {
    padding: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xl {
    font-size: 1.25rem;
    font-weight: 600;
}

.text-2xl {
    font-size: 1.75rem;
    font-weight: 700;
}

.font-bold {
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
}

/* Sidebar */
.sidebar {
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 5000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 280px;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 4000;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .main-content {
        padding: 1.5rem 1rem;
        width: 100% !important;
        margin: 0 !important;
    }
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(var(--primary-hue), 70%, 60%, 0.2);
}

/* Main Content */
.main-content {
    padding: 2.5rem 3rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--surface-color);
    padding: 1.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0.5;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0.5rem 0;
    line-height: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border-radius: 99px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-hue), 80%, 60%, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-hue), 80%, 60%, 0.35);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--surface-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--bg-color);
    background-color: var(--bg-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    color: var(--text-heading);
}

.form-input:focus {
    background-color: var(--surface-color);
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    /* Reduced opacity slightly */
    backdrop-filter: none !important;
    /* Force remove blur */
    -webkit-backdrop-filter: none !important;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Tasks */
.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--bg-color);
    border-radius: calc(var(--radius) - 4px);
    transition: var(--transition);
    border: 1px solid transparent;
}

.task-item:last-child {
    margin-bottom: 0;
}

.task-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
    transform: translateX(4px);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    margin-right: 1rem;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-pending {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
}

.badge-approved {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

.badge-rejected {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
    transition: transform 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

/* Auth Page */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, var(--primary-light), transparent),
        radial-gradient(circle at bottom left, #e0f2fe, transparent);
    background-color: var(--bg-color);
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.auth-box .card {
    padding: 3rem 2rem;
    border: 1px solid white;
    box-shadow: var(--shadow-lg);
}

.modal-content {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform 0.2s ease;
    backdrop-filter: none !important;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Facebook Style Comments - Premium Redesign */
.fb-comment-section {
    display: flex !important;
    gap: 12px;
    align-items: flex-start;
    /* Avatar stays at top if text expands */
    margin-top: 0.75rem;
    width: 100%;
}

.fb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(var(--primary-hue), 60%, 50%, 0.2);
}

.fb-input-wrapper {
    flex: 1;
    background: var(--bg-color);
    /* Light gray background */
    border-radius: 24px;
    /* Pill shape */
    padding: 8px 16px 8px 16px;
    transition: var(--transition);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.fb-input-wrapper:focus-within {
    background: var(--surface-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.fb-textarea {
    flex: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    resize: none;
    min-height: 24px;
    /* Height of one line */
    max-height: 150px;
    font-family: inherit;
    color: var(--text-heading);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 4px 0;
    margin: 0;
    overflow-y: auto;
}

.fb-textarea:focus {
    outline: none;
}

.fb-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.btn-send-comment {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-send-comment:hover {
    background: rgba(var(--primary-hue), 85%, 60%, 0.1);
    transform: scale(1.05);
}

.btn-send-comment:active {
    transform: scale(0.95);
}

.btn-send-comment svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    /* Use fill for solid icons */
}

/* =========================================
   Feed Modal Styles (New Social Design)
   ========================================= */
.feed-modal-content {
    background: var(--surface-color);
    width: 100%;
    max-width: 600px;
    height: 85vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.feed-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.feed-close-btn:hover {
    background: #fff;
    color: var(--danger-color);
    box-shadow: var(--shadow-sm);
}

/* Header */
.feed-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-color);
}

.feed-avatar-large {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.feed-title-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.feed-task-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Body */
.feed-body {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-color);
    padding: 0;
}

.feed-card {
    background: var(--surface-color);
    padding: 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.feed-card.history-section {
    min-height: 200px;
    padding-bottom: 3rem;
    margin-bottom: 0;
}

.feed-desc {
    color: var(--text-heading);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-icon {
    animation: spin 2s linear infinite;
    transform-origin: center;
}

/* Status Chips */
.status-chip-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-chip input {
    display: none;
}

.chip-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-muted);
    transition: var(--transition);
}

.chip-content svg {
    display: block;
    /* Ensure SVG is visible */
    width: 16px;
    height: 16px;
}

.status-chip input:checked+.chip-content {
    background: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.status-chip input:checked+.chip-content.default {
    background: #f3f4f6;
    color: #4b5563;
}

.status-chip input:checked+.chip-content.warning {
    background: #fffbeb;
    color: #d97706;
}

.status-chip input:checked+.chip-content.success {
    background: #ecfdf5;
    color: #059669;
}

.status-chip input:checked+.chip-content.leave {
    background: #475569;
    color: white;
    border-color: #334155;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.spin-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* KPI Section */
.kpi-box {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.kpi-label {
    color: #1e40af;
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.kpi-input {
    width: 100%;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* Attachment */
.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 700;
}

.attachment-preview {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: zoom-in;
}

/* Comments */
.no-data-msg {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 2rem;
    font-size: 0.9rem;
}

.comment-bubble {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-box {
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    border-top-left-radius: 2px;
    display: inline-block;
}

.comment-box p {
    font-size: 0.95rem;
    color: var(--text-heading);
    margin: 0;
}

.comment-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    margin-left: 4px;
}

/* Footer & Input */
.feed-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}

.upload-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.upload-preview img {
    height: 60px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.remove-upload {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.input-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.icon-btn {
    padding: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.text-input-wrapper {
    flex: 1;
    background: var(--bg-color);
    border-radius: 24px;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
}

.text-input-wrapper:focus-within {
    background: var(--surface-color);
    border-color: var(--primary-color);
}

.chat-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    max-height: 100px;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0;
    margin: 0;
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}