/* ==========================================================================
   HMSC Modern Enterprise Theme — Hospital ERP Design System
   Exact Visual Replica matching Image 2 (Reference Mockup)
   - Deep Oceanic Teal/Blue Sidebar with Swoosh Wave Header & Footer
   - Pure Clean White Top Navbar starting at left: 260px
   - No duplicate logo, no extra plus signs in navbar
   - Action Toolbar Pills & 6 KPI Metric Cards
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Brand & Ocean Theme Accents */
    --hmsc-primary: #1877f2;
    --hmsc-primary-hover: #1565c0;
    --hmsc-secondary: #00a887;
    --hmsc-accent: #00bcd4;
    --hmsc-success: #00b074;
    --hmsc-warning: #fd7e14;
    --hmsc-purple: #6f42c1;
    --hmsc-danger: #ef4444;

    /* Workspace Canvas (Soft Light Slate) */
    --hmsc-bg: #f4f7fb;
    --hmsc-bg-card: #ffffff;
    --hmsc-border: #e2e8f0;
    --hmsc-border-light: #f1f5f9;
    --hmsc-text: #0f172a;
    --hmsc-text-muted: #64748b;
    --hmsc-text-light: #94a3b8;

    /* Sidebar Colors (Image 2 Match: Rich Oceanic Teal-Navy) */
    --hmsc-sidebar-bg: #01335f;
    --hmsc-sidebar-top-bg: #004b78;
    --hmsc-sidebar-border: rgba(255, 255, 255, 0.08);
    --hmsc-sidebar-text: #d6e4f0;
    --hmsc-sidebar-text-hover: #ffffff;
    --hmsc-sidebar-active-bg: #1877f2;
    --hmsc-sidebar-active-shadow: 0 4px 14px rgba(24, 119, 242, 0.4);

    /* Layout Dimensions */
    --hmsc-sidebar-width: 260px;
    --hmsc-header-height: 64px;
    --hmsc-radius-sm: 8px;
    --hmsc-radius: 12px;
    --hmsc-radius-lg: 16px;

    /* Shadows */
    --hmsc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
    --hmsc-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.05);
    --hmsc-shadow-md: 0 6px 16px -2px rgba(15, 23, 42, 0.06);

    --hmsc-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --hmsc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Global Resets & Body Shell ---------- */
body, body.ph-app-shell {
    font-family: var(--hmsc-font) !important;
    background: var(--hmsc-bg) !important;
    color: var(--hmsc-text) !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- TOP NAVBAR (100% Crisp Clean White, No Stray Logos/Pluses) ---------- */
.navbar-top.navbar-inverse,
.hmsc-navbar-root {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid #eef2f6 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03) !important;
    position: fixed !important;
    top: 0 !important;
    left: var(--hmsc-sidebar-width) !important;
    right: 0 !important;
    height: var(--hmsc-header-height) !important;
    min-height: var(--hmsc-header-height) !important;
    z-index: 1040 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.navbar-top .navbar-inner,
.hmsc-nav-inner {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    min-height: var(--hmsc-header-height) !important;
    height: var(--hmsc-header-height) !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.hmsc-nav-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    height: var(--hmsc-header-height) !important;
    padding: 0 24px !important;
    box-sizing: border-box !important;
    gap: 16px !important;
}

/* Left Search Pill (Clean & Spacious) */
.hmsc-nav-left-search {
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    max-width: 420px !important;
}
.hmsc-search-bar-form {
    width: 100% !important;
}
.hmsc-search-box {
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 20px !important;
    padding: 6px 14px 6px 38px !important;
    box-sizing: border-box !important;
    height: 38px !important;
    transition: var(--hmsc-transition) !important;
}
.hmsc-search-box:focus-within {
    background: #ffffff !important;
    border-color: #00bcd4 !important;
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15) !important;
}
.hmsc-search-ico {
    position: absolute !important;
    left: 14px !important;
    top: 11px !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    pointer-events: none !important;
}
.hmsc-search-field {
    background: transparent !important;
    border: none !important;
    color: #0f172a !important;
    font-size: 12.5px !important;
    padding: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    height: auto !important;
}
.hmsc-search-field::placeholder {
    color: #94a3b8 !important;
}

/* Right Actions (Role badge, language, profile) */
.hmsc-nav-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
}
.hmsc-nav-pill {
    height: 34px !important;
    padding: 0 14px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    transition: var(--hmsc-transition) !important;
}
.hmsc-nav-pill:hover {
    text-decoration: none !important;
}
.hmsc-role-badge {
    background: #eff6ff !important;
    border: 1px solid #dbeafe !important;
    color: #1877f2 !important;
    text-transform: capitalize !important;
}
.hmsc-role-badge:hover {
    background: #dbeafe !important;
    color: #1565c0 !important;
}
.hmsc-lang-badge {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #475569 !important;
}
.hmsc-lang-badge:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
.hmsc-user-profile-chip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    background: transparent !important;
    border: none !important;
    text-decoration: none !important;
    cursor: pointer !important;
}
.hmsc-user-profile-chip:hover {
    text-decoration: none !important;
    background: #f8fafc !important;
}
.hmsc-avatar-circle {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #01335f !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
}
.hmsc-user-name-text {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
}

