/* HC Project identity. Loaded after the existing component/layout stylesheet. */
@font-face { font-family: Poppins; src: url('../fonts/poppins/Poppins-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url('../fonts/poppins/Poppins-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url('../fonts/poppins/Poppins-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url('../fonts/poppins/Poppins-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
    /* Deep blue lettering, clinical blue folder, cyan edge and ice-blue paper. */
    --hc-blue-900: #13366F;
    --hc-blue-700: #2355A0;
    --hc-blue-500: #3874BB;
    --hc-cyan-400: #72C6DF;
    --hc-cyan-200: #D9F1F8;
    --bg-app: #F3F6FA;
    --bg-surface: #FFFFFF;
    --bg-glass: rgba(246, 250, 255, .88);
    --text-primary: #293443;
    --text-secondary: #53647A;
    --text-muted: #607087;
    --border-soft: #DFE6EF;
    --border-glass: rgba(255, 255, 255, .85);
    --shadow-xs: 0 1px 3px rgba(28, 57, 96, .05);
    --shadow-sm: 0 4px 16px rgba(28, 57, 96, .06);
    --shadow-md: 0 10px 28px rgba(28, 57, 96, .10);
    --shadow-glass: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 32px rgba(28, 57, 96, .09);
    --shadow-lg: 0 16px 42px rgba(28, 57, 96, .16);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 16px;
    --blur-sm: 8px;
    --blur-md: 14px;
    --font-sans: Poppins, system-ui, sans-serif;
    --motion-fast: 150ms ease;
    --motion-med: 180ms ease;
    /* Compatibility aliases keep all existing components on one palette. */
    --primary-900: var(--hc-blue-900);
    --primary-800: #1B4787;
    --primary-700: var(--hc-blue-700);
    --primary-600: #2C63AC;
    --primary-500: var(--hc-blue-500);
    --primary-400: #589CCF;
    --primary-300: var(--hc-cyan-400);
    --primary-200: var(--hc-cyan-200);
    --primary-100: #EAF4FC;
    --background: var(--bg-app);
    --surface-base: var(--bg-app);
    --surface-shell: #EBF1F8;
    --surface-raised: var(--bg-surface);
    --surface-card: #FFFFFF;
    --surface-subtle: #F7F9FC;
    --surface-interactive: #EDF3FA;
    --surface-floating: #F9FBFE;
    --surface-input: #F9FBFD;
    --text-strong: var(--text-primary);
    --text-main: var(--text-primary);
    --text-soft: var(--text-muted);
    --border: var(--border-soft);
    --border-focus: var(--hc-blue-500);
    --shadow-soft: var(--shadow-sm);
    --radius: var(--radius-lg);
}

html, body { background: var(--bg-app); color: var(--text-primary); }
body { background: linear-gradient(180deg, #F7FAFD, var(--bg-app) 480px); font-family: var(--font-sans); }
body, button, input, select, textarea { font-family: var(--font-sans); letter-spacing: 0; }
h1, h2, h3, h4, h5, h6, .topbar h1, .dash-greeting h2 { letter-spacing: 0; font-weight: 600; }
.topbar h1 { font-size: 23px; }
.dash-greeting h2 { font-size: 24px; }
label, th, button, .btn-primary { font-weight: 500; }

/* Logo oficial: PNG transparente sin filtros, mezclas ni fondos; la superficie es del contenedor. */
.hc-logo { display: block; width: 100%; max-width: 100%; height: auto; object-fit: contain; background: none; border: 0; box-shadow: none; filter: none; mix-blend-mode: normal; opacity: 1; user-select: none; -webkit-user-drag: none; }
/* Misma altura expandido y colapsado: el menu no salta al alternar. */
.brand { min-height: 108px; padding: 14px; border-color: var(--border-soft); }
.brand-copy { display: flex; align-items: center; height: auto; min-width: 0; padding-left: 12px; } /* alineado con los iconos del menu */
.brand-copy .hc-logo { width: min(100%, 176px); }
.brand-mark { display: none; width: 40px; height: 40px; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.brand-mark .hc-logo { width: 40px; height: 40px; }
.sidebar { background: #EBF2FB; border-right: 1px solid #D9E4F0; box-shadow: 3px 0 18px rgba(28,57,96,.04); }
.sidebar-link { color: var(--text-secondary); font-weight: 500; }
.sidebar-link:hover { color: var(--hc-blue-900); background: #DFEAF7; transform: none; }
.sidebar-link.active { color: var(--hc-blue-900); background: #DBE9F9; box-shadow: inset 0 0 0 1px rgba(56,116,187,.12); font-weight: 500; }
.sidebar-link.active::before { background: var(--hc-blue-500); }
.sidebar-toggle, .sidebar-mobile-close { color: var(--hc-blue-900); }
.sidebar-toggle:hover, .sidebar-mobile-close:hover { color: var(--hc-blue-900); background: #DDE8F5; }
.sidebar-footer { border-color: var(--border-soft); }
.sidebar-link:focus-visible, .sidebar-toggle:focus-visible, .sidebar-mobile-close:focus-visible, .sidebar-open-button:focus-visible { outline-color: var(--hc-blue-700); }

/* Blur is restricted to chrome and floating surfaces; forms stay opaque. */
.topbar { background: #F6F9FD; border-color: var(--border-soft); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: var(--shadow-xs); }
.topbar-dropdown, .modal-card { background: #F9FBFE; border: 1px solid #D7E2EF; box-shadow: var(--shadow-glass); }
.modal-backdrop { background: rgba(24, 41, 65, .28); backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar-dropdown.open { animation: hcBrandDropdown 150ms ease both; }
@keyframes hcBrandDropdown { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
    .sidebar, .topbar { background: var(--bg-glass); backdrop-filter: blur(var(--blur-sm)); -webkit-backdrop-filter: blur(var(--blur-sm)); }
    .sidebar { background: rgba(233, 241, 252, .93); }
    .topbar-dropdown, .modal-card, .hc-login .auth-panel .auth-card { background: rgba(250,252,255,.94); backdrop-filter: blur(var(--blur-md)); -webkit-backdrop-filter: blur(var(--blur-md)); border-color: var(--border-glass); }
}

.card, .panel-card, .stat-card, .contenedor, .tabla-responsive, .patient-profile-card { background: var(--bg-surface); border-color: var(--border-soft); box-shadow: var(--shadow-sm); }
.clinical-workspace .clinical-top-strip, .clinical-workspace .clinical-header { background: #EDF4FC; border-color: #D7E5F5; }
.clinical-form, .clinical-tab-panel { background: var(--surface-subtle); }
.clinical-card, .clinical-workspace .clinical-card { background: #FFFFFF; box-shadow: var(--shadow-xs); }
.clinical-card:hover { transform: none; }
.clinical-tab.active, .clinical-workspace .clinical-tab.active { color: var(--hc-blue-900); background: #E5EFFC; border-color: #C8DDF4; }
.clinical-vitals-strip { background: #F3F8FD; border-color: #D8E5F2; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { background-color: var(--surface-input); color: var(--text-primary); border-color: #CDD8E5; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--hc-blue-500); outline: 2px solid rgba(56,116,187,.22); outline-offset: 1px; box-shadow: 0 0 0 3px rgba(114,198,223,.12); }
.btn-primary, button[type=submit], .quick-plus, .dash-action.is-primary { background: linear-gradient(180deg, #2C63AC, #2355A0); color: #FFFFFF; border-color: #2355A0; box-shadow: inset 0 1px 0 rgba(255,255,255,.16), var(--shadow-xs); }
.btn-primary:hover, button[type=submit]:hover, .quick-plus:hover, .dash-action.is-primary:hover { background: #1B4787; color: #FFFFFF; }
.btn-secondary, .btn-table, .dash-action:not(.is-primary) { background: #F6F9FE; color: var(--hc-blue-900); border-color: #D7E2EF; box-shadow: inset 0 1px 0 #FFFFFF, var(--shadow-xs); }
.btn-ghost { background: transparent; color: var(--hc-blue-700); }
.btn-table.danger, button.danger, .btn-danger { color: #973D49; background: #FFF1F2; border-color: #EACBD0; }
button:active, .btn-primary:active, .btn-secondary:active, .btn-table:active { transform: scale(.98); }
.sidebar-toggle:active { transform: none; }
html[data-sidebar-mode=collapsed] .sidebar-toggle:active { transform: rotate(180deg); }
.sidebar-link:active { transform: none; }

.dash-hero { background: #F8FBFF; box-shadow: inset 0 1px 0 #FFFFFF, var(--shadow-xs); border: 1px solid var(--border-soft); }
.metric-hero { background: #E4EFFB; color: var(--hc-blue-900); box-shadow: var(--shadow-sm); border: 1px solid #D3E3F6; }
.metric-hero-value, .metric-breakdown strong { color: var(--hc-blue-900); }
.metric-breakdown { border-color: #C8DBF0; }
.metric-breakdown li { color: #455F7F; }
.metric-hero-head .icon { color: var(--hc-blue-500); }
.metric-tile.is-attention { background: #FFF9EE; }
.row-completed, .row-completed td { background: #EDF0F4; color: #536070; }

/* A working login, not a marketing screen. Same routes and field names. */
.hc-login.auth-body { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 100dvh; padding: 32px 20px; background: linear-gradient(145deg, #F5F8FC, #E6EFF9); }
.hc-login .auth-panel { display: block; width: min(100%, 460px); padding: 0; background: transparent; }
.hc-login .auth-card { width: 100%; max-width: none; padding: 32px; border: 1px solid var(--border-glass); border-radius: var(--radius-xl); background: #F9FBFE; box-shadow: var(--shadow-glass); }
.auth-logo { display: block; width: min(100%, 280px); height: auto; background: none; border-radius: 0; box-shadow: none; margin: 0 auto 24px; }
.hc-login .auth-card h1 { font-size: 22px; margin: 0 0 24px; }
.hc-login .auth-card form { display: grid; gap: 8px; padding: 0; background: none; border: 0; box-shadow: none; }
.hc-login .auth-card p { font-size: 13px; color: var(--text-secondary); margin: 22px 0 0; }
.hc-login input { min-height: 46px; margin-bottom: 10px; }
.hc-login button { min-height: 46px; width: 100%; margin-top: 14px; }
.auth-visual { background: #E8F0FA; color: var(--text-primary); }
.auth-visual::before { display: none; }
.auth-visual h1 { color: var(--hc-blue-900); }
.auth-visual p { color: var(--text-secondary); }

@media (min-width: 701px) {
    html[data-sidebar-mode=collapsed] .brand { min-height: 108px; padding: 12px 8px; gap: 4px; }
    html[data-sidebar-mode=collapsed] .brand-mark { display: block; flex: 0 0 40px; }
    html[data-sidebar-mode=collapsed] .brand .sidebar-toggle { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
}
@media (max-width: 1024px) {
    .topbar, .sidebar { backdrop-filter: none; -webkit-backdrop-filter: none; }
    .topbar { background: #F6F9FD; }
    .sidebar { background: #EBF2FB; }
}
@media (max-width: 700px) {
    .brand-copy .hc-logo { width: min(100%, 160px); }
    .topbar h1, .dash-greeting h2 { font-size: 20px; }
    .topbar-dropdown { max-width: calc(100vw - 24px); }
    .hc-login .auth-card { padding: 24px; }
    .hc-login .auth-logo { margin-bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
    .topbar-dropdown.open { opacity: 1; transform: none; }
    button:active, .btn-primary:active, .btn-secondary:active, .btn-table:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .sidebar, .topbar, .topbar-dropdown, .modal-card, .hc-login .auth-panel .auth-card { background: #F6F9FD; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media print {
    .sidebar, .topbar { display: none; }
    body, .card, .clinical-card, .modal-card { background: #FFFFFF; box-shadow: none; backdrop-filter: none; }
}
