/*
 * HR Management System — corporate theme
 *
 * Layered on top of Bootstrap 5. Colours are declared as custom properties so
 * the palette can be retuned in one place.
 */

:root {
    --hr-navy: #14293f;
    --hr-navy-700: #1f3a5f;
    --hr-navy-500: #2c5282;
    --hr-accent: #0d6efd;
    --hr-teal: #0f9b8e;
    --hr-bg: #f4f6fa;
    --hr-surface: #ffffff;
    --hr-border: #e3e8ef;
    --hr-text: #1f2933;
    --hr-muted: #6b7a90;
    --hr-sidebar-width: 264px;
    --hr-topbar-height: 68px;
    --hr-radius: 10px;
    --hr-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .04);
}

body {
    background: var(--hr-bg);
    color: var(--hr-text);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.925rem;
}

/* ------------------------------------------------------------------ layout */

.hr-shell {
    min-height: 100vh;
}

.hr-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--hr-topbar-height);
    background: var(--hr-surface);
    border-bottom: 1px solid var(--hr-border);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: .75rem;
}

.hr-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    color: var(--hr-navy);
    text-decoration: none;
    min-width: calc(var(--hr-sidebar-width) - 1rem);
}

.hr-brand:hover { color: var(--hr-navy-500); }

.hr-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--hr-navy-700), var(--hr-teal));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex: 0 0 auto;
}

.hr-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.hr-brand-text small {
    font-weight: 500;
    font-size: .68rem;
    color: var(--hr-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hr-sidebar {
    position: fixed;
    top: var(--hr-topbar-height);
    bottom: 0;
    left: 0;
    width: var(--hr-sidebar-width);
    background: var(--hr-navy);
    overflow-y: auto;
    z-index: 1020;
    padding: .75rem 0 2rem;
    transition: transform .2s ease;
}

.hr-sidebar::-webkit-scrollbar { width: 6px; }
.hr-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }

.hr-nav-section {
    color: rgba(255, 255, 255, .42);
    font-size: .68rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 1rem 1.25rem .35rem;
    font-weight: 600;
}

.hr-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem 1.25rem;
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    font-size: .89rem;
    border-left: 3px solid transparent;
}

.hr-nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.hr-nav-link.active {
    background: rgba(255, 255, 255, .1);
    border-left-color: var(--hr-teal);
    color: #fff;
    font-weight: 600;
}

.hr-nav-link i { font-size: 1rem; width: 1.15rem; text-align: center; }

.hr-nav-badge {
    margin-left: auto;
    background: var(--hr-teal);
    color: #fff;
    border-radius: 999px;
    padding: .05rem .45rem;
    font-size: .7rem;
    font-weight: 600;
}

.hr-main {
    margin-left: var(--hr-sidebar-width);
    padding: calc(var(--hr-topbar-height) + 1.25rem) 1.5rem 3rem;
}

.hr-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1015;
}

/* --------------------------------------------------------------- surfaces */

.card {
    border: 1px solid var(--hr-border);
    border-radius: var(--hr-radius);
    box-shadow: var(--hr-shadow);
}

.card-header {
    background: var(--hr-surface);
    border-bottom: 1px solid var(--hr-border);
    font-weight: 600;
    padding: .85rem 1.15rem;
    border-radius: var(--hr-radius) var(--hr-radius) 0 0 !important;
}

.hr-page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.hr-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--hr-navy);
    margin: 0;
}

.hr-page-subtitle {
    color: var(--hr-muted);
    margin: .15rem 0 0;
    font-size: .875rem;
}

.breadcrumb {
    font-size: .8rem;
    margin-bottom: .35rem;
}

/* ------------------------------------------------------------- stat tiles */

.hr-stat {
    background: var(--hr-surface);
    border: 1px solid var(--hr-border);
    border-radius: var(--hr-radius);
    box-shadow: var(--hr-shadow);
    padding: 1rem 1.1rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: .9rem;
}

.hr-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex: 0 0 auto;
}

.hr-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--hr-navy);
}

.hr-stat-label {
    font-size: .78rem;
    color: var(--hr-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}

/* ------------------------------------------------------------------ table */

.table {
    --bs-table-hover-bg: #f7f9fc;
    margin-bottom: 0;
}

.table > thead > tr > th {
    background: #f8fafc;
    color: var(--hr-muted);
    font-size: .74rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--hr-border);
    white-space: nowrap;
    padding: .7rem .75rem;
}

.table > tbody > tr > td {
    padding: .7rem .75rem;
    vertical-align: middle;
    border-bottom: 1px solid #eef2f7;
}

