body {
    background-color: #0f172a;
    color: #f1f5f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(51, 65, 85, 0.2) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: -1;
}

.logo-container-premium {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.logo-base {
    position: relative;
    z-index: 10;
    display: block;
    filter: brightness(0) invert(0.65);
}

.logo-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
    mask-image: linear-gradient(110deg, transparent 35%, black 50%, transparent 65%);
    -webkit-mask-image: linear-gradient(110deg, transparent 35%, black 50%, transparent 65%);
    mask-size: 300% 100%;
    -webkit-mask-size: 300% 100%;
    animation: shine-move 2.5s infinite linear;
    pointer-events: none;
}

@keyframes shine-move {
    0% {
        -webkit-mask-position: 150% 0;
        mask-position: 150% 0;
    }

    100% {
        -webkit-mask-position: -50% 0;
        mask-position: -50% 0;
    }
}

.glass {
    background: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.input-premium {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid #475569;
    color: white;
    transition: all 0.3s;
}

.input-premium:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    outline: none;
}

select.input-premium option {
    background-color: #0f172a;
    color: white;
}

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toast-slide 0.4s ease-out forwards;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #991b1b);
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #065f46);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.blocked-stripe {
    background: repeating-linear-gradient(
        45deg,
        rgba(220, 38, 38, 0.88),
        rgba(220, 38, 38, 0.88) 8px,
        rgba(127, 29, 29, 0.98) 8px,
        rgba(127, 29, 29, 0.98) 16px
    );
    box-shadow: inset 0 0 0 1px rgba(254, 202, 202, 0.45);
}

.leave-chip {
    border-radius: 0.45rem;
    padding: 0.24rem 0.4rem;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.leave-chip-approved {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    border: 1px solid rgba(125, 211, 252, 0.95);
    color: #eff6ff;
}

.leave-chip-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 1px dashed rgba(254, 240, 138, 0.95);
    color: #fffbeb;
}

.leave-chip-rejected {
    background: linear-gradient(135deg, #e11d48 0%, #9f1239 100%);
    border: 1px solid rgba(253, 164, 175, 0.95);
    color: #fff1f2;
}

.leave-chip-medical {
    background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    border: 1px solid rgba(232, 121, 249, 0.95);
    color: #faf5ff;
}

.timeline-cell-approved {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(14, 165, 233, 0.96));
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.82);
}

.timeline-cell-pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.94), rgba(217, 119, 6, 0.94));
    box-shadow: inset 0 0 0 1px rgba(254, 240, 138, 0.82);
}

.timeline-cell-rejected {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.9), rgba(159, 18, 57, 0.92));
    box-shadow: inset 0 0 0 1px rgba(253, 164, 175, 0.75);
}

.timeline-cell-medical {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(192, 38, 211, 0.95));
    box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.8);
}

.timeline-legend-chip {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 0.3rem;
    display: inline-block;
    flex: 0 0 auto;
}

.timeline-legend-approved {
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.82);
}

.timeline-legend-pending {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: inset 0 0 0 1px rgba(254, 240, 138, 0.82);
}

.timeline-legend-rejected {
    background: linear-gradient(135deg, #e11d48 0%, #9f1239 100%);
    box-shadow: inset 0 0 0 1px rgba(253, 164, 175, 0.75);
}

.timeline-legend-medical {
    background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
    box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.8);
}

.timeline-legend-company {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.92), rgba(34, 211, 238, 0.92));
    box-shadow: inset 0 0 0 1px rgba(165, 243, 252, 0.72);
}

.timeline-shell {
    max-height: min(68vh, 44rem);
    scrollbar-gutter: stable both-edges;
}

.timeline-table {
    min-width: max-content;
}

.timeline-name-head,
.timeline-name-cell {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

.timeline-name-head {
    padding: 0.55rem 0.75rem;
    background: rgba(30, 41, 59, 0.96);
    border-bottom: 1px solid rgba(71, 85, 105, 0.9);
    color: #94a3b8;
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 6px 0 12px rgba(2, 6, 23, 0.24);
}

.timeline-name-cell {
    padding: 0.45rem 0.75rem;
    background: rgba(15, 23, 42, 0.94);
    border-right: 1px solid rgba(71, 85, 105, 0.4);
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    color: #e2e8f0;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 6px 0 12px rgba(2, 6, 23, 0.2);
}

.timeline-day-head {
    min-width: 26px;
    height: 28px;
    padding: 0.15rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.9);
    text-align: center;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.78);
    font-size: 11px;
    font-weight: 700;
}

