/* ==========================================================================
   HRM Design System
   Single, clean CSS file for both client and admin layouts.
   No legacy hrm_style.css dependency.
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    --color-primary: #3b6fd4;
    --color-primary-dark: #2855b0;
    --color-primary-light: #e8eef8;
    --color-secondary: #64748b;
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-danger: #dc2626;
    --color-danger-light: #fef2f2;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-info: #0891b2;
    --color-info-light: #ecfeff;
    --color-admin: #4f46e5;
    --color-admin-dark: #3730a3;

    /* Neutral gray palette — no blue tint */
    --color-bg: #F7F5F2;
    --color-bg-alt: #e8eaed;
    --color-surface: #ffffff;
    --color-border: #dde1e7;
    --color-text: #1a202c;
    --color-text-secondary: #4a5568;
    --color-text-muted: #718096;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;

    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;

    --header-height: 60px;
    --sidebar-width: 280px;
    --sidebar-collapsed: 0px;

    /* User layout left rail (must track theme — avoid hardcoded light gray in dark mode) */
    --color-left-panel: #f8fafc;

    --transition: 180ms ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #0f172a;
        --color-surface: #1e293b;
        --color-border: #334155;
        --color-text: #f1f5f9;
        --color-text-secondary: #94a3b8;
        --color-text-muted: #64748b;
        --color-primary-light: #1e3a5f;
        --color-success-light: #14532d;
        --color-danger-light: #450a0a;
        --color-warning-light: #451a03;
        --color-info-light: #164e63;
        --color-left-panel: #1e293b;
    }
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[x-cloak] { display: none !important; }

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { border: none; vertical-align: middle; }
form { display: inline; }
ul { list-style: none; }
p { margin: 0; }
strong, b { font-weight: 600; }

h1 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.125rem 0;
    letter-spacing: -0.01em;
}

h2 {
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

h3 {
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

a:link, a:visited, a:active {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Buttons used as anchor tags must override global link color */
a.hrm-btn--primary,
a.hrm-btn--primary:link,
a.hrm-btn--primary:visited,
a.hrm-btn--primary:active,
a.hrm-btn--primary:hover { color: white; text-decoration: none; }
a.hrm-btn--danger,
a.hrm-btn--danger:link,
a.hrm-btn--danger:visited { color: white; text-decoration: none; }
a.hrm-btn--secondary,
a.hrm-btn--secondary:link,
a.hrm-btn--secondary:visited { color: var(--color-text); text-decoration: none; }
a.hrm-btn--secondary:hover { color: var(--color-text); text-decoration: none; }

table {
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text);
    border-collapse: collapse;
}

td { padding: 0.375rem 0.5rem; }

input, select {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    vertical-align: middle;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.5rem;
    background: var(--color-surface);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}
input[type="submit"], input[type="reset"], input[type="button"] {
    cursor: pointer;
    background: var(--color-surface);
    transition: all var(--transition);
}
input[type="submit"]:hover, input[type="reset"]:hover, input[type="button"]:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
}
input[type="hidden"] { border: none; padding: 0; }
input[type="radio"], input[type="checkbox"] {
    border: none;
    padding: 0;
    box-shadow: none;
    accent-color: var(--color-primary);
}

textarea {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-surface);
    padding: 0.5rem 0.625rem;
}
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}


/* ==========================================================================
   3. LAYOUT
   ========================================================================== */

.hrm-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.hrm-layout--modern { flex-direction: column; }

/* Admin layout: header on top, then sidebar+main side by side */
.hrm-layout--admin {
    flex-direction: column;
}

/* Flex row wrapper for admin sidebar + main content */
.hrm-admin-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hrm-main-wrapper {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    align-items: stretch;
    margin: 0;
    padding: 0;
}

.hrm-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

.hrm-content {
    flex: 1;
    padding: 1.25rem 1.5rem;
    max-width: 100%;
    overflow-x: auto;
}

/* Admin header title (compact) */
.hrm-header__admin-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    padding: 0 0.5rem;
}


/* ==========================================================================
   4. HEADER
   ========================================================================== */

.hrm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 4px 0 rgb(0 0 0 / 0.06);
    flex-shrink: 0;
}

.hrm-header--admin { border-bottom-color: var(--color-border); background: var(--color-surface); color: var(--color-text); }
.hrm-header--compact { padding: 0 1rem; }
.hrm-header__spacer { flex: 1; min-width: 0.5rem; }
.hrm-header__admin-title { font-size: 1rem; font-weight: 700; color: var(--color-text); }

.hrm-header__left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.hrm-header__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hrm-header__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}
.hrm-header__toggle:hover { background: var(--color-bg); }

.hrm-header__logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.hrm-header__logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.hrm-header__logo-sub {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

.hrm-header__nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* User dropdown */
.hrm-header__user { position: relative; }

.hrm-header__user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-text);
    transition: all var(--transition);
}
.hrm-header__user-btn:hover { background: var(--color-bg); }
.hrm-header__user-name { font-size: 1rem; font-weight: 500; }


/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */

/* Top navigation links */
.hrm-top-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.hrm-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.hrm-nav-link:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
    text-decoration: none;
}
.hrm-nav-link--active {
    color: var(--color-primary);
    background: var(--color-primary-light);
    font-weight: 600;
}
.hrm-body--admin .hrm-nav-link--active {
    color: var(--color-admin);
    background: #eef2ff;
}

