/* ==========================================================================
   Hospital Management System - Admin Panel Theme
   --------------------------------------------------------------------------
   Design language: dark blue (navy) primary + red accent.
   Built on top of Bootstrap 5; only overrides and new components live here.
   No build step required - this file is served straight from /public.
   ========================================================================== */

:root {
    /* Navy scale - primary brand colour */
    --hms-navy-900: #071b33;
    --hms-navy-800: #0b2545;
    --hms-navy-700: #103057;
    --hms-navy-600: #17416f;
    --hms-navy-500: #1f5286;
    --hms-navy-100: #e7edf6;

    /* Red accent - used sparingly: active state, alerts, key figures */
    --hms-red-700: #a81726;
    --hms-red-600: #c62431;
    --hms-red-500: #dc3545;
    --hms-red-100: #fdecee;

    /* Neutrals */
    --hms-body-bg: #f3f6fb;
    --hms-surface: #ffffff;
    --hms-border: #e2e8f0;
    --hms-text: #1e2a3a;
    --hms-text-muted: #6b7a90;

    /* Semantic */
    --hms-success: #1a8754;
    --hms-warning: #cc8a00;
    --hms-info: #0f6f8f;

    /* Metrics */
    --hms-sidebar-width: 264px;
    --hms-sidebar-collapsed: 78px;
    --hms-topbar-height: 64px;
    --hms-radius: 10px;
    --hms-shadow-sm: 0 1px 2px rgba(11, 37, 69, .06);
    --hms-shadow: 0 2px 10px rgba(11, 37, 69, .08);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

body {
    background-color: var(--hms-body-bg);
    color: var(--hms-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .9375rem;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--hms-navy-500);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Auth (login) screen
   -------------------------------------------------------------------------- */

.hms-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(1100px 600px at 15% -10%, var(--hms-navy-600) 0%, transparent 55%),
        linear-gradient(160deg, var(--hms-navy-900) 0%, var(--hms-navy-800) 55%, #061627 100%);
}

/* Thin red band, the accent that ties the login screen to the panel. */
.hms-auth::before {
    content: "";
    position: fixed;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--hms-red-600), var(--hms-red-500) 45%, var(--hms-navy-500));
}

.hms-auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--hms-surface);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(3, 15, 30, .45);
    overflow: hidden;
}

.hms-auth-card__header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--hms-border);
}

.hms-auth-card__body {
    padding: 1.75rem 2rem 2rem;
}

.hms-auth-title {
    font-size: 1.1875rem;
    font-weight: 700;
    color: var(--hms-navy-800);
    margin: .875rem 0 .25rem;
    line-height: 1.3;
}

.hms-auth-subtitle {
    font-size: .8125rem;
    color: var(--hms-text-muted);
    margin: 0;
}

.hms-auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: .75rem;
    color: rgba(255, 255, 255, .55);
}

/* Logo mark - shown when no hospital logo has been uploaded yet. */
.hms-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 16px;
    background: linear-gradient(140deg, var(--hms-navy-700), var(--hms-navy-500));
    color: #fff;
    font-size: 1.875rem;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .12);
}

.hms-logo-mark--sm {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 1.25rem;
}

.hms-logo-mark i {
    color: #fff;
}

.hms-logo-img {
    max-height: 62px;
    max-width: 100%;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--hms-navy-800);
    margin-bottom: .375rem;
}

.form-control,
.form-select {
    border-color: var(--hms-border);
    border-radius: 8px;
    padding: .625rem .8125rem;
    font-size: .9375rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hms-navy-500);
    box-shadow: 0 0 0 .2rem rgba(31, 82, 134, .15);
}

.input-group-text {
    background: #f7f9fc;
    border-color: var(--hms-border);
    color: var(--hms-text-muted);
}

.form-check-input:checked {
    background-color: var(--hms-navy-600);
    border-color: var(--hms-navy-600);
}

.invalid-feedback {
    font-size: .8125rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: .9375rem;
}

.btn-hms-primary {
    background: var(--hms-navy-700);
    border-color: var(--hms-navy-700);
    color: #fff;
}

.btn-hms-primary:hover,
.btn-hms-primary:focus {
    background: var(--hms-navy-800);
    border-color: var(--hms-navy-800);
    color: #fff;
}

.btn-hms-accent {
    background: var(--hms-red-600);
    border-color: var(--hms-red-600);
    color: #fff;
}