.timeline-day-head-weekend {
    color: #fca5a5;
    background: rgba(30, 41, 59, 0.92);
}

.timeline-day-head-holiday {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.35);
    border-bottom: 2px solid rgba(239, 68, 68, 0.5);
}

.timeline-row:hover .timeline-name-cell {
    background: rgba(30, 41, 59, 0.98);
}

.timeline-day-cell {
    width: 26px;
    min-width: 26px;
    height: 24px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.timeline-day-cell:hover {
    filter: brightness(1.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.company-day-fill {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(14, 116, 144, 0.5));
}

.holiday-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.custom-scroll::-webkit-scrollbar {
    width: 4px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 2px;
}

.app-overlay {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.viewport-panel {
    width: min(100%, 32rem);
    max-height: min(92vh, 92dvh);
    margin: auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.viewport-panel-lg {
    width: min(100%, 42rem);
}

#loginScreen .viewport-panel,
#employeeModal .viewport-panel,
#passwordModal .viewport-panel {
    word-break: break-word;
}

#toast-container .toast,
#myLeavesTableBody td,
#teamLeavesTableBody td,
.employee-info-value,
.employee-side-note,
.employee-detail-main,
.employee-detail-sub {
    overflow-wrap: anywhere;
}

@keyframes goldShine {
    0% {
        background-position: 200% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.gold-text {
    background: linear-gradient(
        to right,
        #bf953f 0%, #fcf6ba 25%, #b38728 50%, #fbf5b7 75%, #aa771c 100%
    );
    background-size: 200% auto;
    color: #b38728;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 11px;
    animation: goldShine 3s linear infinite;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.8));
    display: inline-block;
}

[data-title]:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    border: 1px solid #475569;
}

.employee-grid-shell {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.12));
}

.employee-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 2px 2px 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.28);
}

.employee-list-title {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.employee-list-note {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
}

.employee-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.employee-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 268px);
    gap: 20px;
    align-items: start;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(71, 85, 105, 0.34);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.12);
}

.employee-card:hover {
    border-color: rgba(96, 165, 250, 0.18);
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.16);
}

.employee-card-main {
    min-width: 0;
}

.employee-card-head {
    margin-bottom: 14px;
}

.employee-card-identity {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.employee-identity-copy {
    min-width: 0;
}

.employee-name-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.employee-name {
    color: #f8fafc;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
}

.employee-email {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    word-break: break-word;
}

.employee-card-topline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.employee-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.9fr);
    gap: 16px;
    align-items: start;
}

.employee-card-info {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.employee-info-block {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.2);
    border: 1px solid rgba(71, 85, 105, 0.18);
}

.employee-info-label {
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 8px;
}

.employee-info-value {
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.employee-detail-main {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
}

.employee-detail-sub {
    color: #64748b;
    font-size: 11px;
    margin-top: 3px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    word-break: break-word;
}

.employee-detail-empty {
    color: #94a3b8;
    font-size: 13px;
    font-style: italic;
}

.employee-balance-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.employee-balance-box {
    padding: 12px 13px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(71, 85, 105, 0.18);
}

.employee-balance-value {
    font-size: 14px;
    font-weight: 800;
}

.employee-card-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding-left: 18px;
    border-left: 1px solid rgba(71, 85, 105, 0.28);
}

.employee-card-side-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.employee-side-kicker {
    color: #e2e8f0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.employee-side-note {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.5;
}

.employee-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.95);
    color: #e2e8f0;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.04em;
    border: 1px solid rgba(71, 85, 105, 0.28);
}

.employee-role-pill,
.employee-metric-pill,
#employeesTableBody .text-green-400.text-xs.uppercase.font-bold.bg-green-500\/10.px-2.py-1.rounded.border.border-green-500\/30,
#employeesTableBody .text-red-400.text-xs.uppercase.font-bold.bg-red-500\/10.px-2.py-1.rounded.border.border-red-500\/40,
#employeesTableBody .text-slate-300.text-xs.uppercase.font-bold.bg-slate-500\/20.px-2.py-1.rounded.border.border-slate-500\/40 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid rgba(148, 163, 184, 0.18);
    white-space: nowrap;
    text-transform: uppercase;
}