/* Admin sidebar navigation */
.hrm-nav-sidebar {
    width: 240px;
    min-width: 240px;
    background: transparent;
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    /* Use align-self:stretch so sidebar fills the full flex-row height */
    align-self: stretch;
    min-height: 100%;
    overflow-y: auto;
    z-index: 40;
    flex-shrink: 0;
}
.hrm-nav-sidebar--admin {
    background: #111827;
}
.hrm-nav-sidebar__logo {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hrm-nav-sidebar__logo-text { font-size: 1.25rem; font-weight: 700; color: white; }
.hrm-nav-sidebar__logo-sub { font-size: 0.7rem; color: #94a3b8; margin-top: 0.125rem; }
.hrm-nav-sidebar__nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
a.hrm-nav-sidebar__link,
a.hrm-nav-sidebar__link:link,
a.hrm-nav-sidebar__link:visited {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 0 0.5rem;
    color: #d1d5db;
    text-decoration: none;
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
a.hrm-nav-sidebar__link:hover { background: rgba(255,255,255,0.1); color: white; text-decoration: none; }
a.hrm-nav-sidebar__link--active,
a.hrm-nav-sidebar__link--active:link,
a.hrm-nav-sidebar__link--active:visited {
    background: rgba(79, 70, 229, 0.15);
    color: #a5b4fc;
}
.hrm-nav-sidebar--admin a.hrm-nav-sidebar__link--active,
.hrm-nav-sidebar--admin a.hrm-nav-sidebar__link--active:link,
.hrm-nav-sidebar--admin a.hrm-nav-sidebar__link--active:visited {
    background: rgba(255,255,255,0.15);
    color: #ffffff;
    font-weight: 600;
}
a.hrm-nav-sidebar__link--disabled { opacity: 0.5; cursor: default; pointer-events: none; }
.hrm-nav-sidebar__icon { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.8; }

/* Sidebar collapsible group */
.hrm-nav-sidebar__group {
    margin: 0.125rem 0;
}
.hrm-nav-sidebar__group-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    margin: 0 0.5rem;
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    text-align: left;
}
.hrm-nav-sidebar__group-btn:hover { background: rgba(255,255,255,0.06); color: white; }
.hrm-nav-sidebar__group-btn span { flex: 1; }
.hrm-nav-sidebar__chevron {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: transform 250ms ease;
    flex-shrink: 0;
}
.hrm-nav-sidebar__chevron--open { transform: rotate(90deg); }
.hrm-nav-sidebar__sublinks {
    padding: 0.125rem 0 0.25rem 0;
    overflow: hidden;
}
a.hrm-nav-sidebar__sublink,
a.hrm-nav-sidebar__sublink:link,
a.hrm-nav-sidebar__sublink:visited {
    display: block;
    padding: 0.4rem 1rem 0.4rem 3.25rem;
    margin: 0 0.5rem;
    font-size: 0.9375rem;
    color: #9ca3af;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
a.hrm-nav-sidebar__sublink:hover { color: white; background: rgba(255,255,255,0.1); text-decoration: none; }
a.hrm-nav-sidebar__sublink--active,
a.hrm-nav-sidebar__sublink--active:link,
a.hrm-nav-sidebar__sublink--active:visited {
    color: #ffffff;
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}
a.hrm-nav-sidebar__sublink--disabled { opacity: 0.5; cursor: default; pointer-events: none; }
.hrm-nav-sidebar__divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.5rem 1rem;
}

/* Dropdown */
.hrm-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 100;
}
.hrm-dropdown__item {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--transition);
}
.hrm-dropdown__item:hover { background: var(--color-bg); text-decoration: none; }
.hrm-dropdown__item--full {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}


/* ==========================================================================
   6. LEFT PANEL (Birthdays, Employees on Leave)
   ========================================================================== */

.hrm-left-panel {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    background: var(--color-left-panel);
    border-right: 1px solid var(--color-border);
    color: var(--color-text);
    overflow-y: auto;
    padding: 0.5rem 0.875rem 1.25rem;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
}

.hrm-panel__section {
    margin-bottom: 1.5rem;
}

.hrm-panel__title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-primary);
    padding: 0.375rem 0.625rem;
    margin-bottom: 0.5rem;
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    border: none;
    border-left: 3px solid var(--color-primary);
}
.hrm-panel__body { font-size: 0.9375rem; color: var(--color-text-secondary); margin-bottom: 0; }
.hrm-panel__list { list-style: none; }
.hrm-panel__item {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.375rem;
    padding: 0.3125rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
    line-height: 1.4;
}
.hrm-panel__item:last-child { border-bottom: none; }
/* Birthday list: today’s row (whole line) */
.hrm-panel__item--today { color: var(--color-primary); }
.hrm-panel__item--today .hrm-panel__name { font-weight: 600; color: var(--color-primary); }
.hrm-panel__name { font-weight: 400; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.hrm-panel__meta { font-size: 0.9375rem; color: var(--color-text-muted); white-space: nowrap; }
/* Employees on leave sidebar: highlight dates only when leave includes today */
.hrm-panel__meta--today {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.35rem;
    font-weight: 600;
    color: var(--color-text);
}
.hrm-panel__empty { font-size: 0.9375rem; color: var(--color-text-muted); font-style: italic; }


/* ==========================================================================
   7. FOOTER
   ========================================================================== */

.hrm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
.hrm-footer a { color: var(--color-primary); text-decoration: none; }
.hrm-footer a:hover { text-decoration: underline; }
.hrm-footer__nav { display: flex; gap: 1.5rem; }


/* ==========================================================================
   8. CLOCK
   ========================================================================== */

.hrm-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}
.hrm-clock__time { font-size: 1rem; font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }
.hrm-clock__date { font-size: 0.7rem; color: var(--color-text-muted); }


