/* Global HRMS Design System Styles */

/* Base Typography */
body {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    background-color: var(--bg-base); /* Light background for consistency */
}

body.dark-mode {
    background: var(--bg-base);
    color: var(--text-primary);
}

body.dark-mode .top-header,
body.dark-mode .sidebar,
body.dark-mode .content-card,
body.dark-mode .table-container-card,
body.dark-mode .modal-content,
body.dark-mode .attendance-card,
body.dark-mode .mini-card {
    background: var(--bg-raised);
    color: var(--text-primary);
    border-color: var(--border);
}

body.dark-mode .main-content,
body.dark-mode .page-header,
body.dark-mode .table-wrapper,
body.dark-mode .hrms-table th {
    background-color: var(--bg-sunken);
    color: var(--text-secondary);
}

body.dark-mode .hrms-table td,
body.dark-mode .form-field input,
body.dark-mode .form-field select,
body.dark-mode .form-field textarea {
    background: var(--bg-base);
    color: var(--text-secondary);
    border-color: var(--border);
}

body.dark-mode .content-card,
body.dark-mode .table-container-card,
body.dark-mode .employee-form-section,
body.dark-mode .employee-side-card,
body.dark-mode .profile-card,
body.dark-mode .profile-doc-card,
body.dark-mode .dashboard-stat-card,
body.dark-mode .dashboard-soft-card,
body.dark-mode .dashboard-mini-card,
body.dark-mode .employee-doc-card {
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.35);
}

body.dark-mode .tabs-container {
    background: linear-gradient(180deg, #0f172a, #111827);
    border-color: var(--text-secondary);
}

body.dark-mode .tab-btn {
    color: var(--text-secondary);
}

body.dark-mode .tab-btn.active {
    color: var(--accent-text);
    background: var(--accent-soft);
    border-color: var(--accent);
}

body.dark-mode .btn-cancel {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.dark-mode .search-input {
    background: var(--bg-base);
    color: var(--text-secondary);
    border-color: var(--border);
}

body.dark-mode .sidebar-nav li a:hover,
body.dark-mode .sidebar-nav li a.active,
body.dark-mode .sidebar-nav li a.active-parent {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-secondary); /* Default heading color */
    margin-top: 0;
    margin-bottom: 10px;
}

/* Page Structure & Containers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0; /* Consistent padding */
    border-bottom: 1px solid var(--border); /* Consistent border */
}

.page-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent); /* Primary color for main page titles */
    margin-bottom: 0;
}

.page-header-actions {
    display: flex;
    gap: 10px;
}

.content-card {
    background: var(--bg-raised);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px; /* Consistent spacing between cards */
}

/* Section Styles (Forms & Profile Views) */
.form-section, .profile-section {
    margin-bottom: 15px; /* Consistent spacing between sections */
}

.form-section h3, .profile-section h4 {
    color: var(--text-secondary);
    border-bottom: 2px solid var(--bg-hover);
    padding-bottom: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
}

/* Form Styles */
.hrms-modern-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="date"],
.form-field input[type="number"],
.form-field select {
    border: 1.5px solid var(--border);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-raised);
    transition: all 0.2s ease;
    height: 42px;
}

.form-field textarea {
    border: 1.5px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
}

/* Button Loading Spinner */
@keyframes button-spin {
    to { transform: rotate(360deg); }
}

.btn-loading-spinner { 
    display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.3); border-radius: 50%; border-top-color: var(--bg-raised); animation: button-spin 0.6s linear infinite; margin-right: 8px; 
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--accent);
    background-color: var(--bg-raised);
    box-shadow: 0 0 0 4px rgba(60, 195, 222, 0.1);
    outline: none;
}

/* Button Styles */
.btn-primary, .btn-submit, .btn-cancel, .btn-export, .btn-action, .btn-danger {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent);
    /* --text-inverse flips with the theme; a fixed white fails on the lighter
       dark-mode accent. */
    color: var(--text-inverse);
}
.btn-primary:hover {
    background-color: var(--accent);
}

