:root {
    --bg-main: #eff5f5;
    --bg-alt: #d9ece8;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --primary: #0f766e;
    --primary-soft: #14b8a6;
    --ink: #0f172a;
    --muted: #64748b;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #ca8a04;
    --border: rgba(15, 118, 110, 0.2);
    --shadow: 0 14px 38px rgba(15, 23, 42, 0.12);
    --radius-lg: 22px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 14% 20%, #f8fbff 0%, var(--bg-main) 42%, var(--bg-alt) 100%);
}

a {
    text-decoration: none;
    color: inherit;
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
    font-family: 'Sora', sans-serif;
}

p {
    margin: 0;
}

.glass-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    border-radius: var(--radius-lg);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(170deg, #0f766e 0%, #155e75 46%, #1e3a8a 100%);
    color: #ecfeff;
    padding: 24px 18px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 30;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    display: grid;
    place-items: center;
    font-size: 22px;
}

.sidebar-brand h1 {
    font-size: 20px;
    line-height: 1.15;
}

.sidebar-brand p {
    opacity: 0.8;
    font-size: 13px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.25s ease, background 0.25s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.18);
    transform: translateX(4px);
}

.logout-link {
    margin-top: 14px;
    color: #fee2e2;
}

.content-area {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 22px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--primary);
    cursor: pointer;
    display: none;
}

.topbar-title-wrap p {
    color: var(--muted);
    margin-top: 4px;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
}

.profile-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.18);
}

.page-content {
    display: grid;
    gap: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card p {
    color: var(--muted);
    font-size: 14px;
}

.stat-card h3 {
    font-size: 36px;
    margin-top: 4px;
}

.stat-card i {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 20px;
    color: var(--primary);
    background: rgba(20, 184, 166, 0.14);
}

.panel-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1.2fr 1fr;
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head span {
    color: var(--muted);
    font-size: 13px;
}

.progress-wrap {
    display: grid;
    gap: 14px;
}

.progress-line {
    display: grid;
    gap: 6px;
}

.progress-line label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 700;
}

.meter {
    width: 100%;
    height: 12px;
    background: #dbeafe;
    border-radius: 99px;
    overflow: hidden;
}

.meter span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #14b8a6, #0f766e);
    animation: fillBar 1.2s ease;
}

.simple-list {
    display: grid;
    gap: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2ff;
}

.list-item strong {
    display: block;
    margin-bottom: 4px;
}

.list-item p,
.muted {
    color: var(--muted);
    font-size: 14px;
}

.form-panel,
.table-panel {
    padding: 22px;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    padding: 11px 12px;
    outline: none;
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-soft);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.full-width {
    grid-column: 1 / -1;
}

.admission-grid {
    gap: 12px;
}

.form-section-title {
    margin: 4px 0 2px;
    padding: 8px 10px;
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: #f0fdfa;
    color: #0f172a;
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.form-actions-center {
    text-align: center;
    margin-top: 4px;
}

.lookup-input-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.patient-summary-card {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
}

.patient-summary-card div {
    font-size: 13px;
    color: #334155;
}

.panel-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.btn-primary {
    color: #ffffff;
    background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.26);
}

.btn-lg {
    padding-block: 13px;
}

.btn-sm {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-muted {
    color: #0f172a;
    background: #e2e8f0;
}

.btn-danger {
    color: #ffffff;
    background: #dc2626;
}

.alert {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-weight: 700;
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.table-search {
    width: 260px;
    max-width: 100%;
}

.segment-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.segment-link {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
}

.segment-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
    border-color: #0f766e;
}

.table-actions {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.table-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

.actions-cell {
    min-width: 220px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

th,
td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

th {
    color: #0f172a;
    background: #f8fafc;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.badge-scheduled {
    background: #ecfeff;
    color: #155e75;
}

.badge-completed {
    background: #ecfdf5;
    color: #166534;
}

.badge-pending {
    background: #fffbeb;
    color: #854d0e;
}

.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.login-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.55;
}

.shape-one {
    width: 280px;
    height: 280px;
    background: #99f6e4;
    top: -70px;
    left: -70px;
}

.shape-two {
    width: 320px;
    height: 320px;
    background: #bfdbfe;
    bottom: -90px;
    right: -90px;
}

.login-wrapper {
    width: 100%;
    max-width: 460px;
    z-index: 2;
}

.login-card {
    padding: 28px;
    animation: floatIn 0.6s ease;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.login-logo h1 {
    font-size: 24px;
}

.login-logo p {
    color: var(--muted);
    margin-top: 4px;
}

.login-help {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}

.reveal-up {
    animation: revealUp 0.55s ease both;
}

.delay-1 {
    animation-delay: 0.14s;
}

.delay-2 {
    animation-delay: 0.24s;
}

.mobile-sidebar-open .sidebar {
    transform: translateX(0);
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fillBar {
    from {
        width: 0;
    }
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .content-area {
        margin-left: 0;
        width: 100%;
        padding: 14px;
    }

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .topbar {
        padding: 14px;
    }

    .stats-grid,
    .two-column,
    .patient-summary-card {
        grid-template-columns: 1fr;
    }

    .profile-chip {
        display: none;
    }
}

@media (max-width: 560px) {
    .login-card,
    .form-panel,
    .table-panel,
    .panel,
    .stat-card {
        padding: 16px;
        border-radius: 16px;
    }

    .topbar-title-wrap h2 {
        font-size: 20px;
    }

    .stat-card h3 {
        font-size: 30px;
    }
}