/* ==========================================================================
   9. AVATAR
   ========================================================================== */

.hrm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    flex-shrink: 0;
}
img.hrm-avatar.hrm-avatar--photo {
    display: block;
    padding: 0;
    object-fit: cover;
    background: var(--color-border);
    font-size: 0;
}
.hrm-avatar--md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}
img.hrm-avatar.hrm-avatar--photo.hrm-avatar--md {
    width: 2.5rem;
    height: 2.5rem;
}
.hrm-avatar--lg {
    width: 4rem;
    height: 4rem;
    font-size: 1.125rem;
}
img.hrm-avatar.hrm-avatar--photo.hrm-avatar--lg {
    width: 4rem;
    height: 4rem;
}
/* Contacts: map link instead of inline address text */
.hrm-contacts-map-link {
    display: inline-flex;
    align-items: center;
    color: var(--color-primary);
    line-height: 1;
}
.hrm-contacts-map-link:hover {
    color: var(--color-primary);
    opacity: 0.85;
}
.hrm-contacts-map-icon {
    display: block;
    flex-shrink: 0;
}

.hrm-avatar--admin { background: var(--color-admin); }
.hrm-header--admin .hrm-header__user-btn { border-color: var(--color-border); color: var(--color-text); }
.hrm-header--admin .hrm-header__user-btn:hover { background: var(--color-bg); }
.hrm-header--admin .hrm-clock__time { color: var(--color-text); }
.hrm-header--admin .hrm-clock__date { color: var(--color-text-muted); }


/* ==========================================================================
   10. ALERTS
   ========================================================================== */

.hrm-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 1rem;
}
.hrm-alert--success { background: var(--color-success-light); color: var(--color-success); border: 1px solid var(--color-success); }
.hrm-alert--error   { background: var(--color-danger-light);  color: var(--color-danger);  border: 1px solid var(--color-danger); }
.hrm-alert--info    { background: var(--color-info-light);    color: var(--color-info);    border: 1px solid var(--color-info); }
.hrm-alert--warning { background: var(--color-warning-light); color: var(--color-warning); border: 1px solid var(--color-warning); }

.hrm-alert__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    color: inherit;
    opacity: 0.7;
    padding: 0 0.25rem;
}
.hrm-alert__close:hover { opacity: 1; }


/* ==========================================================================
   11. BUTTONS
   ========================================================================== */

.hrm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.4;
}
.hrm-btn--primary { background: var(--color-primary); color: white; }
.hrm-btn--primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.hrm-btn--danger { background: var(--color-danger); color: white; }
.hrm-btn--danger:hover { background: #b91c1c; }
.hrm-btn--secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.hrm-btn--secondary:hover { background: var(--color-bg); }
.hrm-btn--sm { padding: 0.375rem 0.75rem; font-size: 0.875rem; white-space: nowrap; min-width: max-content; }
.hrm-btn--xs { padding: 0.25rem 0.5rem; font-size: 0.8125rem; white-space: nowrap; }
.hrm-btn:disabled,
.hrm-btn[disabled],
.hrm-btn.hrm-btn--disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}


/* ==========================================================================
   12. CARDS
   ========================================================================== */

.hrm-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.hrm-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
}
.hrm-card__title { font-size: 1rem; font-weight: 600; }
.hrm-card__body { padding: 1.25rem; }


/* ==========================================================================
   13. TABLES
   ========================================================================== */

.hrm-table { width: 100%; border-collapse: collapse; font-size: 1rem; }

.hrm-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}
.hrm-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}
.hrm-table tbody tr:hover { background: var(--color-bg); }
.hrm-table__row--highlight { background: #fefce8; font-weight: 600; }
.hrm-table__row--highlight:hover { background: #fef9c3; }
.hrm-table--leave td:first-child { font-weight: 500; }

/* Employees on leave — grouped by employee, two columns */
.hrm-leave-grouped {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
@media (max-width: 600px) {
    .hrm-leave-grouped { grid-template-columns: 1fr; }
}
.hrm-leave-grouped__employee {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--color-border);
}
.hrm-leave-grouped__employee--today {
    border-left: 3px solid var(--color-warning);
    padding-left: calc(1rem - 3px);
}
.hrm-leave-grouped__employee:nth-last-child(1),
.hrm-leave-grouped__employee:nth-last-child(2) { border-bottom: none; }
.hrm-leave-grouped__name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}
.hrm-leave-grouped__dates {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.15rem;
}
.hrm-leave-grouped__leave-line {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.35rem;
    margin-left: -0.35rem;
}
.hrm-leave-grouped__leave-line--active {
    background: #fef9c3;
    border: 1px solid #fde047;
}
.hrm-leave-grouped__date {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}


/* ==========================================================================
   14. FORMS
   ========================================================================== */

.hrm-form-group { margin-bottom: 1rem; }

.hrm-label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.375rem;
}

.hrm-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition);
    font-family: inherit;
}
.hrm-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}
.hrm-input--error { border-color: var(--color-danger); }
.hrm-input-error { font-size: 0.9375rem; color: var(--color-danger); margin-top: 0.25rem; }
.hrm-error { font-size: 0.875rem; color: var(--color-danger); margin-top: 0.25rem; }

