/* =====================================================================
   MediVerse Hospital Information System
   Modern Clinical Design System
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ---------- Reset & Tokens ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:          #0b6e9e;
    --primary-dark:     #084d6f;
    --primary-light:    #e6f3fa;
    --primary-glow:     rgba(11, 110, 158, 0.15);
    --accent:           #0d9488;
    --accent-dark:      #0f766e;
    --accent-light:     #ccfbf1;
    --surface:          #ffffff;
    --surface-raised:   #ffffff;
    --bg:               #f4f7fb;
    --bg-subtle:        #f8fafc;
    --text:             #0f172a;
    --text-secondary:   #334155;
    --text-muted:       #64748b;
    --border:           #e2e8f0;
    --border-light:     #f1f5f9;
    --danger:           #dc2626;
    --success:          #059669;
    --white:            #ffffff;
    --radius-sm:        8px;
    --radius:           12px;
    --radius-lg:        16px;
    --radius-xl:        24px;
    --radius-full:      9999px;
    --shadow-xs:        0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm:        0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md:        0 4px 14px rgba(15, 23, 42, 0.07);
    --shadow-lg:        0 12px 32px rgba(15, 23, 42, 0.1);
    --shadow-card:      0 0 0 1px rgba(15, 23, 42, 0.04), 0 4px 20px rgba(15, 23, 42, 0.06);
    --transition:       0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font:             'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --header-h:         72px;
}

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;
}

/* ---------- Header & Navigation ---------- */
.header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.navbar {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.875rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(145deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-links a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.nav-links a.active::after,
.nav-links a:hover::after {
    display: none;
}

/* ---------- Hero (Home) ---------- */
.hero {
    background: linear-gradient(160deg, #064e6f 0%, var(--primary) 45%, #0d9488 100%);
    color: var(--white);
    padding: 5.5rem 1.75rem 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.hero .tagline {
    font-size: 1.125rem;
    opacity: 0.92;
    margin-bottom: 2rem;
    line-height: 1.7;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.75rem;
    background-color: var(--white);
    color: var(--primary);
    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);
    box-shadow: var(--shadow-md);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background: var(--white);
    color: var(--primary-dark);
}

.btn-primary:hover {
    background: var(--bg-subtle);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.6);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary-dark);
    border-color: var(--white);
}

/* ---------- Sections ---------- */
.section {
    padding: 4.5rem 1.75rem;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}

.divider {
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 1rem auto;
    border-radius: var(--radius-full);
}

/* ---------- Feature Cards ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--surface);
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--border-light);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    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.5rem;
    margin: 0 auto 1.25rem auto;
    font-weight: 700;
}

.feature-card h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.925rem;
    line-height: 1.65;
}

/* ---------- About Box ---------- */
.about-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.75rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 2.5rem;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.about-box::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;
}

.about-box h2 {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.about-box p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.02rem;
    line-height: 1.75;
}

.about-box p:last-child {
    margin-bottom: 0;
}

/* ---------- Page Header ---------- */
.page-header {
    background: linear-gradient(160deg, #064e6f 0%, var(--primary) 50%, #0d9488 100%);
    color: var(--white);
    padding: 3.5rem 1.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.page-header h1 {
    font-size: clamp(1.85rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
}

.page-header p {
    opacity: 0.9;
    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.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 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.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background-color: var(--bg-subtle);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #cbd5e1;
}

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(145deg, 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), opacity var(--transition);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-reset {
    padding: 0.75rem 1.75rem;
    background: var(--white);
    color: var(--text-muted);
    border: 1px 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 {
    background: var(--bg-subtle);
    color: var(--text);
    border-color: #cbd5e1;
}

.patient-number-display {
    background: linear-gradient(135deg, var(--primary-light) 0%, #f0fdfa 100%);
    border: 1px solid rgba(11, 110, 158, 0.12);
    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 ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--border-light);
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    position: relative;
}

.gallery-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.25) 0%, transparent 50%);
    pointer-events: none;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.06);
}

.gallery-caption {
    padding: 1.25rem 1.35rem;
}

.gallery-caption h3 {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.gallery-caption p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ---------- Contact ---------- */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--surface);
    padding: 2rem 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);
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.contact-card .icon {
    width: 52px;
    height: 52px;
    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.4rem;
    margin: 0 auto 1rem auto;
}

