/* =====================================================================
   CareFlow Hospital Information System
   Clinical Design — Light & Dark Blue
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,500&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:          #1565a8;
    --primary-dark:     #0a3d6b;
    --primary-mid:      #1e88c7;
    --primary-light:    #e3f2fd;
    --primary-glow:     rgba(21, 101, 168, 0.2);
    --accent:           #42a5f5;
    --accent-dark:      #1976d2;
    --accent-light:     #e1f5fe;
    --sage:             #0288d1;
    --sage-light:       #b3e5fc;
    --surface:          #ffffff;
    --bg:               #f4f9fc;
    --bg-warm:          #eef6fb;
    --text:             #0d2137;
    --text-secondary:   #1a3a5c;
    --text-muted:       #5a7a9a;
    --border:           #d4e4f0;
    --border-light:     #e8f2f9;
    --danger:           #c73e54;
    --success:          #2d8a6e;
    --white:            #ffffff;
    --radius-sm:        10px;
    --radius:           14px;
    --radius-lg:        20px;
    --radius-xl:        28px;
    --radius-full:      9999px;
    --shadow-xs:        0 1px 2px rgba(10, 61, 107, 0.06);
    --shadow-sm:        0 2px 8px rgba(10, 61, 107, 0.08);
    --shadow-md:        0 8px 24px rgba(10, 61, 107, 0.1);
    --shadow-lg:        0 16px 40px rgba(10, 61, 107, 0.12);
    --shadow-card:      0 0 0 1px var(--border-light), 0 6px 20px rgba(10, 61, 107, 0.07);
    --transition:       0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --font:             'DM Sans', system-ui, sans-serif;
    --font-display:     'Fraunces', Georgia, serif;
    --header-h:         76px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- Navigation & Side Navbar ---------- */
.mobile-navbar-header {
    display: none;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 61, 107, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1400;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #06192c 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-sm);
    color: var(--white);
}

.sidebar-header {
    padding: 2.25rem 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 12px 12px 12px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(21, 101, 168, 0.4);
}

.sidebar-header .logo-icon svg {
    width: 20px;
    height: 20px;
}

.system-subtitle {
    font-size: 0.72rem;
    color: var(--accent-light);
    opacity: 0.6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
    padding-left: calc(40px + 0.75rem); /* Align with text */
}

.sidebar-nav {
    flex: 1;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li {
    width: 100%;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.78rem 1.1rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    width: 100%;
}

.nav-links a svg {
    flex-shrink: 0;
    opacity: 0.75;
    transition: transform var(--transition), opacity var(--transition);
}

.nav-links a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.07);
}

.nav-links a:hover svg {
    opacity: 1;
    transform: scale(1.05);
}

.nav-links a.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(21, 101, 168, 0.3);
}

.nav-links a.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.1rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    display: inline-block;
}