select.hrm-input { appearance: auto; }
textarea.hrm-input { resize: vertical; min-height: 80px; }

.hrm-checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; cursor: pointer; }
.hrm-checkbox input { width: 1rem; height: 1rem; }

/* Forgot Entry form */
.hrm-fe-date {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 1rem;
}
.hrm-fe-date__label { color: var(--color-primary); font-weight: 600; font-size: 0.8125rem; }
.hrm-fe-date__val { font-weight: 700; color: var(--color-text); }

.hrm-fe-sessions { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.375rem; }
.hrm-fe-session {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.4rem 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem; cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.hrm-fe-session:has(input:checked) { background: var(--color-primary-light); border-color: var(--color-primary); }
.hrm-fe-session--disabled { opacity: 0.6; cursor: not-allowed; }
.hrm-fe-session input { width: 1rem; height: 1rem; cursor: pointer; }



/* ==========================================================================
   15. BADGES
   ========================================================================== */

.hrm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}
.hrm-badge--success { background: var(--color-success-light); color: var(--color-success); }
.hrm-badge--danger  { background: var(--color-danger-light);  color: var(--color-danger); }
.hrm-badge--warning { background: var(--color-warning-light); color: var(--color-warning); }
.hrm-badge--info    { background: var(--color-info-light);    color: var(--color-info); }
.hrm-badge--neutral { background: var(--color-bg);            color: var(--color-text-secondary); }


/* ==========================================================================
   16. PAGINATION
   ========================================================================== */

.hrm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}
.hrm-pagination a,
.hrm-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-decoration: none;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}
.hrm-pagination a:hover { background: var(--color-bg); text-decoration: none; }
.hrm-pagination .active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

.hrm-pagination__disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    cursor: default;
    opacity: 0.5;
}
.hrm-pagination__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    border: none;
}


/* ==========================================================================
   17. PAGE-LEVEL COMPONENTS
   ========================================================================== */

/* Page header */
.hrm-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.hrm-page-header__title { font-size: 1.5rem; font-weight: 700; color: var(--color-text); }

/* Page-level h1 with left accent bar — no border-bottom (hr_line in templates handles separator) */
.hrm-content h1 {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.375rem;
    padding-bottom: 0;
    border-bottom: none;
}
.hrm-content h1::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1.25em;
    background: var(--color-primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Profile page: title + "Full Name (login_id)" */
.hrm-content h1 .hrm-profile-heading__row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.85rem;
}
.hrm-content h1 .hrm-profile-heading__meta {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* hr_line — thin separator below page title */
.hr_line {
    background: none;
    border: none;
    border-bottom: 2px solid var(--color-border);
    height: 0;
    margin: 0 0 1rem 0;
}

/* Admin message banner (Frontend) */
.hrm-admin-message-banner {
    display: flex;
    gap: 1rem;
    background: #fffbeb; /* light yellow */
    border: 1px solid #fcd34d;
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.hrm-admin-message-banner__icon {
    flex-shrink: 0;
    color: #f59e0b;
    width: 24px;
    height: 24px;
    margin-top: 0.125rem;
}
.hrm-admin-message-banner__content {
    flex: 1;
}
.hrm-admin-message-banner__title {
    font-size: 1rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.25rem;
}
.hrm-admin-message-banner__body {
    font-size: 1rem;
    color: #b45309;
}

/* Admin messages list (Popup) */
.hrm-admin-messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.hrm-admin-messages-list__item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.hrm-admin-messages-list__date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
}
.hrm-admin-messages-list__date svg {
    opacity: 0.7;
}
.hrm-admin-messages-list__content {
    font-size: 1rem;
    color: var(--color-text);
}
.hrm-admin-messages-list__divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.25rem 0;
}
.hrm-admin-messages-list__empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1rem;
    padding: 2rem 0;
}

/* Rich text rendered content */
.hrm-rich-text p { margin-bottom: 0.75rem; }
.hrm-rich-text p:last-child { margin-bottom: 0; }
.hrm-rich-text strong, .hrm-rich-text b { font-weight: 700; }
.hrm-rich-text i, .hrm-rich-text em { font-style: italic; }
.hrm-rich-text u { text-decoration: underline; }
.hrm-rich-text ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.hrm-rich-text ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.hrm-rich-text a { color: var(--color-primary); text-decoration: underline; }
.hrm-rich-text h1, .hrm-rich-text h2, .hrm-rich-text h3 { margin-top: 1rem; margin-bottom: 0.5rem; font-weight: 700; }

/* Home page */
.hrm-home__title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.hrm-home__subtitle { color: var(--color-text-muted); font-size: 1rem; margin-bottom: 1rem; }
.hrm-home__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.hrm-home__grid > div { min-width: 0; }
.hrm-home__grid .hrm-admin-message-banner {
    height: 220px;
    margin-bottom: 0;
    display: flex;
    overflow: hidden;
}
.hrm-home__grid .hrm-admin-message-banner__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.hrm-home__grid .hrm-admin-message-banner__body {
    overflow-y: auto;
    padding-right: 0.25rem;
}