.btn-hms-accent:hover,
.btn-hms-accent:focus {
    background: var(--hms-red-700);
    border-color: var(--hms-red-700);
    color: #fff;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.hms-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--hms-sidebar-width);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background: linear-gradient(185deg, var(--hms-navy-800) 0%, var(--hms-navy-900) 100%);
    color: rgba(255, 255, 255, .8);
    transition: width .18s ease, transform .18s ease;
}

.hms-sidebar__brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    height: var(--hms-topbar-height);
    padding: 0 1.125rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex-shrink: 0;
    color: #fff;
    overflow: hidden;
}

.hms-sidebar__brand-text {
    min-width: 0;
}

.hms-sidebar__brand-name {
    display: block;
    font-weight: 700;
    font-size: .9375rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hms-sidebar__brand-sub {
    display: block;
    font-size: .6875rem;
    color: rgba(255, 255, 255, .5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hms-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .875rem .625rem 1.25rem;
}

.hms-sidebar__heading {
    padding: .75rem .75rem .375rem;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .38);
    white-space: nowrap;
}

.hms-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .8125rem;
    padding: .625rem .75rem;
    margin-bottom: .1875rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, .78);
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.hms-nav-link i {
    font-size: 1.0625rem;
    flex-shrink: 0;
    width: 1.375rem;
    text-align: center;
}

.hms-nav-link__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.hms-nav-link.is-active {
    background: rgba(255, 255, 255, .11);
    color: #fff;
    font-weight: 600;
}

/* Red marker on the active module - the accent colour doing real work. */
.hms-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -.625rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 0 3px 3px 0;
    background: var(--hms-red-500);
}

/* Modules that are not built yet: visibly present, clearly not clickable. */
.hms-nav-link.is-disabled {
    color: rgba(255, 255, 255, .38);
    cursor: not-allowed;
}

.hms-nav-link.is-disabled:hover {
    background: transparent;
    color: rgba(255, 255, 255, .38);
}

.hms-soon {
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .1875rem .375rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .55);
    flex-shrink: 0;
}

.hms-sidebar__footer {
    padding: .75rem 1.125rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .6875rem;
    color: rgba(255, 255, 255, .4);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}

/* --- Main column --- */

.hms-main {
    margin-left: var(--hms-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .18s ease;
}

.hms-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--hms-topbar-height);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
    background: var(--hms-surface);
    border-bottom: 1px solid var(--hms-border);
    box-shadow: var(--hms-shadow-sm);
}

.hms-topbar__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--hms-border);
    border-radius: 8px;
    background: #fff;
    color: var(--hms-navy-700);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.hms-topbar__toggle:hover {
    background: var(--hms-navy-100);
}

.hms-topbar__title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--hms-navy-800);
    margin: 0;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hms-topbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.hms-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--hms-border);
    border-radius: 8px;
    background: #fff;
    color: var(--hms-navy-700);
    font-size: 1.0625rem;
}

.hms-icon-btn:hover {
    background: var(--hms-navy-100);
}

.hms-icon-btn__dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hms-red-500);
    border: 1.5px solid #fff;
}

.hms-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hms-navy-700);
    color: #fff;
    font-size: .8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.hms-profile-btn {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .25rem .625rem .25rem .25rem;
    border: 1px solid var(--hms-border);
    border-radius: 999px;
    background: #fff;
    color: var(--hms-text);
}

.hms-profile-btn:hover {
    background: var(--hms-navy-100);
}

.hms-profile-btn__name {
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--hms-navy-800);
}

.hms-profile-btn__role {
    font-size: .6875rem;
    color: var(--hms-text-muted);
    line-height: 1.15;
}

.hms-content {
    flex: 1;
    padding: 1.5rem 1.25rem 2.5rem;
}

.hms-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--hms-border);
    background: var(--hms-surface);
    font-size: .8125rem;
    color: var(--hms-text-muted);
}