.status-dot.online {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

/* Desktop layout constraints */
@media (min-width: 992px) {
    body {
        padding-left: 260px;
    }
    .header {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 100;
        height: 100vh;
        border: none;
        box-shadow: none;
        background: transparent;
    }
    .navbar {
        height: 100%;
        padding: 0;
        display: block;
        min-height: 0;
    }
}

/* Mobile responsive navigation drawer */
@media (max-width: 991px) {
    body {
        padding-top: 60px;
    }
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-xs);
        z-index: 1200;
    }
    .navbar {
        padding: 0 1rem;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 0;
    }
    .mobile-navbar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 100%;
    }
    .mobile-navbar-header .logo {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        font-family: var(--font-display);
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--primary-dark);
    }
    .mobile-navbar-header .logo-icon {
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
        border-radius: 10px 10px 10px 3px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--white);
        font-size: 0.95rem;
        font-weight: 700;
    }
    .mobile-navbar-header .logo-icon svg {
        width: 18px;
        height: 18px;
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 0.4rem;
        border-radius: 6px;
        transition: background-color var(--transition);
    }
    .sidebar-toggle:hover {
        background-color: var(--bg-warm);
        color: var(--primary);
    }
    .sidebar-container {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 270px;
        z-index: 1500;
        transform: translateX(-100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    .header.mobile-open .sidebar-container {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .header.mobile-open .sidebar-backdrop {
        display: block;
        opacity: 1;
    }
    .sidebar-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    .sidebar-header .logo {
        font-size: 1.4rem;
    }
    .sidebar-nav {
        padding: 1.25rem 0.75rem;
    }
}


/* ---------- Hero ---------- */
.hero {
    background: var(--bg-warm);
    padding: 4rem 1.5rem 5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(224, 122, 95, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(21, 101, 168, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: left;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: var(--accent-light);
    color: var(--accent-dark);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 3.1rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.hero h1 em {
    font-style: italic;
    color: var(--primary);
}

.hero .tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.75;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-visual {
    position: relative;
}

.hero-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    position: relative;
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: calc(var(--radius-xl) + 3px);
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--sage));
    z-index: -1;
    opacity: 0.35;
}

.hero-stat-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.hero-stat {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.hero-stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
}

.hero-stat span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hero-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.hero-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.65rem;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-outline {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ---------- Sections ---------- */
.section {
    padding: 4.5rem 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.02rem;
    max-width: 540px;
    margin: 0 auto;
}

.divider {
    width: 56px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--sage));
    margin: 1rem auto;
    border-radius: var(--radius-full);
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-dark);
    margin-bottom: 0.75rem;
}

/* ---------- Features (bento layout) ---------- */
.section-features {
    background: var(--bg-warm);
}

.features-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 3.5rem;
}

.features-intro {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
}

.features-intro h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.5vw, 2rem);
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.features-intro p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
}

.features-bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 1rem;
}

.feature-card {
    background: var(--surface);
    padding: 1.5rem 1.35rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-card--large {
    grid-column: 1 / 5;
    grid-row: 1 / 3;
    padding: 2rem;
    background: linear-gradient(145deg, var(--primary-light) 0%, var(--surface) 60%);
    border-left: 4px solid var(--primary);
}

.feature-card:nth-child(2) {
    grid-column: 5 / 7;
    grid-row: 1;
    border-top: 3px solid var(--accent);
}

.feature-card:nth-child(3) {
    grid-column: 5 / 7;
    grid-row: 2;
    border-top: 3px solid var(--sage);
}

.feature-card--wide {
    grid-column: 1 / 7;
    grid-row: 3;
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(90deg, var(--accent-light) 0%, var(--surface) 45%);
    border-left: 4px solid var(--accent);
}

.feature-card--wide p {
    flex: 1;
}

.feature-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: rgba(21, 101, 168, 0.12);
    line-height: 1;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.feature-card--large .feature-icon,
.feature-card:nth-child(2) .feature-icon { background: var(--primary-light); color: var(--primary); }
.feature-card:nth-child(3) .feature-icon { background: var(--sage-light); color: var(--sage); }
.feature-card--wide .feature-icon { background: var(--accent-light); color: var(--accent-dark); }

.feature-card h3 {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.feature-card--large h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
}

/* ---------- About (side-by-side) ---------- */
.about-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
}

.about-box {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.75rem;
    position: relative;
    overflow: hidden;
}

.about-aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-stat-card {
    flex: 1;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transition: transform var(--transition);
}

.about-stat-card:hover {
    transform: translateX(6px);
}

.about-stat-card strong {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--primary);
    display: block;
    margin-bottom: 0.25rem;
}

.about-stat-card span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.about-box::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    transform: translate(40%, -40%);
}

.about-box h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: 1rem;
    position: relative;
}

.about-box p {
    opacity: 0.92;
    margin-bottom: 1rem;
    font-size: 1.02rem;
    line-height: 1.8;
    max-width: 720px;
    position: relative;
}

.about-box p:last-child {
    margin-bottom: 0;
}

.about-box strong {
    color: var(--accent-light);
}

/* ---------- Page Header ---------- */
.page-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-mid) 100%);
    color: var(--white);
    padding: 3.25rem 1.5rem;
    text-align: center;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23ffffff' stroke-opacity='0.04' fill='none'/%3E%3C/svg%3E");
    pointer-events: none;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
    font-weight: 600;
    position: relative;
}