/* Quick action cards */
.hrm-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-align: center;
    padding: 1.25rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all 200ms ease;
    cursor: pointer;
}
.hrm-quick-action:hover {
    background: var(--color-surface);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(59, 111, 212, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
}
.hrm-quick-action strong {
    color: var(--color-text);
    font-size: 1rem;
}

/* Login form — inline layout (reference style) */
.hrm-card--login-inline {
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
}
.hrm-card--login-inline .hrm-card__body { padding: 0.75rem 1rem; flex: 1; }
.hrm-card--login-inline .hrm-label { font-size: 0.875rem; margin-bottom: 0.2rem; }
.hrm-card--login-inline .hrm-input { padding: 0.4rem 0.6rem; font-size: 0.9375rem; }
/* Holidays card in grid needs max-height for scroll */
.hrm-home__grid .hrm-card--holidays {
    max-height: 220px;
}
@media (max-width: 960px) {
    .hrm-home__grid .hrm-admin-message-banner {
        height: auto;
        max-height: none;
    }
    .hrm-home__grid .hrm-admin-message-banner__body {
        overflow: visible;
    }
}
.hrm-login-inline__fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.hrm-login-inline__field {
    display: flex;
    flex-direction: column;
}
.hrm-login-inline__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}
.hrm-login-inline__link {
    font-size: 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
}
.hrm-login-inline__link:hover { text-decoration: underline; }

/* Login form (legacy) */
.hrm-login-form__links { font-size: 1rem; color: var(--color-text-secondary); }
.hrm-login-form__links a { color: var(--color-primary); text-decoration: none; }
.hrm-login-form__links a:hover { text-decoration: underline; }
.hrm-login-form__sep { margin: 0 0.5rem; color: var(--color-border); }
.hrm-login-form__note { font-size: 0.8125rem; color: var(--color-text-muted); margin: 0; line-height: 1.45; }

/* User nav sidebar (light theme, left panel) */
.hrm-user-nav {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
a.hrm-user-nav__link,
a.hrm-user-nav__link:link,
a.hrm-user-nav__link:visited {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
a.hrm-user-nav__link:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    text-decoration: none;
}
a.hrm-user-nav__link--active,
a.hrm-user-nav__link--active:link,
a.hrm-user-nav__link--active:visited {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}
.hrm-user-nav__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
}
a.hrm-user-nav__link--active .hrm-user-nav__icon { opacity: 1; }

/* Public home: group names only (read-only list from user_groups) */
.hrm-groups-intro { margin-bottom: 0.5rem; }
.hrm-groups-names-list {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}
.hrm-groups-names-list__item {
    font-size: 1rem;
    padding: 0.4rem 0.85rem;
    background: var(--color-primary-light);
    border-radius: var(--radius-md);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

/* Lists */
.hrm-list { list-style: none; padding: 0; margin: 0; }
.hrm-list__item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); font-size: 1rem; }
.hrm-list__item:last-child { border-bottom: none; }
.hrm-list__meta { color: var(--color-text-muted); }

/* Groups grid (legacy) */
.hrm-groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.hrm-groups__item { padding: 0.75rem 0; background: transparent; border-radius: 0; }
.hrm-groups__name { display: block; font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--color-text); border-bottom: 1px dotted var(--color-border); padding-bottom: 0.25rem; }
.hrm-groups__users { font-size: 0.9375rem; color: var(--color-text-muted); line-height: 1.6; }
.hrm-groups__user { display: inline-block; margin-right: 0.75rem; font-weight: 400; }

/* Team columns — groups displayed as side-by-side columns */
.hrm-team-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.hrm-team-column {
    border-right: 1px solid var(--color-border);
    padding: 0;
}
.hrm-team-column:last-child { border-right: none; }
.hrm-team-column__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    padding: 0.625rem 0.75rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    margin: 0;
}
.hrm-team-column__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hrm-team-column__user {
    font-size: 0.9375rem;
    padding: 0.25rem 0.75rem;
    color: #a0aec0;
}
.hrm-team-column__user--active {
    color: var(--color-text);
    font-weight: 500;
}
@media (max-width: 600px) {
    .hrm-team-columns { grid-template-columns: 1fr; }
    .hrm-team-column { border-right: none; border-bottom: 1px solid var(--color-border); }
    .hrm-team-column:last-child { border-bottom: none; }
}

/* Daily Entry page - label/value rows (no tables) */
.hrm-daily-entry__info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.hrm-daily-entry__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--color-border);
}
.hrm-daily-entry__row:last-child { border-bottom: none; }
.hrm-daily-entry__label {
    flex: 0 0 180px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}
.hrm-daily-entry__value {
    flex: 1;
    font-size: 1rem;
    color: var(--color-text);
}
.hrm-daily-entry__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* ======================================================
   Daily Entry — Layout & Component Styles
   ====================================================== */

/* Page: daily entry — uses full main content width */
.hrm-de-page {
    display: block;
    width: 100%;
    max-width: 100%;
}
.hrm-de-page__main { min-width: 0; display: flex; flex-direction: column; }
.hrm-de-page__main .hrm-card { flex: 1; width: 100%; }

/* Graphs + daily report: same content width as punch card */
.hrm-de-below {
    width: 100%;
    max-width: 100%;
}

/* Main card — shared max width for note textarea + forgot-entry banner */
.hrm-de-card {
    overflow: hidden;
    --hrm-de-field-max: 42rem;
}

