:root {
    --hms-primary: #0d9488;
    --hms-primary-dark: #0f766e;
    --hms-primary-light: #ccfbf1;
    --hms-accent: #0369a1;
    --hms-sidebar: #0b2e2a;
    --hms-sidebar-hover: #134e48;
}

body { font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* Brand / navbar */
.main-header.navbar { border-bottom: 2px solid var(--hms-primary); }
.brand-link { background: var(--hms-sidebar) !important; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-link .brand-text { font-weight: 700; letter-spacing: .3px; }
.brand-image { box-shadow: none !important; }

/* Sidebar */
.main-sidebar { background: var(--hms-sidebar) !important; }
.main-sidebar .nav-sidebar > .nav-item > .nav-link { border-radius: .375rem; margin: 2px 8px; transition: all .2s ease; }
.main-sidebar .nav-sidebar > .nav-item > .nav-link:hover { background: var(--hms-sidebar-hover); transform: translateX(3px); }
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active { background: var(--hms-primary) !important; color: #fff !important; box-shadow: 0 2px 8px rgba(13,148,136,.4); }
.nav-header { color: #7fb5ae !important; font-size: .7rem; letter-spacing: 1px; padding: .75rem 1rem .25rem; }
.main-sidebar .user-panel { border-bottom: 1px solid rgba(255,255,255,.08); }

/* Buttons & badges */
.btn-primary { background: var(--hms-primary); border-color: var(--hms-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--hms-primary-dark); border-color: var(--hms-primary-dark); }
.btn-outline-primary { color: var(--hms-primary); border-color: var(--hms-primary); }
.btn-outline-primary:hover { background: var(--hms-primary); border-color: var(--hms-primary); }
.bg-primary { background: var(--hms-primary) !important; }
.badge-primary { background: var(--hms-primary); }
.text-primary { color: var(--hms-primary) !important; }
a { color: var(--hms-primary-dark); }
a:hover { color: var(--hms-primary); }

/* Cards */
.card { border: none; border-radius: .625rem; box-shadow: 0 1px 3px rgba(15,46,43,.08), 0 1px 2px rgba(15,46,43,.06); transition: box-shadow .25s ease, transform .25s ease; }
.card:hover { box-shadow: 0 6px 18px rgba(15,46,43,.12); }
.card-primary.card-outline { border-top: 3px solid var(--hms-primary); }
.card-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,.05); font-weight: 600; }

/* Stat cards */
.stat-card { border-radius: .625rem; color: #fff; overflow: hidden; position: relative; transition: transform .25s ease, box-shadow .25s ease; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.stat-card .stat-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 3.2rem; opacity: .18; transition: transform .3s ease, opacity .3s ease; }
.stat-card:hover .stat-icon { transform: translateY(-50%) scale(1.15); opacity: .3; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; opacity: .9; }
.stat-teal { background: linear-gradient(135deg, #0d9488, #0f766e); }
.stat-blue { background: linear-gradient(135deg, #0284c7, #0369a1); }
.stat-green { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-amber { background: linear-gradient(135deg, #d97706, #b45309); }
.stat-red { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.stat-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.stat-slate { background: linear-gradient(135deg, #475569, #334155); }

/* Tables */
.table thead th { border-top: none; border-bottom: 2px solid var(--hms-primary-light); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: #475569; }
.table-hover tbody tr { transition: background .15s ease; }
.table td { vertical-align: middle; }

/* Forms */
.form-control:focus, .custom-select:focus { border-color: var(--hms-primary); box-shadow: 0 0 0 .2rem rgba(13,148,136,.15); }
.select2-container--bootstrap4 .select2-selection--single { height: calc(2.25rem + 2px) !important; }
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered { line-height: calc(2.25rem + 2px) !important; }

/* Animations */
.fade-in-up { animation: hmsFadeInUp .45s ease both; }
@keyframes hmsFadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.stagger > * { animation: hmsFadeInUp .45s ease both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .13s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .23s; }
.stagger > *:nth-child(6) { animation-delay: .28s; }
.pulse-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #16a34a; animation: hmsPulse 1.6s infinite; }
@keyframes hmsPulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }

/* Bed grid */
.bed-tile { border-radius: .625rem; padding: 1rem; text-align: center; border: 2px solid transparent; transition: all .2s ease; cursor: default; }
.bed-tile:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.bed-tile .bed-no { font-weight: 700; font-size: 1.05rem; }
.bed-available { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.bed-occupied { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.bed-cleaning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.bed-maintenance { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }

/* Queue board */
.queue-now { font-size: 3rem; font-weight: 800; color: var(--hms-primary); line-height: 1; }

/* Fixed top bar */
.main-header,
.layout-fixed .main-header,
.sidebar-mini.sidebar-collapse .main-header,
.sidebar-mini-xs.sidebar-collapse .main-header {
    margin-left: 0 !important;
}
.main-header {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1030;
}
.layout-fixed .main-header {
    left: 250px;
}
.layout-fixed.sidebar-collapse .main-header {
    left: 4.6rem;
}
.content-wrapper {
    margin-top: 58px;
}
.main-header .navbar {
    min-height: 58px;
    padding: .35rem .75rem;
}
.main-header .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: .45rem .65rem;
}
.navbar-badge {
    font-size: .62rem;
    min-width: 1.35rem;
    padding: 2px 4px;
    top: 6px;
    right: 6px;
}
@media (max-width: 991.98px) {
    .layout-fixed .main-header,
    .layout-fixed.sidebar-collapse .main-header {
        left: 0;
    }
    .main-header .navbar-nav .nav-link {
        padding: .4rem .5rem;
    }
}
.login-card { border: 1px solid #e6edf3; border-radius: 1rem; overflow: hidden; box-shadow: 0 10px 40px rgba(15, 46, 42, .08); animation: hmsFadeInUp .5s ease both; }
.login-logo { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 1rem; padding: 8px; }
.login-accent { height: 5px; background: var(--hms-primary, #0d9488); }

/* Sign-in button hover uses the configured secondary colour */
.btn-signin:hover, .btn-signin:focus {
    background: var(--hms-secondary, #0369a1) !important;
    border-color: var(--hms-secondary, #0369a1) !important;
    color: #fff;
}
.breadcrumb { background: transparent; font-size: .85rem; }
.avatar-circle { width: 38px; height: 38px; border-radius: 50%; background: var(--hms-primary-light); color: var(--hms-primary-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.empty-state { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.empty-state i { font-size: 3rem; margin-bottom: .75rem; display: block; opacity: .5; }
.nav-pills .nav-link.active { background: var(--hms-primary); }
.toast-container { position: fixed; top: 70px; right: 16px; z-index: 2000; }

@media (max-width: 575.98px) {
    .stat-card .stat-value { font-size: 1.3rem; }
    .content-header h1 { font-size: 1.25rem; }
    .table-responsive { font-size: .85rem; }
}