.btn-submit {
    background-color: var(--success);
    color: var(--text-inverse);
}
.btn-submit:hover {
    background-color: var(--success);
}

.btn-cancel {
    background-color: var(--border-strong); /* Neutral grey */
    color: var(--text-primary);
}
.btn-cancel:hover {
    background-color: var(--bg-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-inverse);
}
.btn-danger:hover {
    background-color: var(--danger);
}

.btn-primary:hover, .btn-submit:hover, .btn-danger:hover, .btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-export {
    background-color: #6c757d; /* Darker grey for export */
    color: white;
}
.btn-export:hover {
    background-color: #5a6268;
}

/* Link-Style Outline Button (Premium) */
.btn-link {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-link:hover {
    background: var(--bg-sunken);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Form Actions Alignment */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-bottom: 10px;
}

/* Specific button styles from employee-table for delete */
.btn-action {
    background: none;
    color: var(--accent); /* Default action color */
    padding: 4px 8px;
    font-size: 16px;
}
.btn-action.btn-delete {
    color: var(--danger); /* Red for delete */
}
.btn-action:hover {
    opacity: 0.8;
}

/* Table Styles */
.table-container-card {
    background: var(--bg-raised);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.search-wrapper {
    position: relative;
}

.search-input {
    border: 1px solid var(--border);
    padding: 8px 10px 8px 30px; /* Left padding for icon */
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    background-color: var(--bg-raised);
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(60, 195, 222, 0.2);
}

.table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.hrms-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    width: max-content; /* Allows horizontal scrolling */
}

.hrms-table th, .hrms-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap; /* Keep content on one line by default */
    vertical-align: top;
    line-height: 1.6;
    text-align: left; /* Default alignment */
}

.hrms-table th {
    background-color: var(--bg-base);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    position: sticky; /* For sticky header */
    top: 0;
    z-index: 1;
}

/* Sticky Columns */
.sticky-col {
    position: sticky;
    background: var(--bg-raised) !important; /* Override table header background */
    z-index: 2; /* Higher than header for overlap */
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}
thead th.sticky-col {
    z-index: 3; /* Even higher for sticky header + sticky column */
    background: var(--bg-base) !important;
}
.col-1 { left: 0; width: 60px; min-width: 60px; }
.col-2 { left: 60px; width: 100px; min-width: 100px; }
.col-3 { left: 160px; width: 180px; min-width: 180px; }