/* 4-step timeline strip */
.hrm-de-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.5rem;
    padding: 0.75rem 0 0.5rem;
}
.hrm-de-step {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.25rem; min-width: 55px; text-align: center;
}
.hrm-de-step__dot {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid var(--color-border); background: var(--color-surface);
    display: flex; align-items: center; justify-content: center; position: relative;
}
.hrm-de-step--done .hrm-de-step__dot { background: var(--color-success); border-color: var(--color-success); color: white; }
.hrm-de-step--active .hrm-de-step__dot { border-color: var(--color-primary); background: var(--color-primary-light); }
.hrm-de-step__pulse {
    width: 10px; height: 10px; border-radius: 50%; background: var(--color-primary);
    animation: hrmPulse 1.4s ease-in-out infinite;
}
@keyframes hrmPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.6;transform:scale(0.85)} }
.hrm-de-step__label { font-size: 0.6875rem; font-weight: 600; color: var(--color-text-muted); line-height: 1.2; }
.hrm-de-step--done .hrm-de-step__label { color: var(--color-success); }
.hrm-de-step--active .hrm-de-step__label { color: var(--color-primary); }
.hrm-de-step__time { font-size: 0.6875rem; font-weight: 700; color: var(--color-text); }
.hrm-de-connector { display: none; }
.hrm-de-connector--done { display: none; }

/* Form: single column — summary, note, actions, timeline, forgot banner */
.hrm-de-form {
    display: block;
    padding: 1rem 1.25rem 1.25rem;
}
.hrm-de-form__meta {
    max-width: 100%;
}
.hrm-de-form__badge {
    display: block; color: var(--color-primary);
    font-size: 1rem; font-weight: 700;
    padding: 0 0 0.5rem 0; margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary-light);
}
.hrm-de-form__meta-row {
    display: flex; align-items: baseline; gap: 0.5rem;
    padding: 0.2rem 0; font-size: 0.9375rem;
}
.hrm-de-form__meta-label { flex: 0 0 68px; color: var(--color-text-muted); font-size: 0.8125rem; }
.hrm-de-form__meta-val { font-weight: 600; color: var(--color-text); font-size: 0.9375rem; }
.hrm-de-form__right { display: flex; flex-direction: column; gap: 0.5rem; }
.hrm-de-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }

/* Optional note — multiline textarea */
.hrm-de-note-group { display: flex; flex-direction: column; gap: 0.35rem; }
.hrm-de-note-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    letter-spacing: 0.01em;
}
.hrm-de-note-label-hint {
    font-weight: 500;
    color: var(--color-text-muted);
}
.hrm-de-note-input {
    border: 1px dashed var(--color-border) !important;
    box-shadow: none !important;
    background: var(--color-bg) !important;
    font-size: 0.9375rem;
    line-height: 1.45;
    font-family: inherit;
    width: 100%;
    max-width: var(--hrm-de-field-max, 42rem);
    min-height: 4.5rem;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    resize: vertical;
    border-radius: var(--radius-sm);
}
.hrm-de-note-input::placeholder { color: var(--color-text-muted); font-style: italic; }
.hrm-de-note-input:focus {
    border: 1px solid var(--color-primary) !important;
    background: var(--color-surface) !important;
    outline: 2px solid var(--color-primary-light);
    outline-offset: 1px;
    color: var(--color-text);
}

/* Forgot Entry link */
.hrm-de-forgot-link { font-size: 0.9375rem; color: var(--color-primary); font-weight: 500; text-decoration: none; margin-left: 0.125rem; }
.hrm-de-forgot-link:hover { text-decoration: underline; }

/* Pending forgot-entry requests (submitted today, awaiting admin) — match note field width */
.hrm-de-forgot-pending {
    margin-top: 1rem;
    width: 100%;
    max-width: var(--hrm-de-field-max, 42rem);
    box-sizing: border-box;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    padding: 0;
    overflow: hidden;
}
.hrm-de-forgot-pending__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(to bottom, var(--color-info-light), var(--color-surface));
    border-bottom: 1px solid var(--color-border);
}
.hrm-de-forgot-pending__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.01em;
}
.hrm-de-forgot-pending__badge {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-info-light);
    color: var(--color-info);
    border: 1px solid var(--color-info);
}
.hrm-de-forgot-pending__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.hrm-de-forgot-pending__table thead th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}
.hrm-de-forgot-pending__table thead th:last-child,
.hrm-de-forgot-pending__table tbody td:last-child {
    text-align: right;
}
.hrm-de-forgot-pending__table tbody td {
    padding: 0.55rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}
.hrm-de-forgot-pending__table tbody tr:last-child td {
    border-bottom: none;
}
.hrm-de-forgot-pending__session {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.hrm-de-forgot-pending__session-lbl {
    font-weight: 600;
}
.hrm-de-forgot-pending__session-code {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.12rem 0.35rem;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    font-family: ui-monospace, monospace;
}
.hrm-de-forgot-pending__time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-primary-dark);
    white-space: nowrap;
}
.hrm-de-forgot-pending__foot {
    margin: 0;
    padding: 0.55rem 1rem 0.65rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

/* Complete state */
.hrm-de-complete { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.25rem; text-align: center; }
.hrm-de-complete .hrm-de-forgot-pending {
    align-self: center;
}
.hrm-de-complete__msg { font-weight: 600; color: var(--color-success); font-size: 0.9375rem; }

/* Late instances — right panel */
.hrm-de-late-panel {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
    padding: 1rem;
}
.hrm-de-late-panel__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-warning);
    margin-top: 0;
    margin-bottom: 0.75rem;
}
.hrm-de-late-panel__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}
.hrm-de-late-panel__list strong { color: var(--color-warning); }

/* Side panel — Display Time */
.hrm-input--sm { font-size: 0.9375rem; padding: 0.3rem 0.5rem; height: auto; }

