:root {
    --black: #050505;
    --dark: #101010;
    --dark-2: #181818;
    --dark-3: #242424;
    --gray: #7d7d7d;
    --gray-soft: #d9d9d9;
    --white: #ffffff;
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.24);
    --card: rgba(255, 255, 255, 0.105);
    --card-strong: rgba(255, 255, 255, 0.16);
    --input: rgba(255, 255, 255, 0.96);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.20);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --success: #1f7a3f;
    --danger: #b42318;
    --transition: 0.14s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--white);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, #050505 0%, #171717 58%, #f3f3f3 175%);
    text-rendering: optimizeSpeed;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    border: 0;
}

/* =========================
   Login page
   ========================= */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 3vw, 42px);
    overflow-x: hidden;
    position: relative;
}

.login-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-background::before {
    content: "";
    position: absolute;
    inset: clamp(18px, 5vw, 70px);
    border-radius: clamp(24px, 3vw, 42px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow);
}

/* Login logo position fix */
.login-corner-logo {
    position: fixed !important;
    top: 100px !important;
    right: 75px !important;
    width: 260px !important;
    max-width: 28vw !important;
    height: auto !important;
    z-index: 10 !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: none;
}

.login-bg-logo {
    position: absolute;
    left: clamp(18px, 8vw, 120px);
    top: 50%;
    width: clamp(250px, 35vw, 520px);
    height: auto;
    transform: translateY(-50%);
    filter: none;
    opacity: 0.14;
}

.orb,
.shape-ring,
.shape-wave {
    position: absolute;
    display: block;
    opacity: 0.55;
}

.orb-one {
    width: clamp(140px, 18vw, 230px);
    height: clamp(140px, 18vw, 230px);
    right: 10%;
    bottom: 9%;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,0.38), rgba(255,255,255,0.06));
}

.orb-two {
    width: clamp(120px, 15vw, 190px);
    height: clamp(120px, 15vw, 190px);
    left: 8%;
    bottom: 7%;
    border-radius: 999px;
    border: clamp(18px, 3vw, 38px) solid rgba(255, 255, 255, 0.08);
}

.orb-three {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 48%;
    border-radius: 999px;
    border: 22px solid rgba(255, 255, 255, 0.10);
}

.shape-ring {
    width: clamp(220px, 30vw, 420px);
    height: clamp(220px, 30vw, 420px);
    right: 20%;
    top: 26%;
    border-radius: 48% 52% 56% 44%;
    border: clamp(22px, 4vw, 52px) solid rgba(255, 255, 255, 0.06);
    transform: rotate(18deg);
}

.shape-wave {
    width: 240px;
    height: 84px;
    border-radius: 999px;
    border: 26px solid rgba(255, 255, 255, 0.10);
    border-left-color: transparent;
    border-right-color: transparent;
}

.shape-wave-left {
    left: 29%;
    top: 38%;
    transform: rotate(-38deg);
}

.shape-wave-right {
    right: 27%;
    bottom: 27%;
    transform: rotate(8deg) scale(0.72);
}

.login-shell {
    width: min(100%, 1180px);
    position: relative;
    z-index: 2;
}

.login-panel {
    min-height: min(700px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 410px);
    gap: clamp(26px, 5vw, 90px);
    align-items: center;
}

.login-brand {
    max-width: 560px;
    padding: clamp(6px, 2vw, 24px);
}

.brand-mark {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--black);
    font-size: 28px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-soft);
}

.login-brand h1 {
    margin: 0;
    max-width: 520px;
    font-size: clamp(40px, 5vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.login-brand p {
    margin: 20px 0 0;
    max-width: 420px;
    color: rgba(255, 255, 255, 0.72);
    font-size: clamp(14px, 1.2vw, 16px);
    line-height: 1.6;
}

.login-card {
    width: 100%;
    border-radius: 30px;
    padding: clamp(30px, 4vw, 44px);
}

.login-heading {
    margin-bottom: 26px;
}

.login-heading h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 34px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.login-card label,
.form-field label {
    display: block;
    margin: 16px 0 8px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    font-weight: 750;
}

.login-input,
.search-box {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    background: var(--input);
    color: #242424;
    border: 1px solid rgba(255, 255, 255, 0.55);
    padding: 0 14px;
}

.login-input input,
.search-box input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--black);
    font-size: 14px;
}

.login-input input::placeholder,
.search-box input::placeholder {
    color: #9b9b9b;
}

.login-input button {
    background: transparent;
    color: #6f6f6f;
    cursor: pointer;
}

.login-options {
    margin: 16px 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}

.login-options label {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
}

.login-options a {
    font-weight: 750;
}

.login-footer {
    margin: 18px 0 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
}

/* =========================
   General UI
   ========================= */
.glass-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.145), rgba(255,255,255,0.065));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.primary-btn,
.secondary-btn,
.logout-btn,
.icon-btn,
.table-action,
.combo-toggle,
.combo-option,
.combo-add-option {
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition), box-shadow var(--transition);
}

.primary-btn,
.secondary-btn,
.logout-btn,
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 13px;
    font-weight: 850;
    white-space: nowrap;
}

.primary-btn {
    min-height: 46px;
    padding: 0 18px;
    background: var(--white);
    color: var(--black);
    box-shadow: var(--shadow-soft);
}

.primary-btn:hover {
    background: #eeeeee;
}

.secondary-btn {
    min-height: 42px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.10);
    color: var(--white);
    border: 1px solid var(--line);
}

.secondary-btn:hover,
.icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--line-strong);
}

.full-btn {
    width: 100%;
}

.icon-btn {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.10);
    color: var(--white);
    border: 1px solid var(--line);
}

.compact-close-btn {
    height: 42px;
    min-height: 42px;
    padding: 0 14px;
}

/* =========================
   App navigation
   ========================= */
.app-body {
    min-height: 100vh;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 2.2vw, 34px);
    padding: 12px clamp(18px, 2.6vw, 42px);
    background: rgba(9, 9, 9, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.nav-logo {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    border-radius: 50%;
    filter: none;
}

.nav-brand-text {
    min-width: 0;
    display: block;
}

.nav-brand strong,
.nav-brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-brand strong {
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.nav-brand small {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(14px, 1.8vw, 24px);
    flex: 0 0 auto;
}

.nav-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--white);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition);
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--white);
}

.nav-links a.active::after,
.nav-links a:hover::after {
    transform: scaleX(1);
}

.logout-btn {
    min-height: 40px;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--white);
    color: var(--black);
    border: 1px solid var(--white);
    box-shadow: var(--shadow-soft);
    font-size: 13px;
    font-weight: 900;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border-color: var(--line-strong);
}

.mobile-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid var(--line);
    color: var(--white);
}

/* =========================
   Page layout
   ========================= */
.page-shell {
    width: min(100%, 1500px);
    margin: 0 auto;
    padding: clamp(20px, 2.4vw, 34px) clamp(18px, 2.6vw, 42px) clamp(42px, 4vw, 70px);
}

body[data-page="employees"] .page-shell {
    width: min(100%, 1800px);
    max-width: 1800px;
    padding-left: clamp(14px, 1.8vw, 32px);
    padding-right: clamp(14px, 1.8vw, 32px);
}

