:root {
    --patient-bg: #f2f7fb;
    --patient-surface: rgba(255, 255, 255, 0.9);
    --patient-surface-strong: #ffffff;
    --patient-line: rgba(19, 49, 75, 0.12);
    --patient-text: #17314a;
    --patient-muted: #66798d;
    --patient-primary: #0d5a93;
    --patient-primary-2: #2f88c9;
    --patient-accent: #10b790;
    --patient-accent-2: #7ae0cf;
    --patient-danger: #d24f57;
    --patient-warning: #dc9a30;
    --patient-shadow: 0 22px 48px rgba(24, 52, 82, 0.12);
    --patient-radius: 28px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(122, 224, 207, 0.5), transparent 24%),
        radial-gradient(circle at right top, rgba(47, 136, 201, 0.22), transparent 22%),
        linear-gradient(180deg, #fbfdff 0%, var(--patient-bg) 100%);
    color: var(--patient-text);
    font-family: "proxima-nova", "Aptos", sans-serif;
}

a {
    color: var(--patient-primary);
}

.patient-shell {
    min-height: 100vh;
    padding: 22px;
}

.patient-app {
    max-width: 1360px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.patient-nav {
    position: sticky;
    top: 22px;
    border-radius: 30px;
    overflow: hidden;
    background:
        linear-gradient(160deg, rgba(7, 57, 99, 0.98), rgba(17, 93, 140, 0.92));
    color: #fff;
    box-shadow: var(--patient-shadow);
    padding: 24px;
}

.patient-nav-logo img {
    width: min(220px, 100%);
    display: block;
}

.patient-nav-copy {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    font-size: 0.95rem;
}

.patient-user-card {
    margin-top: 24px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.patient-user-avatar {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--patient-accent), var(--patient-primary-2));
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.patient-user-name {
    margin: 14px 0 4px;
    font-weight: 700;
    font-size: 1.08rem;
}

.patient-user-meta {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.patient-nav-links {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.patient-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    transition: transform 160ms ease, background 160ms ease;
}

.patient-nav-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.patient-nav-link.is-active {
    background: rgba(16, 183, 144, 0.18);
    color: #fff;
}

.patient-nav-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.15rem;
}

.patient-main {
    min-width: 0;
}

.patient-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    margin-bottom: 20px;
    border-radius: 28px;
    background: var(--patient-surface);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--patient-shadow);
    backdrop-filter: blur(18px);
}

.patient-topbar-title {
    margin: 0;
    font-family: "ff-tisa-sans-web-pro", "proxima-nova", sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.patient-topbar-copy {
    margin: 8px 0 0;
    color: var(--patient-muted);
}

.patient-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.patient-chip,
.patient-button {
    appearance: none;
    border: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.patient-chip {
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(13, 90, 147, 0.08);
    color: var(--patient-primary);
    font-weight: 600;
}

.patient-button {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 16px;
    font-weight: 700;
}

.patient-button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--patient-primary), var(--patient-primary-2));
    box-shadow: 0 16px 30px rgba(13, 90, 147, 0.22);
}

.patient-button-secondary {
    color: var(--patient-text);
    background: rgba(13, 90, 147, 0.08);
}

.patient-button-light {
    color: var(--patient-primary);
    background: #fff;
}

.patient-button-ghost {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.patient-section {
    padding: 28px;
    border-radius: 28px;
    background: var(--patient-surface);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: var(--patient-shadow);
    backdrop-filter: blur(18px);
}

.patient-section + .patient-section {
    margin-top: 20px;
}

.patient-section-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.patient-section-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.08;
}

.patient-section-copy {
    margin: 8px 0 0;
    color: var(--patient-muted);
    line-height: 1.7;
}

.patient-grid {
    display: grid;
    gap: 18px;
}

.patient-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.patient-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.patient-grid.compact-gap {
    gap: 14px;
}

.patient-stat {
    padding: 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--patient-line);
}

.patient-stat-kicker {
    display: block;
    color: var(--patient-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.patient-stat-value {
    display: block;
    margin-top: 12px;
    font-size: 1.8rem;
    font-weight: 700;
}

.patient-stat-value.small {
    font-size: 1.02rem;
    line-height: 1.45;
}

.patient-table-wrap {
    overflow: auto;
    border-radius: 22px;
    border: 1px solid var(--patient-line);
    background: rgba(255, 255, 255, 0.75);
}

.patient-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.patient-table thead th {
    padding: 16px 18px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--patient-muted);
    background: rgba(13, 90, 147, 0.06);
}

.patient-table tbody td {
    padding: 18px;
    border-top: 1px solid rgba(19, 49, 75, 0.08);
    vertical-align: middle;
}

.patient-table tbody tr:hover {
    background: rgba(16, 183, 144, 0.05);
}

.patient-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(16, 183, 144, 0.12);
    color: #0c6f5c;
    font-weight: 600;
    font-size: 0.88rem;
}

.patient-badge.alt {
    background: rgba(13, 90, 147, 0.08);
    color: var(--patient-primary);
}

.patient-inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.patient-inline-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    background: rgba(13, 90, 147, 0.08);
    color: var(--patient-primary);
    text-decoration: none;
    font-weight: 700;
}

.patient-inline-action.is-video {
    background: rgba(47, 136, 201, 0.12);
    color: var(--patient-primary);
}

.patient-inline-action.is-location {
    background: rgba(16, 183, 144, 0.12);
    color: #0b7561;
}

.patient-inline-action.is-pdf {
    background: rgba(210, 79, 87, 0.12);
    color: #a52c39;
}

.patient-inline-action.is-disabled {
    background: rgba(102, 121, 141, 0.12);
    color: var(--patient-muted);
    cursor: not-allowed;
}

