/* =========================================================
   GLOBAL OVERRIDES FOR FULL WIDTH
   ========================================================= */

body[data-path*="practitioner-portal"] .page-content-wrapper,
body[data-path*="practitioner-portal"] .page_content,
body[data-path*="practitioner-portal"] .page-content-wrapper > main.container,
body[data-path*="practitioner-portal"] .page-content-wrapper > main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

body[data-path*="practitioner-portal"] .page-breadcrumbs,
body[data-path*="practitioner-portal"] .page-header-wrapper {
    display: none !important;
}

.practitioner-portal {
    width: 100%;
    max-width: 100%;
    min-height: calc(100vh - 60px);
    padding-top: 60px;
    background: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
}

.practitioner-portal *,
.practitioner-portal *::before,
.practitioner-portal *::after {
    box-sizing: border-box;
}

/* =========================================================
   TOP NAVBAR HEADER (ALWAYS FIXED)
   ========================================================= */

.practitioner-portal-navbar {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 clamp(16px, 2.5vw, 32px);
    height: 60px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1050 !important;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.practitioner-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    height: 100%;
}

.navbar-left {
    display: flex;
    align-items: center;
    min-width: 200px;
}

.navbar-brand-badge {
    width: 32px;
    height: 32px;
    background: #16233b;
    color: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    flex-shrink: 0;
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-title {
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}

.navbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 540px;
    margin: 0 auto;
}

.navbar-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    height: 38px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.navbar-search-box:focus-within {
    border-color: #94a3b8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

.search-icon {
    width: 16px;
    height: 16px;
    stroke: #94a3b8;
    flex-shrink: 0;
}

.navbar-search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 12.5px;
    color: #0f172a;
}

.navbar-search-input::placeholder {
    color: #94a3b8;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 220px;
    justify-content: flex-end;
}

.navbar-notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    padding: 0;
    transition: background 0.15s;
}

.navbar-notif-btn:hover {
    background: #f8fafc;
}

.notif-icon {
    width: 17px;
    height: 17px;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.practitioner-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.practitioner-nav-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.practitioner-doctor-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: left;
}

.practitioner-nav-name {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}

.practitioner-nav-sub {
    font-size: 11px;
    color: #64748b;
}

.navbar-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.15s;
    cursor: pointer;
    flex-shrink: 0;
}

.navbar-logout-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.navbar-logout-btn .logout-icon {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

/* =========================================================
   PORTAL BODY & SIDEBAR
   ========================================================= */

.portal-body {
    display: flex;
    width: 100%;
    min-height: calc(100vh - 60px);
    background: #f8fafc;
}

.portal-sidebar {
    width: 225px;
    min-width: 225px;
    flex-shrink: 0;
    padding: 14px 10px;
    background: #16233b;
    color: #94a3b8;
    border-right: 1px solid #0f172a;
    display: flex;
    flex-direction: column;
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    bottom: 0 !important;
    height: calc(100vh - 60px) !important;
    z-index: 1000 !important;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.portal-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.portal-menu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border-radius: 7px;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    position: relative;
    border: none;
    min-height: 38px;
}

.portal-menu-item:hover {
    background: #1e304f;
    color: #e2e8f0;
    transform: none;
}

.portal-menu-item.active {
    background: #253858;
    color: #ffffff;
    font-weight: 600;
    border: none;
}

.sidebar-svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    flex-shrink: 0;
}

.menu-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10.5px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    margin-left: auto;
}

.sidebar-badge.badge-red {
    background: #dc2626;
}

.sidebar-badge.badge-blue {
    background: #2563eb;
}

/* Sidebar Submenu */
.portal-menu-group {
    display: flex;
    flex-direction: column;
}

.portal-menu-item .menu-caret {
    font-size: 11px;
    color: #94a3b8;
    margin-left: auto;
    transition: transform 0.2s ease;
    line-height: 1;
}

.portal-menu-group.open .menu-caret,
.portal-menu-group.active .menu-caret,
.portal-menu-item.active .menu-caret {
    color: #ffffff;
}

.portal-menu-group.open .menu-caret {
    transform: rotate(180deg);
}

.portal-submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding-left: 28px;
    padding-right: 8px;
    margin-top: 2px;
    margin-bottom: 4px;
}

.portal-menu-group.active .portal-submenu,
.portal-menu-group.open .portal-submenu,
.portal-menu-item.active + .portal-submenu {
    display: flex;
}

.portal-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    color: #94a3b8;
    text-decoration: none !important;
    font-size: 12.5px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    min-height: 28px;
    cursor: pointer;
}

.portal-submenu-item:hover {
    background: #1e304f;
    color: #ffffff;
}

.portal-submenu-item.active {
    color: #ffffff;
    font-weight: 600;
}

.portal-submenu-item .submenu-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-submenu-item .sidebar-badge {
    margin-left: auto;
    width: 17px;
    height: 17px;
    font-size: 10px;
}

.sidebar-logout-item {
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
    color: #94a3b8;
}

.sidebar-logout-item:hover {
    background: #7f1d1d !important;
    color: #ffffff !important;
}

/* Sidebar Footer / Enterprise Logout */
.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    padding-bottom: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logout-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    width: 100%;
}

.sidebar-logout-card:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.logout-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sidebar-logout-card:hover .logout-icon-box {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.logout-box-svg {
    width: 15px;
    height: 15px;
    stroke: #94a3b8;
    transition: stroke 0.2s ease;
}

.sidebar-logout-card:hover .logout-box-svg {
    stroke: #ef4444;
}

.logout-info-box {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.25;
}

.logout-title {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.sidebar-logout-card:hover .logout-title {
    color: #fca5a5;
}

.logout-sub {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 400;
    margin-top: 1px;
    transition: color 0.2s ease;
}

.sidebar-logout-card:hover .logout-sub {
    color: #f87171;
}

.logout-arrow-box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logout-arrow-svg {
    width: 14px;
    height: 14px;
    stroke: #475569;
    transition: all 0.2s ease;
}

.sidebar-logout-card:hover .logout-arrow-svg {
    stroke: #fca5a5;
    transform: translateX(2px);
}

/* =========================================================
   NEW DASHBOARD STYLES (MATCHING DESIGN)
   ========================================================= */

.dash-welcome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.dash-welcome-text {
    display: flex;
    flex-direction: column;
}

.dash-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
}

.dash-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-dash-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    padding: 7px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-dash-secondary:hover {
    background: #f1f5f9;
}

.btn-dash-primary {
    background: #16233b;
    border: 1px solid #16233b;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    padding: 7px 18px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-dash-primary:hover {
    background: #253858;
}

/* CRITICAL ALERT */
.dash-critical-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.dash-alert-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-alert-icon {
    width: 24px;
    height: 24px;
    color: #dc2626;
    flex-shrink: 0;
}

.dash-alert-icon svg {
    width: 100%;
    height: 100%;
    stroke: #dc2626;
}

.dash-alert-text {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.dash-alert-title {
    color: #991b1b;
    font-size: 13px;
    font-weight: 700;
}

.dash-alert-desc {
    color: #7f1d1d;
    font-size: 12px;
    margin: 2px 0 0 0;
}

.dash-alert-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-alert-outline {
    background: #ffffff;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-alert-outline:hover {
    background: #fff5f5;
}

.btn-alert-solid {
    background: #b91c1c;
    border: 1px solid #b91c1c;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    padding: 6px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-alert-solid:hover {
    background: #991b1b;
}

/* KPI CARDS */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.dash-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    margin: 4px 0 2px 0;
    line-height: 1.1;
}

.kpi-val-red {
    color: #dc2626 !important;
}

.kpi-subtext {
    font-size: 11px;
    color: #64748b;
}

/* TWO COLUMN MAIN GRID */
.dash-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.dash-col-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-col-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.dash-card-meta {
    font-size: 12px;
    color: #64748b;
}

.dash-card-link {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none !important;
    font-weight: 500;
    cursor: pointer;
}

.dash-card-link:hover {
    text-decoration: underline !important;
}

/* TABLES */
.dash-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 12.5px;
}

.dash-table thead th {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-transform: capitalize;
    padding: 6px 8px 10px 8px;
    border-bottom: 1px solid #f1f5f9;
}

.dash-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}

.token-val {
    font-weight: 700;
    color: #0f172a;
    font-size: 13px;
}

.patient-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.patient-name {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}

.patient-sub {
    font-size: 11px;
    color: #64748b;
}

.reason-val {
    color: #334155;
    font-size: 12.5px;
}

.wait-red {
    color: #dc2626;
    font-weight: 600;
    font-size: 12px;
}