/* Graph links — moved to bottom, horizontal row */
/* Daily entry — graphs: single card, tab strip + iframe viewport (same background) */
.hrm-de-graph-card .hrm-de-graph-card__inner {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: inherit;
    overflow: hidden;
}
.hrm-de-graph-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}
.hrm-de-graph-tab {
    flex: 1 1 0;
    min-width: 7.5rem;
    padding: 0.7rem 0.75rem;
    margin: 0;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.hrm-de-graph-tab:hover {
    background: var(--color-bg);
    color: var(--color-text-secondary);
}
.hrm-de-graph-tab--active.hrm-de-graph-tab--accent-fh-in {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.hrm-de-graph-tab--active.hrm-de-graph-tab--accent-fh-out {
    color: var(--color-warning);
    border-bottom-color: var(--color-warning);
}
.hrm-de-graph-tab--active.hrm-de-graph-tab--accent-sh-in {
    color: var(--color-success);
    border-bottom-color: var(--color-success);
}
.hrm-de-graph-tab--active.hrm-de-graph-tab--accent-sh-out {
    color: var(--color-info);
    border-bottom-color: var(--color-info);
}
.hrm-de-graph-viewport {
    padding: 1rem 1.25rem 1.25rem;
    background: var(--color-surface);
    overflow: hidden;
}
.hrm-de-graph-placeholder {
    margin: 0;
    padding: 1.75rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.45;
}
.hrm-de-graph-placeholder[hidden] {
    display: none !important;
}
.hrm-de-graph-pane[hidden] {
    display: none !important;
}
.hrm-de-graph-pane:not([hidden]) {
    display: block;
    overflow: hidden;
    line-height: 0;
}
/* Initial height until graph document postMessage resizes to content */
.hrm-de-graph-iframe {
    display: block;
    width: 100%;
    height: 320px;
    min-height: 240px;
    max-height: 800px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    overflow: hidden;
    vertical-align: top;
}


/* Stat cards */
.hrm-stat {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}
.hrm-stat__label { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 0.25rem; }
.hrm-stat__value { font-size: 1.75rem; font-weight: 700; color: var(--color-text); }
.hrm-stat__change { font-size: 0.875rem; margin-top: 0.25rem; }

/* Empty state */
.hrm-empty { text-align: center; padding: 3rem 1rem; color: var(--color-text-muted); }
.hrm-empty__icon { font-size: 3rem; margin-bottom: 1rem; }
.hrm-empty__text { font-size: 1rem; }

/* Admin login card */
.hrm-admin-login { max-width: 420px; margin: 3rem auto; }

/* Guest user shell: login only (no sidebar), similar to admin login */
.hrm-layout--guest-login .hrm-user-login {
    max-width: 480px;
    margin: 2rem auto 3rem;
    padding: 0 1rem;
}
.hrm-layout--guest-login .hrm-main-area {
    flex: 1;
    min-width: 0;
}
.hrm-layout--guest-login .hrm-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}


/* ==========================================================================
   18. LEGACY COMPATIBILITY
   Classes still referenced in active Blade templates.
   These will be phased out over time as templates are modernised.
   ========================================================================== */

/* Table row striping */
.subheader {
    background-color: var(--color-bg);
}
.subheader td {
    background-color: var(--color-bg);
    padding: 0.625rem 0.75rem;
    font-weight: 600;
    color: var(--color-text);
    font-size: 1rem;
}
.even {
    background-color: var(--color-surface);
    color: var(--color-text);
}
.even td { padding: 0.5rem 0.75rem; }
.odd {
    background-color: var(--color-bg);
    color: var(--color-text);
}
.odd td { padding: 0.5rem 0.75rem; }
.fieldheader { background-color: var(--color-primary-light); }

/* Content border wrapper */
.content_border {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

/* Horizontal rule */
.hr_line {
    background: none;
    border-bottom: 1px solid var(--color-border);
    height: auto;
    margin: 0.375rem 0 1rem 0;
}

/* Flash / error messages */
.message {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-info);
    border: 1px solid var(--color-info);
    background-color: var(--color-info-light);
    border-radius: var(--radius-md);
    padding: 0.625rem 0.75rem;
    width: 100%;
    float: none;
}
.message_new,
.leave_popup_message {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-danger);
}

/* Legacy button */
.button {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0.4375rem 1rem;
    cursor: pointer;
    transition: all var(--transition);
    background-image: none;
    line-height: 1.4;
}
.button:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Grey box containers (rounded-corner wrappers) */
.grey_box_bl {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 100%;
    box-shadow: var(--shadow-sm);
}
.grey_box_br {
    background: none;
    height: auto !important;
}
.grey_box_tl,
.grey_box_tr {
    background: none;
    padding: 1rem;
}

/* Grey border table */
.grey_border {
    border: none;
}

/* Select dropdowns (legacy forms) */
.normallist1,
.normallist2,
.normallist1_sel,
.normallist2_sel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.4375rem 0.5rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    background-color: var(--color-surface);
}
.normallist1_sel,
.normallist2_sel {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
}

/* Textarea (legacy forms) */
.textarea,
.textarea_sel,
.textarea1,
.textarea2,
.textarea3,
.textarea3_sel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
    background-color: var(--color-surface);
    padding: 0.5rem 0.625rem;
}
.textarea_sel,
.textarea3_sel {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
}

/* Textbox (legacy forms) */
.textbox,
.textbox1,
.textbox2,
.textbox3,
.textbox_sel,
.textbox1_sel,
.textbox2_sel,
.textbox3_sel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface);
    padding: 0.4375rem 0.5rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
}
.textbox_sel,
.textbox1_sel,
.textbox2_sel,
.textbox3_sel {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
}