.page-hero {
    border-radius: var(--radius-xl);
    padding: clamp(22px, 2.8vw, 38px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 22px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.67);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.page-hero h1,
.section-title h2 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.page-hero h1 {
    font-size: clamp(34px, 4.2vw, 56px);
}

.page-hero p {
    max-width: 720px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.55;
}

.section-title {
    margin-bottom: 18px;
}

.section-title h2 {
    font-size: clamp(20px, 2vw, 25px);
}

.split-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.panel-card,
.stat-card,
.page-hero {
    min-width: 0;
}

.panel-card {
    border-radius: var(--radius-lg);
    padding: clamp(18px, 2vw, 24px);
    overflow: hidden;
}

/* =========================
   Dashboard
   ========================= */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    min-height: 108px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: clamp(18px, 1.8vw, 24px);
    border-radius: var(--radius-lg);
    color: var(--white);
}

.clickable-card:hover {
    background: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
    border-color: var(--line-strong);
}

.stat-card span {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--black);
}

.stat-card strong,
.stat-card small {
    display: block;
}

.stat-card strong {
    font-size: clamp(25px, 2.7vw, 34px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.stat-card small {
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 750;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

body[data-page="dashboard"] .dashboard-layout .panel-card {
    min-height: 400px;
    max-height: clamp(430px, 48vh, 570px);
    display: flex;
    flex-direction: column;
}

body[data-page="dashboard"] #designationBars,
body[data-page="dashboard"] #officeBars {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

.bar-list {
    display: grid;
    gap: 12px;
}

.bar-item {
    display: grid;
    gap: 8px;
}

.bar-link {
    color: inherit;
    border-radius: 12px;
    padding: 8px;
    margin-left: -8px;
}

.bar-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 800;
}

.bar-top span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.bar-fill {
    height: 100%;
    min-width: 10px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--white), rgba(255, 255, 255, 0.42));
}

/* =========================
   Tables
   ========================= */
.table-wrap {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dashboard-table {
    min-width: 780px;
}

.data-table th,
.data-table td {
    padding: 14px 15px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.data-table th {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table td {
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.055);
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.dashboard-table th,
.dashboard-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-name-cell strong,
.employee-name-cell small,
.muted-cell {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-name-cell small,
.muted-cell {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.56);
}

.empty-box,
.empty-table {
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.62);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.status-active {
    background: rgba(255, 255, 255, 0.92);
    color: var(--success);
}

.status-ended {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* =========================
   Employees page
   ========================= */
.employee-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
}

.employee-form-card {
    display: none;
    width: 100%;
    position: static;
}

.employee-form-card.is-visible {
    display: block;
}

.employee-form-card .section-title.split-title {
    align-items: flex-start;
}

.form-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.employee-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.full-field {
    grid-column: 1 / -1;
}

.form-field input,
.form-field select,
.form-field textarea,
.filter-select {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    outline: 0;
    border-radius: 12px;
    background: var(--input);
    color: var(--black);
}

.form-field textarea {
    min-height: 108px;
    padding-top: 12px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.filter-select:focus,
.login-input:focus-within,
.search-box:focus-within {
    border-color: rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.09);
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.form-actions .primary-btn,
.form-actions .secondary-btn {
    flex: 1 1 180px;
}

.employee-list-card {
    display: flex;
    flex-direction: column;
    height: clamp(580px, calc(100dvh - 188px), 940px);
    min-height: 520px;
    overflow: hidden;
}

.employee-list-card .section-title,
.employee-list-card .filters-row {
    flex: 0 0 auto;
}

.filters-row {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(160px, 210px);
    gap: 14px;
    margin-bottom: 16px;
}

.employee-list-card .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.employee-table {
    min-width: 1280px;
    table-layout: fixed;
}

.employee-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(58, 58, 58, 0.98);
}

.employee-table th,
.employee-table td {
    padding: 13px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    font-size: 13px;
}

.employee-table th:nth-child(1),
.employee-table td:nth-child(1) { width: 15%; }
.employee-table th:nth-child(2),
.employee-table td:nth-child(2) { width: 12%; }
.employee-table th:nth-child(3),
.employee-table td:nth-child(3) { width: 13%; }
.employee-table th:nth-child(4),
.employee-table td:nth-child(4) { width: 12%; }
.employee-table th:nth-child(5),
.employee-table td:nth-child(5) { width: 12%; }
.employee-table th:nth-child(6),
.employee-table td:nth-child(6) { width: 15%; }
.employee-table th:nth-child(7),
.employee-table td:nth-child(7) { width: 9%; }
.employee-table th:nth-child(8),
.employee-table td:nth-child(8) { width: 9%; }
.employee-table th:nth-child(9),
.employee-table td:nth-child(9) { width: 76px; }

.actions-header {
    font-size: 0;
    color: transparent;
}

.employee-table td:nth-child(9),
.employee-table th:nth-child(9) {
    text-align: center;
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.table-action {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.table-action:hover {
    background: var(--white);
    color: var(--black);
}

.table-action.danger:hover {
    color: var(--danger);
}

.record-count,
#employeeCountLabel {
    display: none !important;
}

/* Combo dropdowns */
.combo-field {
    position: relative;
    width: 100%;
}

.combo-field input {
    padding-right: 46px;
}

.combo-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
    color: #2c2c2c;
    transform: translateY(-50%);
}

.combo-toggle:hover {
    background: rgba(0, 0, 0, 0.14);
}

.combo-field.is-open .combo-toggle i {
    transform: rotate(180deg);
}

.combo-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    display: none;
    max-height: 270px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 14px;
    background: rgba(24, 24, 24, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow);
}

.combo-field.is-open .combo-menu {
    display: grid;
    gap: 6px;
}

.combo-option,
.combo-add-option {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    padding: 0 11px;
    text-align: left;
    font-size: 13px;
    font-weight: 750;
}

.combo-option {
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.88);
}

.combo-option:hover {
    background: rgba(255, 255, 255, 0.15);
}

.combo-add-option {
    margin-top: 4px;
    justify-content: center;
    background: var(--white);
    color: var(--black);
}

.combo-empty {
    padding: 11px;
    text-align: center;
    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}

/* Toasts */
.toast-box {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    display: grid;
    gap: 10px;
    max-width: 360px;
}

.inline-toast {
    position: static;
    max-width: none;
    margin-bottom: 12px;
}

.toast {
    border-radius: 14px;
    padding: 13px 15px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--black);
    box-shadow: var(--shadow-soft);
    font-weight: 750;
    font-size: 14px;
}

.toast.error {
    color: var(--danger);
}

.toast.success {
    color: var(--success);
}

/* Scrollbar */
.employee-list-card .table-wrap::-webkit-scrollbar,
#designationBars::-webkit-scrollbar,
#officeBars::-webkit-scrollbar,
.combo-menu::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.employee-list-card .table-wrap::-webkit-scrollbar-track,
#designationBars::-webkit-scrollbar-track,
#officeBars::-webkit-scrollbar-track,
.combo-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.employee-list-card .table-wrap::-webkit-scrollbar-thumb,
#designationBars::-webkit-scrollbar-thumb,
#officeBars::-webkit-scrollbar-thumb,
.combo-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.30);
    border-radius: 999px;
}