.contact-card h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.developers-section {
    background: var(--surface);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.developers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.developer-card {
    text-align: center;
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.developer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(11, 110, 158, 0.2);
    background: var(--white);
}

.developer-avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    margin: 0 auto 1rem auto;
    box-shadow: 0 8px 24px var(--primary-glow);
    overflow: hidden;
    border: 3px solid var(--white);
    outline: 1px solid var(--border);
}

.developer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.developer-card h4 {
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.35;
}

.developer-card .role {
    color: var(--accent-dark);
    font-size: 0.85rem;
    font-weight: 500;
}

.developer-card .email {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.925rem;
    line-height: 1.6;
    border: 1px solid transparent;
}

.alert ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

.alert a {
    text-decoration: underline;
    font-weight: 600;
    margin-left: 0.5rem;
}

.alert-success {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* ---------- Patient Records 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 {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.records-count strong {
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 700;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 480px;
    align-items: stretch;
}

.search-form input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-subtle);
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-form .btn-submit,
.search-form .btn-reset {
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-full);
}

.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(--bg-subtle);
    border-bottom: 1px solid var(--border);
}

.data-table th {
    padding: 1rem 1.15rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-secondary);
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background-color: var(--primary-light);
}

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

.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;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border: 1px solid rgba(11, 110, 158, 0.12);
}

.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 {
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ---------- Action Buttons ---------- */
.actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.btn-action {
    padding: 0.45rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--white);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-action.view {
    color: var(--primary);
    border-color: rgba(11, 110, 158, 0.35);
    background: var(--primary-light);
}

.btn-action.view:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-action.edit {
    color: var(--accent-dark);
    border-color: rgba(13, 148, 136, 0.35);
}

.btn-action.edit:hover {
    background: var(--accent);
    color: var(--white);
}

.btn-action.delete {
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.35);
}