.hms-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(7, 27, 51, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

/* --------------------------------------------------------------------------
   Collapsed sidebar (desktop icon rail)
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {
    body.hms-sidebar-collapsed .hms-sidebar {
        width: var(--hms-sidebar-collapsed);
    }

    body.hms-sidebar-collapsed .hms-main {
        margin-left: var(--hms-sidebar-collapsed);
    }

    body.hms-sidebar-collapsed .hms-sidebar__brand {
        justify-content: center;
        padding: 0 .5rem;
    }

    body.hms-sidebar-collapsed .hms-sidebar__brand-text,
    body.hms-sidebar-collapsed .hms-nav-link__label,
    body.hms-sidebar-collapsed .hms-soon,
    body.hms-sidebar-collapsed .hms-sidebar__footer,
    body.hms-sidebar-collapsed .hms-sidebar__heading {
        display: none;
    }

    body.hms-sidebar-collapsed .hms-nav-link {
        justify-content: center;
        padding: .6875rem .5rem;
    }
}

/* --------------------------------------------------------------------------
   Mobile / tablet: sidebar slides in over the content
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .hms-sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(3, 15, 30, .35);
    }

    body.hms-sidebar-open .hms-sidebar {
        transform: translateX(0);
    }

    body.hms-sidebar-open .hms-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .hms-main {
        margin-left: 0;
    }

    .hms-content {
        padding: 1.125rem .875rem 2rem;
    }

    .hms-topbar {
        padding: 0 .875rem;
    }

    /* Keep the bar uncluttered on small screens. */
    .hms-profile-btn__meta {
        display: none;
    }
}

/* Stop the page scrolling behind the open drawer. */
@media (max-width: 991.98px) {
    body.hms-sidebar-open {
        overflow: hidden;
    }
}

/* --------------------------------------------------------------------------
   Cards & panels
   -------------------------------------------------------------------------- */

.hms-card {
    background: var(--hms-surface);
    border: 1px solid var(--hms-border);
    border-radius: var(--hms-radius);
    box-shadow: var(--hms-shadow-sm);
    height: 100%;
}

.hms-card__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .9375rem 1.125rem;
    border-bottom: 1px solid var(--hms-border);
}

.hms-card__title {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--hms-navy-800);
    margin: 0;
}

.hms-card__subtitle {
    font-size: .75rem;
    color: var(--hms-text-muted);
    margin: .125rem 0 0;
}

.hms-card__tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .375rem;
}

.hms-card__body {
    padding: 1.125rem;
}

.hms-card__body--flush {
    padding: 0;
}

/* --- Statistic card --- */

.hms-stat {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: 1.0625rem 1.125rem;
    background: var(--hms-surface);
    border: 1px solid var(--hms-border);
    border-radius: var(--hms-radius);
    box-shadow: var(--hms-shadow-sm);
    height: 100%;
}

.hms-stat__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 11px;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.hms-stat__body {
    min-width: 0;
}

.hms-stat__label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--hms-text-muted);
    margin-bottom: .1875rem;
    line-height: 1.25;
}

.hms-stat__value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hms-navy-800);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.hms-stat__meta {
    display: block;
    font-size: .6875rem;
    color: var(--hms-text-muted);
    margin-top: .1875rem;
}

/* Icon tints */
.hms-tint-navy   { background: var(--hms-navy-100); color: var(--hms-navy-700); }
.hms-tint-red    { background: var(--hms-red-100);  color: var(--hms-red-600); }
.hms-tint-green  { background: #e6f5ee;             color: var(--hms-success); }
.hms-tint-amber  { background: #fdf3e0;             color: var(--hms-warning); }
.hms-tint-teal   { background: #e3f2f7;             color: var(--hms-info); }
.hms-tint-purple { background: #eeeaf9;             color: #5b46b8; }
.hms-tint-slate  { background: #eef1f6;             color: #566a85; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.hms-table {
    margin: 0;
    font-size: .875rem;
}

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

.hms-table > tbody > tr > td {
    padding: .8125rem 1.125rem;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
    color: var(--hms-text);
}

.hms-table > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* --------------------------------------------------------------------------
   Empty states - what every Phase 1 panel shows instead of invented data
   -------------------------------------------------------------------------- */

.hms-empty {
    padding: 2.25rem 1.25rem;
    text-align: center;
    color: var(--hms-text-muted);
}

.hms-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: .75rem;
    border-radius: 50%;
    background: #f1f5fa;
    color: #93a3b8;
    font-size: 1.5rem;
}

.hms-empty__title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--hms-navy-800);
    margin: 0 0 .25rem;
}

.hms-empty__text {
    font-size: .8125rem;
    margin: 0;
    max-width: 24rem;
    margin-inline: auto;
}

.hms-empty--sm {
    padding: 1.5rem 1rem;
}

/* --------------------------------------------------------------------------
   Charts
   -------------------------------------------------------------------------- */

.hms-chart {
    position: relative;
    width: 100%;
    height: 280px;
}

.hms-chart--sm {
    height: 230px;
}

/* --------------------------------------------------------------------------
   Quick actions
   -------------------------------------------------------------------------- */

.hms-quick {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .8125rem .9375rem;
    background: #fff;
    border: 1px solid var(--hms-border);
    border-radius: 9px;
    text-align: left;
    color: var(--hms-text);
}

.hms-quick__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.hms-quick__body {
    min-width: 0;
    flex: 1;
}

.hms-quick__label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--hms-navy-800);
    line-height: 1.25;
}