/* Lightweight animation only */
.page-hero,
.panel-card,
.stat-card,
.login-card,
.login-brand {
    animation: fadeIn 0.12s ease-out both;
}

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

/* =========================
   Desktop zoom safety
   ========================= */
@media (max-width: 1280px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .page-shell {
        max-width: 1180px;
    }

    body[data-page="employees"] .page-shell {
        max-width: 100%;
    }
}

@media (max-width: 980px) {
    .login-panel {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 28px;
        padding-top: 100px;
    }

    .login-brand {
        margin: 0 auto;
        text-align: center;
    }

    .brand-mark {
        margin-left: auto;
        margin-right: auto;
    }

    .login-brand p {
        margin-left: auto;
        margin-right: auto;
    }

    .top-nav {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .mobile-nav-toggle {
        display: grid;
        place-items: center;
        flex: 0 0 auto;
    }

    .nav-brand {
        max-width: calc(100% - 60px);
    }

    .nav-links {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 10px;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        justify-content: flex-start;
        width: 100%;
        padding: 12px 0;
    }

    .nav-links a::after {
        right: auto;
        width: 36px;
    }

    .logout-btn {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }

    .page-hero,
    .split-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-hero .primary-btn,
    .split-title .secondary-btn {
        width: 100%;
    }

    .filters-row {
        grid-template-columns: 1fr;
    }

    .employee-list-card {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .employee-list-card .table-wrap {
        max-height: none;
        overflow: auto;
    }
}

@media (max-width: 720px) {
    .login-body {
        padding: 16px;
    }

    .login-corner-logo {
        width: min(220px, 58vw);
        top: 18px;
    }

    .login-bg-logo {
        left: 50%;
        top: 27%;
        width: 82vw;
        transform: translate(-50%, -50%);
        opacity: 0.10;
    }

    .login-card {
        padding: 28px;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .page-shell,
    body[data-page="employees"] .page-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

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

    .form-header-actions {
        width: 100%;
        justify-content: stretch;
    }

    .form-header-actions .icon-btn {
        flex: 0 0 44px;
    }

    .form-header-actions .compact-close-btn {
        flex: 1 1 auto;
    }

    .page-hero,
    .panel-card,
    .stat-card {
        border-radius: 18px;
    }
}

@media (min-width: 1600px) {
    .page-shell {
        max-width: 1580px;
    }

    body[data-page="employees"] .page-shell {
        max-width: 1860px;
    }

    .employee-table {
        min-width: 1400px;
    }

    .employee-table th,
    .employee-table td {
        font-size: 14px;
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* Removed Position column: 8-column employee table sizing */
.employee-table {
    min-width: 1180px;
}

.employee-table th:nth-child(1),
.employee-table td:nth-child(1) { width: 16%; }
.employee-table th:nth-child(2),
.employee-table td:nth-child(2) { width: 13%; }
.employee-table th:nth-child(3),
.employee-table td:nth-child(3) { width: 15%; }
.employee-table th:nth-child(4),
.employee-table td:nth-child(4) { width: 16%; }
.employee-table th:nth-child(5),
.employee-table td:nth-child(5) { width: 17%; }
.employee-table th:nth-child(6),
.employee-table td:nth-child(6) { width: 10%; }
.employee-table th:nth-child(7),
.employee-table td:nth-child(7) { width: 9%; }
.employee-table th:nth-child(8),
.employee-table td:nth-child(8) { width: 76px; text-align: center; }

@media (min-width: 1600px) {
    .employee-table {
        min-width: 1280px;
    }
}

/* Dropdown option delete + keyboard highlight */
.combo-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 6px;
}

.combo-option-row .combo-option {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combo-selectable.is-highlighted,
.combo-option:hover {
    background: rgba(255, 255, 255, 0.20);
    color: var(--white);
    outline: 1px solid rgba(255, 255, 255, 0.18);
}

.combo-delete-option {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.combo-delete-option:hover {
    background: rgba(180, 35, 24, 0.22);
    border-color: rgba(255, 255, 255, 0.20);
    color: #ffffff;
}

.combo-delete-option:disabled {
    cursor: wait;
    opacity: 0.65;
}

/* =========================================================
   Light desktop theme for Dashboard and Employees pages
   ========================================================= */
.app-body {
    --line: rgba(0, 0, 0, 0.10);
    --line-strong: rgba(0, 0, 0, 0.18);
    --card: rgba(235, 235, 235, 0.96);
    --card-strong: rgba(220, 220, 220, 0.98);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
    --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.08);
    color: #111111;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 32%),
        linear-gradient(135deg, #f7f7f7 0%, #eeeeee 46%, #d8d8d8 100%);
}

.app-body .top-nav {
    background: rgba(248, 248, 248, 0.96);
    border-bottom: 1px solid rgba(0, 0, 0, 0.10);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.app-body .nav-brand strong,
.app-body .nav-links a,
.app-body .mobile-nav-toggle {
    color: #151515;
}

.app-body .nav-brand small {
    color: #555555;
}

.app-body .nav-links a {
    color: #4a4a4a;
}

.app-body .nav-links a::after {
    background: #151515;
}

.app-body .nav-links a.active,
.app-body .nav-links a:hover {
    color: #000000;
}

.app-body .logout-btn {
    background: #1b1b1b;
    color: #ffffff;
    border-color: #1b1b1b;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.app-body .logout-btn:hover {
    background: #3a3a3a;
    color: #ffffff;
    border-color: #3a3a3a;
}

.app-body .mobile-nav-toggle {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
}

.app-body .glass-card,
.app-body .panel-card,
.app-body .stat-card,
.app-body .page-hero {
    background: linear-gradient(145deg, rgba(238, 238, 238, 0.98), rgba(214, 214, 214, 0.96));
    border: 1px solid rgba(0, 0, 0, 0.10);
    color: #111111;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.09);
}

.app-body .clickable-card:hover,
.app-body .bar-link:hover {
    background: linear-gradient(145deg, rgba(246, 246, 246, 0.98), rgba(225, 225, 225, 0.98));
    border-color: rgba(0, 0, 0, 0.18);
}

.app-body .eyebrow,
.app-body .page-hero p,
.app-body .stat-card small,
.app-body .empty-box,
.app-body .empty-table,
.app-body .employee-name-cell small,
.app-body .muted-cell,
.app-body .combo-empty {
    color: #555555;
}

.app-body .stat-card span {
    background: #1f1f1f;
    color: #ffffff;
}

.app-body .primary-btn {
    background: #111111;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.app-body .primary-btn:hover {
    background: #333333;
}

.app-body .secondary-btn,
.app-body .icon-btn,
.app-body .table-action {
    background: rgba(255, 255, 255, 0.70);
    color: #151515;
    border-color: rgba(0, 0, 0, 0.12);
}

.app-body .secondary-btn:hover,
.app-body .icon-btn:hover,
.app-body .table-action:hover {
    background: #111111;
    color: #ffffff;
    border-color: #111111;
}

.app-body .table-wrap {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.46);
}

.app-body .data-table th,
.app-body .employee-table thead th {
    background: #d0d0d0;
    color: #222222;
    border-bottom-color: rgba(0, 0, 0, 0.12);
}

.app-body .data-table td {
    color: #191919;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.app-body .data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.045);
}

.app-body .status-active {
    background: rgba(31, 122, 63, 0.12);
    color: #155b2e;
    border: 1px solid rgba(31, 122, 63, 0.18);
}

.app-body .status-ended {
    background: rgba(0, 0, 0, 0.07);
    color: #444444;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.app-body .bar-track {
    background: rgba(0, 0, 0, 0.12);
}

.app-body .bar-fill {
    background: linear-gradient(90deg, #151515, #777777);
}

.app-body .form-field label,
.app-body .combo-option,
.app-body .combo-add-option {
    color: #151515;
}

.app-body .form-field input,
.app-body .form-field select,
.app-body .form-field textarea,
.app-body .filter-select,
.app-body .search-box {
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    border-color: rgba(0, 0, 0, 0.14);
}

.app-body .form-field input:focus,
.app-body .form-field select:focus,
.app-body .form-field textarea:focus,
.app-body .filter-select:focus,
.app-body .search-box:focus-within {
    border-color: rgba(0, 0, 0, 0.36);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}

.app-body .combo-toggle {
    background: rgba(0, 0, 0, 0.08);
    color: #111111;
}

.app-body .combo-toggle:hover {
    background: rgba(0, 0, 0, 0.14);
}

.app-body .combo-menu {
    background: #f2f2f2;
    border-color: rgba(0, 0, 0, 0.14);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.14);
}

.app-body .combo-option,
.app-body .combo-add-option {
    background: rgba(255, 255, 255, 0.72);
}

.app-body .combo-option:hover,
.app-body .combo-selectable.is-highlighted {
    background: #d9d9d9;
    color: #111111;
    outline: 1px solid rgba(0, 0, 0, 0.12);
}

.app-body .combo-add-option {
    background: #111111;
    color: #ffffff;
}

.app-body .combo-delete-option {
    background: rgba(0, 0, 0, 0.06);
    color: #333333;
    border-color: rgba(0, 0, 0, 0.12);
}

.app-body .combo-delete-option:hover {
    background: rgba(180, 35, 24, 0.12);
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.25);
}

.app-body .employee-list-card .table-wrap::-webkit-scrollbar-track,
.app-body #designationBars::-webkit-scrollbar-track,
.app-body #officeBars::-webkit-scrollbar-track,
.app-body .combo-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.06);
}

.app-body .employee-list-card .table-wrap::-webkit-scrollbar-thumb,
.app-body #designationBars::-webkit-scrollbar-thumb,
.app-body #officeBars::-webkit-scrollbar-thumb,
.app-body .combo-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.26);
}

/* =========================
   Reports page
   ========================= */
.report-page-shell {
    max-width: 1440px;
}

.report-hero-actions,
.form-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.report-stat-grid {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
}

.report-card {
    overflow: visible;
}

.report-template-header {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding-bottom: 20px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    text-align: left;
}

.report-logo-wrap {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    padding: 10px;
}

.report-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.report-template-header p,
.report-template-header h2,
.report-template-header h3,
.report-template-header strong {
    margin: 0;
    display: block;
}

.report-template-header p {
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.report-template-header h2 {
    margin-top: 4px;
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1.05;
}

.report-template-header h3 {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 15px;
    font-weight: 700;
}

.report-template-header strong {
    margin-top: 12px;
    font-size: 18px;
}

.report-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.report-meta-grid div {
    min-width: 0;
    border-radius: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.report-meta-grid span,
.report-meta-grid strong {
    display: block;
}

.report-meta-grid span {
    color: rgba(255, 255, 255, 0.64);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.report-meta-grid strong {
    margin-top: 6px;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.2;
}

.report-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.report-table {
    min-width: 1180px;
}

.report-table th,
.report-table td {
    white-space: normal;
    line-height: 1.35;
}

.report-table th:first-child,
.report-table td:first-child {
    width: 56px;
    text-align: center;
}

.report-signature-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 28px;
    margin-top: 34px;
}

.report-signature-row div {
    display: grid;
    gap: 9px;
    text-align: center;
}

.report-signature-row span,
.report-signature-row small {
    color: rgba(255, 255, 255, 0.62);
}

.report-signature-row strong {
    color: #ffffff;
    font-size: 16px;
    letter-spacing: 0.02em;
}

@media (max-width: 1050px) {
    .report-stat-grid,
    .report-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .report-hero-actions,
    .report-hero-actions .primary-btn,
    .report-hero-actions .secondary-btn {
        width: 100%;
    }

    .report-template-header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .report-logo-wrap {
        margin: 0 auto;
    }

    .report-meta-grid,
    .report-signature-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    html,
    body {
        width: 100%;
        min-height: auto;
        background: #ffffff !important;
        color: #111111 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .no-print,
    .top-nav,
    .toast-box {
        display: none !important;
    }

    .page-shell,
    .report-page-shell {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .report-card,
    .glass-card,
    .panel-card {
        box-shadow: none !important;
        background: #ffffff !important;
        color: #111111 !important;
        border: 0 !important;
        padding: 0 !important;
    }

    .report-template-header {
        grid-template-columns: 70px 1fr;
        border-bottom: 2px solid #111111 !important;
        color: #111111 !important;
        text-align: left;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .report-logo-wrap {
        width: 70px;
        height: 70px;
        background: #ffffff !important;
        border: 1px solid #d0d0d0;
    }

    .report-template-header p,
    .report-template-header h2,
    .report-template-header h3,
    .report-template-header strong,
    .report-meta-grid span,
    .report-meta-grid strong,
    .report-signature-row span,
    .report-signature-row small,
    .report-signature-row strong {
        color: #111111 !important;
    }

    .report-template-header h2 {
        font-size: 20px;
    }

    .report-template-header h3,
    .report-template-header strong {
        font-size: 13px;
    }

    .report-meta-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0;
        margin-bottom: 10px;
    }

    .report-meta-grid div {
        border-radius: 0;
        background: #f2f2f2 !important;
        border: 1px solid #777777 !important;
        color: #111111 !important;
        padding: 6px 8px;
    }

    .report-table-wrap {
        overflow: visible !important;
        border: 0 !important;
    }

    .report-table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: collapse !important;
        font-size: 10px;
    }

    .report-table th {
        background: #1f1f1f !important;
        color: #ffffff !important;
        border: 1px solid #555555 !important;
        padding: 5px !important;
    }

    .report-table td {
        color: #111111 !important;
        border: 1px solid #777777 !important;
        padding: 5px !important;
        background: #ffffff !important;
    }

    .employee-name-cell strong {
        color: #111111 !important;
    }

    .report-signature-row {
        break-inside: avoid;
        margin-top: 28px;
    }
}

/* =========================
   Report page readability fixes
   ========================= */
.report-stat-grid {
    grid-template-columns: repeat(3, minmax(240px, 1fr)) !important;
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
}

.app-body .report-stat-grid .stat-card {
    min-height: 108px;
    align-items: center;
}

.app-body .report-card,
.app-body #activeReportPrintArea {
    background: linear-gradient(145deg, rgba(236, 236, 236, 0.98), rgba(214, 214, 214, 0.98)) !important;
    color: #111111 !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

.app-body .report-template-header {
    border-bottom-color: rgba(0, 0, 0, 0.12) !important;
}

.app-body .report-template-header p,
.app-body .report-template-header h2,
.app-body .report-template-header h3,
.app-body .report-template-header strong {
    color: #111111 !important;
    text-shadow: none !important;
}

.app-body .report-template-header p,
.app-body .report-template-header h3 {
    color: #4a4a4a !important;
}

.app-body .report-meta-grid div {
    background: rgba(255, 255, 255, 0.72) !important;
    border-color: rgba(0, 0, 0, 0.10) !important;
}

.app-body .report-meta-grid span {
    color: #555555 !important;
    text-shadow: none !important;
}

.app-body .report-meta-grid strong {
    color: #111111 !important;
    text-shadow: none !important;
}

.app-body .report-table-wrap {
    background: rgba(255, 255, 255, 0.56) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

.app-body .report-table th {
    background: #cfcfcf !important;
    color: #222222 !important;
}

.app-body .report-table td {
    color: #111111 !important;
}

.app-body .report-signature-row span,
.app-body .report-signature-row small {
    color: #555555 !important;
    text-shadow: none !important;
}

.app-body .report-signature-row strong {
    color: #111111 !important;
    text-shadow: none !important;
}

@media (max-width: 1050px) {
    .report-stat-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
        max-width: 100%;
    }
}

@media (max-width: 720px) {
    .report-stat-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =========================
   Employee profile and appointment PDF UI
   ========================= */
.employee-profile-link {
    display: inline;
    max-width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

.employee-profile-link:hover,
.employee-profile-link:focus-visible {
    color: #ffffff;
    outline: none;
    text-decoration-thickness: 2px;
}

.profile-open {
    overflow: hidden;
}

.profile-overlay[hidden] {
    display: none !important;
}

.profile-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
}

.profile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.56);
}

.profile-panel {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    max-height: min(88vh, 920px);
    overflow: auto;
    border-radius: 24px;
    padding: clamp(20px, 3vw, 32px);
    background: #242424 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.profile-header h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.profile-header p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.68);
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.profile-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 92px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.profile-summary-card > span {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #ffffff;
    color: #111111;
}

.profile-summary-card div {
    min-width: 0;
}

.profile-summary-card small,
.profile-detail-grid small,
.appointment-document-box small,
.record-number {
    display: block;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-summary-card strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
    color: #ffffff;
    font-size: 15px;
}

.profile-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.profile-section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 14px;
}

.profile-section-title h3 {
    margin: 0;
    font-size: 22px;
}

.profile-section-title small {
    color: rgba(255, 255, 255, 0.64);
    font-weight: 800;
}

.profile-records-list {
    display: grid;
    gap: 14px;
}

.profile-record-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.profile-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.profile-record-head h4 {
    margin: 4px 0 0;
    font-size: 18px;
    color: #ffffff;
}

.profile-record-heading-copy {
    min-width: 0;
}

.profile-record-date-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-record-date-line h4 {
    color: #123a63 !important;
}

.record-resigned-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(100%, 520px);
    margin-top: 4px;
    padding: 6px 10px;
    border: 1px solid #8f1717;
    border-radius: 999px;
    background: #b42318;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    box-shadow: 0 4px 10px rgba(180, 35, 24, 0.2);
    white-space: normal;
    overflow-wrap: anywhere;
}

.record-resigned-badge i {
    flex: 0 0 auto;
}

.profile-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.profile-detail-grid div {
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
}

.profile-detail-grid strong {
    display: block;
    margin-top: 4px;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
}

.profile-detail-wide {
    grid-column: 1 / -1;
}

.appointment-document-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.appointment-document-box > div:first-child {
    min-width: 0;
}

.appointment-document-box strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
    color: #ffffff;
}

.appointment-document-box span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
}