.btn-action.delete:hover {
    background: var(--danger);
    color: var(--white);
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-add {
    padding: 0.65rem 1.35rem;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-add span[aria-hidden="true"] {
    font-size: 1.15rem;
    line-height: 1;
    font-weight: 700;
}

.btn-danger {
    padding: 0.75rem 1.5rem;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition), transform var(--transition);
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    padding: 2rem 1rem;
    overflow-y: auto;
    animation: overlayIn 0.2s ease-out;
}

.modal-overlay.open {
    display: flex;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto 0;
    border: 1px solid var(--border-light);
}

.modal-confirm {
    max-width: 440px;
}

@keyframes modalIn {
    from { transform: translateY(16px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    background: linear-gradient(160deg, #064e6f, var(--primary));
    color: var(--white);
    padding: 1.15rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
    background: var(--bg-subtle);
}

.modal-body .form-section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ---------- View Modal ---------- */
.view-section-title {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 1.5rem 0 0.75rem 0;
    padding-bottom: 0;
    border-bottom: none;
}

.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 {
    background: var(--white);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.view-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.view-item .value {
    color: var(--text);
    font-size: 0.925rem;
    word-break: break-word;
    line-height: 1.5;
}

/* ---------- Footer ---------- */
.footer {
    background: linear-gradient(180deg, #0c2d42 0%, #071f2e 100%);
    color: #94a3b8;
    padding: 3rem 1.75rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1240px;
    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.08);
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.footer-col p,
.footer-col a {
    color: #94a3b8;
    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: #64748b;
    font-size: 0.825rem;
    max-width: 1240px;
    margin: 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .navbar {
        padding: 0.875rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
        min-height: auto;
    }

    .nav-links {
        gap: 0.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }

    .hero {
        padding: 4rem 1.25rem 4.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .section {
        padding: 3rem 1.25rem;
    }

    .about-box {
        padding: 1.75rem 1.5rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-submit,
    .btn-reset {
        width: 100%;
    }

    .records-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: none;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius);
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn-submit,
    .modal-footer .btn-reset,
    .modal-footer .btn-danger {
        width: 100%;
    }

    .actions {
        flex-wrap: wrap;
    }

    .toolbar-actions {
        width: 100%;
    }

    .btn-add {
        width: 100%;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .developers-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .developers-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 640px;
    }
}

/* ---------- Plugins (aligned with site design system) ---------- */
.section.plugin-content {
    padding: 1.5rem 1.75rem 3.5rem;
    flex: 1;
    overflow-x: clip;
}

.plugin-content .container {
    max-width: 1240px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
}

.plugin-content .container > .alert {
    margin-bottom: 0;
}

.plugin-content .container > .alert + * {
    margin-top: 1.25rem;
}

/* Keep all plugin UI inside the container bounds */
.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 input,
.plugin-content select,
.plugin-content textarea,
.plugin-content .btn-submit,
.plugin-content .btn-reset,
.plugin-content .btn-add {
    max-width: 100%;
}

.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 th {
    white-space: normal;
    line-height: 1.35;
    vertical-align: bottom;
}

.plugin-content .data-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.plugin-content .data-table .col-date,
.plugin-content .data-table .col-actions {
    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 */
.plugin-features .plugin-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    border-top: 4px solid var(--primary);
}

.plugin-features .plugin-card-link:hover {
    border-top-color: var(--accent);
}

.plugin-features .feature-icon.plugin-icon {
    font-size: 1.5rem;
}

/* Stat summary row — matches feature-card language */
.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;
    overflow-wrap: anywhere;
}

.stat-value {
    display: block;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Content cards — same visual as about-box */
.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;
    overflow: visible;
    min-width: 0;
}

.plugin-content .content-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.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,
.content-card + .table-wrapper,
.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;
}

.stats-grid + .plugin-grid-2 {
    margin-top: 0;
}

.card-heading {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-width: 0;
}

.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 > * {
    min-width: 0;
}

.plugin-grid-2 .content-card {
    margin-top: 0;
}

.plugin-grid-2 + .content-card {
    margin-top: 1.5rem;
}

.stats-grid > * {
    min-width: 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);
    overflow-wrap: anywhere;
}

.card-hint a {
    color: var(--primary);
    font-weight: 600;
}

.card-hint a:hover {
    color: var(--accent-dark);
}

.content-card .form-actions {
    margin-top: 1.25rem;
    padding-top: 0;
    border-top: none;
}

.content-card .form-group + .form-group {
    margin-top: 0;
}

.content-card .form-grid {
    margin-top: 0;
}

.content-card .form-group + .form-grid,
.content-card .form-grid + .form-group {
    margin-top: 1rem;
}

/* Chart notes list */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.note-card {
    background: var(--bg-subtle);
    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(11, 110, 158, 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;
}

@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;
    }
}

.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;
    word-break: break-word;
}

.note-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.notes-list--modal {
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.note-card--compact {
    padding: 0.85rem 1rem;
}

.note-card--compact .note-card-header {
    margin-bottom: 0.5rem;
}

.view-note-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

#viewModal .modal {
    max-width: 720px;
}

/* Plugin toolbar (patients-style) */
.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;
}

/* Chart canvas containers */
.chart-wrap {
    position: relative;
    min-height: 220px;
    padding: 0.25rem 0;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
}

.plugin-content .chart-card .chart-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    height: 240px;
}

.plugin-content .chart-card .chart-wrap.chart-wrap--short {
    height: 180px;
}

.chart-wrap canvas {
    max-width: 100% !important;
}

.content-card .empty-state,
.empty-state--inset {
    padding: 2rem 1.25rem;
    box-shadow: none;
    border: 1px dashed var(--border);
    background: var(--bg-subtle);
    margin-top: 0.5rem;
    max-width: 100%;
}

.content-card .empty-state p,
.empty-state--inset p {
    margin-bottom: 0;
}

.content-card .form-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.content-card.chart-card {
    padding: 1.75rem 2rem;
}

.content-card .table-wrapper.table-inset {
    box-shadow: none;
    border: none;
    border-radius: var(--radius);
    margin-top: 0.5rem;
    overflow-x: auto;
    max-width: 100%;
}

@media (max-width: 640px) {
    .records-count-inline {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .section.plugin-content {
        padding: 1.25rem 1rem 2.5rem;
    }

    .content-card {
        padding: 1.5rem 1.35rem;
    }

    .card-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .plugin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .plugin-toolbar .toolbar-actions {
        justify-content: stretch;
    }

    .plugin-toolbar .toolbar-actions .btn-add,
    .plugin-toolbar .toolbar-actions .btn-submit {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .plugin-grid-2 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