.page-header p {
    opacity: 0.88;
    font-size: 1.05rem;
    position: relative;
    max-width: 560px;
    margin: 0 auto;
}

/* ---------- Forms ---------- */
.form-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-card);
    max-width: 1000px;
    margin: -2rem auto 2rem auto;
    position: relative;
    z-index: 5;
    border: 1px solid var(--border-light);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    color: var(--text);
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.form-section h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
}

label .required {
    color: var(--danger);
    margin-left: 2px;
}

input[type="text"],
input[type="date"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.72rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background-color: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background-color: var(--white);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-submit {
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-submit:hover {
    transform: translateY(-1px);
}

.btn-reset {
    padding: 0.75rem 1.75rem;
    background: var(--white);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-reset:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.patient-number-display {
    background: linear-gradient(135deg, var(--primary-light), var(--sage-light));
    border: 1px solid rgba(21, 101, 168, 0.15);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.patient-number-display .label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.patient-number-display .number {
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

/* ---------- Gallery (stacked horizontal rows) ---------- */
.section-gallery {
    background: var(--bg);
}

.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 960px;
    margin: 0 auto;
}

.gallery-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: transform var(--transition), box-shadow var(--transition);
}

.gallery-item:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-lg);
}

.gallery-item--reverse {
    grid-template-columns: 1fr 280px;
}

.gallery-item--reverse .gallery-image {
    order: 2;
}

.gallery-item--reverse .gallery-caption {
    order: 1;
    text-align: right;
}

.gallery-item--featured {
    grid-template-columns: 1fr;
    max-width: 100%;
}

.gallery-item--featured .gallery-image {
    height: 320px;
}

.gallery-item--featured .gallery-caption {
    padding: 1.75rem 2rem;
}

.gallery-image {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.04);
}

.gallery-caption {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 4px solid var(--primary);
}

.gallery-item--reverse .gallery-caption {
    border-left: none;
    border-right: 4px solid var(--accent);
}

.gallery-item--featured .gallery-caption {
    border-left: none;
    border-top: 4px solid var(--accent);
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--surface) 100%);
}

.gallery-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
}

.gallery-caption h3 {
    font-family: var(--font-display);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.gallery-caption p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* ---------- Contact (developers first, stacked cards) ---------- */
.section-contact .container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.developers-section--top {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.developers-header {
    margin-bottom: 2rem;
    max-width: 520px;
}

.developers-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text);
    margin-bottom: 0.5rem;
}

.developers-header p {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.developers-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.developer-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    transition: background var(--transition), transform var(--transition);
}

.developer-row:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.developer-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.developer-row:nth-child(6n+1) .developer-avatar { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.developer-row:nth-child(6n+2) .developer-avatar { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.developer-row:nth-child(6n+3) .developer-avatar { background: linear-gradient(135deg, var(--sage), var(--accent-dark)); }
.developer-row:nth-child(6n+4) .developer-avatar { background: linear-gradient(135deg, var(--primary-mid), var(--primary)); }
.developer-row:nth-child(6n+5) .developer-avatar { background: linear-gradient(135deg, var(--accent-dark), var(--primary)); }
.developer-row:nth-child(6n+6) .developer-avatar { background: linear-gradient(135deg, var(--primary), var(--accent)); }

.developer-info h4 {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.developer-info .role {
    color: var(--accent-dark);
    font-size: 0.8rem;
    font-weight: 500;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(200px, 280px) 1fr;
    gap: 2rem;
    align-items: start;
}

.contact-panel h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.contact-panel p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.contact-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.contact-card--horizontal {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--surface);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    text-align: left;
    transition: transform var(--transition), box-shadow var(--transition);
}

.contact-card--horizontal:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.contact-card--horizontal .icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin: 0;
}

.contact-card--horizontal:nth-child(2) .icon { background: var(--accent-light); color: var(--accent-dark); }
.contact-card--horizontal:nth-child(3) .icon { background: var(--sage-light); color: var(--sage); }
.contact-card--horizontal:nth-child(4) .icon { background: var(--primary-light); color: var(--primary-dark); }

.contact-card-body h3 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-card-body p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.925rem;
    border: 1px solid transparent;
}