/* Specific Address Column in Table */
.hrms-table td:nth-child(11) { /* Assuming Address is the 11th column */
    white-space: normal; /* Allow text wrapping */
    min-width: 220px;
    color: var(--text-secondary);
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
    display: inline-block;
    text-transform: capitalize;
}
.status-active { background: #e6f4ea; color: #1e7e34; } /* Green */
.status-resigned { background: #fdeaea; color: #d93025; } /* Red */
.status-other { background: #fff4e5; color: #b05d00; } /* Yellow/Gray fallback */
.status-infield { background: #e1f5fe; color: #0288d1; } /* Blue */
.status-leave { background: #fff3e0; color: #e65100; } /* Orange */
.status-holiday { background: #f3e5f5; color: #7b1fa2; } /* Purple */
.status-weekoff { background: #f5f5f5; color: #757575; } /* Grey */

/* Employee Photo Circle */
.emp-photo-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex; /* For centering image */
    justify-content: center;
    align-items: center;
}
.emp-photo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile View Styles (from employee-view.js) */
.profile-view-container {
    max-width: 900px;
    margin: auto;
    padding: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--accent); /* Primary blue */
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: white;
}

.profile-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.profile-header p {
    margin: 5px 0;
    opacity: 0.9;
}

.profile-header strong {
    font-weight: 600;
}

.emp-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.emp-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.profile-item {
    margin-bottom: 5px;
    font-size: 12px;
    line-height: 1.3;
}

.profile-item strong {
    width: 110px; /* Align labels */
    display: inline-block;
    color: var(--text-secondary);
    font-weight: 500;
}

.address-block {
    background: #f9f9f9;
    padding: 8px;
    border-radius: 6px;
    border-left: 4px solid var(--warning); /* Accent color border */
    line-height: 1.4;
    font-size: 12px;
    color: var(--text-secondary);
}

.view-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

/* Toast Notifications (from notifications.js) */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10005; }
.toast { background: var(--bg-raised); color: var(--text-primary); padding: 12px 24px; border-radius: 4px; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); min-width: 280px; font-family: 'Montserrat', sans-serif; font-size: 13px; animation: toast-slide-in 0.3s ease-out; border-left: 5px solid var(--accent); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
@keyframes toast-slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Confirmation Modal Styles (from employee-table.js) */
.confirm-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; z-index: 10001; font-family: 'Montserrat', sans-serif; }
.confirm-modal { background: var(--bg-raised); padding: 24px; border-radius: 8px; max-width: 380px; width: 90%; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2); animation: confirm-fade 0.3s ease; }
.confirm-modal h3 { margin: 0 0 10px; color: var(--danger); font-size: 18px; }
.confirm-modal p { color: var(--text-secondary); font-size: 14px; margin-bottom: 25px; line-height: 1.5; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }
@keyframes confirm-fade { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* General Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }

/* ==========================================================================
   Layout Framework (Header, Sidebar, Main)
   ========================================================================== */

.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--bg-raised);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 1000;
    box-sizing: border-box;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-placeholder {
    width: 35px;
    height: 35px;
    /* A solid accent tile with inverse text: a translucent white tile plus
       near-white text was unreadable, and a tile matching the header colour
       disappeared entirely. */
    background: var(--accent);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.logo-section h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    /* This class is now part of the button, so it defines the button's layout */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 12px; /* Slightly less rounded than before for a modern look */
    background: var(--bg-raised); /* Themed surface, not a fixed light grey */
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Soft shadow */
}

.user-profile:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.user-profile-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align text to the right */
}

.user-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.user-role-line {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-soft);
    color: var(--accent-text);
    border-radius: 8px; /* Squircle shape for modern look */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    overflow: hidden; /* Ensure image fits */
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-secondary); /* Down arrow */
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.profile-menu-wrap.open .dropdown-arrow {
    transform: rotate(180deg); /* Rotate arrow when open */
}

/* Profile Dropdown Styling */
.profile-menu-wrap {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px); /* Position below the button */
    right: 0;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
    min-width: 240px;
    z-index: 1001; /* Ensure it's above other content */
    display: none; /* Hidden by default */
    flex-direction: column;
    padding: 10px;
}

.profile-dropdown.open {
    display: flex; /* Show when open */
}

.profile-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg-hover);
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 8px 8px 0 0;
}

.profile-dropdown-head:hover {
    background: var(--accent-soft);
}

.profile-dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.profile-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-dropdown-head strong {
    font-size: 14px;
    color: var(--text-primary);
}

.profile-meta-line {
    font-size: 11px;
    color: var(--text-secondary);
}

.profile-dropdown-btn {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.profile-dropdown-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.profile-dropdown-btn.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.user-profile-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 240px;
    height: calc(100vh - 60px);
    background: var(--bg-raised);
    border-right: 1px solid var(--border);
    z-index: 999;
    transition: transform 0.3s ease;
}

.main-content {
    margin-left: 240px;
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
    box-sizing: border-box;
    background-color: var(--bg-base);
}