.patient-empty {
    padding: 28px;
    text-align: center;
    color: var(--patient-muted);
}

.patient-form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.patient-field {
    display: grid;
    gap: 10px;
}

.patient-field.span-2 {
    grid-column: span 2;
}

.patient-field label {
    font-weight: 600;
    color: var(--patient-text);
}

.patient-field input,
.patient-field select,
.patient-field textarea {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--patient-line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--patient-text);
    font-size: 1rem;
}

.patient-field textarea {
    min-height: 140px;
    padding: 14px 16px;
    resize: vertical;
}

.patient-field input:disabled,
.patient-field select:disabled,
.patient-field textarea:disabled {
    color: var(--patient-muted);
    background: rgba(13, 90, 147, 0.05);
}

.patient-field input:focus,
.patient-field select:focus,
.patient-field textarea:focus {
    outline: none;
    border-color: rgba(13, 90, 147, 0.34);
    box-shadow: 0 0 0 5px rgba(47, 136, 201, 0.12);
}

.patient-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.patient-radio {
    flex: 1 1 160px;
    position: relative;
}

.patient-radio input {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.patient-radio span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    border-radius: 16px;
    border: 1px solid var(--patient-line);
    background: rgba(255, 255, 255, 0.84);
    font-weight: 600;
}

.patient-radio input:checked + span {
    color: #fff;
    background: linear-gradient(135deg, var(--patient-accent), var(--patient-primary-2));
    border-color: transparent;
}

.patient-hero {
    display: grid;
    gap: 20px;
    grid-template-columns: 1.3fr 0.9fr;
    align-items: stretch;
}

.patient-highlight {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(13, 90, 147, 0.98), rgba(47, 136, 201, 0.88));
    color: #fff;
}

.patient-highlight h3 {
    margin: 0 0 10px;
    font-size: 1.35rem;
}

.patient-highlight p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}

.patient-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.patient-panel-soft {
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--patient-line);
}

.patient-panel-soft h4 {
    margin: 0 0 10px;
    font-size: 1.08rem;
}

.patient-panel-soft p {
    margin: 0;
    color: var(--patient-muted);
    line-height: 1.7;
}

.patient-mini-head {
    margin-bottom: 16px;
}

.patient-mini-head h3 {
    margin: 0;
    font-size: 1.08rem;
}

.patient-mini-head p {
    margin: 8px 0 0;
    color: var(--patient-muted);
}

.patient-scheduler-grid {
    grid-template-columns: 0.9fr 0.8fr 1.15fr;
    align-items: start;
}

.patient-calendar-shell {
    min-height: 280px;
    padding: 10px;
    border-radius: 22px;
    border: 1px dashed rgba(13, 90, 147, 0.2);
    background: rgba(255, 255, 255, 0.66);
}

.patient-schedule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.patient-table-wrap.compact {
    border-radius: 18px;
}

.patient-table.compact {
    min-width: 100%;
}

.patient-table.compact tbody td,
.patient-table.compact thead th {
    padding: 14px 16px;
}

.patient-inline-action:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.patient-inline-action.is-danger {
    background: rgba(210, 79, 87, 0.12);
    color: #a52c39;
}

.patient-inline-action.is-accent {
    background: rgba(16, 183, 144, 0.12);
    color: #0b7561;
}

.patient-inline-action.has-text {
    min-width: 0;
}

.patient-modal-card {
    border: 0;
    border-radius: 30px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.98), rgba(242, 247, 251, 0.98));
    box-shadow: 0 30px 60px rgba(17, 52, 82, 0.18);
}

.patient-modal-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 28px 8px;
}

.patient-modal-head.compact {
    padding-bottom: 0;
}

.patient-modal-head img {
    width: 108px;
    max-width: 30%;
}

.patient-modal-head h3 {
    margin: 6px 0 0;
    font-size: 1.5rem;
    color: var(--patient-text);
}

.patient-modal-kicker {
    margin: 0;
    color: var(--patient-primary);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 700;
}

.patient-modal-body {
    padding: 0 28px 10px;
}

.patient-modal-note {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(13, 90, 147, 0.06);
    color: var(--patient-muted);
}

.patient-legal-note {
    margin: 18px 0 0;
    color: var(--patient-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.patient-modal-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 0.9fr 1.1fr;
    padding: 20px 24px 24px;
}

.patient-form-grid.single-line {
    grid-template-columns: 1fr;
}

.patient-table .patient-empty,
.patient-empty {
    text-align: center;
}

.modal-footer {
    border-top: 0;
    padding: 12px 28px 28px;
}

.patient-footer-note {
    margin-top: 18px;
    color: var(--patient-muted);
    font-size: 0.92rem;
}

.patient-profile-hero {
    display: grid;
    gap: 18px;
    grid-template-columns: 1.15fr 0.85fr;
    margin-bottom: 22px;
}

.patient-readonly-cards {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 22px;
}

@media (max-width: 1160px) {
    .patient-app {
        grid-template-columns: 1fr;
    }

    .patient-nav {
        position: static;
    }

    .patient-hero,
    .patient-grid.cols-3,
    .patient-grid.cols-2,
    .patient-profile-hero,
    .patient-readonly-cards,
    .patient-scheduler-grid,
    .patient-modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .patient-shell {
        padding: 14px;
    }

    .patient-nav,
    .patient-topbar,
    .patient-section {
        border-radius: 24px;
        padding: 20px;
    }

    .patient-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .patient-form-grid {
        grid-template-columns: 1fr;
    }

    .patient-field.span-2 {
        grid-column: auto;
    }

    .patient-table {
        min-width: 560px;
    }
}