.alert ul {
    margin: 0.5rem 0 0 1.25rem;
}

.alert-success {
    background-color: var(--sage-light);
    color: #1f5c4d;
    border-color: #a8d9cc;
}

.alert-error {
    background-color: #fce8ec;
    color: #9b2c42;
    border-color: #f5c4ce;
}

/* ---------- Table ---------- */
.records-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    background: var(--surface);
    padding: 1.15rem 1.35rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.records-count strong {
    color: var(--primary);
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 480px;
}

.search-form input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg);
}

.table-wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead {
    background: var(--primary-dark);
    color: var(--white);
}

.data-table th {
    padding: 1rem 1.15rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.data-table td {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.data-table tbody tr:hover {
    background-color: var(--primary-light);
}

.badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(21, 101, 168, 0.15);
}

.empty-state {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.actions {
    display: flex;
    gap: 0.4rem;
}

.btn-action {
    padding: 0.45rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--white);
    font-family: inherit;
    transition: all var(--transition);
}

.btn-action.view {
    color: var(--primary);
    border-color: rgba(21, 101, 168, 0.35);
    background: var(--primary-light);
}

.btn-action.view:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-add {
    padding: 0.65rem 1.35rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(21, 101, 168, 0.3);
    transition: transform var(--transition);
}

.btn-add:hover {
    transform: translateY(-1px);
}

.btn-danger {
    padding: 0.75rem 1.5rem;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 21, 40, 0.5);
    backdrop-filter: blur(6px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 900px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: auto 0;
    border: 1px solid var(--border-light);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    padding: 1.15rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    background: var(--bg);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.view-section-title {
    font-family: var(--font-display);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.view-section-title:first-child {
    margin-top: 0;
}

.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.view-grid.full {
    grid-template-columns: 1fr;
}

.view-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.view-item .label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.3;
}

.view-item .value {
    display: block;
    color: var(--text);
    font-size: 0.925rem;
    line-height: 1.55;
    width: 100%;
}

/* ---------- Footer ---------- */
.footer {
    background: linear-gradient(180deg, var(--primary-dark) 0%, #062a4a 100%);
    color: #a8c4dc;
    padding: 3rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
    font-family: var(--font-display);
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.footer-col p,
.footer-col a {
    color: #a8c4dc;
    font-size: 0.9rem;
    line-height: 1.85;
    display: block;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--accent-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    color: #7a9bb5;
    font-size: 0.825rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        text-align: center;
    }

    .hero .tagline {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .features-layout {
        grid-template-columns: 1fr;
    }

    .features-intro {
        position: static;
        text-align: center;
    }

    .features-bento {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .feature-card--large,
    .feature-card:nth-child(2),
    .feature-card:nth-child(3),
    .feature-card--wide {
        grid-column: 1;
        grid-row: auto;
    }

    .feature-card--wide {
        flex-direction: column;
        align-items: flex-start;
    }

    .about-layout {
        grid-template-columns: 1fr;
    }

    .about-aside {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .about-stat-card {
        flex: 1 1 140px;
    }

    .gallery-item,
    .gallery-item--reverse {
        grid-template-columns: 1fr;
    }

    .gallery-item--reverse .gallery-image,
    .gallery-item--reverse .gallery-caption {
        order: unset;
    }

    .gallery-item--reverse .gallery-caption {
        text-align: left;
        border-right: none;
        border-left: 4px solid var(--accent);
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .developers-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        min-height: auto;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .about-box {
        padding: 2rem 1.5rem;
    }

    .records-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: none;
    }

    .about-aside {
        flex-direction: column;
    }
}

/* ---------- Plugins (CareFlow design system) ---------- */
.section.plugin-content {
    padding: 1.5rem 1.75rem 3.5rem;
    flex: 1;
    overflow-x: clip;
}

.plugin-content .container > .alert {
    margin-bottom: 0;
}

.plugin-content .container > .alert + * {
    margin-top: 1.25rem;
}

.plugin-content .stats-grid,
.plugin-content .plugin-grid-2,
.plugin-content .plugin-toolbar,
.plugin-content .content-card,
.plugin-content .empty-state {
    max-width: 100%;
    min-width: 0;
}

.plugin-content .form-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.65rem;
}

.plugin-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.plugin-content .data-table {
    width: 100%;
    table-layout: fixed;
}

.plugin-content .data-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.plugin-content .data-table .col-date {
    white-space: nowrap;
    width: 7.5rem;
}

.plugin-content .data-table .col-print {
    width: 5.5rem;
}

.plugin-content .data-table .col-patient-no {
    width: 8.5rem;
}

.plugin-content .data-table .col-name {
    width: 11rem;
}

/* Home page plugin cards (separate from bento grid) */
.section-title--plugins {
    margin-bottom: 2rem;
}

.plugin-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 3.5rem;
}

.plugin-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.75rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    min-height: 240px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.plugin-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, transparent 40%, rgba(21, 101, 168, 0.04) 100%);
    pointer-events: none;
}

.plugin-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(21, 101, 168, 0.2);
}

.plugin-card-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-dark);
}