/* ---------- FIXED FULL-HEIGHT SIDEBAR (Image 2 Match) ---------- */
.sidebar-background,
.sidebar-background .primary-sidebar-background {
    display: none !important;
}

.primary-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: var(--hmsc-sidebar-width) !important;
    height: 100vh !important;
    z-index: 1050 !important;
    background: linear-gradient(180deg, #01335f 0%, #012b50 60%, #001f3b 100%) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    margin: 0 !important;
}

/* Sidebar Custom Scrollbar */
.primary-sidebar::-webkit-scrollbar {
    width: 5px;
}
.primary-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.primary-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* Sidebar Top Brand Zone (Clean CSS Gradient, No Overlapping Background Image) */
.hmsc-sidebar-brand-zone {
    position: relative !important;
    width: var(--hmsc-sidebar-width) !important;
    height: 68px !important;
    min-height: 68px !important;
    background: linear-gradient(135deg, #004e7c 0%, #01335f 100%) !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    border-bottom: 2px solid #00bcd4 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}
.hmsc-sidebar-brand-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    width: 100% !important;
}
.hmsc-sidebar-brand-link:hover {
    text-decoration: none !important;
}
.hmsc-logo-emblem {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    width: 42px !important;
    height: 42px !important;
}
.hmsc-brand-titles {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}
.hmsc-brand-name {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.2px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}
.hmsc-brand-type {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.1px !important;
}

/* Sidebar Navigation Menu Links */
.primary-sidebar .nav {
    flex: 1 1 auto !important;
    margin: 8px 0 !important;
    padding: 0 10px !important;
    list-style: none !important;
}
.primary-sidebar .nav > li {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 3px 0 !important;
    list-style: none !important;
}
.primary-sidebar .nav > li a:before,
.primary-sidebar .nav > li a:after,
.primary-sidebar .nav:after,
.primary-sidebar .nav > li .glow {
    display: none !important;
    content: none !important;
}

.primary-sidebar .nav > li > a {
    background: transparent !important;
    color: var(--hmsc-sidebar-text) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 9px 12px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    text-shadow: none !important;
    border: none !important;
    transition: var(--hmsc-transition) !important;
    text-decoration: none !important;
}
.primary-sidebar .nav > li > a:hover,
.primary-sidebar .nav > li > a:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}
.primary-sidebar .nav > li > a i {
    width: 22px !important;
    font-size: 14px !important;
    margin-right: 10px !important;
    color: #7ea3be !important;
    text-align: center !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}
.primary-sidebar .nav > li > a:hover i {
    color: #ffffff !important;
}