.employee-role-admin {
    background: rgba(190, 24, 93, 0.12);
    color: #fbcfe8;
    border-color: rgba(244, 114, 182, 0.18);
}

.employee-role-hr {
    background: rgba(8, 145, 178, 0.14);
    color: #cffafe;
    border-color: rgba(34, 211, 238, 0.18);
}

.employee-role-manager {
    background: rgba(180, 83, 9, 0.16);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.16);
}

.employee-role-employee {
    background: rgba(51, 65, 85, 0.62);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.16);
}

.employee-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.employee-actions .action-btn {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: none;
    font-weight: 700;
    font-size: 13px;
}

#myLeavesTableBody td,
#teamLeavesTableBody td {
    vertical-align: top;
}

.action-btn-primary {
    background: rgba(37, 99, 235, 0.16);
    color: #dbeafe;
}

.action-btn-cyan {
    background: rgba(8, 145, 178, 0.16);
    color: #cffafe;
}

.action-btn-cyan:hover {
    background: rgba(8, 145, 178, 0.26);
    color: #ffffff;
}

.action-btn-primary:hover {
    background: rgba(37, 99, 235, 0.24);
    color: #ffffff;
}

.action-btn-muted {
    background: rgba(51, 65, 85, 0.72);
    color: #e2e8f0;
}

.action-btn-muted:hover {
    background: rgba(71, 85, 105, 0.88);
    color: #ffffff;
}

.action-btn-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fef3c7;
}

.action-btn-warning:hover {
    background: rgba(245, 158, 11, 0.22);
    color: #ffffff;
}

.action-btn-success {
    background: rgba(16, 185, 129, 0.14);
    color: #bbf7d0;
}

.action-btn-success:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #ffffff;
}

.action-btn-danger {
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
}

.action-btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #ffffff;
}

@media (max-width: 1280px) {
    .employee-card {
        grid-template-columns: 1fr;
    }

    .employee-card-body {
        grid-template-columns: 1fr;
    }

    .employee-card-side {
        padding: 14px 0 0;
        border-left: 0;
        border-top: 1px solid rgba(71, 85, 105, 0.28);
    }
}

@media (max-width: 900px) {
    .employee-card-info,
    .employee-balance-row {
        grid-template-columns: 1fr;
    }

    .employee-name-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .employee-avatar {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 13px;
    }

    .employee-list-header {
        padding-bottom: 12px;
    }
}

.employee-admin-actions {
    flex-wrap: wrap;
}

.employee-admin-actions > button {
    white-space: nowrap;
}

.employee-admin-toolbar > label {
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .employee-admin-toolbar {
        align-items: stretch;
    }

    .employee-admin-actions {
        width: 100%;
    }

    .employee-admin-actions > button {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .employee-grid-shell {
        padding: 12px;
    }

    .employee-card {
        padding: 14px;
        gap: 14px;
        border-radius: 14px;
    }

    .employee-card-body {
        gap: 12px;
    }

    .employee-card-side {
        gap: 10px;
        padding-top: 12px;
    }

    .employee-list-note {
        width: 100%;
        line-height: 1.6;
    }

    .employee-admin-actions > button {
        flex: 1 1 100%;
    }

    .employee-modal-grid {
        grid-template-columns: 1fr;
    }

    .company-days-grid,
    .reports-grid {
        grid-template-columns: 1fr;
    }

    #employeeModal .glass,
    #passwordModal .glass,
    #loginScreen .glass {
        padding: 20px;
        max-height: min(94vh, 94dvh);
        overflow-y: auto;
    }

    #calendarGrid {
        font-size: 11px;
    }

    #timelineContent {
        min-width: 720px;
    }

    .glass.p-6,
    .glass.p-8 {
        padding: 18px;
    }
}

@media (max-width: 900px) {
    .timeline-shell {
        max-height: min(62vh, 36rem);
    }

    .timeline-name-head,
    .timeline-name-cell {
        width: 142px;
        min-width: 142px;
        max-width: 142px;
    }

    .timeline-day-head {
        min-width: 24px;
        height: 26px;
        font-size: 10px;
    }

    .timeline-day-cell {
        width: 24px;
        min-width: 24px;
        height: 22px;
    }
}

@media (max-height: 820px) {
    #loginScreen,
    #employeeModal,
    #passwordModal {
        align-items: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }
}

@media (min-height: 821px) {
    #loginScreen,
    #employeeModal,
    #passwordModal {
        align-items: center;
    }
}