.plugin-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px 14px 14px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.plugin-card--chart .plugin-card-icon {
    background: linear-gradient(135deg, var(--primary-light), #bbdefb);
}

.plugin-card--vitals .plugin-card-icon {
    background: linear-gradient(135deg, #e0f7fa, var(--sage-light));
}

.plugin-card--reports .plugin-card-icon {
    background: linear-gradient(135deg, var(--accent-light), #fff3e0);
}

.plugin-card--chart { border-top: 4px solid var(--primary); }
.plugin-card--vitals { border-top: 4px solid var(--sage); }
.plugin-card--reports { border-top: 4px solid var(--accent); }

.plugin-card h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 600;
    position: relative;
}

.plugin-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    flex: 1;
    position: relative;
}

.plugin-card-cta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
    position: relative;
}

.plugin-card:hover .plugin-card-cta {
    color: var(--accent-dark);
}

@media (max-width: 960px) {
    .plugin-cards-grid {
        grid-template-columns: 1fr;
    }

    .plugin-card {
        min-height: auto;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.75rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(145deg, var(--primary-light), var(--accent-light));
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.content-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: relative;
    min-width: 0;
}

.plugin-content .content-card {
    overflow: hidden;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 4px 0 0 4px;
}

.content-card + .content-card,
.stats-grid + .content-card,
.content-card + .plugin-grid-2,
.content-card + .empty-state,
.plugin-toolbar + .content-card,
.plugin-grid-2 + .content-card {
    margin-top: 1.5rem;
}

.card-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    margin-bottom: 1rem;
}

.card-header-row .card-heading {
    margin-bottom: 0;
}

.records-count-inline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
}

.records-count-inline strong {
    color: var(--primary);
    font-weight: 700;
}

.card-heading {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-display);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.card-heading::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.plugin-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.plugin-grid-2 .content-card {
    margin-top: 0;
}

.card-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.card-hint a {
    color: var(--primary);
    font-weight: 600;
}