.wait-normal {
    color: #334155;
    font-size: 12px;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    padding: 2.5px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-arrived {
    background: #fef3c7;
    color: #92400e;
}

.badge-vitals {
    background: #ccfbf1;
    color: #0f766e;
}

.badge-booked {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-confirmed {
    background: #dcfce7;
    color: #15803d;
}

.badge-ot {
    background: #ffe4e6;
    color: #be123c;
}

.badge-planned {
    background: #f1f5f9;
    color: #475569;
}

.btn-table-call {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    padding: 3.5px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-table-call:hover {
    background: #f1f5f9;
}

.schedule-time {
    font-weight: 500;
    font-size: 12px;
    color: #334155;
}

.schedule-title {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}

.schedule-desc {
    font-size: 12px;
    color: #64748b;
}

/* PENDING WORK */
.pending-work-list {
    display: flex;
    flex-direction: column;
}

.pending-work-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.pending-work-item:last-child {
    border-bottom: none;
}

.pending-work-item:hover {
    background: #f8fafc;
}

.pending-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.badge-circle-red {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-circle-amber {
    background: #fef3c7;
    color: #b45309;
}

.badge-circle-blue {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-circle-indigo {
    background: #ede9fe;
    color: #4338ca;
}

.badge-circle-yellow {
    background: #fef9c3;
    color: #854d0e;
}

.pending-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    line-height: 1.25;
}

.pending-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.pending-sub {
    font-size: 11px;
    color: #64748b;
}

.pending-chevron {
    width: 16px;
    height: 16px;
    stroke: #94a3b8;
    flex-shrink: 0;
}

/* MY ADMITTED PATIENTS */
.admitted-list {
    display: flex;
    flex-direction: column;
}

.admitted-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid #f8fafc;
}

.admitted-item:last-child {
    border-bottom: none;
}

.bed-tag {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 700;
    font-size: 11px;
    padding: 2.5px 7px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.admitted-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    line-height: 1.25;
}

.admitted-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.admitted-sub {
    font-size: 11px;
    color: #64748b;
}

.admitted-status {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-critical {
    color: #dc2626;
}

.status-discharge {
    color: #0d9488;
}

.status-labs {
    color: #d97706;
}

.status-today {
    color: #475569;
}

/* =========================================================
   SCHEDULE AND LEAVE STYLES (MATCHING DESIGN)
   ========================================================= */

.schedule-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.schedule-col-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.schedule-col-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.schedule-card {
    padding: 16px 18px;
}

/* Calendar Toolbar */
.cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cal-arrow {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, border-color 0.15s;
}

.btn-cal-arrow:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.cal-date-title {
    font-weight: 700;
    font-size: 13.5px;
    color: #0f172a;
}

.cal-view-group {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.btn-cal-view {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-cal-view:hover {
    color: #0f172a;
}

.btn-cal-view.active {
    background: #16233b;
    color: #ffffff;
    font-weight: 600;
}

/* Calendar Grid Table */
.cal-grid-wrap {
    width: 100%;
    overflow-x: auto;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 14px;
}

.cal-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.cal-th-time {
    width: 50px;
    min-width: 50px;
    padding: 6px 4px;
}

.cal-th-day {
    text-align: center;
    padding: 6px 4px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.cal-day-active {
    background: #16233b;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
    font-weight: 600;
    font-size: 12px;
}

.cal-td-time {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    vertical-align: top;
    padding-top: 8px;
    padding-right: 6px;
    text-align: right;
    border-top: 1px solid #f1f5f9;
}

.cal-td-slot {
    height: 48px;
    border-top: 1px solid #f1f5f9;
    border-left: 1px solid #f1f5f9;
    padding: 2.5px 3px;
    vertical-align: top;
}

.cal-event {
    border-radius: 6px;
    padding: 3.5px 7px;
    height: 100%;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.2;
}

.cal-event .event-title {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-event .event-desc {
    font-size: 10.5px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Event color variants matching design */
.event-visit {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
}
.event-visit .event-desc {
    color: #2563eb;
}

.event-tele {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.event-tele .event-desc {
    color: #059669;
}

.event-ot {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}
.event-ot .event-desc {
    color: #be123c;
}

.event-ward {
    background: #fefce8;
    border: 1px solid #fde68a;
    color: #854d0e;
}
.event-ward .event-desc {
    color: #a16207;
}

.event-blocked {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
}
.event-blocked .event-desc {
    color: #64748b;
}

.event-open {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}
.event-open .event-desc {
    color: #94a3b8;
}

/* Calendar Legend */
.cal-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 11px;
    color: #64748b;
}

.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.swatch-visit {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.swatch-tele {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.swatch-ot {
    background: #fff1f2;
    border: 1px solid #fecdd3;
}
.swatch-ward {
    background: #fefce8;
    border: 1px solid #fde68a;
}
.swatch-blocked {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
}

/* Leave Request Form */
.leave-form-group {
    margin-bottom: 12px;
}

.leave-form-label {
    font-size: 11.5px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
    display: block;
}

.leave-form-control {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 11px;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.leave-form-control:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.leave-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2364748b%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

.leave-form-row-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.leave-warning-note {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 11.5px;
    color: #92400e;
    line-height: 1.35;
    margin: 12px 0 14px 0;
}

.btn-submit-leave {
    width: 100%;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 6px;
    text-align: center;
}

/* Upcoming Time Off */
.timeoff-list {
    display: flex;
    flex-direction: column;
}

.timeoff-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #f8fafc;
    gap: 10px;
}

.timeoff-item:last-child {
    border-bottom: none;
}

.timeoff-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.timeoff-date {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
}

.timeoff-sub {
    font-size: 11px;
    color: #64748b;
}

.badge-timeoff-pending {
    background: #fef3c7;
    color: #b45309;
}

.badge-timeoff-holiday {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-timeoff-approved {
    background: #dcfce7;
    color: #15803d;
}

/* OPD Session Settings */
.opd-settings-list {
    display: flex;
    flex-direction: column;
}

.opd-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 12px;
    gap: 12px;
}

.opd-setting-row:last-child {
    border-bottom: none;
}

.opd-label {
    color: #64748b;
    font-weight: 500;
}

.opd-value {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
}

/* =========================================================
   MY PATIENTS STYLES (MATCHING DESIGN)
   ========================================================= */

.patient-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.btn-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-filter-pill:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.btn-filter-pill.active {
    background: #16233b;
    color: #ffffff;
    border-color: #16233b;
    font-weight: 600;
}

.btn-filter-pill .pill-count {
    padding: 1px 7px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
}

.btn-filter-pill.active .pill-count {
    background: #ffffff;
    color: #16233b;
    font-weight: 700;
}

.patient-search-sort-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.patient-search-box {
    flex: 1;
    max-width: 600px;
}

.patient-search-input-wrap {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.patient-search-input-wrap .patient-search-input {
    width: 100%;
    padding-right: 36px;
}

.patient-search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #94a3b8;
    transition: color 0.15s, background-color 0.15s;
    line-height: 1;
}

.patient-search-clear-btn:hover {
    color: #334155;
    background-color: #f1f5f9;
}

.patient-search-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.patient-search-input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.patient-sort-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.sort-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.patient-sort-select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}

.patients-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.patients-col-left,
.patients-col-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.patients-card {
    padding: 16px 18px;
}

.patients-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.patients-table {
    width: 100%;
    border-collapse: collapse;
}

.visit-val,
.diag-val,
.followup-val {
    color: #334155;
    font-size: 12.5px;
}

.text-teal-bold {
    color: #0d9488 !important;
    font-weight: 600;
}

.text-red-bold {
    color: #dc2626 !important;
    font-weight: 600;
}

/* Flag badges */
.badge-allergy {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-critical-flag {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-under-review {
    background: #fef3c7;
    color: #b45309;
}

.badge-new-patient {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-pre-op {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-review-labs {
    background: #fef3c7;
    color: #b45309;
}

.badge-discharge-flag {
    background: #dcfce7;
    color: #15803d;
}

.badge-followup-due {
    background: #fef3c7;
    color: #b45309;
}

.btn-table-open {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    padding: 3.5px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-table-open:hover {
    background: #f1f5f9;
}

.patients-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    margin-top: 10px;
    border-top: 1px solid #f8fafc;
}

.pagination-info-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-sep {
    color: #cbd5e1;
    font-size: 14px;
}

.page-size-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    margin: 0;
}

.patient-page-size-select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s;
}

.patient-page-size-select:focus {
    border-color: #94a3b8;
}

.pagination-info {
    font-size: 12px;
    color: #64748b;
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page-nav {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    padding: 4px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-page-nav:hover {
    background: #f1f5f9;
}

/* Needs your attention card */
.attention-list {
    display: flex;
    flex-direction: column;
}

.attention-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
}

.attention-item:last-child {
    border-bottom: none;
}

.attention-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.attention-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
}

.attention-sub {
    font-size: 11px;
    color: #64748b;
}

/* Care programmes card */
.care-programme-list {
    display: flex;
    flex-direction: column;
}

.care-programme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 12.5px;
}

.care-programme-row:last-child {
    border-bottom: none;
}

.care-label {
    color: #0f172a;
    font-weight: 600;
}

.care-count {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}


/* =========================================================
   CONSULTATION SCREEN
   ========================================================= */

/* Patient Top Banner */
.consult-patient-banner {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.consult-patient-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.consult-patient-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e0e7ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.consult-patient-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.consult-patient-name {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
}

.consult-patient-meta {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 400;
}

.consult-patient-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.consult-badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    line-height: 1.3;
}

.consult-badge-allergy {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.consult-badge-condition {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.consult-token-meta {
    font-size: 12px;
    color: #64748b;
    margin-left: 4px;
}

/* Two-column layout */
.consult-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}

.consult-col-left {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.consult-col-right {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.consult-card {
    padding: 18px 20px;
}

.consult-mt-14 {
    margin-top: 14px;
}

.consult-mt-16 {
    margin-top: 16px;
}

.consult-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-consult-action {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    line-height: 1.3;
}

.btn-consult-action:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Form inputs & grid */
.consult-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.consult-form-group {
    display: flex;
    flex-direction: column;
}

.consult-form-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.consult-textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #1e293b;
    background: #ffffff;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.consult-textarea:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.1);
}

/* Diagnosis Tag Box */
.consult-diagnosis-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    min-height: 38px;
    box-sizing: border-box;
}

.diagnosis-tag {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.diagnosis-input {
    border: none;
    outline: none;
    font-size: 12.5px;
    color: #64748b;
    flex: 1;
    min-width: 200px;
    padding: 3px 0;
    background: transparent;
}

.diagnosis-input::placeholder {
    color: #94a3b8;
}

/* Select wrapper */
.consult-select-wrap {
    width: 100%;
}

.consult-select {
    width: 100%;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 12.5px;
    color: #1e293b;
    background: #ffffff;
    cursor: pointer;
    box-sizing: border-box;
}

.consult-select:focus {
    outline: none;
    border-color: #0284c7;
}

/* Warning Banner */
.consult-warning-banner {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.warning-banner-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.warning-text-group {
    font-size: 12.5px;
    line-height: 1.45;
}

.warning-title {
    color: #b45309;
    font-weight: 700;
    margin-right: 6px;
}

.warning-desc {
    color: #78350f;
}

.warning-reason-link {
    font-size: 12px;
    color: #92400e;
    font-weight: 500;
    text-decoration: underline;
    white-space: nowrap;
    cursor: pointer;
}

.warning-select-wrap {
    margin-top: 8px;
}

.warning-select {
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    background: #ffffff;
    color: #1e293b;
    width: 280px;
    max-width: 100%;
    cursor: pointer;
}

/* e-Prescription Table */
.consult-rx-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-bottom: 1px solid #f1f5f9;
}

.consult-rx-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.consult-rx-table thead th {
    background: #fafafa;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-align: left;
    text-transform: capitalize;
}

.consult-rx-table tbody td {
    padding: 10px 12px;
    font-size: 12.5px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.rx-med-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 13px;
}

.rx-med-instruction {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

.rx-action-cell {
    text-align: center;
}

.btn-rx-remove {
    width: 24px;
    height: 24px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #94a3b8;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.btn-rx-remove:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* Add Row (Search input + Action button) */
.consult-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.consult-add-input {
    flex: 1;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 12.5px;
    color: #1e293b;
    background: #ffffff;
    box-sizing: border-box;
}

.consult-add-input::placeholder {
    color: #94a3b8;
}

.consult-add-input:focus {
    outline: none;
    border-color: #0284c7;
}

.btn-consult-add {
    height: 38px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    padding: 0 16px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.btn-consult-add:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Investigation Orders List */
.consult-orders-list {
    display: flex;
    flex-direction: column;
}

.consult-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.consult-order-item:last-child {
    border-bottom: 1px solid #f1f5f9;
}

.order-item-left {
    display: flex;
    flex-direction: column;
}

.order-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
}

.order-item-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.order-item-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.order-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2.5px 8px;
    border-radius: 4px;
    line-height: 1.25;
}

.badge-routine {
    background-color: #e0f2fe;
    color: #0284c7;
}

.badge-urgent {
    background-color: #fef3c7;
    color: #b45309;
}

.order-dept {
    font-size: 12.5px;
    color: #64748b;
}

/* Bottom Draft Bar */
.consult-draft-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 18px;
}

.draft-bar-left {
    display: flex;
    flex-direction: column;
}

.draft-saved-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.draft-saved-desc {
    font-size: 11.5px;
    color: #64748b;
    margin: 2px 0 0 0;
}

.draft-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-draft-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 6px;
    padding: 7px 16px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-draft-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-draft-primary {
    background-color: #1e4d40;
    border: 1px solid #1e4d40;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 6px;
    padding: 7px 18px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-draft-primary:hover {
    background-color: #15392f;
}

/* Safety Checks Card */
.safety-checks-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.safety-check-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.safety-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.safety-icon svg {
    width: 13px;
    height: 13px;
}

.safety-icon-ok {
    background-color: #dcfce7;
    color: #16a34a;
}

.safety-icon-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.safety-item-content {
    display: flex;
    flex-direction: column;
}

.safety-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.safety-item-desc {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    margin-top: 2px;
}

/* Next Steps Card */
.next-steps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-next-step {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-next-step:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

@media (max-width: 1024px) {
    .consult-main-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   ORDERS AND RESULTS PAGE
   ========================================================= */

.orders-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.orders-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.orders-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.btn-mark-normal {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-mark-normal:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Filter Pills */
.orders-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.orders-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.orders-filter-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.orders-filter-pill.active {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
}

.pill-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 0 6px;
    line-height: 1;
}

.badge-dark {
    background: #334155;
    color: #ffffff;
}

.badge-critical {
    background: #fee2e2;
    color: #dc2626;
}

.badge-abnormal {
    background: #fef3c7;
    color: #d97706;
}

.badge-normal {
    background: #ccfbf1;
    color: #0f766e;
}

.badge-pending {
    background: #f1f5f9;
    color: #475569;
}

/* Critical Result Card */
.orders-critical-card {
    background: #ffffff;
    border: 1.5px solid #dc2626;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.06);
}

.critical-card-header {
    background: #fef2f2;
    border-bottom: 1px solid #fee2e2;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.critical-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.critical-warn-icon {
    width: 16px;
    height: 16px;
    color: #dc2626;
    flex-shrink: 0;
}

.critical-header-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #991b1b;
}

.critical-header-right {
    font-size: 12.5px;
    color: #991b1b;
}

.escalation-timer-text {
    font-weight: 500;
}

.escalation-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    margin-left: 2px;
}

.critical-card-body {
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 1fr 1.15fr 1.15fr;
    gap: 24px;
    align-items: start;
}

.crit-patient-headline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.crit-patient-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.crit-patient-meta {
    font-size: 12px;
    color: #64748b;
}

.crit-test-title {
    margin-top: 10px;
    font-size: 13px;
    color: #64748b;
}

.crit-value-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 4px 0 8px 0;
}

.crit-num-value {
    font-size: 34px;
    font-weight: 700;
    color: #dc2626;
    line-height: 1;
}

.crit-unit {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.crit-meta-footer {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.45;
}

/* Sparkline Trend Chart */
.crit-graph-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.crit-chart-container {
    width: 100%;
    height: 85px;
}

.crit-trend-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* Action Required Column */
.crit-action-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.crit-select-wrap {
    position: relative;
    width: 100%;
}

.crit-action-select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.crit-action-select:focus {
    outline: none;
    border-color: #94a3b8;
}

.crit-note-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    margin-top: 8px;
    resize: none;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.crit-note-input:focus {
    outline: none;
    border-color: #94a3b8;
}

.crit-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-crit-open {
    flex: 1;
    background: #ffffff;
    border: 1px solid #dc2626;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-crit-open:hover {
    background: #fef2f2;
}

.btn-crit-ack {
    flex: 1.4;
    background: #991b1b;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s;
}

.btn-crit-ack:hover {
    background: #7f1d1d;
}

/* Lower 2-Column Grid */
.orders-main-grid {
    display: grid;
    grid-template-columns: 1.9fr 1fr;
    gap: 20px;
    align-items: start;
}

.orders-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.orders-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.orders-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.orders-sort-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
}

.orders-table-wrapper {
    overflow-x: auto;
    margin: 0 -4px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.orders-table th {
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
    padding: 8px 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.orders-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
    color: #334155;
}

.orders-table tbody tr:last-child td {
    border-bottom: none;
}

.orders-table tbody tr:hover {
    background-color: #fafafa;
}

.pat-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.3;
}

.pat-sub {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.3;
    margin-top: 1px;
}

.res-highlight {
    font-weight: 600;
    font-size: 13px;
}

.res-critical {
    color: #dc2626;
}

.res-high {
    color: #b45309;
}

.res-normal {
    color: #0f766e;
}

.res-flag-badge {
    display: inline-block;
    padding: 2.5px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.flag-critical {
    background: #fee2e2;
    color: #b91c1c;
}

.flag-high {
    background: #fef3c7;
    color: #b45309;
}

.flag-normal {
    background: #ccfbf1;
    color: #0f766e;
}

.res-time {
    color: #64748b;
    font-size: 12px;
}

.btn-table-review {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-table-review:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Orders in progress */
.orders-progress-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-progress-item {
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.order-progress-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.prog-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.prog-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}

.prog-item-meta {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 4px;
}

.prog-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2.5px 9px;
    border-radius: 9999px;
    white-space: nowrap;
    line-height: 1.2;
}

.status-scheduled {
    background: #e0f2fe;
    color: #0369a1;
}

.status-sample-due {
    background: #fef3c7;
    color: #b45309;
}

.status-in-progress {
    background: #e0f2fe;
    color: #0284c7;
}

.status-not-placed {
    background: #fee2e2;
    color: #b91c1c;
}

/* Responsive adjustments */
@media (max-width: 1080px) {
    .critical-card-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .orders-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .orders-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-mark-normal {
        width: 100%;
        text-align: center;
    }
}


/* =========================================================
   IPD ROUNDS PAGE
   ========================================================= */

.ipd-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.ipd-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.ipd-page-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.ipd-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-ipd-reviewed {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-ipd-reviewed:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-ipd-start-next {
    background: #1e293b;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-ipd-start-next:hover {
    background: #0f172a;
}

/* 2-Column Layout */
.ipd-layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}

.ipd-sidebar-col {
    min-width: 0;
}

.ipd-ward-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ipd-ward-head {
    padding: 0 6px 12px 6px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 8px;
}

.ipd-ward-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.ipd-ward-meta {
    font-size: 11.5px;
    color: #64748b;
    margin: 3px 0 0 0;
}

.ipd-patient-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ipd-pat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    border-left: 3px solid transparent;
}

.ipd-pat-item:hover {
    background: #f8fafc;
}

.ipd-pat-item.active {
    background: #f8fafc;
    border-left: 3px solid #dc2626;
    border-radius: 0 8px 8px 0;
}

.ipd-bed-tag {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    width: 44px;
    flex-shrink: 0;
}

.ipd-bed-tag.bed-critical {
    color: #dc2626;
    font-weight: 700;
}

.ipd-pat-info {
    flex: 1;
    min-width: 0;
}

.ipd-pat-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ipd-pat-sub {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 1px;
}

.ipd-badge-wrap {
    flex-shrink: 0;
}

.flag-to-see {
    background: #fef3c7;
    color: #b45309;
}

.flag-seen {
    background: #ccfbf1;
    color: #0f766e;
}

/* Right Column */
.ipd-main-col {
    min-width: 0;
}

.ipd-patient-banner {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.ipd-banner-left {
    flex: 1;
    min-width: 250px;
}

.ipd-banner-name {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px 0;
}

.ipd-banner-meta {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 4px;
}

.ipd-banner-clinical {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.ipd-banner-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ipd-alert-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 9999px;
    line-height: 1.3;
    white-space: nowrap;
}

.pill-critical {
    background: #fee2e2;
    color: #b91c1c;
}

.pill-allergy {
    background: #fef3c7;
    color: #b45309;
}

/* Navigation Tabs */
.ipd-nav-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 18px;
    overflow-x: auto;
}

.ipd-tab-btn {
    background: none;
    border: none;
    padding: 8px 2px 10px 2px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.15s;
}

.ipd-tab-btn:hover {
    color: #0f172a;
}

.ipd-tab-btn.active {
    color: #0f172a;
    font-weight: 600;
}

.ipd-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: #1e293b;
    border-radius: 2px;
}

/* IPD Cards */
.ipd-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 18px;
}

.ipd-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px 0;
}

/* Round Note Form */
.round-note-group {
    margin-bottom: 14px;
}

.round-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.round-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    resize: none;
    font-family: inherit;
    line-height: 1.45;
}

.round-textarea:focus {
    outline: none;
    border-color: #94a3b8;
}

.vitals-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.vital-metric-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.vital-label {
    font-size: 11px;
    color: #64748b;
    line-height: 1.2;
}

.vital-val {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
}

.vital-metric-card.metric-warning {
    background: #fef3c7;
    border-color: #fde68a;
}

.vital-metric-card.metric-warning .vital-label {
    color: #92400e;
}

.vital-metric-card.metric-warning .vital-val {
    color: #b45309;
}

.vital-metric-card.metric-critical {
    background: #fee2e2;
    border-color: #fca5a5;
}

.vital-metric-card.metric-critical .vital-label {
    color: #991b1b;
}

.vital-metric-card.metric-critical .vital-val {
    color: #dc2626;
}

.round-note-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.btn-round-draft {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-round-draft:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-round-sign {
    background: #1e3a34;
    border: none;
    border-radius: 7px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-round-sign:hover {
    background: #132a25;
}

/* Active Orders */
.active-orders-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.active-order-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.active-order-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.order-cat-tag {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    width: 100px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.order-detail-col {
    flex: 1;
    min-width: 0;
}

.order-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.order-sched {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

.order-status-wrap {
    flex-shrink: 0;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-review {
    background: #fef3c7;
    color: #b45309;
}

.active-orders-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.btn-order-action {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-order-action:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Discharge Planning */
.discharge-progress-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.discharge-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.discharge-progress-bar {
    width: 140px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.discharge-progress-fill {
    height: 100%;
    background: #15803d;
    border-radius: 9999px;
}

.discharge-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.criteria-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.criteria-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    font-weight: 700;
}

.criteria-icon.checked {
    background: #ccfbf1;
    color: #0f766e;
}

.criteria-icon.dash {
    background: #f1f5f9;
    color: #94a3b8;
}

.criteria-label {
    font-size: 12.5px;
    color: #334155;
}

.btn-discharge-summary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-discharge-summary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* IPD Responsive */
@media (max-width: 1024px) {
    .ipd-layout-grid {
        grid-template-columns: 1fr;
    }

    .ipd-sidebar-col {
        margin-bottom: 16px;
    }
}

@media (max-width: 640px) {
    .ipd-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ipd-header-actions {
        width: 100%;
    }

    .btn-ipd-reviewed,
    .btn-ipd-start-next {
        flex: 1;
        text-align: center;
    }

    .vitals-metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* =========================================================
   REFERRALS AND REQUESTS PAGE
   ========================================================= */

.ref-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.ref-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.25;
}

.ref-page-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.btn-ref-primary {
    background: #1e293b;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-ref-primary:hover {
    background: #0f172a;
}

/* Tabs */
.ref-tabs-row {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    overflow-x: auto;
}

.ref-tab-btn {
    background: none;
    border: none;
    padding: 8px 2px 12px 2px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s;
}

.ref-tab-btn:hover {
    color: #0f172a;
}

.ref-tab-btn.active {
    color: #0f172a;
    font-weight: 600;
}

.ref-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: #1e293b;
    border-radius: 2px;
}

.ref-tab-count {
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 9999px;
    line-height: 1.3;
}

/* 2-Column Main Layout Grid */
.ref-layout-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 20px;
    align-items: start;
}

.ref-left-col,
.ref-right-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.ref-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ref-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 16px 0;
}

/* Received by you list */
.received-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.received-item {
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.received-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rec-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.rec-pat-headline {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.rec-pat-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.rec-pat-meta {
    font-size: 12px;
    color: #64748b;
}

.rec-item-source {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 3px;
}

.rec-item-clinical {
    font-size: 12.5px;
    color: #334155;
    line-height: 1.45;
    margin: 8px 0 12px 0;
}

.rec-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-rec-accept {
    background: #1e293b;
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-rec-accept:hover {
    background: #0f172a;
}

.btn-rec-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-rec-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Sent by you list */
.sent-list,
.admission-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sent-item-row,
.admission-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.sent-item-row:last-child,
.admission-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sent-pat-col,
.adm-pat-col {
    flex: 1;
    min-width: 0;
}

.sent-pat-name,
.adm-pat-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.sent-pat-meta,
.adm-pat-meta {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.3;
}

.sent-reason-col {
    font-size: 12.5px;
    color: #475569;
    text-align: right;
    padding: 0 8px;
}

.adm-date-col {
    font-size: 12.5px;
    color: #64748b;
    white-space: nowrap;
}

.sent-badge-col,
.adm-badge-col {
    flex-shrink: 0;
}

/* Status Badges */
.status-routine {
    background: #e0f2fe;
    color: #0284c7;
}

.status-urgent {
    background: #fef3c7;
    color: #b45309;
}

.status-sent {
    background: #e0f2fe;
    color: #0284c7;
}

.status-accepted {
    background: #dcfce7;
    color: #166534;
}

.status-seen {
    background: #ccfbf1;
    color: #0f766e;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-awaiting-bed {
    background: #fef3c7;
    color: #b45309;
}

/* Form Styles */
.ref-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ref-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.ref-form-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.ref-form-input,
.ref-form-select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ref-form-input:focus,
.ref-form-select:focus,
.ref-form-textarea:focus {
    outline: none;
    border-color: #94a3b8;
}

.ref-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ref-form-row-three {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.ref-form-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12.5px;
    color: #0f172a;
    background: #ffffff;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ref-attached-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.ref-attach-pill {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 9999px;
    line-height: 1.3;
}

.btn-ref-submit {
    background: #1e3a5f;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 6px;
    transition: background 0.15s;
}

.btn-ref-submit:hover {
    background: #162c47;
}

.btn-ot-submit {
    background: #1e3a34;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 6px;
    transition: background 0.15s;
}

.btn-ot-submit:hover {
    background: #132a25;
}

/* Referrals Responsive */
@media (max-width: 1080px) {
    .ref-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ref-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-ref-primary {
        width: 100%;
        text-align: center;
    }

    .ref-form-row,
    .ref-form-row-three {
        grid-template-columns: 1fr;
    }

    .sent-item-row,
    .admission-item-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .sent-reason-col {
        text-align: left;
        padding: 0;
    }
}


/* =========================================================
   PATIENT CHART / RECORD PAGE
   ========================================================= */

.chart-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.chart-breadcrumb .breadcrumb-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}

.chart-breadcrumb .breadcrumb-link:hover {
    color: #0f172a;
    text-decoration: underline;
}

.chart-breadcrumb .breadcrumb-sep {
    color: #cbd5e1;
}

.chart-breadcrumb .breadcrumb-current {
    color: #0f172a;
    font-weight: 600;
}

/* Patient Header Card */
.chart-patient-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.chart-pat-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 280px;
    flex: 1;
}

.chart-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.chart-pat-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chart-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-patient-name {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
}

.chart-patient-age {
    font-size: 13px;
    color: #64748b;
}

.chart-patient-meta {
    font-size: 12.5px;
    color: #64748b;
    margin: 2px 0 4px 0;
}

.chart-patient-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chart-pat-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

a.btn-chart-outline,
button.btn-chart-outline,
.btn-chart-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

a.btn-chart-outline:hover,
a.btn-chart-outline:focus,
a.btn-chart-outline:active,
button.btn-chart-outline:hover,
button.btn-chart-outline:focus,
button.btn-chart-outline:active,
.btn-chart-outline:hover,
.btn-chart-outline:focus,
.btn-chart-outline:active {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    text-decoration: none !important;
}

a.btn-chart-primary,
a.btn-chart-primary:visited,
button.btn-chart-primary,
.btn-chart-primary {
    background: #1e293b !important;
    border: 1px solid #1e293b !important;
    border-radius: 8px !important;
    padding: 8px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

a.btn-chart-primary:hover,
a.btn-chart-primary:focus,
a.btn-chart-primary:active,
a.btn-chart-primary:visited:hover,
a.btn-chart-primary:visited:focus,
button.btn-chart-primary:hover,
button.btn-chart-primary:focus,
button.btn-chart-primary:active,
.btn-chart-primary:hover,
.btn-chart-primary:focus,
.btn-chart-primary:active {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25) !important;
}

/* Tabs */
.chart-nav-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    overflow-x: auto;
}

.chart-tab-btn {
    background: none;
    border: none;
    padding: 8px 2px 10px 2px;
    font-size: 13.5px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.15s;
}

.chart-tab-btn:hover {
    color: #0f172a;
}

.chart-tab-btn.active {
    color: #0f172a;
    font-weight: 600;
}

.chart-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: #1e293b;
    border-radius: 2px;
}

/* Main Grid */
.chart-main-grid {
    display: grid;
    grid-template-columns: 1.85fr 1fr;
    gap: 20px;
    align-items: start;
}

.chart-col-left,
.chart-col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.chart-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chart-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.chart-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.chart-card-sub {
    font-size: 11.5px;
    color: #64748b;
}

.chart-link-action {
    font-size: 12.5px;
    font-weight: 600;
    color: #0284c7;
    text-decoration: none;
}

.chart-link-action:hover {
    text-decoration: underline;
}

/* Vitals Grid */
.chart-vitals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.chart-vital-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 98px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.chart-vital-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
    border-color: #cbd5e1;
}

/* Colored top accent lines on each card */
.chart-vital-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.9;
}

.chart-vital-box.vital-box-bp::before { background: #ef4444; }
.chart-vital-box.vital-box-pulse::before { background: #ec4899; }
.chart-vital-box.vital-box-temp::before { background: #f97316; }
.chart-vital-box.vital-box-spo2::before { background: #0284c7; }
.chart-vital-box.vital-box-resp::before { background: #10b981; }
.chart-vital-box.vital-box-weight::before { background: #8b5cf6; }
.chart-vital-box.vital-box-bmi::before { background: #f59e0b; }

/* Subtle gradient tints */
.chart-vital-box.vital-box-bp { background: linear-gradient(180deg, #ffffff 0%, #fffbfb 100%); }
.chart-vital-box.vital-box-pulse { background: linear-gradient(180deg, #ffffff 0%, #fdf8fb 100%); }
.chart-vital-box.vital-box-temp { background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%); }
.chart-vital-box.vital-box-spo2 { background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%); }
.chart-vital-box.vital-box-resp { background: linear-gradient(180deg, #ffffff 0%, #f8fdf9 100%); }
.chart-vital-box.vital-box-weight { background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%); }
.chart-vital-box.vital-box-bmi {
    background: linear-gradient(180deg, #ffffff 0%, #fffdf5 100%);
    grid-column: span 2;
}

/* Vital Box Top */
.vital-box-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vital-icon-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.chart-vital-box:hover .vital-icon-badge {
    transform: scale(1.08);
}

.vital-icon-badge svg {
    width: 17px;
    height: 17px;
}

/* Individual Icon Badge Colors */
.vital-icon-badge.badge-bp {
    background: #fee2e2;
    color: #dc2626;
}
.vital-icon-badge.badge-pulse {
    background: #fce7f3;
    color: #db2777;
}
.vital-icon-badge.badge-temp {
    background: #ffedd5;
    color: #ea580c;
}
.vital-icon-badge.badge-spo2 {
    background: #e0f2fe;
    color: #0284c7;
}
.vital-icon-badge.badge-resp {
    background: #dcfce7;
    color: #059669;
}
.vital-icon-badge.badge-weight {
    background: #ede9fe;
    color: #7c3aed;
}
.vital-icon-badge.badge-bmi {
    background: #fef3c7;
    color: #d97706;
}

/* Meta & Labels */
.vital-box-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vital-box-label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vital-box-ref {
    font-size: 10.5px;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 1px;
}

/* Vital Box Bottom */
.vital-box-bottom {
    margin-top: 10px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.vital-box-val {
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.3px;
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.vital-box-unit-inline {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

/* BMI Pill Badge */
.vital-bmi-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
}

.vital-bmi-pill.bmi-normal {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.vital-bmi-pill.bmi-overweight {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.vital-bmi-pill.bmi-underweight {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.vital-bmi-pill.bmi-obese {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

@media (max-width: 1100px) {
    .chart-vitals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-vital-box.vital-box-bmi {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .chart-vitals-grid {
        grid-template-columns: 1fr;
    }
    .chart-vital-box.vital-box-bmi {
        grid-column: span 1;
    }
}

/* Blood Pressure Trend Graph */
.chart-bp-trend-section {
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.bp-trend-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.bp-trend-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
}

.bp-trend-sub {
    font-size: 11.5px;
    color: #64748b;
}

.bp-chart-svg-wrap {
    width: 100%;
    height: 110px;
}

.bp-trend-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* Medications List */
.medications-list,
.problems-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.med-item-row,
.problem-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.med-item-row:last-child,
.problem-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.med-name-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1.4;
    min-width: 0;
}

.med-name,
.prob-name-col {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.med-dose-col {
    font-size: 12px;
    color: #64748b;
    flex: 1.3;
}

.med-time-col,
.prob-date-col {
    font-size: 12px;
    color: #64748b;
    flex: 1;
}

.med-status-col,
.prob-status-col {
    flex-shrink: 0;
    text-align: right;
}

.status-ending-soon {
    background: #fef3c7;
    color: #b45309;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
}

.status-completed {
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 2.5px 9px;
    border-radius: 9999px;
}

.prob-name-col {
    flex: 1.8;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.prob-code-col {
    font-size: 12px;
    color: #64748b;
    width: 60px;
    flex-shrink: 0;
}

.status-followup {
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
    font-weight: 600;
    padding: 2.5px 9px;
    border-radius: 9999px;
}

.status-chronic {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 600;
    padding: 2.5px 9px;
    border-radius: 9999px;
}

/* Timeline */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-item {
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.timeline-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.timeline-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.timeline-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.timeline-item-date {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.timeline-item-desc {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.35;
}

/* Recent Results */
.recent-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.recent-result-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.res-item-left {
    flex: 1;
    min-width: 0;
}

.res-test-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.res-test-meta {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

.res-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.res-val-num {
    font-size: 13px;
    font-weight: 700;
}

.res-val-num.val-high {
    color: #b45309;
}

.res-val-num.val-normal {
    color: #0f766e;
}

/* Documents */
.docs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-item-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.doc-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.doc-svg-icon {
    width: 16px;
    height: 16px;
    color: #64748b;
    flex-shrink: 0;
    margin-top: 2px;
}

.doc-info-col {
    flex: 1;
    min-width: 0;
}

.doc-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.doc-meta {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}

/* Chart Responsive */
@media (max-width: 1080px) {
    .chart-main-grid {
        grid-template-columns: 1fr;
    }

    .chart-vitals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .chart-patient-card {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-pat-actions {
        width: 100%;
    }

    .btn-chart-outline,
    .btn-chart-primary {
        flex: 1;
        text-align: center;
    }

    .chart-vitals-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .med-item-row,
    .problem-item-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   TELE-CONSULTATION PAGE
   ========================================================= */

.tele-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tele-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.tele-page-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.btn-tele-device-test {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: #0f172a !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-tele-device-test:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

/* 2-Column Grid */
.tele-layout-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 20px;
    align-items: start;
}

.tele-col-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tele-col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Video Stage */
.tele-video-stage {
    background: #1e2d2a;
    border-radius: 14px;
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.tele-stage-badges {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.tele-badge-connected {
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3.5px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.tele-pulse-dot {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    animation: telePulse 1.5s infinite;
}

@keyframes telePulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.tele-badge-quality {
    background: #e6f4ea;
    color: #0d652d;
    font-size: 11px;
    font-weight: 600;
    padding: 3.5px 10px;
    border-radius: 20px;
}

.tele-patient-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.tele-avatar-patient {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #39524c;
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 12px;
}

.tele-pat-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.tele-pat-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.tele-pip-box {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 110px;
    height: 80px;
    background: #39524c;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.tele-pip-label {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

/* Call Controls Bar */
.tele-controls-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 4px;
}

.tele-ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1e2d2a;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tele-ctrl-btn:hover {
    background: #2b3f3b;
    transform: translateY(-1px);
}

.tele-ctrl-btn.active {
    background: #1e2d2a;
}

.tele-ctrl-btn.muted,
.tele-ctrl-btn.off {
    background: #475569;
    color: #cbd5e1;
}

.tele-ctrl-btn.tele-ctrl-end {
    background: #b1251f;
}

.tele-ctrl-btn.tele-ctrl-end:hover {
    background: #8e1c17;
    transform: translateY(-1px);
}

.tele-ctrl-svg {
    width: 18px;
    height: 18px;
}

/* During the call card */
.tele-during-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
}

.tele-during-card .dash-card-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.tele-during-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

a.btn-during-action,
button.btn-during-action,
.btn-during-action {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: #0f172a !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    display: inline-flex;
    align-items: center;
}

a.btn-during-action:hover,
button.btn-during-action:hover,
.btn-during-action:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* Right Column Cards */
.tele-pat-card,
.tele-checklist-card,
.tele-waiting-card,
.tele-chat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
}

.tele-pat-top-info {
    margin-bottom: 16px;
}

.tele-patient-name-h {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.tele-pat-demographics {
    font-size: 12.5px;
    font-weight: 400;
    color: #64748b;
    margin-left: 4px;
}

.tele-pat-reason {
    font-size: 12px;
    color: #475569;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.tele-pat-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.badge-tele-med {
    background: #e0f2fe;
    color: #0369a1;
}

.tele-vitals-heading {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 10px 0;
}

.tele-vitals-table {
    display: flex;
    flex-direction: column;
}

.tele-vitals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12.5px;
}

.tele-vitals-row:last-child {
    border-bottom: none;
}

.tele-vitals-label {
    color: #64748b;
}

.tele-vitals-val {
    font-weight: 600;
    color: #0f172a;
}

/* Checklist */
.tele-checklist-body {
    display: flex;
    flex-direction: column;
}

.tele-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.tele-check-item:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.tele-check-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tele-check-icon.icon-success {
    background: #e6f4ea;
    color: #16a34a;
}

.tele-check-icon.icon-warning {
    background: #fef3c7;
    color: #d97706;
}

.tele-check-icon svg {
    width: 13px;
    height: 13px;
}

.tele-check-text {
    font-size: 12.5px;
    color: #334155;
    font-weight: 500;
}

/* Waiting room */
.tele-waiting-body {
    display: flex;
    flex-direction: column;
}

.tele-wait-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.tele-wait-item:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.tele-wait-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tele-wait-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
}

.tele-wait-sub {
    font-size: 11.5px;
    color: #64748b;
}

.badge-waiting-state {
    background: #fef3c7;
    color: #b45309;
}

.badge-booked-state {
    background: #e0f2fe;
    color: #0369a1;
}

/* Call chat */
.tele-chat-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tele-chat-stream {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
}

.chat-msg {
    display: flex;
    width: 100%;
}

.chat-msg-incoming {
    justify-content: flex-start;
}

.chat-msg-outgoing {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.4;
}

.chat-msg-incoming .chat-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.chat-msg-outgoing .chat-bubble {
    background: #e0f2fe;
    color: #0f172a;
    border-bottom-right-radius: 4px;
}

.tele-chat-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tele-chat-input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    font-size: 12.5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s;
    background: #ffffff;
    color: #0f172a;
}

.tele-chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.tele-chat-send-btn {
    height: 36px;
    padding: 0 16px;
    background: #1e293b;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.tele-chat-send-btn:hover {
    background: #0f172a;
}

/* Responsiveness */
@media (max-width: 1080px) {
    .tele-layout-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   MESSAGES PAGE
   ========================================================= */

.msg-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.msg-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.msg-page-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.msg-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.msg-filter-pill {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #166534;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.msg-filter-dot {
    width: 6px;
    height: 6px;
    background: #16a34a;
    border-radius: 50%;
}

.btn-msg-outline {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7.5px 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: #0f172a !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-msg-outline:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
}

.btn-msg-primary {
    background: #1e293b;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 7.5px 18px;
    font-size: 12.5px;
    font-weight: 600;
    color: #ffffff !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-msg-primary:hover {
    background: #0f172a !important;
}

/* 3-Column Layout */
.msg-layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr 260px;
    gap: 18px;
    align-items: start;
}

.msg-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Conversations List */
.msg-conversations-card {
    padding: 12px 0;
    overflow: hidden;
}

.msg-search-wrap {
    padding: 0 12px 10px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.msg-search-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    font-size: 12.5px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.msg-search-input:focus {
    border-color: #3b82f6;
    background: #ffffff;
}

.msg-threads-list {
    display: flex;
    flex-direction: column;
}

.msg-thread-item {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.msg-thread-item:hover {
    background: #f8fafc;
}

.msg-thread-item.active {
    background: #f0f7ff;
    border-left-color: #1e3a5f;
}

.msg-thread-info {
    flex: 1;
    min-width: 0;
}

.msg-thread-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
}

.msg-thread-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-thread-time {
    font-size: 11px;
    color: #94a3b8;
    margin-left: 6px;
    flex-shrink: 0;
}

.msg-thread-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-thread-snippet {
    font-size: 11.5px;
    color: #64748b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-unread-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    color: #ffffff;
    flex-shrink: 0;
    margin-left: 6px;
}

.msg-unread-badge.badge-red {
    background: #dc2626;
}

.msg-unread-badge.badge-blue {
    background: #2563eb;
}

/* Avatars */
.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-ms { background: #fee2e2; color: #991b1b; }
.avatar-am { background: #e0f2fe; color: #0369a1; }
.avatar-ot { background: #e6f4ea; color: #065f46; }
.avatar-w2 { background: #fef3c7; color: #b45309; }
.avatar-gs { background: #f1f5f9; color: #475569; }
.avatar-av { background: #d1fae5; color: #065f46; }
.avatar-mr { background: #e0f2fe; color: #0369a1; }
.avatar-sj { background: #fef3c7; color: #b45309; }

/* Center Chat */
.msg-chat-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
}

.msg-chat-header {
    margin-bottom: 12px;
}

.msg-chat-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px 0;
}

.msg-chat-participants {
    font-size: 11.5px;
    color: #64748b;
    margin: 0;
}

.msg-chat-banner {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 11.5px;
    color: #1d4ed8;
    margin-bottom: 14px;
    line-height: 1.4;
}

.msg-chat-stream {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 260px;
    max-height: 380px;
    overflow-y: auto;
    padding: 4px 2px 14px 2px;
}

.msg-post {
    display: flex;
    flex-direction: column;
    max-width: 82%;
}

.msg-post.incoming {
    align-self: flex-start;
}

.msg-post.outgoing {
    align-self: flex-end;
    align-items: flex-end;
}

.msg-meta-header {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.msg-post-bubble {
    padding: 9px 14px;
    font-size: 12.5px;
    line-height: 1.45;
}

.msg-post.incoming .msg-post-bubble {
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 12px;
    border-top-left-radius: 4px;
}

.msg-post.outgoing .msg-post-bubble {
    background: #1e3a5f;
    color: #ffffff;
    border-radius: 12px;
    border-top-right-radius: 4px;
}

.msg-attach-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 320px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    align-self: flex-start;
}

.msg-attach-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #334155;
    font-weight: 500;
}

.msg-attach-critical {
    color: #dc2626;
    font-weight: 700;
}

.msg-attach-link {
    color: #2563eb;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
}

.msg-attach-link:hover {
    text-decoration: underline;
}

/* Quick chips */
.msg-quick-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 10px 0;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.msg-quick-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 11.5px;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}

.msg-quick-chip:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* Chat Input Form */
.msg-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-chat-input {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    font-size: 12.5px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s;
    background: #ffffff;
    color: #0f172a;
}

.msg-chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.btn-msg-clip {
    width: 38px;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-msg-clip:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #94a3b8;
}

.clip-svg {
    width: 16px;
    height: 16px;
}

.btn-msg-send {
    height: 38px;
    padding: 0 18px;
    background: #1e293b;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-msg-send:hover {
    background: #0f172a;
}

/* Right Context Cards */
.msg-context-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg-side-card {
    padding: 14px 16px;
}

.msg-side-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.msg-side-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.msg-pat-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px 0;
}

.msg-pat-age {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

.msg-pat-desc {
    font-size: 11.5px;
    color: #475569;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.badge-critical-potassium {
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
}

.msg-pat-link-wrap {
    margin-top: 10px;
}

.msg-link-patient {
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.msg-link-patient:hover {
    text-decoration: underline;
}

.msg-people-list,
.msg-files-list {
    display: flex;
    flex-direction: column;
}

.msg-person-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
}

.msg-person-row:last-child {
    border-bottom: none;
}

.msg-person-name {
    font-size: 12.5px;
    color: #0f172a;
    display: block;
}

.msg-person-role {
    font-size: 11px;
    color: #64748b;
    display: block;
}

.msg-file-row {
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
}

.msg-file-row:last-child {
    border-bottom: none;
}

.msg-file-name {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    display: block;
}

.msg-file-meta {
    font-size: 11px;
    color: #64748b;
    display: block;
}

/* Responsiveness */
@media (max-width: 1200px) {
    .msg-layout-grid {
        grid-template-columns: 260px 1fr;
    }

    .msg-context-col {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (max-width: 820px) {
    .msg-layout-grid {
        grid-template-columns: 1fr;
    }

    .msg-context-col {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   CONSULTATION HUB
   ========================================================= */

.consult-hub-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.consult-hub-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.consult-hub-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.consult-hub-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
    font-weight: 400;
}

.consult-hub-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 9999px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 500;
    color: #166534;
    white-space: nowrap;
    flex-shrink: 0;
}

.consult-hub-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a34a;
    flex-shrink: 0;
}

.consult-hub-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.consult-hub-search-input {
    flex: 1;
    height: 42px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.consult-hub-search-input:focus {
    border-color: #1e304f;
    box-shadow: 0 0 0 3px rgba(30, 48, 79, 0.1);
}

.btn-consult-hub-search {
    height: 42px;
    padding: 0 24px;
    background: #1e304f;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.btn-consult-hub-search:hover {
    background: #152238;
}

.consult-search-result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    gap: 16px;
}

.consult-result-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.consult-result-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.consult-result-meta {
    font-size: 13px;
    color: #64748b;
}

.consult-hub-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.consult-hub-card-header {
    padding: 14px 20px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.consult-header-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.consult-hub-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.consult-hub-count {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.consult-hub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    gap: 16px;
}

.consult-hub-row:last-child {
    border-bottom: none;
}

.consult-hub-row:hover {
    background: #f8fafc;
}

.consult-hub-row-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.consult-hub-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.consult-avatar-blue {
    background: #e0eaf8;
    color: #1e40af;
}

.consult-avatar-amber {
    background: #fef3c7;
    color: #92400e;
}

.consult-hub-row-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.consult-hub-patient-name {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.consult-hub-patient-meta {
    font-size: 12.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.consult-name-with-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.consult-badge-next {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    line-height: 1.2;
}

.consult-queue-token {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    width: 42px;
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.consult-hub-row-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.consult-time-pill {
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 9999px;
    border: 1px solid #dbeafe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.consult-queue-time {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    min-width: 55px;
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.btn-hub-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1e304f;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s, transform 0.1s;
    min-width: 72px;
}

.btn-hub-primary:hover {
    background: #152238;
    color: #ffffff !important;
}

.btn-hub-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1e304f !important;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 18px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.15s;
    min-width: 72px;
}

.btn-hub-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a !important;
}

@media (max-width: 768px) {
    .consult-hub-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .consult-hub-search-box {
        flex-direction: column;
    }
    .btn-consult-hub-search {
        width: 100%;
    }
    .consult-search-result-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .consult-search-result-card .btn-hub-outline {
        align-self: flex-start;
    }
    .consult-hub-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .consult-hub-row-right {
        width: 100%;
        justify-content: space-between;
    }
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.portal-content {
    flex: 1;
    width: calc(100% - 225px);
    margin-left: 225px;
    min-width: 0;
    max-width: none;
    padding: 24px clamp(16px, 2.5vw, 32px);
    overflow-x: hidden;
    box-sizing: border-box;
    min-height: calc(100vh - 60px);
}


/* =========================================================
   PAGE
   ========================================================= */

.portal-page {
    display: none;

    width: 100%;
}

.portal-page.active {
    display: block;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;

    color: #182230;

    font-size: 22px;
    font-weight: 600;
}

.page-header p {
    margin: 5px 0 0;

    color: #777;

    font-size: 13px;
}


/* =========================================================
   PATIENT DETAIL
   ========================================================= */

.patient-detail-card {
    padding: 0 28px 28px;

    margin-bottom: 24px;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.patient-detail-header {
    display: flex;
    align-items: center;

    gap: 18px;

    margin: 0 -28px;
    padding: 24px 28px;

    background: linear-gradient(
        120deg,
        #f1f7fd 0%,
        #ffffff 72%
    );

    border-bottom: 1px solid #edf0f3;
}

.patient-detail-avatar,
.patient-detail-avatar-fallback {
    width: 78px;
    height: 78px;
    min-width: 78px;

    border-radius: 50%;
}

.patient-detail-avatar {
    object-fit: cover;
}

.patient-detail-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;

    background: #eaf3ff;

    color: #0f4c81;

    font-size: 30px;
    font-weight: 600;
}

.patient-detail-name {
    flex: 1;
    min-width: 0;
}

.patient-detail-name h3 {
    margin: 0 0 5px;

    color: #182230;

    font-size: 22px;
    font-weight: 600;
}

.patient-detail-name > span:last-child {
    color: #788493;

    font-size: 12px;
}

.patient-detail-header .profile-status {
    margin-left: auto;
}

.portal-detail-section {
    margin-top: 26px;
}

.portal-detail-section .page-header {
    margin-bottom: 18px;
}


/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-cards {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}

.dashboard-card {
    display: flex;
    align-items: center;

    gap: 15px;

    padding: 20px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.dashboard-card:hover {
    text-decoration: none;

    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(15, 76, 129, 0.10);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;
    min-width: 44px;

    border-radius: 10px;

    font-size: 25px;
}

.card-icon-blue {
    background: #eaf3ff;
}

.card-icon-amber {
    background: #fff4df;
}

.card-icon-green {
    background: #e8f7ef;
}

.card-icon-red {
    background: #ffeded;
}

.card-title {
    color: #777;

    font-size: 13px;
}

.card-number {
    margin-top: 3px;

    font-size: 24px;
    font-weight: 600;
}

.card-caption {
    margin-top: 5px;

    color: #999;

    font-size: 11px;
}

.dashboard-eyebrow {
    display: block;

    margin-bottom: 7px;

    color: #0f4c81;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

.dashboard-primary-action {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    padding: 10px 14px;

    border-radius: 7px;

    background: #0f4c81;
    color: #ffffff;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;
}

.dashboard-primary-action:hover {
    background: #0b3b65;

    color: #ffffff;

    text-decoration: none;
}

.dashboard-lower-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(0, 0.9fr);

    gap: 18px;

    margin-top: 22px;
}

.dashboard-focus-panel,
.dashboard-activity-panel {
    min-height: 220px;

    padding: 22px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.dashboard-focus-panel {
    background: linear-gradient(
        135deg,
        #f4f9ff 0%,
        #ffffff 72%
    );
}

.dashboard-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;
}

.dashboard-panel-heading h3 {
    margin: 0;

    color: #182230;

    font-size: 17px;
}

.dashboard-panel-heading .dashboard-eyebrow {
    margin-bottom: 5px;
}

.dashboard-panel-mark {
    color: #0f4c81;

    font-size: 24px;
}

.dashboard-focus-panel > p {
    max-width: 520px;

    margin: 18px 0 20px;

    color: #647080;

    font-size: 13px;

    line-height: 1.6;
}

.dashboard-shortcuts {
    display: flex;
    flex-wrap: wrap;

    gap: 10px 22px;
}

.dashboard-shortcuts a {
    color: #0f4c81;

    font-size: 12px;
    font-weight: 600;
}

.dashboard-shortcuts a span {
    margin-left: 5px;
}

.dashboard-tool-list {
    margin-top: 14px;
}

.dashboard-tool-list > a {
    display: grid;

    grid-template-columns:
        28px
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 10px;

    padding: 11px 0;

    border-bottom: 1px solid #f0f0f0;

    color: #263342;

    text-decoration: none;
}

.dashboard-tool-list > a:last-child {
    border-bottom: none;
}

.dashboard-tool-list > a:hover {
    color: #0f4c81;

    text-decoration: none;
}

.dashboard-tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    border-radius: 7px;

    background: #edf4fb;

    color: #0f4c81;
}

.dashboard-tool-list strong,
.dashboard-tool-list small {
    display: block;
}

.dashboard-tool-list strong {
    font-size: 12px;
}

.dashboard-tool-list small {
    margin-top: 2px;

    color: #999;

    font-size: 11px;
}

.dashboard-tool-list > a > span:last-child {
    margin-left: 5px;
}


/* =========================================================
   APPOINTMENT TABS
   ========================================================= */

.appointment-tabs {
    display: flex;

    gap: 25px;

    margin-bottom: 22px;

    border-bottom: 1px solid #e5e7eb;
}

.appointment-tab {
    padding: 10px 5px;

    background: none;

    border: none;

    color: #777;

    font-size: 14px;

    cursor: pointer;
}

.appointment-tab.active {
    color: #111;

    font-weight: 600;

    border-bottom: 2px solid #222;
}

.appointment-tab-panel {
    display: none;
}

.appointment-tab-panel.active {
    display: block;
}


/* =========================================================
   BOOK BUTTON
   ========================================================= */

.book-button {
    padding: 8px 14px;

    background: #111111;
    color: #ffffff;

    border: none;
    border-radius: 7px;

    font-size: 13px;

    cursor: pointer;

    white-space: nowrap;
}

.book-button:hover {
    background: #222222;
}


/* =========================================================
   APPOINTMENTS
   ========================================================= */

.appointment-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}

.appointment-card {
    min-width: 0;
    min-height: 135px;

    padding: 16px;

    background: #ffffff;

    border: 1px solid #e2e2e2;
    border-radius: 9px;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.06);
}

.appointment-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;
}

.appointment-id {
    min-width: 0;

    overflow: hidden;

    color: #999;

    font-size: 11px;

    text-overflow: ellipsis;
}

.appointment-card h4 {
    margin: 10px 0;

    overflow: hidden;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.appointment-info {
    margin-top: 5px;

    color: #777;

    font-size: 11px;
}


/* =========================================================
   STATUS
   ========================================================= */

.status {
    padding: 2px 7px;

    border: 1px solid #dddddd;
    border-radius: 8px;

    font-size: 10px;

    white-space: nowrap;
}

.status.confirmed {
    color: #2d9c62;

    border-color: #a9dfc2;

    background: #f2fff7;
}

.status.no-show {
    color: #666666;

    background: #f8f8f8;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    margin-top: 20px;

    padding: 40px;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    color: #888888;

    text-align: center;
}


/* =========================================================
   PATIENTS
   ========================================================= */

.patients-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(250px, 1fr));

    gap: 18px;
}

.patient-card {
    padding: 18px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.05);
}

.patient-card-header {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 18px;
}

.patient-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    min-width: 42px;

    border-radius: 50%;

    background: #f0f0f0;

    font-size: 17px;
    font-weight: 600;
}

.patient-card h4 {
    margin: 0;

    font-size: 15px;
    font-weight: 600;
}

.patient-id {
    display: block;

    margin-top: 3px;

    color: #999;

    font-size: 11px;
}

.patient-details {
    display: flex;
    flex-direction: column;

    gap: 8px;

    color: #555;

    font-size: 12px;
}

.patient-details > div {
    display: flex;
    justify-content: space-between;

    gap: 10px;
}

.detail-label {
    color: #999;
}

.patient-actions {
    margin-top: 18px;
    padding-top: 12px;

    border-top: 1px solid #eeeeee;
}


/* =========================================================
   PROFILE
   ========================================================= */

.profile-card {
    width: 100%;
    max-width: 900px;

    overflow: hidden;

    padding: 0 28px 28px;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.05);
}

.profile-header {
    display: flex;
    align-items: center;

    gap: 18px;

    min-height: 144px;

    margin: 0 -28px;
    padding: 28px;

    background: linear-gradient(
        120deg,
        #f1f7fd 0%,
        #ffffff 72%
    );

    position: relative;
}

.profile-header > div {
    min-width: 0;
}

.profile-header h4 {
    margin: 0;

    font-size: 18px;
}

.profile-eyebrow {
    display: block;

    margin-bottom: 5px;

    color: #0f4c81;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 6px 14px;

    margin-top: 6px;

    color: #788493;

    font-size: 11px;
}

.profile-meta span + span {
    position: relative;
}

.profile-meta span + span::before {
    content: "";

    position: absolute;

    left: -8px;
    top: 50%;

    width: 3px;
    height: 3px;

    border-radius: 50%;

    background: #aab4bf;

    transform: translateY(-50%);
}

.profile-status {
    display: inline-flex;
    align-items: center;

    gap: 6px;

    margin-left: auto;

    padding: 6px 9px;

    border: 1px solid #b8e2c9;
    border-radius: 999px;

    background: #f1fff6;

    color: #287346;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}

.profile-status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #35a463;
}

.profile-status.disabled {
    border-color: #e6c2c2;

    background: #fff6f6;

    color: #9a4242;
}

.profile-status.disabled .profile-status-dot {
    background: #bd5a5a;
}

.profile-image-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    margin-left: auto;
}

.profile-image-input {
    display: none;
}

.profile-image-button {
    padding: 7px 10px;

    border: 1px solid #cdddeb;
    border-radius: 6px;

    background: #ffffff;
    color: #0f4c81;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}

.profile-image-button:hover {
    background: #f1f7fd;
}

.profile-image-status {
    color: #6b7785;

    font-size: 10px;
}

.profile-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 15px;

    margin-top: 26px;
    padding-bottom: 12px;

    border-bottom: 1px solid #edf0f3;
}

.profile-section-heading .dashboard-eyebrow {
    margin-bottom: 3px;
}

.profile-section-heading h3 {
    margin: 0;

    color: #1c2937;

    font-size: 16px;
}

.profile-section-mark {
    color: #0f4c81;

    font-size: 20px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;

    border-radius: 50%;

    object-fit: cover;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;
    min-width: 64px;

    border-radius: 50%;

    background: #f0f0f0;

    font-size: 24px;
    font-weight: 600;
}

.profile-details {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 0 24px;

    margin-top: 8px;
}

.profile-detail-row {
    display: flex;
    flex-direction: column;

    gap: 4px;

    min-width: 0;

    padding: 11px 0;

    border-bottom: 1px solid #f0f0f0;

    font-size: 13px;

    overflow-wrap: anywhere;
}

.profile-detail-full {
    align-items: flex-start;
}

.profile-detail-full .detail-label {
    min-width: 180px;
}


/* =========================================================
   LAB ORDER DETAIL
   ========================================================= */

.lab-order-detail-card {
    padding: 0 28px 28px;

    margin-bottom: 24px;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.lab-order-detail-header {
    display: flex;
    align-items: center;

    gap: 18px;

    margin: 0 -28px;
    padding: 24px 28px;

    background: linear-gradient(
        120deg,
        #f1f7fd 0%,
        #ffffff 75%
    );

    border-bottom: 1px solid #edf0f3;
}

.lab-order-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;
    min-width: 64px;

    border-radius: 14px;

    background: #eaf3ff;

    font-size: 30px;
}

.lab-order-title {
    flex: 1;
    min-width: 0;
}

.lab-order-title h3 {
    margin: 4px 0 8px;

    color: #182230;

    font-size: 22px;
    font-weight: 600;
}

.lab-order-title .status {
    display: inline-flex;
}


/* =========================================================
   DIAGNOSTIC ORDER DETAIL
   ========================================================= */

.diagnostic-detail-card {
    padding: 0 28px 28px;

    margin-bottom: 24px;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.diagnostic-detail-header {
    display: flex;
    align-items: center;

    gap: 18px;

    margin: 0 -28px;
    padding: 24px 28px;

    background: linear-gradient(
        120deg,
        #f1f7fd 0%,
        #ffffff 75%
    );

    border-bottom: 1px solid #edf0f3;
}

.diagnostic-order-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;
    min-width: 64px;

    border-radius: 14px;

    background: #eaf3ff;

    font-size: 30px;
}

.diagnostic-order-title {
    flex: 1;
    min-width: 0;
}

.diagnostic-order-title h3 {
    margin: 4px 0 8px;

    color: #182230;

    font-size: 22px;
    font-weight: 600;
}

.diagnostic-order-title .status {
    display: inline-flex;
}


/* =========================================================
   PATIENT SUMMARY
   ========================================================= */

.patient-summary {
    display: flex;
    align-items: center;

    gap: 16px;

    margin: 0 -28px;
    padding: 20px 28px;

    border-bottom: 1px solid #e5e7eb;
}

.patient-summary-info {
    flex: 1;
    min-width: 0;
}

.patient-summary-info h3 {
    margin: 0 0 4px;

    font-size: 18px;
    font-weight: 600;
}

.patient-summary-info span {
    color: #788493;

    font-size: 12px;
}

.portal-detail-actions {
    display: flex;
    justify-content: flex-start;

    margin-top: 20px;
}


/* =========================================================
   REPORTS
   ========================================================= */

.report-period {
    padding: 7px 12px;

    border: 1px solid #e5e7eb;
    border-radius: 6px;

    color: #666;

    font-size: 12px;
}

.report-summary-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}

.report-summary-card,
.report-panel {
    background: #ffffff;

    border: 1px solid #e2e2e2;
    border-radius: 9px;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.04);
}

.report-summary-card {
    display: flex;
    flex-direction: column;

    gap: 5px;

    padding: 18px;
}

.report-summary-label {
    color: #666;

    font-size: 12px;
}

.report-summary-card strong {
    color: #111;

    font-size: 27px;
    line-height: 1.1;
}

.report-summary-note {
    color: #999;

    font-size: 11px;
}

.report-detail-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-top: 18px;
}

.report-panel-header {
    padding: 18px 20px;

    border-bottom: 1px solid #eeeeee;
}

.report-panel-header h3,
.report-note h3 {
    margin: 0;

    font-size: 15px;
}

.report-panel-header p,
.report-note p {
    margin: 5px 0 0;

    color: #888;

    font-size: 12px;
}

.report-metric-list {
    padding: 4px 20px 10px;
}

.report-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 12px 0;

    border-bottom: 1px solid #f0f0f0;

    color: #555;

    font-size: 13px;
}

.report-metric-row:last-child {
    border-bottom: none;
}

.report-metric-row strong {
    color: #111;
}

.report-note {
    margin-top: 18px;

    padding: 18px 20px;
}


/* =========================================================
   MY AVAILABILITY
   ========================================================= */

.availability-summary {
    margin-bottom: 28px;
}

.availability-summary .dashboard-card {
    cursor: default;
}

.availability-section {
    margin-top: 20px;
}

.availability-schedule-card {
    margin-bottom: 24px;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.availability-schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 22px 24px;

    background: linear-gradient(
        120deg,
        #f1f7fd 0%,
        #ffffff 75%
    );

    border-bottom: 1px solid #e5e7eb;
}

.availability-schedule-header h3 {
    margin: 4px 0 6px;

    color: #182230;

    font-size: 19px;
    font-weight: 600;
}

.availability-service-unit {
    color: #687586;

    font-size: 13px;
}

.availability-active-badge {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 6px 10px;

    border: 1px solid #b7ebc6;
    border-radius: 999px;

    background: #ecfdf3;

    color: #18794e;

    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
}

.availability-status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #22c55e;
}

.availability-table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.availability-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 13px;
}

.availability-table th {
    padding: 13px 18px;

    background: #f8fafc;

    border-bottom: 1px solid #e5e7eb;

    color: #687586;

    font-size: 11px;
    font-weight: 600;

    text-align: left;

    text-transform: uppercase;
}

.availability-table td {
    padding: 15px 18px;

    border-bottom: 1px solid #eef1f4;

    color: #334155;
}

.availability-table tbody tr:last-child td {
    border-bottom: none;
}

.availability-table tbody tr:hover {
    background: #fafcff;
}

.availability-time {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    color: #0f4c81;

    font-weight: 500;
}

.availability-empty {
    padding: 60px 20px;

    text-align: center;
}

.availability-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;

    margin: 0 auto 15px;

    border-radius: 50%;

    background: #eef5fb;

    color: #0f4c81;

    font-size: 25px;
}

.availability-empty h3 {
    margin: 0 0 6px;
}

.availability-empty p {
    margin: 0;

    color: #788493;
}

.availability-info-card {
    display: flex;
    align-items: flex-start;

    gap: 14px;

    margin-top: 25px;
    padding: 18px 20px;

    border: 1px solid #dce8f3;
    border-radius: 10px;

    background: #f5f9fd;
}

.availability-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    min-width: 30px;

    border-radius: 50%;

    background: #e3f0fb;

    color: #0f4c81;

    font-weight: 700;
}

.availability-info-card strong {
    display: block;

    margin-bottom: 4px;

    color: #26384a;
}

.availability-info-card p {
    margin: 0;

    color: #687586;

    font-size: 13px;

    line-height: 1.6;
}


/* =========================================================
   RESPONSIVE - TABLET / SMALL DESKTOP
   ========================================================= */

@media (max-width: 1200px) {
    .dash-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .appointment-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .dashboard-cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .report-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .patients-grid {
        grid-template-columns:
            repeat(2, minmax(250px, 1fr));
    }
}

@media (max-width: 1080px) {
    .dash-main-grid,
    .schedule-main-grid,
    .patients-main-grid,
    .consult-main-grid {
        grid-template-columns: 1fr !important;
    }
}


/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 900px) {

    .portal-sidebar {
        width: 70px !important;
        min-width: 70px !important;
        padding: 16px 8px !important;
    }

    .portal-content {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
        padding: 20px 16px !important;
    }

    .portal-menu-item {
        justify-content: center !important;
        padding: 9px 0 !important;
        position: relative;
    }

    .portal-menu-item span:last-child,
    .menu-label {
        display: none !important;
    }

    .sidebar-badge {
        position: absolute;
        top: 4px;
        right: 8px;
        width: 15px;
        height: 15px;
        font-size: 9.5px;
        margin-left: 0;
    }

    .sidebar-logout-card {
        padding: 8px !important;
        justify-content: center !important;
    }

    .logout-info-box,
    .logout-arrow-box {
        display: none !important;
    }

    .appointment-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-lower-grid {
        grid-template-columns: 1fr;
    }

    .report-detail-grid {
        grid-template-columns: 1fr;
    }

    .profile-card {
        max-width: 100%;
    }
}


/* =========================================================
   RESPONSIVE - MEDIUM MOBILE & TABLET PORTRAIT
   ========================================================= */

@media (max-width: 768px) {

    .navbar-search-box {
        max-width: 220px;
    }

    .brand-subtitle {
        display: none;
    }

    .dash-critical-alert {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dash-alert-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .dash-welcome-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dash-header-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .consult-form-grid-2 {
        grid-template-columns: 1fr !important;
    }

    .consult-patient-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .consult-patient-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .consult-draft-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .draft-bar-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-draft-secondary,
    .btn-draft-primary {
        flex: 1;
        text-align: center;
    }

    .cal-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .cal-view-group {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .btn-cal-view {
        flex: 1;
        text-align: center;
    }

    .filter-pills-row {
        flex-wrap: wrap;
    }
}


/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .portal-body {
        min-height: auto;
    }

    .portal-content {
        padding: 18px 14px !important;
    }

    .page-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .appointment-grid {
        grid-template-columns: 1fr;
    }

    .patients-grid {
        grid-template-columns: 1fr;
    }

    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .availability-schedule-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .availability-table {
        min-width: 650px;
    }

    .patient-summary {
        align-items: flex-start;

        flex-wrap: wrap;
    }

    .patient-detail-header {
        align-items: flex-start;

        flex-wrap: wrap;
    }

    .patient-detail-header .profile-status {
        margin-left: 0;
    }

    .profile-header {
        align-items: flex-start;

        flex-wrap: wrap;
    }

    .profile-status {
        margin-left: 0;
    }

    .profile-image-actions {
        margin-left: 0;
    }

    .profile-detail-full {
        flex-direction: column;

        gap: 6px;
    }

    .profile-detail-full .detail-label {
        min-width: auto;
    }

    .lab-order-detail-header,
    .diagnostic-detail-header {
        align-items: flex-start;
    }

    .lab-order-detail-header,
    .diagnostic-detail-header {
        flex-wrap: wrap;
    }
}


/* =========================================================
   RESPONSIVE - SMALL MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .portal-sidebar {
        width: 58px !important;
        min-width: 58px !important;
        padding: 12px 5px !important;
    }

    .portal-content {
        margin-left: 58px !important;
        width: calc(100% - 58px) !important;
        padding: 14px 10px !important;
    }

    .navbar-search-box {
        display: none !important;
    }

    .practitioner-doctor-meta .practitioner-nav-sub {
        display: none;
    }

    .practitioner-nav-name {
        font-size: 13px;
    }

    .navbar-notif-btn {
        display: none;
    }

    .dash-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .portal-menu {
        gap: 4px;
    }

    .portal-menu-item {
        min-height: 38px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .dashboard-lower-grid {
        gap: 14px;
    }

    .dashboard-focus-panel,
    .dashboard-activity-panel {
        padding: 18px;
    }

    .profile-card,
    .patient-detail-card,
    .lab-order-detail-card,
    .diagnostic-detail-card {
        padding: 0 18px 20px;
    }

    .profile-header,
    .patient-detail-header,
    .lab-order-detail-header,
    .diagnostic-detail-header,
    .patient-summary {
        margin: 0 -18px;

        padding: 22px 18px;
    }

    .patient-detail-name h3 {
        font-size: 19px;
    }

    .patient-detail-avatar,
    .patient-detail-avatar-fallback {
        width: 64px;
        height: 64px;
        min-width: 64px;
    }

    .availability-schedule-header {
        padding: 18px;
    }
}
@media print {
    .portal-sidebar {
        display: none;
    }
    .practitioner-portal {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    .portal-content {
        padding: 0;
    }
    .portal-page {
        display: block !important;
    }
}