.hms-quick__meta {
    display: block;
    font-size: .6875rem;
    color: var(--hms-text-muted);
}

.hms-quick:disabled,
.hms-quick.is-disabled {
    cursor: not-allowed;
    background: #fafbfd;
}

.hms-quick:disabled .hms-quick__label,
.hms-quick.is-disabled .hms-quick__label {
    color: var(--hms-text-muted);
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.hms-badge {
    display: inline-block;
    padding: .25rem .5rem;
    border-radius: 5px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.hms-badge--muted     { background: #eef1f6; color: #566a85; }
.hms-badge--success   { background: #e6f5ee; color: var(--hms-success); }
.hms-badge--warning   { background: #fdf3e0; color: var(--hms-warning); }
.hms-badge--danger    { background: var(--hms-red-100); color: var(--hms-red-600); }
.hms-badge--info      { background: #e3f2f7; color: var(--hms-info); }
.hms-badge--navy      { background: var(--hms-navy-100); color: var(--hms-navy-700); }

/* --------------------------------------------------------------------------
   Error pages
   -------------------------------------------------------------------------- */

.hms-error {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--hms-navy-900), var(--hms-navy-800) 60%, #061627);
    text-align: center;
    color: #fff;
}

.hms-error__code {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--hms-red-500);
    margin-bottom: .5rem;
}

.hms-error__title {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.hms-error__text {
    color: rgba(255, 255, 255, .65);
    font-size: .9375rem;
    max-width: 30rem;
    margin: 0 auto 1.5rem;
}

/* --------------------------------------------------------------------------
   Sidebar sub-navigation (Module 02 onwards)
   Only rendered while a section is open, so the rail stays one level deep.
   -------------------------------------------------------------------------- */

.hms-nav-sub {
    display: flex;
    flex-direction: column;
    gap: .0625rem;
    margin: .125rem 0 .375rem 2.1875rem;
    padding-left: .625rem;
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.hms-nav-sublink {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4375rem .625rem;
    border-radius: 7px;
    color: rgba(255, 255, 255, .62);
    font-size: .8125rem;
}

.hms-nav-sublink i {
    font-size: .8125rem;
}

.hms-nav-sublink:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.hms-nav-sublink.is-active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-weight: 600;
}

@media (min-width: 992px) {
    body.hms-sidebar-collapsed .hms-nav-sub {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Page header (title + breadcrumb + actions)
   -------------------------------------------------------------------------- */

.hms-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.hms-page-head__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hms-navy-800);
    margin: 0 0 .25rem;
}

.hms-page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.hms-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem;
    font-size: .8125rem;
    color: var(--hms-text-muted);
    margin: 0;
    padding: 0;
    list-style: none;
}

.hms-crumbs a {
    color: var(--hms-navy-600);
}

.hms-crumbs a:hover {
    text-decoration: underline;
}

.hms-crumbs__sep {
    color: #b7c2d3;
}

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */

.hms-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .625rem;
    align-items: end;
}

.hms-filters__label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--hms-text-muted);
    text-transform: uppercase;
    letter-spacing: .02em;
    margin-bottom: .25rem;
}

.hms-filters__actions {
    display: flex;
    gap: .5rem;
}

/* --------------------------------------------------------------------------
   Doctor avatars
   -------------------------------------------------------------------------- */

.hms-doc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--hms-navy-100);
    border: 1px solid var(--hms-border);
    flex: 0 0 auto;
}

.hms-doc-avatar--lg {
    width: 104px;
    height: 104px;
    border-radius: 12px;
    border-width: 2px;
}

.hms-doc-avatar--preview {
    width: 84px;
    height: 84px;
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   Table helpers
   -------------------------------------------------------------------------- */

.hms-table__actions {
    display: flex;
    gap: .25rem;
    justify-content: flex-end;
}

.hms-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--hms-border);
    border-radius: 8px;
    background: #fff;
    color: var(--hms-navy-600);
    font-size: .875rem;
    line-height: 1;
    padding: 0;
}

.hms-act-btn:hover {
    background: var(--hms-navy-100);
    color: var(--hms-navy-800);
}

.hms-act-btn--danger:hover {
    background: var(--hms-red-100);
    color: var(--hms-red-600);
    border-color: var(--hms-red-100);
}