.card-hint a:hover {
    color: var(--accent-dark);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-card {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.note-card:hover {
    border-color: rgba(21, 101, 168, 0.25);
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.note-card-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.note-card-header strong {
    color: var(--text);
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.note-type-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.note-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    overflow-wrap: anywhere;
}

.note-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.plugin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.plugin-toolbar .records-count {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.plugin-toolbar .records-count strong {
    color: var(--primary);
    font-weight: 700;
}

.plugin-toolbar .toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.vitals-patient-name {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.empty-state--inset {
    padding: 2rem 1.25rem;
    box-shadow: none;
    border: 1px dashed var(--border);
    background: var(--bg);
    margin-top: 0.5rem;
    text-align: center;
}

.content-card .table-wrapper.table-inset {
    box-shadow: none;
    border: none;
    border-radius: var(--radius);
    margin-top: 0.5rem;
}

.modal-footer .btn-submit {
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .section.plugin-content {
        padding: 1.25rem 1rem 2.5rem;
    }

    .content-card {
        padding: 1.5rem 1.35rem;
    }

    .plugin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .plugin-grid-2,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .records-count-inline {
        text-align: left;
    }
}

@media (max-width: 520px) {
    .note-card-header {
        grid-template-columns: auto 1fr;
    }

    .note-card-header .note-type-tag {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

/* ---------- Chart Notes workspace (CareFlow-only layout) ---------- */
.section.chart-notes-page,
.section.vitals-page,
.section.reports-page {
    padding: 1.25rem 1.5rem 3rem;
}

.chart-notes-page .container,
.vitals-page .container,
.reports-page .container {
    max-width: 1280px;
}

.chart-flash {
    margin-bottom: 1rem;
}

.chart-workspace {
    display: grid;
    grid-template-columns: minmax(260px, 300px) 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 0.5rem;
}

.chart-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.chart-back-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.65rem;
    display: inline-block;
}

.chart-back-link:hover {
    color: var(--accent-dark);
}

.chart-sidebar-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--text);
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.chart-sidebar-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.chart-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.chart-stat-pill {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 0.75rem 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-xs);
}

.chart-stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
}

.chart-stat-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.2rem;
}

.chart-patient-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.chart-panel-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.85rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-warm);
}

.chart-patient-nav {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chart-patient-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition), padding-left var(--transition);
}

.chart-patient-item:last-child {
    border-bottom: none;
}

.chart-patient-item:hover {
    background: var(--primary-light);
    padding-left: 1.15rem;
}

.chart-patient-item.is-active {
    background: linear-gradient(90deg, var(--primary-light), transparent);
    border-left: 3px solid var(--primary);
    padding-left: calc(1rem - 3px);
}

.chart-patient-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px 10px 10px 4px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-patient-avatar--all {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-mid));
    font-size: 0.65rem;
    letter-spacing: 0.02em;
}

.chart-patient-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chart-patient-meta strong {
    font-size: 0.88rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-patient-meta span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.chart-active-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: var(--shadow-md);
}

.chart-active-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.chart-active-banner .badge {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.chart-active-banner strong {
    font-family: var(--font-display);
    font-size: 1.05rem;
}

.chart-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.chart-compose {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.chart-compose-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-mid) 100%);
    color: var(--white);
}

.chart-compose-header .section-label {
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.35rem;
}

.chart-compose-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.chart-type-legend {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    padding-top: 0.25rem;
}

