:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
    background: #0f172a !important;
    min-height: 100%;
    overscroll-behavior-y: none;
    overflow-y: scroll;
}

body {
    background: #0f172a !important;
    background-image: none;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--bg-gradient);
    background-color: #0f172a;
    z-index: 0;
    pointer-events: none;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]):not([type="color"]):not([type="range"]),
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
}

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px !important;
}

/* Prevent double arrows when a select element is wrapped in .select-wrapper or has .custom-select */
.select-wrapper select,
select.custom-select {
    background-image: none !important;
    padding-right: 16px !important;
}

input:focus,
textarea:focus {
    border-color: var(--primary-color);
}

select option {
    background: #111827;
    color: white;
}

input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    background: transparent;
    position: relative;
    z-index: 1;
}

header {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 18px;
    }

    .grid {
        gap: 18px;
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .glass-card,
    .task-card {
        padding: 20px;
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 14px;
    }

    header {
        margin-bottom: 24px;
        padding: 14px 0 18px;
    }

    .glass-card,
    .task-card,
    .empty-state {
        border-radius: 18px;
    }

    .btn {
        width: 100%;
        padding: 12px 16px;
    }

    .table-responsive {
        border-radius: 16px;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 640px;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="hidden"]):not([type="color"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px;
    }
}

@media (max-width: 520px) {
    .container {
        padding: 12px;
    }

    .grid {
        gap: 16px;
    }

    .glass-card {
        border-radius: 16px;
    }

    .glass-card,
    .task-card,
    .empty-state {
        padding: 16px;
    }

    .badge {
        font-size: 0.74rem;
        padding: 5px 10px;
    }

    .btn {
        border-radius: 10px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.notice {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.notice-success {
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.2);
}

.notice-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.2);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    word-break: normal;
}

.user-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    word-break: normal;
    vertical-align: middle;
}

.user-tag.role-admin {
    background: rgba(236, 72, 153, 0.14);
    color: #f9a8d4;
}

.user-tag.role-dept_head {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
}

.user-tag.role-hr {
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
}

.user-tag.role-hr_dept_head {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
}

.user-tag.role-user {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.user-tag.status-approved {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
}

.user-tag.status-blocked {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}

.table-responsive {
    overflow-x: auto;
}

.mobile-stack {
    overflow-x: visible;
}

.empty-state {
    padding: 24px;
    border-radius: 18px;
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.task-card {
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.task-grid {
    display: grid;
    gap: 16px;
}

.text-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    color: #a5b4fc;
}

.muted {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .tab-container {
        flex-direction: column;
    }

    .task-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .mobile-stack-table,
    .mobile-stack-table thead,
    .mobile-stack-table tbody,
    .mobile-stack-table th,
    .mobile-stack-table td,
    .mobile-stack-table tr {
        display: block;
        width: 100%;
    }

    .mobile-stack-table {
        min-width: 0 !important;
    }

    .mobile-stack-table thead {
        display: none;
    }

    .mobile-stack-table tbody {
        display: grid;
        gap: 14px;
    }

    .mobile-stack-table tr {
        border: 1px solid var(--border-color) !important;
        border-radius: 16px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        padding: 12px 14px !important;
        margin-bottom: 16px !important;
        display: block !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }

    .mobile-stack-table tr.completed-task {
        border-left: 4px solid #10b981 !important;
        background: rgba(16, 185, 129, 0.04) !important;
    }

    .mobile-stack-table td {
        min-width: 0;
        text-align: left !important;
        border: 0 !important;
        padding: 10px 14px !important;
    }

    .mobile-stack-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--text-secondary);
        font-size: 0.74rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
}



/* Completed task desktop styling */
tr.completed-task {
    border-left: 4px solid #10b981 !important;
    background: rgba(16, 185, 129, 0.03) !important;
}