/* Active Nav Item: Solid Electric Blue Pill */
.primary-sidebar .nav > li.dark-nav.active > a,
.primary-sidebar .nav > li.active > a {
    background: #1877f2 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(24, 119, 242, 0.4) !important;
}
.primary-sidebar .nav > li.dark-nav.active > a i,
.primary-sidebar .nav > li.active > a i {
    color: #ffffff !important;
}

/* Section Headings */
.primary-sidebar .nav-header {
    font-size: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: #7ea3be !important;
    font-weight: 700 !important;
    padding: 14px 12px 4px 12px !important;
    text-shadow: none !important;
}

/* Bottom Sidebar Footer (Clean CSS Gradient, No Overlapping Background Image) */
.hmsc-sidebar-footer {
    margin-top: auto !important;
    width: var(--hmsc-sidebar-width) !important;
    height: 64px !important;
    min-height: 64px !important;
    background: linear-gradient(180deg, rgba(1, 51, 95, 0.4) 0%, #001f3b 100%) !important;
    padding: 12px 16px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.hmsc-footer-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
}
.hmsc-footer-text {
    display: flex !important;
    flex-direction: column !important;
}
.hmsc-footer-title {
    color: #ffffff !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}
.hmsc-footer-subtitle {
    color: #d6e4f0 !important;
    font-size: 10px !important;
    font-weight: 500 !important;
}
.hmsc-footer-ecg {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

/* ---------- MAIN CANVAS AREA ---------- */
.main-content {
    margin-left: var(--hmsc-sidebar-width) !important;
    padding-top: var(--hmsc-header-height) !important;
    background: var(--hmsc-bg) !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
}
.container-fluid.padded {
    padding: 20px 24px !important;
    max-width: 1440px !important;
    margin: 0 auto !important;
}

/* ---------- DASHBOARD COMPONENTS (Image 2) ---------- */

/* Top Reception Dashboard Header Card */
.hmsc-dash-header-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.hmsc-dash-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.hmsc-dash-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #1877f2;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.hmsc-dash-header-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px 0;
}
.hmsc-dash-header-sub {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
}

/* Staff Count Metric Cards in Row */
.hmsc-staff-metrics-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.hmsc-staff-mini-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hmsc-staff-mini-icon {
    font-size: 16px;
}
.hmsc-staff-mini-info {
    display: flex;
    flex-direction: column;
}
.hmsc-staff-mini-label {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hmsc-staff-mini-num {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}

/* Front Desk Action Toolbar */
.hmsc-action-toolbar {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.hmsc-action-title {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.hmsc-btn-pill {
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-decoration: none !important;
    transition: var(--hmsc-transition) !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}
.hmsc-btn-pill:hover {
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}
.hmsc-btn-blue {
    background: #1877f2 !important;
    color: #ffffff !important;
}
.hmsc-btn-green {
    background: #00b074 !important;
    color: #ffffff !important;
}
.hmsc-btn-purple {
    background: #6f42c1 !important;
    color: #ffffff !important;
}
.hmsc-btn-orange {
    background: #fd7e14 !important;
    color: #ffffff !important;
}
.hmsc-btn-search {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}
.hmsc-btn-dark {
    background: #0f172a !important;
    color: #ffffff !important;
    margin-left: auto;
}

/* 6 KPI Stat Cards Grid (Image 2) */
.hmsc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 1200px) {
    .hmsc-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .hmsc-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.hmsc-kpi-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 16px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--hmsc-transition);
}
.hmsc-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
.hmsc-kpi-circle-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 12px;
}
.hmsc-kpi-num {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 6px;
}
.hmsc-kpi-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 4 Data Cards */
.hmsc-data-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.hmsc-data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.hmsc-data-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.token-pill {
    background: #01335f;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Mobile Responsiveness */
@media (max-width: 979px) {
    .primary-sidebar {
        left: calc(-1 * var(--hmsc-sidebar-width)) !important;
        transition: left 0.3s ease !important;
    }
    .primary-sidebar.show-mobile {
        left: 0 !important;
    }
    .navbar-top.navbar-inverse,
    .hmsc-navbar-root {
        left: 0 !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .hmsc-nav-left-search {
        display: none !important;
    }
}