.chart-type-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.chart-type-dot--shift    { background: #64b5f6; }
.chart-type-dot--vitals   { background: #4dd0e1; }
.chart-type-dot--followup { background: #81c784; }
.chart-type-dot--general  { background: #ffb74d; }

.chart-compose-form {
    padding: 1.35rem 1.5rem 1.5rem;
    background: var(--bg);
}

.chart-compose-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.9fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-field-body textarea {
    min-height: 110px;
    background: var(--white);
}

.chart-compose-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.chart-compose-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 420px;
}

.chart-feed-header {
    margin-bottom: 1rem;
}

.chart-feed-header h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.chart-feed-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.chart-timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chart-timeline-date {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 2px solid var(--primary-light);
}

.chart-timeline-date time {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.chart-timeline-date span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.chart-timeline-entries {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chart-entry {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 0 1.15rem;
    position: relative;
}

.chart-entry:not(:last-child) .chart-entry-rail::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 22px;
    bottom: -12px;
    width: 2px;
    background: var(--border);
    transform: translateX(-50%);
}

.chart-entry-rail {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 0.35rem;
}

.chart-entry-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--border);
    background: var(--primary);
    z-index: 1;
}

.chart-entry--shift .chart-entry-dot    { background: #1565a8; box-shadow: 0 0 0 2px #90caf9; }
.chart-entry--vitals .chart-entry-dot   { background: #00838f; box-shadow: 0 0 0 2px #80deea; }
.chart-entry--followup .chart-entry-dot { background: #2e7d32; box-shadow: 0 0 0 2px #a5d6a7; }
.chart-entry--general .chart-entry-dot  { background: #ef6c00; box-shadow: 0 0 0 2px #ffcc80; }

.chart-entry-body {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition), transform var(--transition);
}

.chart-entry-body:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.chart-entry--shift .chart-entry-body    { border-left: 4px solid #1565a8; }
.chart-entry--vitals .chart-entry-body   { border-left: 4px solid #00838f; }
.chart-entry--followup .chart-entry-body { border-left: 4px solid #2e7d32; }
.chart-entry--general .chart-entry-body  { border-left: 4px solid #ef6c00; }

.chart-entry-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.65rem;
}

.chart-entry-top time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.chart-entry-type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.chart-entry--shift .chart-entry-type    { background: #e3f2fd; color: #0d47a1; }
.chart-entry--vitals .chart-entry-type   { background: #e0f7fa; color: #006064; }
.chart-entry--followup .chart-entry-type { background: #e8f5e9; color: #1b5e20; }
.chart-entry--general .chart-entry-type  { background: #fff3e0; color: #e65100; }

.chart-entry-patient {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.chart-entry-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.65rem;
}

.chart-entry-footer {
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.chart-entry-nurse {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.chart-entry-nurse::before {
    content: 'RN ';
    color: var(--accent-dark);
    font-weight: 700;
}

.chart-empty {
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border);
}

.chart-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.chart-empty h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.chart-empty p {
    color: var(--text-muted);
    max-width: 360px;
    margin: 0 auto;
    font-size: 0.92rem;
}

@media (max-width: 960px) {
    .chart-workspace {
        grid-template-columns: 1fr;
    }

    .chart-sidebar {
        position: static;
    }

    .chart-patient-nav {
        max-height: 200px;
    }

    .chart-compose-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .chart-mini-stats {
        grid-template-columns: 1fr;
    }

    .chart-entry-patient {
        margin-left: 0;
        width: 100%;
    }

    .chart-compose-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-compose-footer .btn-add {
        width: 100%;
        justify-content: center;
    }
}

/* Vitals workspace (extends chart workspace) */
.chart-compose-header--vitals {
    background: linear-gradient(135deg, #0a3d6b 0%, #1565a8 45%, #0288d1 100%);
}

.chart-vitals-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-top: 0.25rem;
}

.chart-vitals-legend-item {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.chart-compose-row--vitals-top {
    grid-template-columns: 1.5fr 1fr;
    margin-bottom: 1rem;
}

.vitals-input-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.85rem;
    margin-bottom: 0.25rem;
}

.vitals-input-cell label {
    font-size: 0.8rem;
}

.vitals-input-cell input {
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.chart-entry--vitals-reading .chart-entry-dot {
    background: #0288d1;
    box-shadow: 0 0 0 2px #80deea;
}

.chart-entry--vitals-reading .chart-entry-body {
    border-left: 4px solid #0288d1;
}

.chart-entry--vitals-reading .chart-entry-type {
    background: #e0f7fa;
    color: #006064;
}

.chart-entry--alert .chart-entry-dot {
    background: var(--danger);
    box-shadow: 0 0 0 2px #f5c4ce;
}

.chart-entry--alert .chart-entry-body {
    border-left-color: var(--danger);
}

.vitals-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.vitals-metric {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.5rem;
    text-align: center;
}

.vitals-metric-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.vitals-metric-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
}

.vitals-metric--warn {
    background: #fce8ec;
    border-color: #f5c4ce;
}

.vitals-metric--warn .vitals-metric-value {
    color: var(--danger);
}

@media (max-width: 900px) {
    .vitals-input-grid,
    .vitals-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .vitals-input-grid,
    .vitals-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-compose-row--vitals-top {
        grid-template-columns: 1fr;
    }
}

/* Reports workspace */
.reports-filter-panel,
.reports-quick-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.reports-filter-form {
    padding: 1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.reports-filter-form .form-group label {
    font-size: 0.8rem;
}

.reports-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.reports-filter-actions .btn-submit,
.reports-filter-actions .btn-reset {
    width: 100%;
    text-align: center;
}

.reports-quick-panel {
    margin-top: 0.25rem;
}

.reports-quick-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.35rem;
}

.reports-quick-link {
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition);
}

.reports-quick-link:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.reports-export-panel {
    margin-top: 0.25rem;
}

.reports-export-btn {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.chart-entry--report .chart-entry-dot {
    background: var(--accent-dark);
    box-shadow: 0 0 0 2px var(--accent-light);
}

.chart-entry--report .chart-entry-body {
    border-left: 4px solid var(--accent);
}

.report-entry-top {
    flex-wrap: wrap;
    align-items: center;
}

.report-entry-name {
    font-size: 1rem;
    color: var(--text);
    flex: 1;
    min-width: 140px;
}

.report-print-btn {
    margin-left: auto;
}

.report-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.report-entry-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.report-entry-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-muted);
}

.report-entry-value {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.report-view-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
}

.report-view-link:hover {
    color: var(--accent-dark);
}

.reports-timeline .chart-timeline-day + .chart-timeline-day {
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .report-entry-grid {
        grid-template-columns: 1fr;
    }

    .report-print-btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

/* ---------- Patient workspace (plugins on Patient Information) ---------- */
.modal--workspace {
    max-width: 1080px;
}

.modal-body--workspace {
    padding: 0;
    background: var(--bg-warm);
}

.patient-record-block {
    padding: 1.25rem 1.5rem 0;
}

.patient-plugins-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-light);
    margin-top: 0.5rem;
    background: var(--bg-warm);
}

.patient-page-plugin-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-light);
}

.patient-plugin-head--reports {
    background: linear-gradient(135deg, #5d4037, #8d6e63);
}

.patient-reports-toolbar {
    padding: 1.15rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px dashed var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: flex-end;
    justify-content: space-between;
}

.patient-reports-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    flex: 1;
    min-width: 280px;
}

.patient-reports-filter .form-group {
    margin: 0;
    min-width: 120px;
}

.patient-reports-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.patient-reports-results {
    padding: 1rem 1.25rem 1.25rem;
}

.patient-reports-meta {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.plugin-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
}

.plugin-count-badge--notes {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.plugin-count-badge--vitals {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.patient-plugin {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.patient-plugin-head {
    padding: 1rem 1.25rem;
    color: var(--white);
}

.patient-plugin-head--chart {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.patient-plugin-head--vitals {
    background: linear-gradient(135deg, #2e7d32, #43a047);
}

.patient-plugin-tag {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 0.35rem;
}

.patient-plugin-head h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.patient-plugin-head p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.45;
}

.patient-plugin-form {
    padding: 1.15rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px dashed var(--border);
}

.patient-plugin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.patient-plugin-form-grid--vitals {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.patient-plugin-feed {
    padding: 1rem 1.25rem 1.25rem;
    max-height: 280px;
    overflow-y: auto;
}

.patient-plugin-feed-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.patient-plugin-entry {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: var(--white);
    margin-bottom: 0.65rem;
}

.patient-plugin-entry--shift    { border-left: 3px solid #64b5f6; }
.patient-plugin-entry--vitals   { border-left: 3px solid #4dd0e1; }
.patient-plugin-entry--followup { border-left: 3px solid #81c784; }
.patient-plugin-entry--general  { border-left: 3px solid #ffb74d; }
.patient-plugin-entry--vitals-reading { border-left: 3px solid #43a047; }
.patient-plugin-entry--alert    { border-left-color: #e53935; background: #fff5f5; }

.patient-plugin-entry header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}

.patient-plugin-entry header time {
    font-weight: 600;
    color: var(--primary-dark);
}

.patient-plugin-entry-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.patient-plugin-entry p {
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.patient-plugin-entry footer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.patient-vitals-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.patient-vitals-metrics .vitals-spo2-warn {
    color: #c62828;
    font-weight: 600;
}

.patient-plugin-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .modal--workspace {
        max-width: 100%;
    }

    .patient-plugin-form-grid {
        grid-template-columns: 1fr;
    }

    .patient-record-block,
    .patient-plugins-stack {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