.hms-cell-strong {
    font-weight: 600;
    color: var(--hms-navy-800);
}

.hms-cell-sub {
    display: block;
    font-size: .75rem;
    color: var(--hms-text-muted);
}

.hms-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8125rem;
    color: var(--hms-navy-700);
}

/* --------------------------------------------------------------------------
   Forms: grouped sections
   -------------------------------------------------------------------------- */

.hms-form-section {
    border-top: 1px solid var(--hms-border);
    padding-top: 1.125rem;
    margin-top: 1.125rem;
}

.hms-form-section:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.hms-form-section__title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    font-weight: 700;
    color: var(--hms-navy-800);
    margin-bottom: .875rem;
}

.hms-form-section__title i {
    color: var(--hms-red-600);
}

.hms-form-hint {
    display: block;
    font-size: .75rem;
    color: var(--hms-text-muted);
    margin-top: .25rem;
}

.hms-required {
    color: var(--hms-red-600);
}

.hms-form-footer {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--hms-border);
    padding-top: 1.125rem;
    margin-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   Doctor profile
   -------------------------------------------------------------------------- */

.hms-profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

/* Patient profile avatar - patients have no photo, so this is an
   icon-in-a-box placeholder that keeps the layout identical to the
   doctor profile header above it. */
.hms-patient-avatar {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: var(--hms-red-100);
    color: var(--hms-red-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex: 0 0 auto;
    border: 1px solid var(--hms-border);
}

.hms-profile-head__name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hms-navy-800);
    margin: 0 0 .25rem;
}

.hms-profile-head__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    color: var(--hms-text-muted);
}

.hms-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .875rem 1.25rem;
    margin: 0;
}

.hms-fact__label {
    display: block;
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--hms-text-muted);
    margin-bottom: .125rem;
}

.hms-fact__value {
    display: block;
    font-size: .875rem;
    color: var(--hms-text);
    word-break: break-word;
}

.hms-fact__value--muted {
    color: var(--hms-text-muted);
    font-style: italic;
}

.hms-fee {
    display: flex;
    align-items: baseline;
    gap: .375rem;
}

.hms-fee__amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hms-navy-800);
}

.hms-bio {
    font-size: .875rem;
    line-height: 1.7;
    color: var(--hms-text);
    white-space: pre-line;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Small-screen refinements
   -------------------------------------------------------------------------- */

@media (max-width: 575.98px) {
    .hms-stat {
        padding: .875rem;
        gap: .75rem;
    }

    .hms-stat__icon {
        width: 40px;
        height: 40px;
        font-size: 1.1875rem;
    }

    .hms-stat__value {
        font-size: 1.25rem;
    }

    .hms-card__header,
    .hms-card__body {
        padding: .875rem;
    }

    .hms-table > thead > tr > th,
    .hms-table > tbody > tr > td {
        padding-left: .875rem;
        padding-right: .875rem;
    }

    .hms-error__code {
        font-size: 3.25rem;
    }
}

/* Respect the operating system's reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* Printing a dashboard should not print the chrome. */
@media print {
    .hms-sidebar,
    .hms-topbar,
    .hms-footer,
    .hms-backdrop {
        display: none !important;
    }

    .hms-main {
        margin-left: 0 !important;
    }
}

/* -- Searchable doctor combobox (code/name substring search) ----------- */

.hms-combobox {
    position: relative;
}

.hms-combobox__list {
    position: absolute;
    z-index: 1060;
    top: 100%;
    left: 0;
    right: 0;
    margin: .25rem 0 0;
    padding: .25rem;
    list-style: none;
    background: var(--hms-surface, #fff);
    border: 1px solid var(--hms-border, #e2e8f0);
    border-radius: var(--hms-radius, 10px);
    box-shadow: var(--hms-shadow, 0 2px 10px rgba(11, 37, 69, .08));
    max-height: 240px;
    overflow-y: auto;
}

.hms-combobox__option {
    display: block;
    width: 100%;
    text-align: left;
    padding: .45rem .65rem;
    border: 0;
    border-radius: calc(var(--hms-radius, 10px) - 4px);
    background: transparent;
    color: var(--hms-text, #1e2a3a);
    font-size: .875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hms-combobox__option--active,
.hms-combobox__option:focus {
    background: var(--hms-navy-100, #e7edf6);
    color: var(--hms-navy-700, #103057);
    outline: none;
}

.hms-combobox__empty {
    padding: .5rem .65rem;
    color: var(--hms-text-muted, #6b7a90);
    font-size: .875rem;
}