.table-responsive { border-radius: 0 0 var(--hr-radius) var(--hr-radius); }

.hr-empty {
    text-align: center;
    padding: 2.75rem 1rem;
    color: var(--hr-muted);
}

.hr-empty i {
    font-size: 2.2rem;
    display: block;
    margin-bottom: .6rem;
    color: #c4cddb;
}

/* ------------------------------------------------------------------- misc */

.hr-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--hr-navy-500);
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-size: .78rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.hr-avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; }

.badge { font-weight: 600; letter-spacing: .01em; }

.hr-punch-card {
    background: linear-gradient(135deg, var(--hr-navy-700), var(--hr-navy));
    color: #fff;
    border-radius: var(--hr-radius);
    padding: 1.4rem;
}

.hr-punch-clock {
    font-size: 2.3rem;
    font-weight: 700;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums;
}

.hr-timeline { list-style: none; margin: 0; padding: 0; position: relative; }

.hr-timeline::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--hr-border);
}

.hr-timeline-item { position: relative; padding: 0 0 1.15rem 2.65rem; }

.hr-timeline-dot {
    position: absolute;
    left: 4px;
    top: 1px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hr-surface);
    border: 2px solid var(--hr-accent);
    color: var(--hr-accent);
    display: grid;
    place-items: center;
    font-size: .68rem;
}

.hr-required::after { content: " *"; color: #dc3545; }

.form-label { font-weight: 600; font-size: .82rem; color: #344054; margin-bottom: .3rem; }

.form-text { font-size: .78rem; }

.hr-fieldset-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--hr-muted);
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--hr-border);
    margin-bottom: 1rem;
}

.hr-map { height: 420px; border-radius: var(--hr-radius); border: 1px solid var(--hr-border); }

.hr-progress-thin { height: 6px; border-radius: 999px; }

.hr-calendar-day {
    min-height: 92px;
    border: 1px solid var(--hr-border);
    border-radius: 8px;
    padding: .35rem .4rem;
    font-size: .78rem;
    background: var(--hr-surface);
}

.hr-calendar-day.is-muted { background: #f8fafc; color: var(--hr-muted); }
.hr-calendar-day.is-today { border-color: var(--hr-accent); box-shadow: 0 0 0 2px rgba(13, 110, 253, .12); }
.hr-calendar-chip { display: block; border-radius: 4px; padding: .05rem .3rem; margin-top: .15rem; color: #fff; font-size: .68rem; }

.hr-json {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: .78rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: .85rem;
    max-height: 340px;
    overflow: auto;
}

.hr-sticky-actions {
    position: sticky;
    bottom: 0;
    background: var(--hr-surface);
    border-top: 1px solid var(--hr-border);
    padding: .85rem 1.15rem;
    border-radius: 0 0 var(--hr-radius) var(--hr-radius);
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
    .hr-sidebar { transform: translateX(-100%); }
    .hr-sidebar.is-open { transform: translateX(0); }
    .hr-sidebar-backdrop.is-visible { display: block; }
    .hr-main { margin-left: 0; padding-left: 1rem; padding-right: 1rem; }
    .hr-brand { min-width: auto; }
}

@media print {
    .hr-topbar, .hr-sidebar, .hr-no-print { display: none !important; }
    .hr-main { margin: 0; padding: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: none; }
}

/* ------------------------------------------------------------------- brand */

/*
 * The logo is a raster image, so it is rendered at its natural aspect ratio
 * and never stretched. Height is set by the caller; width follows.
 */
.hr-logo {
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    /* Keep edges crisp when the source is larger than the rendered size. */
    image-rendering: auto;
}

.hr-logo-rounded {
    border-radius: 8px;
}

/* Login and other guest screens. */
.hr-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.hr-auth-brand .hr-logo {
    /* Belt and braces: an <img> is inline-level, so centre it explicitly as
       well as through the flex container. */
    margin-left: auto;
    margin-right: auto;
    /* The mark is an app-icon style rounded square; match its own corner radius
       and keep the lift subtle so it reads as artwork, not a UI chip. */
    border-radius: 22px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .08);
}

.hr-auth-tagline {
    color: var(--hr-muted);
    font-size: .85rem;
    margin: 0;
    text-align: center;
}

/* Top bar. The logo carries the brand name, so the wordmark beside it stays
   quiet and is hidden on small screens. */
.hr-brand .hr-logo {
    flex: 0 0 auto;
    border-radius: 9px;
}

.hr-brand-divider {
    width: 1px;
    height: 26px;
    background: var(--hr-border);
    margin: 0 .15rem;
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .hr-brand-divider { display: none; }
}