.appointment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.compact-profile-btn {
    min-height: 38px !important;
    padding: 0 13px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
}

.profile-warning-box {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #111111;
    background: #fff3cd;
    border: 1px solid #ffec99;
}

.profile-warning-box span {
    color: #38320a;
}

.profile-warning-box code {
    font-weight: 900;
}

@media (max-width: 980px) {
    .profile-summary-grid,
    .profile-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .profile-overlay {
        padding: 10px;
        place-items: stretch;
    }

    .profile-panel {
        max-height: calc(100vh - 20px);
        border-radius: 18px;
    }

    .profile-header,
    .profile-record-head,
    .appointment-document-box,
    .profile-section-title {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-record-date-line {
        align-items: flex-start;
    }

    .record-resigned-badge {
        width: fit-content;
        max-width: 100%;
    }

    .profile-summary-grid,
    .profile-detail-grid {
        grid-template-columns: 1fr;
    }

    .profile-actions-row,
    .profile-actions-row .primary-btn,
    .appointment-actions,
    .appointment-actions .primary-btn,
    .appointment-actions .secondary-btn {
        width: 100%;
    }
}

/* =========================
   Employee profile light-grey theme fix
   ========================= */
.profile-panel {
    background: #eeeeee !important;
    color: #151515 !important;
    border: 1px solid #d2d2d2 !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28) !important;
}

.profile-header h2,
.profile-section-title h3,
.profile-record-head h4,
.profile-summary-card strong,
.profile-detail-grid strong,
.appointment-document-box strong {
    color: #151515 !important;
}

.profile-header p,
.profile-section-title small,
.appointment-document-box span {
    color: #555555 !important;
}

.profile-summary-card,
.profile-record-card,
.profile-detail-grid div,
.appointment-document-box {
    background: #f8f8f8 !important;
    border: 1px solid #d7d7d7 !important;
    color: #151515 !important;
}

.profile-summary-card small,
.profile-detail-grid small,
.appointment-document-box small,
.record-number {
    color: #666666 !important;
}

.profile-summary-card > span {
    background: #202020 !important;
    color: #ffffff !important;
}

.profile-section-title {
    border-top-color: #d2d2d2 !important;
}

.profile-record-card .status-badge.status-active {
    background: #1f7a3f !important;
    color: #ffffff !important;
}

.profile-record-card .status-badge.status-ended {
    background: #dedede !important;
    color: #333333 !important;
    border-color: #c8c8c8 !important;
}

.profile-panel .secondary-btn,
.profile-panel .icon-btn,
.profile-panel .compact-profile-btn.secondary-btn {
    background: #ffffff !important;
    color: #151515 !important;
    border: 1px solid #cfcfcf !important;
}

.profile-panel .secondary-btn:hover,
.profile-panel .icon-btn:hover,
.profile-panel .compact-profile-btn.secondary-btn:hover {
    background: #e6e6e6 !important;
    color: #111111 !important;
}

.profile-panel .compact-profile-btn.remove-appointment-document {
    background: #fff1f1 !important;
    color: #9c1c1c !important;
    border-color: #e6b9b9 !important;
}

.profile-panel .compact-profile-btn.remove-appointment-document:hover {
    background: #f7dada !important;
    color: #7f1111 !important;
    border-color: #d99b9b !important;
}

.profile-panel .primary-btn,
.profile-panel .compact-profile-btn.primary-btn {
    background: #202020 !important;
    color: #ffffff !important;
    border: 1px solid #202020 !important;
}

.profile-panel .primary-btn:hover,
.profile-panel .compact-profile-btn.primary-btn:hover {
    background: #000000 !important;
    color: #ffffff !important;
}

.employee-profile-link:hover,
.employee-profile-link:focus-visible {
    color: #dcdcdc;
}


/* Report length-of-service column update */
.report-table {
    min-width: 1320px;
}

.report-table th:nth-child(8),
.report-table td:nth-child(8) {
    min-width: 130px;
    text-align: center;
}

@media print {
    .report-table {
        font-size: 8.8px;
    }

    .report-table th,
    .report-table td {
        padding: 4px !important;
    }
}


/* =========================================================
   Faster employee entry: duplicate details / keep details
   ========================================================= */
.quick-entry-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.quick-entry-option label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: inherit;
    font-weight: 800;
    cursor: pointer;
}