/* Sidebar Navigation */
.sidebar-nav ul {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-nav .nav-group {
    padding: 8px 0 4px;
}

.sidebar-nav .nav-group-label {
    padding: 10px 20px 8px;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-nav .nav-submenu {
    padding: 0 0 6px;
}

.sidebar-nav .nav-submenu li a {
    padding-left: 34px;
    font-size: 14px;
    color: var(--text-secondary);
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    gap: 12px;
}

.sidebar-nav li a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.sidebar-nav li a.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

/* ==========================================================================
   Modals (Form & Profile Popup)
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 30px auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover { color: var(--text-primary); }

/* ==========================================================================
   Tab Navigation
   ========================================================================== */

.tabs-container {
    display: inline-flex;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, #f8fbfd);
    box-shadow: 0 18px 35px rgba(15,23,42,.05);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
}

.tab-btn.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, #dff7fb, #ffffff);
    border-color: #b6e8f1;
    box-shadow: 0 10px 24px rgba(60, 195, 222, 0.18);
}

.tab-btn.active::after {
    display: none;
}

/* Tab Content Panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ==========================================================================
   Calendar Event Tags
   ========================================================================== */

.calendar-event-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 3px;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-type-holiday, .event-type-sudden-holiday { background-color: var(--danger); } /* Red */
.event-type-half-day { background-color: #fd7e14; color: white; } /* Orange */
.event-type-work-from-home { background-color: #3498db; } /* Blue */
.event-type-special-event { background-color: #2ecc71; } /* Green */

/* ==========================================================================
   Calendar Grid Layout
   ========================================================================== */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    background-color: var(--bg-raised);
}

.weekday-header {
    background-color: var(--bg-base);
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
}

.day-cell {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

.day-cell:hover { background-color: var(--accent-soft); }

.day-cell.weekend { background-color: var(--bg-sunken); }

.day-cell.other-month { background-color: #fdfdfd; opacity: 0.4; pointer-events: none; }

.day-number {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    display: block;
    margin-bottom: 5px;
}

/* Navigation Controls */
.btn-nav {
    padding: 5px 12px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}

/* ==========================================================================
   Week-Off Marking
   ========================================================================== */

.day-cell.week-off {
    background-color: #f2f2f2;
}

.week-off-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-hover);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    margin-top: 6px;
    text-align: center;
    border-radius: 4px;
    padding: 3px 6px;
}

/* ==========================================================================
   Enhanced Calendar Controls UI
   ========================================================================== */

.calendar-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-base);
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.calendar-nav-group .btn-nav {
    background: var(--accent);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 4px;
}

.calendar-nav-group .btn-nav:hover { background: var(--accent); }

.calendar-nav-ux {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
}

.calendar-month-year-display {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary); /* Darker Slate */
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
    user-select: none;
}

.calendar-month-year-display:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.btn-nav-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-nav-ghost:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

/* ==========================================================================
   Month/Year Picker Grid (Premium SaaS Style)
   ========================================================================== */

.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 15px;
}

.month-picker-item {
    padding: 12px;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.month-picker-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.month-picker-item.active {
    background: var(--accent);
    color: white;
}

/* ==========================================================================
   Segmented Control (Audience Filter)
   ========================================================================== */

.segment-control {
    display: inline-flex;
    background: var(--bg-hover);
    padding: 3px;
    border-radius: 10px;
    gap: 2px;
    flex-wrap: wrap;
    justify-content: center;
}

.segment-btn {
    padding: 6px 16px;
    border: none;
    background: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.segment-btn.active {
    background: var(--bg-raised);
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ==========================================================================
   Work Tracker Profile Cards (Modern UX)
   ========================================================================== */

.tracker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.tracker-card {
    background: var(--bg-raised);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 400px; /* Prevents the card from becoming too large when it's the only one */
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

.tracker-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: var(--accent);
}

.tracker-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tracker-avatar-wrap {
    position: relative;
}

.tracker-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-hover);
    border: 2px solid var(--bg-raised);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tracker-emp-info {
    flex: 1;
    overflow: hidden;
}

.tracker-emp-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tracker-emp-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.tracker-current-status {
    margin-top: 4px;
}

.tracker-body {
    background: var(--bg-sunken);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--bg-hover);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tracker-body-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
}

.tracker-current-work {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.4;
}

.tracker-footer {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.tracker-footer .btn-link {
    flex: 1;
    justify-content: center;
    font-size: 10px;
    height: 34px;
}