/* Required field indicator */
.star { color: var(--color-danger); }

/* Paragraph */
.par {
    text-align: justify;
    margin: 0;
    padding: 0.5rem 0;
    font-family: var(--font-sans);
    font-size: 1rem;
}

/* Holiday month header */
.holiday_month {
    background: none;
    background-image: none;
}

/* Admin message bar */
.admin_message {
    background: var(--color-primary);
    background-image: none;
    color: white;
    height: auto;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Report header */
.report_header {
    color: var(--color-primary);
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 700;
}

/* Date display */
.date {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 0.25rem;
}

/* Content border inner tables - ensure full width and relaxed spacing */
.content_border > tbody > tr > td { padding: 0.625rem 1rem; }
.content_border .subheader td { padding: 0.75rem 1rem; }

/* Spacer rows inside legacy tables */
td[height="5"], td[height="7"], td[height="8"],
td[height="10"], td[height="15"], td[height="20"] {
    padding: 0 !important;
    line-height: 0;
    font-size: 0;
}

/* Legacy table full-width on content */
.hrm-content table[width="100%"] { width: 100%; }

/* Iframes (graphs etc.) */
iframe {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

/* Modal overlay and dialog */
.hrm-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    padding: 1rem;
}
.hrm-modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.hrm-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}
.hrm-modal__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}
.hrm-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
}
.hrm-modal__close:hover { color: var(--color-text); }
.hrm-modal__body {
    padding: 1.25rem;
    overflow-y: auto;
}

/* Popup overlays */
.hrm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
}

/* Section spacer (replace <br /> between sections) */
.hrm-section-gap { margin-top: 1.5rem; }

/* Inline action buttons in tables (admin) */
td form button:not([class]) {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0;
    text-decoration: none;
    transition: opacity var(--transition);
}
td form button:not([class]):hover { opacity: 0.7; }


/* ==========================================================================
   19. UTILITIES
   ========================================================================== */

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }

.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.inline-block { display: inline-block; margin-right: 0.25rem; }
.text-center { text-align: center; }
.text-danger { color: var(--color-danger); }
.text-primary { color: var(--color-primary); }
.text-sm { font-size: 0.9375rem; }

.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.rotate-180 { transform: rotate(180deg); }

/* Grid utilities */
.hrm-grid { display: grid; gap: 1.5rem; }
.hrm-grid--2 { grid-template-columns: repeat(2, 1fr); }
.hrm-grid--3 { grid-template-columns: repeat(3, 1fr); }
.hrm-grid--4 { grid-template-columns: repeat(4, 1fr); }


/* ==========================================================================
   20. RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .hrm-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .hrm-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile nav overlay (shown when .hrm-left-panel--open; toggled by Alpine mobileMenu) */
.hrm-nav-backdrop {
    display: none;
}

@media (max-width: 768px) {
    .hrm-header__toggle { display: flex; }

    .hrm-nav-backdrop {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgb(15 23 42 / 0.45);
        z-index: 44;
    }

    @media (prefers-color-scheme: dark) {
        .hrm-nav-backdrop {
            background: rgb(0 0 0 / 0.55);
        }
    }

    .hrm-top-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 0.5rem;
        box-shadow: var(--shadow-lg);
        z-index: 40;
    }
    .hrm-top-nav--open { display: flex; }

    .hrm-left-panel {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: min(18rem, 92vw);
        max-width: 280px;
        height: calc(100vh - var(--header-height));
        z-index: 45;
        box-shadow: 4px 0 24px rgb(0 0 0 / 0.14);
        -webkit-overflow-scrolling: touch;
    }
    .hrm-left-panel--open {
        display: block;
    }

    .hrm-content { padding: 1rem; }
    .hrm-clock { display: none; }
    .hrm-header__user-name { display: none; }

    .hrm-home__grid,
    .hrm-grid--2,
    .hrm-grid--3,
    .hrm-grid--4 { grid-template-columns: 1fr; }

    .hrm-page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

    .hrm-footer { flex-direction: column; gap: 0.5rem; text-align: center; }
    .hrm-footer__nav { justify-content: center; }

    .hrm-nav-sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 60;
        box-shadow: var(--shadow-lg);
    }
    .hrm-nav-sidebar--open { display: flex; }
}

@media (min-width: 769px) {
    .hrm-nav-backdrop {
        display: none !important;
        visibility: hidden;
        pointer-events: none;
    }
}

/* ==========================================================================
   21. ERROR PAGES (4xx / 5xx)
   ========================================================================== */

.hrm-error-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hrm-error-shell__header {
    flex-shrink: 0;
}

.hrm-error-shell__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.hrm-error-shell__footer {
    flex-shrink: 0;
    margin-top: auto;
}

.hrm-error-card {
    max-width: 28rem;
    width: 100%;
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 0.75rem);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.08));
}

.hrm-error-card__code {
    margin: 0 0 0.5rem;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.hrm-error-card__title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
}

.hrm-error-card__message {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.hrm-error-card__message-debug {
    display: block;
    margin-top: 0.75rem;
    padding: 0.75rem;
    text-align: left;
    font-size: 0.9375rem;
    font-family: ui-monospace, monospace;
    word-break: break-word;
    color: var(--color-danger);
    background: var(--color-bg);
    border-radius: var(--radius-md, 0.5rem);
}

.hrm-error-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.75rem;
}