.quick-entry-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    flex: 0 0 auto;
    accent-color: #111111;
}

.quick-entry-option small {
    max-width: 420px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.35;
    text-align: right;
}

.table-action.duplicate-employee-details {
    background: rgba(255, 255, 255, 0.18);
}

.table-action.duplicate-employee-details:hover {
    background: #e9e9e9;
    color: #111111;
}

.employee-table th:nth-child(8),
.employee-table td:nth-child(8) {
    width: 128px;
    min-width: 128px;
    text-align: center;
}

.form-header-actions .compact-close-btn {
    min-height: 38px;
}

@media (max-width: 720px) {
    .quick-entry-option {
        flex-direction: column;
        align-items: flex-start;
    }

    .quick-entry-option small {
        text-align: left;
    }
}

/* =========================================================
   Employee List filter controls: Name + Designation + Office
   ========================================================= */
.employee-filter-grid {
    display: grid !important;
    grid-template-columns: minmax(240px, 1.2fr) minmax(190px, 0.9fr) minmax(220px, 1fr) minmax(145px, 0.6fr) auto !important;
    align-items: end !important;
    gap: 12px !important;
}

.filter-field {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.filter-field label {
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.filter-field .search-box,
.filter-field .filter-select {
    min-height: 46px;
}

.filter-clear-btn {
    min-height: 46px;
    padding: 0 16px;
    border-radius: 12px;
    white-space: nowrap;
}

.app-body .filter-field label {
    color: rgba(255, 255, 255, 0.78);
}

@media (max-width: 1180px) {
    .employee-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .filter-clear-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .employee-filter-grid {
        grid-template-columns: 1fr !important;
    }
}


/* Added date/time display */
.employee-table .added-date-cell {
    min-width: 160px;
    white-space: nowrap;
    font-weight: 700;
}

.profile-detail-grid strong {
    word-break: break-word;
}

@media (max-width: 900px) {
    .employee-table .added-date-cell {
        white-space: normal;
    }
}


/* Employee List date-added placement fix */
.employee-name-cell .employee-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 7px;
}

.employee-name-cell .date-added-inline {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.employee-table .added-date-cell {
    display: none !important;
}

@media (max-width: 720px) {
    .employee-name-cell .employee-row-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .employee-name-cell .date-added-inline {
        white-space: normal;
        line-height: 1.25;
    }
}

/* =========================================================
   Desktop layout update: Record Form + Employee List side-by-side
   ========================================================= */
@media (min-width: 1180px) {
    body[data-page="employees"] .page-shell {
        width: min(100%, 1840px);
        padding-left: clamp(18px, 2.4vw, 44px);
        padding-right: clamp(18px, 2.4vw, 44px);
    }

    body[data-page="employees"] .employee-grid {
        display: grid !important;
        grid-template-columns: minmax(360px, 430px) minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 18px !important;
    }

    body[data-page="employees"] .employee-grid:not(:has(.employee-form-card.is-visible)) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body[data-page="employees"] .employee-grid:not(:has(.employee-form-card.is-visible)) .employee-list-card {
        grid-column: 1 / -1 !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form-card {
        grid-column: 1 !important;
        position: sticky !important;
        top: 92px !important;
        max-height: calc(100dvh - 112px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-list-card {
        grid-column: 2 !important;
        height: calc(100dvh - 188px) !important;
        min-height: 620px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form-card .section-title.split-title {
        gap: 12px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-header-actions .secondary-btn {
        flex: 1 1 auto !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form .form-field,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form .full-field {
        grid-column: 1 / -1 !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-list-card .table-wrap {
        max-height: none !important;
        overflow: auto !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-table {
        min-width: 1060px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-table th,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-table td {
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: 12.5px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-filter-grid {
        grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(170px, 0.9fr) minmax(120px, 0.6fr) auto !important;
        gap: 10px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .filter-clear-btn {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

@media (min-width: 1180px) and (max-width: 1380px) {
    body[data-page="employees"] .employee-grid {
        grid-template-columns: minmax(330px, 380px) minmax(0, 1fr) !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .filter-clear-btn {
        width: 100% !important;
    }
}

@media (max-width: 1179px) {
    body[data-page="employees"] .employee-form-card.is-visible {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* =========================================================
   Record Form fit + readable small text fixes
   Added after side-by-side layout so it overrides older rules.
   ========================================================= */

/* Make the "Keep these details" helper readable */
.quick-entry-option {
    background: #ececec !important;
    border: 1px solid #cfcfcf !important;
    color: #111111 !important;
    box-shadow: none !important;
}

.quick-entry-option label,
.quick-entry-option label span {
    color: #111111 !important;
}

.quick-entry-option small {
    color: #333333 !important;
    font-weight: 700 !important;
}

/* Make the "Added date/time" badge readable under the employee name */
.employee-name-cell .date-added-inline,
.date-added-badge,
.added-date-badge,
.employee-added-date,
.record-added-date,
.employee-meta-badge {
    background: #e6e6e6 !important;
    color: #111111 !important;
    border: 1px solid #c9c9c9 !important;
    font-weight: 850 !important;
    text-shadow: none !important;
}

/* Wider, more square record form on desktop */
@media (min-width: 1180px) {
    body[data-page="employees"] .page-shell {
        width: min(100%, 1920px) !important;
        padding-left: clamp(16px, 2vw, 34px) !important;
        padding-right: clamp(16px, 2vw, 34px) !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) {
        grid-template-columns: minmax(520px, 610px) minmax(680px, 1fr) !important;
        gap: 18px !important;
        align-items: start !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form-card {
        position: sticky !important;
        top: 88px !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 18px !important;
        border-radius: 20px !important;
    }

    body[data-page="employees"] .employee-form-card .section-title.split-title {
        margin-bottom: 14px !important;
        gap: 10px !important;
    }

    body[data-page="employees"] .employee-form-card .section-title h2 {
        font-size: 21px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-header-actions {
        width: auto !important;
        justify-content: flex-end !important;
        gap: 7px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-header-actions .secondary-btn,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-header-actions .icon-btn {
        min-height: 36px !important;
        height: 36px !important;
        padding-left: 11px !important;
        padding-right: 11px !important;
        font-size: 12px !important;
        flex: 0 0 auto !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px 12px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form .full-field {
        grid-column: 1 / -1 !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-field label {
        margin: 8px 0 6px !important;
        font-size: 12px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-field input,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-field select,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-field textarea,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .combo-field input {
        min-height: 40px !important;
        height: 40px !important;
        border-radius: 10px !important;
        padding-left: 11px !important;
        padding-right: 38px !important;
        font-size: 13px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .combo-toggle {
        width: 38px !important;
        height: 40px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-field textarea {
        min-height: 64px !important;
        height: 64px !important;
        padding-top: 10px !important;
        resize: vertical !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .quick-entry-option {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(190px, 0.8fr) !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px 12px !important;
        border-radius: 12px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .quick-entry-option input[type="checkbox"] {
        width: 16px !important;
        height: 16px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .quick-entry-option label {
        gap: 8px !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .quick-entry-option small {
        max-width: none !important;
        text-align: right !important;
        font-size: 11px !important;
        line-height: 1.25 !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-actions {
        margin-top: 4px !important;
        gap: 8px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-actions .primary-btn,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-actions .secondary-btn {
        min-height: 40px !important;
        height: 40px !important;
        border-radius: 11px !important;
        font-size: 13px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-list-card {
        height: calc(100dvh - 188px) !important;
        min-height: 620px !important;
    }
}

/* Fit better on normal laptop widths while keeping the form two-column */
@media (min-width: 1180px) and (max-width: 1450px) {
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) {
        grid-template-columns: minmax(500px, 540px) minmax(0, 1fr) !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .employee-form-card {
        padding: 16px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .form-header-actions .secondary-btn:first-child {
        flex: 1 1 180px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .quick-entry-option {
        grid-template-columns: 1fr !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .quick-entry-option small {
        text-align: left !important;
    }
}

/* On smaller screens, keep the readable colors and allow normal stacking */
@media (max-width: 1179px) {
    body[data-page="employees"] .employee-form-card.is-visible {
        max-height: none !important;
        overflow: visible !important;
    }

    .quick-entry-option small {
        color: #333333 !important;
        text-align: left !important;
    }
}



/* =========================================================
   CLEAN FORM INPUT ICONS
   Fixes date picker and combo/dropdown icons inside Record Form
   ========================================================= */

/* Make every form input/control use the same clean height and spacing */
body[data-page="employees"] .employee-form-card .form-field input,
body[data-page="employees"] .employee-form-card .form-field textarea,
body[data-page="employees"] .employee-form-card .combo-field input {
    background: #f8f8f8 !important;
    color: #111111 !important;
    border: 1px solid #d3d3d3 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

body[data-page="employees"] .employee-form-card .form-field input:hover,
body[data-page="employees"] .employee-form-card .combo-field input:hover {
    border-color: #bbbbbb !important;
}

body[data-page="employees"] .employee-form-card .form-field input:focus,
body[data-page="employees"] .employee-form-card .combo-field input:focus,
body[data-page="employees"] .employee-form-card .form-field textarea:focus {
    border-color: #777777 !important;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.10) !important;
}

/* Clean native calendar icon inside date fields */
body[data-page="employees"] .employee-form-card input[type="date"] {
    min-width: 0 !important;
    padding-left: 12px !important;
    padding-right: 44px !important;
    line-height: 1 !important;
    color-scheme: light !important;
}

body[data-page="employees"] .employee-form-card input[type="date"]::-webkit-calendar-picker-indicator {
    width: 18px !important;
    height: 18px !important;
    padding: 8px !important;
    margin-right: -4px !important;
    border-radius: 9px !important;
    cursor: pointer !important;
    opacity: 0.88 !important;
    background-color: #eeeeee !important;
}

body[data-page="employees"] .employee-form-card input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-color: #dedede !important;
    opacity: 1 !important;
}

/* Clean dropdown arrow button area */
body[data-page="employees"] .employee-form-card .combo-field {
    position: relative !important;
    display: block !important;
}

body[data-page="employees"] .employee-form-card .combo-field input {
    padding-right: 48px !important;
}

body[data-page="employees"] .employee-form-card .combo-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 5px !important;
    width: 36px !important;
    height: calc(100% - 10px) !important;
    min-height: 30px !important;
    max-height: 34px !important;
    transform: translateY(-50%) !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 9px !important;
    background: #eeeeee !important;
    color: #111111 !important;
    border: 1px solid #d5d5d5 !important;
    box-shadow: none !important;
}

body[data-page="employees"] .employee-form-card .combo-toggle i {
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    color: #111111 !important;
    transform-origin: center !important;
}

body[data-page="employees"] .employee-form-card .combo-toggle:hover {
    background: #dedede !important;
    border-color: #c6c6c6 !important;
}

body[data-page="employees"] .employee-form-card .combo-field.is-open .combo-toggle {
    background: #111111 !important;
    border-color: #111111 !important;
    color: #ffffff !important;
}

body[data-page="employees"] .employee-form-card .combo-field.is-open .combo-toggle i {
    color: #ffffff !important;
}

/* Keep icon buttons in the form header consistent */
body[data-page="employees"] .employee-form-card .icon-btn,
body[data-page="employees"] .employee-form-card .compact-close-btn {
    border-radius: 10px !important;
}

body[data-page="employees"] .employee-form-card .icon-btn i,
body[data-page="employees"] .employee-form-card .secondary-btn i,
body[data-page="employees"] .employee-form-card .primary-btn i {
    line-height: 1 !important;
}

/* Smaller laptop layout: keep icons centered even when the form is compressed */
@media (min-width: 1180px) {
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .combo-toggle {
        width: 34px !important;
        height: 30px !important;
        right: 5px !important;
        border-radius: 8px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) .combo-field input,
    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) input[type="date"] {
        padding-right: 44px !important;
    }

    body[data-page="employees"] .employee-grid:has(.employee-form-card.is-visible) input[type="date"]::-webkit-calendar-picker-indicator {
        width: 16px !important;
        height: 16px !important;
        padding: 7px !important;
        margin-right: -3px !important;
    }
}

/* =========================================================
   FINAL CLEANUP: date picker icon + employee name fitting
   ========================================================= */

/* Use one clean custom calendar icon, aligned on the right side. */
body[data-page="employees"] .employee-form-card input[type="date"] {
    position: relative !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #f8f8f8 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 9h18'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 13px center !important;
    background-size: 17px 17px !important;
    padding-right: 48px !important;
    color: #111111 !important;
    color-scheme: light !important;
}

/* Keep the real browser date picker clickable, but hide the ugly native icon. */
body[data-page="employees"] .employee-form-card input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute !important;
    top: 50% !important;
    right: 7px !important;
    width: 34px !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-50%) !important;
    cursor: pointer !important;
    opacity: 0 !important;
}

body[data-page="employees"] .employee-form-card input[type="date"]::-webkit-inner-spin-button,
body[data-page="employees"] .employee-form-card input[type="date"]::-webkit-clear-button {
    display: none !important;
}

body[data-page="employees"] .employee-form-card input[type="date"]:focus {
    background-color: #ffffff !important;
    border-color: #777777 !important;
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.10) !important;
}

/* Keep dropdown arrow boxes neat and vertically centered with the date fields. */
body[data-page="employees"] .employee-form-card .combo-toggle {
    top: 50% !important;
    right: 6px !important;
    width: 34px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9px !important;
}

body[data-page="employees"] .employee-form-card .combo-toggle i {
    display: block !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1 !important;
}

/* Give employee names more room in the list and keep them clean on one line. */
body[data-page="employees"] .employee-list-card .table-wrap {
    overflow: auto !important;
}

body[data-page="employees"] .employee-table {
    min-width: 1320px !important;
    table-layout: fixed !important;
}

body[data-page="employees"] .employee-table th,
body[data-page="employees"] .employee-table td {
    vertical-align: middle !important;
}

body[data-page="employees"] .employee-table th:nth-child(1),
body[data-page="employees"] .employee-table td:nth-child(1) {
    width: 300px !important;
}

body[data-page="employees"] .employee-table th:nth-child(2),
body[data-page="employees"] .employee-table td:nth-child(2) {
    width: 135px !important;
}

body[data-page="employees"] .employee-table th:nth-child(3),
body[data-page="employees"] .employee-table td:nth-child(3) {
    width: 155px !important;
}

body[data-page="employees"] .employee-table th:nth-child(4),
body[data-page="employees"] .employee-table td:nth-child(4) {
    width: 145px !important;
}

body[data-page="employees"] .employee-table th:nth-child(5),
body[data-page="employees"] .employee-table td:nth-child(5) {
    width: 205px !important;
}

body[data-page="employees"] .employee-table th:nth-child(6),
body[data-page="employees"] .employee-table td:nth-child(6) {
    width: 100px !important;
}

body[data-page="employees"] .employee-table th:nth-child(7),
body[data-page="employees"] .employee-table td:nth-child(7) {
    width: 170px !important;
}

body[data-page="employees"] .employee-table th:nth-child(8),
body[data-page="employees"] .employee-table td:nth-child(8) {
    width: 110px !important;
    text-align: center !important;
}

body[data-page="employees"] .employee-name-cell {
    min-width: 0 !important;
    overflow: hidden !important;
}

body[data-page="employees"] .employee-profile-link {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-align: left !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
}

body[data-page="employees"] .employee-name-cell .employee-row-meta {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

body[data-page="employees"] .employee-name-cell .status-badge {
    flex: 0 0 auto !important;
}

body[data-page="employees"] .employee-name-cell .date-added-inline {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 165px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    background: #e6e6e6 !important;
    color: #111111 !important;
    border-color: #c9c9c9 !important;
    text-shadow: none !important;
}

@media (max-width: 720px) {
    body[data-page="employees"] .employee-profile-link {
        white-space: normal !important;
        overflow: visible !important;
    }

    body[data-page="employees"] .employee-name-cell .employee-row-meta {
        flex-wrap: wrap !important;
    }
}

/* =========================
   Existing appointment PDF picker
   ========================= */
.existing-document-overlay[hidden] {
    display: none !important;
}

.existing-document-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: 24px;
}

.existing-document-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
}

.existing-document-panel {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    max-height: min(86vh, 820px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    padding: clamp(20px, 3vw, 30px);
    border-radius: 24px;
    background: #eeeeee;
    color: #151515;
    border: 1px solid #d2d2d2;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

.existing-document-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.existing-document-header h2 {
    margin: 4px 0 0;
    font-size: clamp(22px, 3vw, 32px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.existing-document-header p {
    margin: 8px 0 0;
    color: #555555;
    font-weight: 700;
}

.existing-document-storage-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #e5f4e9;
    border: 1px solid #badfc4;
    color: #245b32;
    font-size: 13px;
    font-weight: 750;
}

.existing-document-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #cfcfcf;
}

.existing-document-search:focus-within {
    border-color: #202020;
    box-shadow: 0 0 0 3px rgba(32, 32, 32, 0.1);
}

.existing-document-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #151515;
    font: inherit;
}

.existing-document-list {
    min-height: 150px;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 10px;
    padding-right: 4px;
}

.existing-document-choice {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #d5d5d5;
}

.existing-document-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #202020;
    color: #ffffff;
    font-size: 19px;
}

.existing-document-details {
    min-width: 0;
}

.existing-document-details strong,
.existing-document-details span,
.existing-document-details small {
    display: block;
}

.existing-document-details strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #151515;
}

.existing-document-details span {
    margin-top: 4px;
    color: #555555;
    font-size: 13px;
}

.existing-document-details small {
    margin-top: 4px;
    color: #717171;
    font-weight: 750;
}

.existing-document-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.existing-document-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    border-radius: 16px;
    background: #f8f8f8;
    border: 1px dashed #c9c9c9;
}

.existing-document-empty i {
    font-size: 28px;
    color: #777777;
}

.existing-document-empty span {
    max-width: 430px;
    color: #666666;
    font-size: 13px;
}

.existing-document-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

@media (max-width: 680px) {
    .existing-document-overlay {
        padding: 10px;
        place-items: stretch;
    }

    .existing-document-panel {
        max-height: calc(100vh - 20px);
        border-radius: 18px;
    }

    .existing-document-header {
        align-items: flex-start;
    }

    .existing-document-choice {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .existing-document-choice .existing-document-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .existing-document-choice .existing-document-actions .primary-btn,
    .existing-document-choice .existing-document-actions .secondary-btn {
        flex: 1 1 180px;
    }

    .existing-document-footer .secondary-btn {
        width: 100%;
    }
}


/* =========================
   Appointment PDF preview
   ========================= */
.pdf-preview-overlay[hidden] {
    display: none !important;
}

.pdf-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 180;
    display: grid;
    place-items: center;
    padding: 20px;
}

.pdf-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.pdf-preview-panel {
    position: relative;
    z-index: 1;
    width: min(1040px, 100%);
    height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    padding: clamp(16px, 2.5vw, 26px);
    border-radius: 24px;
    background: #eeeeee;
    color: #151515;
    border: 1px solid #d2d2d2;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.pdf-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.pdf-preview-header h2 {
    margin: 4px 0 0;
    max-width: min(720px, 72vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(21px, 3vw, 30px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.pdf-preview-header p {
    margin: 7px 0 0;
    color: #555555;
    font-weight: 700;
}

.pdf-preview-frame-wrap {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    border-radius: 16px;
    background: #dadada;
    border: 1px solid #c7c7c7;
}

.pdf-preview-frame-wrap iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px;
    border: 0;
    background: #ffffff;
}

.pdf-preview-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pdf-preview-footer #pdfPreviewOpenNewTab {
    margin-right: auto;
}

@media (max-width: 680px) {
    .pdf-preview-overlay {
        padding: 8px;
        place-items: stretch;
    }

    .pdf-preview-panel {
        width: 100%;
        height: calc(100vh - 16px);
        border-radius: 18px;
    }

    .pdf-preview-header h2 {
        max-width: 72vw;
    }

    .pdf-preview-frame-wrap iframe {
        min-height: 300px;
    }

    .pdf-preview-footer,
    .pdf-preview-footer .primary-btn,
    .pdf-preview-footer .secondary-btn {
        width: 100%;
    }

    .pdf-preview-footer #pdfPreviewOpenNewTab {
        margin-right: 0;
    }
}

/* Employee service record date range: keep visibly blue after profile theme overrides. */
body[data-page="employees"] .profile-panel .profile-record-date-line h4 {
    color: #2563eb !important;
}
