/*
Theme Name: Melklik Theme
Theme URI: https://melklik.clinic
Author: Melklik Digital Health Team
Author URI: https://melklik.clinic
Description: Modern, mobile-first PWA-ready clinic management theme for Melklik Clinic. Dynamic clinic branding, role-based dashboards, AJAX appointment booking, post likes/comments/views, and full integration with the Melklik Clinic Companion plugin.
Version: 1.1.5
Tested up to: 6.7
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: melklik-theme
Tags: healthcare, clinic, accessibility-ready, custom-colors, custom-menu, featured-images, mobile-first, one-column, two-columns, blog
*/

/* ==========================================================================
   1. CSS Variables & Global Styles
   ========================================================================== */

:root {
    --ct-primary: #0d6efd;
    --ct-accent: #198754;
    --ct-danger: #dc3545;
    --ct-warning: #fd7e14;
    --ct-bg: #f7f9fc;
    --ct-surface: #ffffff;
    --ct-text: #1d2733;
    --ct-text-muted: #5b6b7c;
    --ct-border: #e3e9f0;
    --ct-radius: 12px;
    --ct-radius-sm: 8px;
    --ct-shadow: 0 4px 18px rgba(20, 40, 80, 0.08);
    --ct-shadow-lg: 0 12px 34px rgba(20, 40, 80, 0.14);
    --ct-space-1: 4px;
    --ct-space-2: 8px;
    --ct-space-3: 16px;
    --ct-space-4: 24px;
    --ct-space-5: 40px;
    --ct-space-6: 64px;
    --ct-header-height: 72px;
    --ct-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--ct-font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ct-text);
    background: var(--ct-bg);
    -webkit-font-smoothing: antialiased;
}

body.ct-menu-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--ct-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--ct-accent);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    color: var(--ct-text);
    margin: 0 0 var(--ct-space-3);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); }

p {
    margin: 0 0 var(--ct-space-3);
}

ul, ol {
    padding-left: 1.25em;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ct-skip-link {
    position: absolute;
    top: -60px;
    left: var(--ct-space-3);
    z-index: 99999;
    background: var(--ct-primary);
    color: #fff;
    padding: var(--ct-space-2) var(--ct-space-3);
    border-radius: 0 0 var(--ct-radius-sm) var(--ct-radius-sm);
    transition: top 0.2s ease;
}

.ct-skip-link:focus {
    top: 0;
    color: #fff;
}

.ct-container {
    width: min(1120px, 100% - 2 * var(--ct-space-3));
    margin-inline: auto;
}

.ct-section {
    padding-block: var(--ct-space-5);
}

.ct-section--alt {
    background: var(--ct-surface);
}

.ct-section-title {
    text-align: center;
    margin-bottom: var(--ct-space-2);
}

.ct-section-subtitle {
    text-align: center;
    color: var(--ct-text-muted);
    max-width: 640px;
    margin: 0 auto var(--ct-space-5);
}

/* ==========================================================================
   2. Buttons
   ========================================================================== */

.ct-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ct-space-2);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    border: 2px solid transparent;
    border-radius: var(--ct-radius-sm);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    text-align: center;
    min-height: 48px;
}

.ct-btn:active {
    transform: scale(0.98);
}

.ct-btn--primary {
    background: var(--ct-primary);
    color: #fff;
}

.ct-btn--primary:hover,
.ct-btn--primary:focus {
    background: color-mix(in srgb, var(--ct-primary) 85%, #000);
    color: #fff;
    box-shadow: var(--ct-shadow);
}

.ct-btn--accent {
    background: var(--ct-accent);
    color: #fff;
}

.ct-btn--accent:hover,
.ct-btn--accent:focus {
    background: color-mix(in srgb, var(--ct-accent) 85%, #000);
    color: #fff;
}

.ct-btn--outline {
    background: transparent;
    color: var(--ct-primary);
    border-color: var(--ct-primary);
}

.ct-btn--outline:hover,
.ct-btn--outline:focus {
    background: var(--ct-primary);
    color: #fff;
}

.ct-btn--light {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

.ct-btn--light:hover,
.ct-btn--light:focus {
    background: #fff;
    color: var(--ct-primary);
}

.ct-btn--block {
    width: 100%;
}

.ct-btn[disabled],
.ct-btn.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

/* ==========================================================================
   3. Header & Navigation (sticky)
   ========================================================================== */

.ct-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--ct-surface);
    border-bottom: 1px solid var(--ct-border);
    transition: box-shadow 0.25s ease;
}

.ct-header.is-stuck {
    box-shadow: var(--ct-shadow);
}

.ct-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ct-space-3);
    min-height: var(--ct-header-height);
}

.ct-brand {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
    color: var(--ct-text);
    text-decoration: none;
    min-width: 0;
}

.ct-brand:hover {
    color: var(--ct-text);
}

.ct-logo {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.ct-logo img,
.ct-logo--fallback {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.ct-brand__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ct-brand__name {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-brand__tagline {
    font-size: 0.75rem;
    color: var(--ct-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.ct-nav {
    display: none;
}

.ct-nav-list {
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
    list-style: none;
    margin: 0;
    padding: 0;
}

.ct-nav-list a {
    color: var(--ct-text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: var(--ct-space-2) 0;
    border-bottom: 2px solid transparent;
}

.ct-nav-list a:hover,
.ct-nav-list a:focus,
.ct-nav-list .current-menu-item > a {
    color: var(--ct-primary);
    border-bottom-color: var(--ct-primary);
}

.ct-header__actions {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
}

/* Hamburger */
.ct-hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 11px;
    background: transparent;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    cursor: pointer;
}

.ct-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ct-text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.ct-hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ct-hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.ct-hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.ct-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1100;
    visibility: hidden;
    pointer-events: none;
}

.ct-mobile-menu.is-open {
    visibility: visible;
    pointer-events: auto;
}

.ct-mobile-menu__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 40, 0.55);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ct-mobile-menu.is-open .ct-mobile-menu__overlay {
    opacity: 1;
}

.ct-mobile-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 88vw);
    height: 100%;
    background: var(--ct-surface);
    box-shadow: var(--ct-shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
}

.ct-mobile-menu.is-open .ct-mobile-menu__panel {
    transform: translateX(0);
}

.ct-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ct-space-2);
    padding: var(--ct-space-3);
    border-bottom: 1px solid var(--ct-border);
    font-weight: 700;
}

.ct-mobile-menu__close {
    width: 42px;
    height: 42px;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ct-text);
}

.ct-mobile-menu-list {
    list-style: none;
    list-style-type: none;
    margin: 0;
    padding: var(--ct-space-2) 0;
    flex: 1;
}

.ct-mobile-menu-list li {
    list-style: none;
}

.ct-mobile-menu-list li::marker,
.ct-mobile-menu-list li::before {
    content: none;
    display: none;
}

.ct-mobile-menu-list a {
    display: block;
    padding: 0.9rem var(--ct-space-4);
    color: var(--ct-text);
    font-weight: 500;
    border-bottom: 1px solid var(--ct-border);
}

.ct-mobile-menu-list a:hover,
.ct-mobile-menu-list a:focus {
    background: var(--ct-bg);
    color: var(--ct-primary);
}

.ct-mobile-menu__footer {
    padding: var(--ct-space-3) var(--ct-space-4) var(--ct-space-4);
    display: grid;
    gap: var(--ct-space-2);
    border-top: 1px solid var(--ct-border);
}

/* ==========================================================================
   4. Hero Section
   ========================================================================== */

.ct-hero {
    position: relative;
    background: linear-gradient(135deg, var(--ct-primary) 0%, color-mix(in srgb, var(--ct-primary) 60%, #0a2a5e) 100%);
    color: #fff;
    padding-block: clamp(3rem, 8vw, 6rem);
    overflow: hidden;
}

.ct-hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -40% auto;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.ct-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.ct-hero__eyebrow {
    display: inline-block;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--ct-space-3);
}

.ct-hero h1 {
    color: #fff;
    margin-bottom: var(--ct-space-3);
}

.ct-hero__lead {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--ct-space-4);
}

.ct-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ct-space-3);
}

/* ==========================================================================
   5. Cards & Grids
   ========================================================================== */

.ct-grid {
    display: grid;
    gap: var(--ct-space-4);
    grid-template-columns: 1fr;
}

.ct-card {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: var(--ct-space-4);
    box-shadow: var(--ct-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.ct-card__icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ct-radius-sm);
    background: color-mix(in srgb, var(--ct-primary) 12%, transparent);
    color: var(--ct-primary);
    margin-bottom: var(--ct-space-3);
}

.ct-card__meta {
    color: var(--ct-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--ct-space-2);
}

.ct-card__price {
    font-weight: 700;
    color: var(--ct-accent);
}

.ct-card__thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--ct-radius) var(--ct-radius) 0 0;
    margin: calc(-1 * var(--ct-space-4)) calc(-1 * var(--ct-space-4)) var(--ct-space-3);
    width: calc(100% + 2 * var(--ct-space-4));
    max-width: none;
}

.ct-card--doctor .ct-card__thumbnail {
    aspect-ratio: 1 / 1;
    max-height: 280px;
}

/* ==========================================================================
   6. Forms
   ========================================================================== */

.ct-form {
    display: grid;
    gap: var(--ct-space-3);
}

.ct-form-row {
    display: grid;
    gap: var(--ct-space-3);
    grid-template-columns: 1fr;
}

.ct-field label,
.ct-field .label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: var(--ct-space-1);
}

.ct-field .required {
    color: var(--ct-danger);
}

.ct-input,
.ct-select,
.ct-textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ct-text);
    background: var(--ct-surface);
    border: 1.5px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 48px;
}

.ct-textarea {
    min-height: 130px;
    resize: vertical;
}

.ct-input:focus,
.ct-select:focus,
.ct-textarea:focus {
    outline: none;
    border-color: var(--ct-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ct-primary) 20%, transparent);
}

.ct-field--hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.ct-form-message {
    display: none;
    padding: var(--ct-space-3);
    border-radius: var(--ct-radius-sm);
    font-weight: 500;
}

.ct-form-message.is-visible {
    display: block;
}

.ct-form-message--success {
    background: color-mix(in srgb, var(--ct-accent) 12%, #fff);
    color: var(--ct-accent);
    border: 1px solid color-mix(in srgb, var(--ct-accent) 35%, #fff);
}

.ct-form-message--error {
    background: color-mix(in srgb, var(--ct-danger) 10%, #fff);
    color: var(--ct-danger);
    border: 1px solid color-mix(in srgb, var(--ct-danger) 30%, #fff);
}

/* ==========================================================================
   7. Page Header (inner pages)
   ========================================================================== */

.ct-page-header {
    background: linear-gradient(135deg, var(--ct-primary), color-mix(in srgb, var(--ct-primary) 55%, #0a2a5e));
    color: #fff;
    padding-block: var(--ct-space-5);
}

.ct-page-header h1 {
    color: #fff;
    margin: 0;
}

.ct-page-header .entry-meta,
.ct-page-header p {
    color: rgba(255, 255, 255, 0.85);
    margin: var(--ct-space-2) 0 0;
}

/* ==========================================================================
   8. Content, Posts, Comments
   ========================================================================== */

.ct-main {
    padding-block: var(--ct-space-5);
}

.ct-article {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: var(--ct-space-4);
    margin-bottom: var(--ct-space-4);
    box-shadow: var(--ct-shadow);
}

.ct-article__header {
    margin-bottom: var(--ct-space-3);
}

.ct-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ct-space-3);
    font-size: 0.88rem;
    color: var(--ct-text-muted);
}

.ct-entry-meta a {
    color: var(--ct-text-muted);
}

.ct-entry-meta a:hover {
    color: var(--ct-primary);
}

.ct-post-thumbnail {
    border-radius: var(--ct-radius);
    margin-bottom: var(--ct-space-3);
}

.ct-content img {
    border-radius: var(--ct-radius-sm);
}

.ct-content blockquote {
    margin: var(--ct-space-4) 0;
    padding: var(--ct-space-3) var(--ct-space-4);
    border-left: 4px solid var(--ct-primary);
    background: var(--ct-bg);
    border-radius: 0 var(--ct-radius-sm) var(--ct-radius-sm) 0;
    font-style: italic;
}

.ct-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--ct-space-3);
}

.ct-content th,
.ct-content td {
    border: 1px solid var(--ct-border);
    padding: var(--ct-space-2) var(--ct-space-3);
    text-align: left;
}

/* Reactions */
.ct-reactions {
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
    padding-top: var(--ct-space-3);
    border-top: 1px solid var(--ct-border);
    margin-top: var(--ct-space-4);
    flex-wrap: wrap;
}

.ct-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--ct-space-2);
    padding: 0.55rem 1.1rem;
    border: 1.5px solid var(--ct-border);
    border-radius: 999px;
    background: var(--ct-surface);
    color: var(--ct-text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.ct-reaction-btn:hover,
.ct-reaction-btn:focus {
    border-color: var(--ct-primary);
    color: var(--ct-primary);
}

.ct-reaction-btn.is-active[data-reaction="like"] {
    background: color-mix(in srgb, var(--ct-accent) 12%, #fff);
    border-color: var(--ct-accent);
    color: var(--ct-accent);
}

.ct-reaction-btn.is-active[data-reaction="dislike"] {
    background: color-mix(in srgb, var(--ct-danger) 10%, #fff);
    border-color: var(--ct-danger);
    color: var(--ct-danger);
}

.ct-views {
    margin-left: auto;
    font-size: 0.88rem;
    color: var(--ct-text-muted);
}

/* Comments */
.ct-comments {
    margin-top: var(--ct-space-5);
}

.ct-comment-form p {
    margin: 0 0 var(--ct-space-3);
}

.ct-comment-form label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: var(--ct-space-1);
}

.ct-comment-form input[type="text"],
.ct-comment-form input[type="email"],
.ct-comment-form input[type="url"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ct-text);
    background: var(--ct-surface);
    border: 1.5px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    min-height: 48px;
}

.ct-comment-form input[type="text"]:focus,
.ct-comment-form input[type="email"]:focus,
.ct-comment-form input[type="url"]:focus {
    outline: none;
    border-color: var(--ct-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ct-primary) 20%, transparent);
}

.ct-comment-form .form-submit {
    margin-bottom: 0;
}

.ct-comment-reply a {
    font-size: 0.88rem;
    font-weight: 600;
}

.ct-comment-list {
    list-style: none;
    margin: 0 0 var(--ct-space-4);
    padding: 0;
}

.ct-comment {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    padding: var(--ct-space-3);
    margin-bottom: var(--ct-space-3);
}

.ct-comment__author {
    font-weight: 700;
}

.ct-comment__date {
    font-size: 0.82rem;
    color: var(--ct-text-muted);
    margin-left: var(--ct-space-2);
}

.ct-comment-children {
    list-style: none;
    margin: var(--ct-space-2) 0 0;
    padding-left: var(--ct-space-4);
    border-left: 2px solid var(--ct-border);
}

/* ==========================================================================
   9. Info Blocks (contact, hours)
   ========================================================================== */

.ct-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--ct-space-3);
}

.ct-info-list li {
    display: flex;
    gap: var(--ct-space-3);
    align-items: flex-start;
}

.ct-info-list__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--ct-primary) 12%, transparent);
    color: var(--ct-primary);
    border-radius: var(--ct-radius-sm);
}

.ct-info-list__label {
    display: block;
    font-size: 0.82rem;
    color: var(--ct-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ct-map {
    width: 100%;
    border: 0;
    border-radius: var(--ct-radius);
    min-height: 320px;
    box-shadow: var(--ct-shadow);
}

.ct-hours-table {
    width: 100%;
    border-collapse: collapse;
}

.ct-hours-table td {
    padding: var(--ct-space-2) 0;
    border-bottom: 1px dashed var(--ct-border);
}

.ct-hours-table td:last-child {
    text-align: right;
    font-weight: 600;
}

/* ==========================================================================
   10. Social Links
   ========================================================================== */

.clinic-social {
    display: flex;
    gap: var(--ct-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.clinic-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ct-primary) 10%, transparent);
    color: var(--ct-primary);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.clinic-social__link:hover,
.clinic-social__link:focus {
    background: var(--ct-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ==========================================================================
   11. Footer
   ========================================================================== */

.ct-footer {
    background: #101a2b;
    color: rgba(255, 255, 255, 0.82);
    padding-top: var(--ct-space-5);
    margin-top: var(--ct-space-5);
}

.ct-footer a {
    color: rgba(255, 255, 255, 0.82);
}

.ct-footer a:hover,
.ct-footer a:focus {
    color: #fff;
}

.ct-footer__grid {
    display: grid;
    gap: var(--ct-space-4);
    grid-template-columns: 1fr;
    padding-bottom: var(--ct-space-4);
}

.ct-footer h3,
.ct-footer h2 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: var(--ct-space-3);
}

.ct-footer__brand {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: var(--ct-space-2);
}

.ct-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--ct-space-2);
}

.ct-footer .clinic-social__link {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.ct-footer .clinic-social__link:hover {
    background: var(--ct-primary);
}

.ct-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-block: var(--ct-space-3);
    display: flex;
    flex-wrap: wrap;
    gap: var(--ct-space-2);
    justify-content: space-between;
    font-size: 0.88rem;
    text-align: center;
}

.ct-footer__bottom p {
    margin: 0;
}

/* ==========================================================================
   12. PWA Install Prompt & Misc
   ========================================================================== */

.ct-pwa-prompt {
    position: fixed;
    left: var(--ct-space-3);
    right: var(--ct-space-3);
    bottom: var(--ct-space-3);
    z-index: 1200;
    display: none;
    align-items: center;
    gap: var(--ct-space-3);
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow-lg);
    padding: var(--ct-space-3);
}

.ct-pwa-prompt.is-visible {
    display: flex;
}

.ct-pwa-prompt__text {
    flex: 1;
    font-size: 0.92rem;
}

.ct-pwa-prompt__actions {
    display: flex;
    gap: var(--ct-space-2);
}

.ct-pwa-prompt__close {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--ct-text-muted);
    line-height: 1;
    padding: var(--ct-space-1);
}

.ct-notice {
    background: color-mix(in srgb, var(--ct-warning) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--ct-warning) 35%, #fff);
    color: var(--ct-text);
    padding: var(--ct-space-3);
    border-radius: var(--ct-radius-sm);
    margin-bottom: var(--ct-space-4);
}

.ct-reference-box {
    background: color-mix(in srgb, var(--ct-accent) 10%, #fff);
    border: 1px dashed var(--ct-accent);
    border-radius: var(--ct-radius-sm);
    padding: var(--ct-space-3);
    font-weight: 600;
    display: none;
}

.ct-reference-box.is-visible {
    display: block;
}

.ct-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ct-space-2);
    justify-content: center;
}

.ct-pagination .page-numbers {
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    background: var(--ct-surface);
    min-width: 44px;
    text-align: center;
}

.ct-pagination .page-numbers.current {
    background: var(--ct-primary);
    border-color: var(--ct-primary);
    color: #fff;
}

.ct-empty {
    text-align: center;
    color: var(--ct-text-muted);
    padding: var(--ct-space-5) var(--ct-space-3);
}

/* ==========================================================================
   13. Login Page
   ========================================================================== */

.ct-login {
    padding-block: var(--ct-space-5);
}

.ct-login__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ct-space-4);
    align-items: stretch;
    max-width: 980px;
}

.ct-login__aside {
    position: relative;
    overflow: hidden;
    background: linear-gradient(140deg, var(--ct-primary) 0%, color-mix(in srgb, var(--ct-primary) 55%, #08234d) 100%);
    color: #fff;
    border-radius: var(--ct-radius);
    padding: var(--ct-space-4);
}

.ct-login__aside::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -140px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, transparent 70%);
    pointer-events: none;
}

.ct-login__aside > * {
    position: relative;
    z-index: 1;
}

.ct-login__brand {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: var(--ct-space-4);
}

.ct-login__brand .ct-logo {
    width: 46px;
    height: 46px;
    background: #fff;
    border-radius: var(--ct-radius-sm);
    padding: 5px;
}

.ct-login__aside h1 {
    color: #fff;
    margin-bottom: var(--ct-space-2);
}

.ct-login__lead {
    color: rgba(255, 255, 255, 0.9);
    max-width: 38ch;
    margin-bottom: 0;
}

.ct-login__features {
    list-style: none;
    margin: var(--ct-space-4) 0 0;
    padding: 0;
    display: grid;
    gap: var(--ct-space-3);
}

.ct-login__features li {
    display: flex;
    align-items: flex-start;
    gap: var(--ct-space-3);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
}

.ct-login__feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.ct-login__help {
    margin: var(--ct-space-5) 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
}

.ct-login__help a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ct-login__form-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ct-login__card {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
    padding: var(--ct-space-4);
}

.ct-login__card h2 {
    margin-bottom: var(--ct-space-1);
}

.ct-login__intro {
    color: var(--ct-text-muted);
    margin-bottom: var(--ct-space-4);
}

.ct-login__notice {
    border-radius: var(--ct-radius-sm);
    padding: var(--ct-space-3);
    margin-bottom: var(--ct-space-3);
    font-size: 0.95rem;
}

.ct-login__notice p {
    margin: 0 0 var(--ct-space-1);
}

.ct-login__notice p:last-child {
    margin-bottom: 0;
}

.ct-login__notice--success {
    background: color-mix(in srgb, var(--ct-accent) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--ct-accent) 35%, #fff);
    color: var(--ct-accent);
}

.ct-login__notice--error {
    background: color-mix(in srgb, var(--ct-danger) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--ct-danger) 30%, #fff);
    color: var(--ct-danger);
}

.ct-login__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--ct-space-2);
    font-size: 0.92rem;
}

.ct-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--ct-space-2);
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
}

.ct-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--ct-primary);
}

.ct-password-wrap {
    position: relative;
}

.ct-password-wrap .ct-input {
    padding-right: 3rem;
}

.ct-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ct-text-muted);
    border-radius: var(--ct-radius-sm);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.ct-password-toggle:hover,
.ct-password-toggle:focus {
    color: var(--ct-primary);
    background: color-mix(in srgb, var(--ct-primary) 10%, transparent);
}

.ct-password-toggle__icon--hide {
    display: none;
}

.ct-password-toggle.is-visible .ct-password-toggle__icon--show {
    display: none;
}

.ct-password-toggle.is-visible .ct-password-toggle__icon--hide {
    display: block;
}

.ct-login__privacy {
    margin: var(--ct-space-4) 0 0;
    padding-top: var(--ct-space-3);
    border-top: 1px solid var(--ct-border);
    font-size: 0.8rem;
    color: var(--ct-text-muted);
}

.ct-login__back {
    margin: var(--ct-space-3) 0 0;
    text-align: center;
    font-size: 0.92rem;
}

.ct-login__back a {
    color: var(--ct-text-muted);
    font-weight: 600;
}

.ct-login__back a:hover,
.ct-login__back a:focus {
    color: var(--ct-primary);
}

/* ==========================================================================
   14. Appointment Booking Form
   ========================================================================== */

.ct-appointments {
    padding-block: var(--ct-space-5);
}

.ct-appointments__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ct-space-4);
    align-items: stretch;
    max-width: 980px;
}

.ct-appointments__info {
    position: relative;
    overflow: hidden;
    background: linear-gradient(140deg, var(--ct-primary) 0%, color-mix(in srgb, var(--ct-primary) 55%, #08234d) 100%);
    color: #fff;
    border-radius: var(--ct-radius);
    padding: var(--ct-space-4);
}

.ct-appointments__info::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -140px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, transparent 70%);
    pointer-events: none;
}

.ct-appointments__info > * {
    position: relative;
    z-index: 1;
}

.ct-appointments__brand {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: var(--ct-space-4);
}

.ct-appointments__brand .ct-logo {
    width: 46px;
    height: 46px;
    background: #fff;
    border-radius: var(--ct-radius-sm);
    padding: 5px;
}

.ct-appointments__info h1 {
    color: #fff;
    margin-bottom: var(--ct-space-2);
}

.ct-appointments__lead {
    color: rgba(255, 255, 255, 0.9);
    max-width: 38ch;
    margin-bottom: 0;
}

.ct-appointments__features {
    list-style: none;
    margin: var(--ct-space-4) 0 0;
    padding: 0;
    display: grid;
    gap: var(--ct-space-3);
}

.ct-appointments__features li {
    display: flex;
    align-items: flex-start;
    gap: var(--ct-space-3);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
}

.ct-appointments__feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.ct-appointments__help {
    margin: var(--ct-space-5) 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
}

.ct-appointments__help a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ct-appointments__form-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ct-appointments__form-intro {
    color: var(--ct-text-muted);
    margin-bottom: var(--ct-space-4);
}

.ct-appointments__form {
    display: grid;
    gap: var(--ct-space-3);
}

.ct-appointments__privacy {
    margin: var(--ct-space-4) 0 0;
    padding-top: var(--ct-space-3);
    border-top: 1px solid var(--ct-border);
    font-size: 0.8rem;
    color: var(--ct-text-muted);
}

.ct-appointments__back {
    margin: var(--ct-space-3) 0 0;
    text-align: center;
    font-size: 0.92rem;
}

.ct-appointments__back a {
    color: var(--ct-text-muted);
    font-weight: 600;
}

.ct-appointments__back a:hover,
.ct-appointments__back a:focus {
    color: var(--ct-primary);
}

/* ==========================================================================
   15. Dashboard Styles
   ========================================================================== */

.ct-dashboard {
    padding-block: var(--ct-space-4);
    min-height: calc(100vh - var(--ct-header-height));
}

.ct-dashboard__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ct-space-3);
    align-items: stretch;
}

.ct-dashboard__sidebar {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: var(--ct-space-3);
    box-shadow: var(--ct-shadow);
}

.ct-dashboard__user {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--ct-space-3);
    padding-bottom: var(--ct-space-3);
    border-bottom: 1px solid var(--ct-border);
}

.ct-dashboard__logo {
    width: 48px;
    height: 48px;
    margin-bottom: var(--ct-space-2);
}

.ct-dashboard__user h2 {
    font-size: 1.1rem;
    margin-bottom: var(--ct-space-1);
}

.ct-dashboard__role {
    color: var(--ct-text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.ct-dashboard__nav {
    display: flex;
    flex-direction: column;
    gap: var(--ct-space-1);
}

.ct-dashboard__nav-link {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
    padding: var(--ct-space-2) var(--ct-space-3);
    border-radius: var(--ct-radius-sm);
    color: var(--ct-text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-height: 48px;
}

.ct-dashboard__nav-link:hover,
.ct-dashboard__nav-link:focus {
    background: var(--ct-bg);
    color: var(--ct-primary);
}

.ct-dashboard__nav-link--active {
    background: color-mix(in srgb, var(--ct-primary) 12%, transparent);
    color: var(--ct-primary);
    font-weight: 600;
}

.ct-dashboard__nav-link--logout {
    margin-top: var(--ct-space-3);
    color: var(--ct-danger);
}

.ct-dashboard__nav-link--logout:hover,
.ct-dashboard__nav-link--logout:focus {
    background: color-mix(in srgb, var(--ct-danger) 10%, transparent);
    color: var(--ct-danger);
}

.ct-dashboard__content {
    display: flex;
    flex-direction: column;
    gap: var(--ct-space-3);
}

.ct-dashboard__header {
    margin-bottom: var(--ct-space-2);
}

.ct-dashboard__header h1 {
    margin-bottom: var(--ct-space-1);
}

.ct-dashboard__subtitle {
    color: var(--ct-text-muted);
    margin: 0;
}

.ct-dashboard__stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ct-space-3);
}

.ct-stat-card {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: var(--ct-space-3);
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
    box-shadow: var(--ct-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.ct-stat-card--primary {
    background: linear-gradient(135deg, var(--ct-primary) 0%, color-mix(in srgb, var(--ct-primary) 75%, #062a5c) 100%);
    border-color: var(--ct-primary);
}

.ct-stat-card--primary .ct-stat-card__icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.ct-stat-card--primary .ct-stat-card__value,
.ct-stat-card--primary .ct-stat-card__label {
    color: #fff;
}

.ct-stat-card--attention {
    border-color: var(--ct-warning);
    background: color-mix(in srgb, var(--ct-warning) 8%, #fff);
}

.ct-stat-card__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ct-radius-sm);
    background: color-mix(in srgb, var(--ct-primary) 12%, transparent);
    color: var(--ct-primary);
}

.ct-stat-card__data {
    flex: 1;
    min-width: 0;
}

.ct-stat-card__value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ct-text);
}

.ct-stat-card__label {
    display: block;
    font-size: 0.85rem;
    color: var(--ct-text-muted);
    margin-top: var(--ct-space-1);
}

.ct-dashboard__section {
    display: flex;
    flex-direction: column;
    gap: var(--ct-space-3);
}

.ct-dashboard__section-title {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
    flex-wrap: wrap;
    margin: 0;
    font-size: 1.2rem;
}

.ct-panel__head h2 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.ct-patient-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ct-space-2);
}

.ct-patient-search input[type="search"] {
    flex: 1 1 18rem;
    min-height: 48px;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    background: var(--ct-surface);
    color: var(--ct-text);
}

.ct-patient-search select {
    min-height: 48px;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
    background: var(--ct-surface);
    color: var(--ct-text);
}

.ct-doctor-profile .ct-card__header {
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
    padding-bottom: var(--ct-space-3);
    border-bottom: 1px solid var(--ct-border);
}

.ct-doctor-profile__avatar {
    flex: 0 0 auto;
    border-radius: 50%;
}

.ct-doctor-profile .ct-card__header h2,
.ct-doctor-profile .ct-card__header p {
    margin: 0;
}

.ct-doctor-profile .ct-card__header p {
    margin-top: var(--ct-space-1);
    color: var(--ct-text-muted);
}

.ct-doctor-profile__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--ct-space-3);
    margin: 0;
}

.ct-doctor-profile__details dt {
    margin-bottom: var(--ct-space-1);
    color: var(--ct-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.ct-doctor-profile__details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.ct-doctor-profile__notice {
    margin: var(--ct-space-3) 0 0;
    color: var(--ct-text-muted);
}

.ct-patient-profile .ct-card__header {
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
    padding-bottom: var(--ct-space-3);
    border-bottom: 1px solid var(--ct-border);
}

.ct-patient-profile__photo {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
}

.ct-patient-profile .ct-card__header h2,
.ct-patient-profile .ct-card__header p {
    margin: 0;
}

.ct-patient-profile__details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--ct-space-3);
    margin: 0;
}

.ct-patient-profile__details dt {
    margin-bottom: var(--ct-space-1);
    color: var(--ct-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.ct-patient-profile__details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.ct-patient-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--ct-space-3);
}

.ct-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    background: var(--ct-bg);
    border: 1px solid var(--ct-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ct-text-muted);
}

.ct-dashboard__grid-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--ct-space-4);
}

/* Dashboard booking form styling */
.ct-booking-modal {
    width: min(680px, calc(100% - 2rem));
    max-width: none;
    max-height: min(90vh, 900px);
    padding: 0;
    color: var(--ct-text);
    background: var(--ct-surface);
    border: 0;
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow-lg);
}

.ct-booking-modal::backdrop {
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
}

.ct-booking-modal__content {
    max-height: min(90vh, 900px);
    overflow-y: auto;
    padding: var(--ct-space-4);
}

.ct-booking-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ct-space-3);
    margin-bottom: var(--ct-space-3);
}

.ct-booking-modal__header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.ct-booking-modal__close {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    color: var(--ct-text-muted);
    background: transparent;
    border: 1px solid var(--ct-border);
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.ct-booking-modal__close:hover,
.ct-booking-modal__close:focus-visible {
    color: var(--ct-text);
    background: var(--ct-bg);
}

#ct-booking-form-dashboard .ct-form-row {
    grid-template-columns: repeat(2, 1fr);
}

.ct-dashboard__empty {
    color: var(--ct-text-muted);
    font-style: italic;
}

.ct-dashboard__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ct-space-2);
}

.ct-empty-state {
    text-align: center;
    padding: var(--ct-space-5) var(--ct-space-3);
    color: var(--ct-text-muted);
}

.ct-empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--ct-space-3);
    color: var(--ct-border);
}

.ct-empty-state p {
    margin-bottom: var(--ct-space-3);
}

.ct-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
    display: block;
}

.ct-table thead {
    background: var(--ct-bg);
}

.ct-table th,
.ct-table td {
    padding: var(--ct-space-2) var(--ct-space-3);
    text-align: left;
    border-bottom: 1px solid var(--ct-border);
    white-space: nowrap;
}

.ct-table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ct-text-muted);
}

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

.ct-table code {
    background: var(--ct-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.ct-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--ct-radius-sm);
    border: 1px solid var(--ct-border);
}

.ct-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.ct-status-pill--pending {
    background: color-mix(in srgb, var(--ct-warning) 15%, #fff);
    color: var(--ct-warning);
    border: 1px solid color-mix(in srgb, var(--ct-warning) 30%, #fff);
}

.ct-status-pill--confirmed {
    background: color-mix(in srgb, var(--ct-accent) 15%, #fff);
    color: var(--ct-accent);
    border: 1px solid color-mix(in srgb, var(--ct-accent) 30%, #fff);
}

.ct-status-pill--completed {
    background: color-mix(in srgb, var(--ct-primary) 15%, #fff);
    color: var(--ct-primary);
    border: 1px solid color-mix(in srgb, var(--ct-primary) 30%, #fff);
}

.ct-status-pill--cancelled,
.ct-status-pill--no_show {
    background: color-mix(in srgb, var(--ct-danger) 10%, #fff);
    color: var(--ct-danger);
    border: 1px solid color-mix(in srgb, var(--ct-danger) 25%, #fff);
}

.ct-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ct-space-3);
}

.ct-history-item {
    padding: var(--ct-space-3);
    background: var(--ct-bg);
    border-radius: var(--ct-radius-sm);
}

.ct-history-item__date {
    display: flex;
    align-items: center;
    gap: var(--ct-space-2);
    margin-bottom: var(--ct-space-1);
}

.ct-history-item__service {
    font-weight: 600;
    margin-bottom: var(--ct-space-1);
}

.ct-history-item__reason {
    color: var(--ct-text-muted);
    font-size: 0.9rem;
}

.ct-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ct-space-3);
}

.ct-recent-list li {
    padding-bottom: var(--ct-space-3);
    border-bottom: 1px solid var(--ct-border);
}

.ct-recent-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ct-recent-list__meta {
    color: var(--ct-text-muted);
    font-size: 0.85rem;
    margin-top: var(--ct-space-1);
}

.ct-recent-list__preview {
    color: var(--ct-text-muted);
    font-size: 0.9rem;
    margin-top: var(--ct-space-1);
}

.ct-notice {
    display: flex;
    gap: var(--ct-space-3);
    padding: var(--ct-space-3);
    border-radius: var(--ct-radius-sm);
    background: var(--ct-bg);
    border: 1px solid var(--ct-border);
}

.ct-notice--info {
    background: color-mix(in srgb, var(--ct-primary) 10%, #fff);
    border-color: color-mix(in srgb, var(--ct-primary) 25%, #fff);
}

.ct-notice__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--ct-primary);
}

.ct-notice__content {
    flex: 1;
}

.ct-notice__content p {
    margin: 0;
}

.ct-btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    min-height: 36px;
}

/* Touch-friendly optimizations */
@media (hover: none) and (pointer: coarse) {
    .ct-dashboard__nav-link:hover,
    .ct-dashboard__nav-link:focus {
        background: color-mix(in srgb, var(--ct-primary) 12%, transparent);
        color: var(--ct-primary);
    }

    .ct-dashboard__nav-link--active {
        background: var(--ct-primary);
        color: #fff;
    }

    .ct-stat-card:active {
        transform: scale(0.98);
    }

    .ct-status-pill {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Mobile-specific dashboard optimizations */
@media (max-width: 599px) {
    .ct-dashboard {
        padding-block: var(--ct-space-3);
    }

    .ct-dashboard__inner {
        gap: var(--ct-space-3);
    }

    .ct-dashboard__sidebar {
        padding: var(--ct-space-3);
    }

    .ct-dashboard__user {
        margin-bottom: var(--ct-space-3);
        padding-bottom: var(--ct-space-3);
    }

    .ct-dashboard__logo {
        width: 40px;
        height: 40px;
    }

    .ct-dashboard__user h2 {
        font-size: 1rem;
    }

    .ct-dashboard__role {
        font-size: 0.8rem;
    }

    .ct-dashboard__nav-link {
        padding: var(--ct-space-2);
        font-size: 0.9rem;
    }

    .ct-dashboard__nav-link span {
        font-size: 18px;
    }

    .ct-dashboard__content {
        gap: var(--ct-space-3);
    }

    .ct-dashboard__header h1 {
        font-size: 1.5rem;
    }

    .ct-dashboard__subtitle {
        font-size: 0.9rem;
    }

    .ct-dashboard__stats {
        grid-template-columns: 1fr;
        gap: var(--ct-space-2);
    }

    .ct-stat-card {
        padding: var(--ct-space-3);
    }

    .ct-stat-card__icon {
        width: 40px;
        height: 40px;
    }

    .ct-stat-card__value {
        font-size: 1.4rem;
    }

    .ct-stat-card__label {
        font-size: 0.8rem;
    }

    .ct-dashboard__section-title {
        font-size: 1.1rem;
        flex-wrap: wrap;
    }

    .ct-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .ct-dashboard__grid-2col {
        grid-template-columns: 1fr;
        gap: var(--ct-space-3);
    }

    .ct-table-wrapper {
        border-radius: var(--ct-radius-sm);
        margin: calc(-1 * var(--ct-space-3));
        margin-bottom: 0;
        margin-top: calc(-1 * var(--ct-space-3));
        width: calc(100% + 2 * var(--ct-space-3));
        max-width: calc(100% + 2 * var(--ct-space-3));
    }

    .ct-table {
        font-size: 0.85rem;
    }

    .ct-table th,
    .ct-table td {
        padding: var(--ct-space-2);
    }

    .ct-table th {
        font-size: 0.75rem;
    }

    .ct-status-pill {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .ct-history-item {
        padding: var(--ct-space-2);
    }

    .ct-history-item__date {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--ct-space-1);
    }

    .ct-recent-list li {
        padding-bottom: var(--ct-space-2);
    }

    .ct-recent-list__meta,
    .ct-recent-list__preview {
        font-size: 0.85rem;
    }

    .ct-notice {
        padding: var(--ct-space-2);
        gap: var(--ct-space-2);
    }

    .ct-notice__icon {
        width: 20px;
        height: 20px;
    }

    .ct-empty-state {
        padding: var(--ct-space-4) var(--ct-space-2);
    }

    .ct-empty-state__icon {
        width: 48px;
        height: 48px;
    }

    /* Appointment form mobile */
    .ct-appointments {
        padding-block: var(--ct-space-4);
    }

    .ct-appointments__inner {
        gap: var(--ct-space-3);
    }

    .ct-appointments__info {
        padding: var(--ct-space-3);
    }

    .ct-appointments__brand {
        font-size: 1rem;
        margin-bottom: var(--ct-space-3);
    }

    .ct-appointments__brand .ct-logo {
        width: 40px;
        height: 40px;
    }

    .ct-appointments__info h1 {
        font-size: 1.5rem;
    }

    .ct-appointments__lead {
        font-size: 0.95rem;
    }

    .ct-appointments__features {
        gap: var(--ct-space-2);
    }

    .ct-appointments__features li {
        font-size: 0.9rem;
    }

    .ct-appointments__feature-icon {
        width: 36px;
        height: 36px;
    }

    .ct-appointments__help {
        font-size: 0.85rem;
    }
}

/* Shared doctor and nurse dashboard portal */
.ct-role-portal__inner {
    display: flex;
    flex-direction: column;
    gap: var(--ct-space-4);
}

.ct-role-portal__inner > .ct-dashboard__sidebar {
    display: none;
}

.ct-role-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ct-space-4);
    padding: var(--ct-space-4);
    color: #fff;
    background: linear-gradient(120deg, #2271b1, #0a6ecb);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
}

.ct-role-hero__identity,
.ct-role-hero__actions {
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
}

.ct-role-hero__avatar {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    object-fit: cover;
}

.ct-role-hero__greeting,
.ct-role-hero__copy h1,
.ct-role-hero__meta {
    margin: 0;
}

.ct-role-hero__greeting {
    font-weight: 600;
    opacity: 0.85;
}

.ct-role-hero__copy h1 {
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.ct-role-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ct-space-2);
    margin-top: var(--ct-space-1);
    font-size: 0.9rem;
}

.ct-role-hero__badge {
    padding: 0.15rem 0.6rem;
    background: rgba(255, 255, 255, 0.17);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.ct-role-hero__actions {
    justify-content: flex-end;
}

.ct-role-hero__clinic {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--ct-space-3);
    text-align: right;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
}

.ct-role-hero__clinic span {
    font-size: 0.85rem;
    opacity: 0.85;
}

.ct-role-hero__logout {
    padding: 0.6rem 0.9rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--ct-radius-sm);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.ct-role-hero__logout:hover,
.ct-role-hero__logout:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.ct-role-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ct-space-3);
}

.ct-role-menu[hidden],
.ct-role-back[hidden],
.ct-role-toast[hidden] {
    display: none !important;
}

.ct-role-menu__item {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: var(--ct-space-3);
    padding: var(--ct-space-3);
    color: var(--ct-text);
    background: #fff;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: 0 2px 8px rgba(20, 40, 80, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ct-role-menu__item:hover,
.ct-role-menu__item:focus-visible {
    color: var(--ct-text);
    transform: translateY(-3px);
    box-shadow: var(--ct-shadow);
}

.ct-role-menu__item.is-active {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.14), var(--ct-shadow);
}

.ct-role-menu__icon {
    display: inline-flex;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 16px;
}

.ct-role-menu__item--blue .ct-role-menu__icon {
    background: linear-gradient(135deg, #2271b1, #0a6ecb);
}

.ct-role-menu__item--orange .ct-role-menu__icon {
    background: linear-gradient(135deg, #f28c28, #e65c00);
}

.ct-role-menu__item--green .ct-role-menu__icon {
    background: linear-gradient(135deg, #2eaa67, #16834a);
}

.ct-role-menu__label {
    flex: 1;
    font-weight: 600;
}

.ct-role-menu__arrow {
    color: var(--ct-text-muted);
}

.ct-role-back {
    align-self: flex-start;
    padding: 0.55rem 0.8rem;
    color: #2271b1;
    background: transparent;
    border: 1px solid rgba(34, 113, 177, 0.35);
    border-radius: var(--ct-radius-sm);
    cursor: pointer;
}

.ct-role-back:hover,
.ct-role-back:focus-visible {
    background: rgba(34, 113, 177, 0.08);
}

.ct-role-panel {
    min-height: 180px;
    padding: var(--ct-space-4);
    background: #fff;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
}

.ct-role-panel[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
}

.ct-role-toast {
    margin-bottom: var(--ct-space-3);
    padding: var(--ct-space-2) var(--ct-space-3);
    color: #155724;
    background: #e8f7ed;
    border: 1px solid #c4e8d0;
    border-radius: var(--ct-radius-sm);
}

.ct-doctor-portal .ct-dashboard__content,
.ct-nurse-portal .ct-dashboard__content {
    gap: var(--ct-space-3);
}

.ct-doctor-profile__avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

@media (max-width: 899px) {
    .ct-role-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .ct-role-hero,
    .ct-role-hero__identity,
    .ct-role-hero__actions {
        align-items: flex-start;
    }

    .ct-role-hero {
        flex-direction: column;
        padding: var(--ct-space-3);
    }

    .ct-role-hero__avatar {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }

    .ct-role-hero__actions {
        width: 100%;
        justify-content: space-between;
    }

    .ct-role-hero__clinic {
        padding-left: 0;
        text-align: left;
        border-right: 0;
    }

    .ct-role-menu {
        grid-template-columns: 1fr;
    }

    .ct-role-menu__item {
        min-height: 72px;
        padding: var(--ct-space-2) var(--ct-space-3);
    }

    .ct-role-panel {
        padding: var(--ct-space-3);
    }

    .ct-doctor-profile__avatar {
        width: 88px;
        height: 88px;
    }
}

/* ==========================================================================
   16. Responsive Breakpoints (mobile-first)
   ========================================================================== */

@media (max-width: 599px) {
    .ct-brand__tagline {
        display: none;
    }

    .ct-brand__name {
        font-size: 1rem;
        max-width: 46vw;
    }

    .ct-section {
        padding-block: var(--ct-space-4);
    }
}

@media (min-width: 600px) {
    .ct-grid--2,
    .ct-grid--services {
        grid-template-columns: repeat(2, 1fr);
    }

    .ct-form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .ct-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Tablet dashboard stats */
    .ct-dashboard__stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ct-grid--3,
    .ct-grid--services,
    .ct-grid--doctors {
        grid-template-columns: repeat(3, 1fr);
    }

    .ct-login__inner {
        grid-template-columns: 1.05fr 0.95fr;
    }

    .ct-login__aside {
        padding: var(--ct-space-5) var(--ct-space-4);
    }

    .ct-login__card {
        padding: var(--ct-space-5) var(--ct-space-4);
    }

    .ct-grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .ct-brand__name {
        font-size: 1.25rem;
    }

    .ct-footer__grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .ct-pwa-prompt {
        left: auto;
        right: var(--ct-space-4);
        bottom: var(--ct-space-4);
        max-width: 420px;
    }

    /* Appointment form desktop */
    .ct-appointments__inner {
        grid-template-columns: 1.05fr 0.95fr;
    }

    .ct-appointments__info {
        padding: var(--ct-space-5) var(--ct-space-4);
    }

    /* Dashboard responsive - Desktop */
    .ct-dashboard {
        padding-block: var(--ct-space-5);
    }

    .ct-dashboard__inner {
        grid-template-columns: 260px 1fr;
        gap: var(--ct-space-4);
        align-items: start;
    }

    .ct-dashboard__sidebar {
        position: sticky;
        top: calc(var(--ct-header-height) + var(--ct-space-4));
        max-height: calc(100vh - var(--ct-header-height) - var(--ct-space-4) * 2);
        overflow-y: auto;
        padding: var(--ct-space-4);
    }

    .ct-dashboard__user {
        margin-bottom: var(--ct-space-4);
        padding-bottom: var(--ct-space-4);
    }

    .ct-dashboard__logo {
        width: 56px;
        height: 56px;
    }

    .ct-dashboard__user h2 {
        font-size: 1.2rem;
    }

    .ct-dashboard__role {
        font-size: 0.9rem;
    }

    .ct-dashboard__nav-link {
        padding: var(--ct-space-2) var(--ct-space-3);
        font-size: 0.95rem;
    }

    .ct-dashboard__nav-link span {
        font-size: 20px;
    }

    .ct-dashboard__content {
        gap: var(--ct-space-4);
    }

    .ct-dashboard__stats {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--ct-space-3);
    }

    .ct-stat-card {
        padding: var(--ct-space-3);
    }

    .ct-stat-card__icon {
        width: 48px;
        height: 48px;
    }

    .ct-stat-card__value {
        font-size: 1.6rem;
    }

    .ct-stat-card__label {
        font-size: 0.85rem;
    }

    .ct-dashboard__grid-2col {
        grid-template-columns: 1fr 1fr;
    }

    .ct-table-wrapper {
        margin: 0;
        width: 100%;
        max-width: 100%;
    }

    .ct-table {
        font-size: 1rem;
        display: table;
    }

    .ct-table th,
    .ct-table td {
        padding: var(--ct-space-2) var(--ct-space-3);
    }

    .ct-table th {
        font-size: 0.9rem;
    }

    .ct-status-pill {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }

    /* Smaller font for patient number on desktop */
    .ct-stat-card__value--small {
        font-size: 1.2rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Patient portal redesign */
.ct-patient-portal {
    padding-block: var(--ct-space-5);
}

.ct-patient-portal__inner {
    display: flex;
    flex-direction: column;
    gap: var(--ct-space-4);
}

.ct-patient-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ct-space-4);
    padding: var(--ct-space-4);
    color: #fff;
    background: linear-gradient(120deg, #2271b1, #0a6ecb);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
}

.ct-patient-hero__identity,
.ct-patient-hero__actions {
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
}

.ct-patient-hero__avatar {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    object-fit: cover;
}

.ct-patient-hero__greeting,
.ct-patient-hero__copy h1,
.ct-patient-hero__meta {
    margin: 0;
}

.ct-patient-hero__greeting {
    opacity: 0.85;
    font-weight: 600;
}

.ct-patient-hero__copy h1 {
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.ct-patient-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ct-space-2);
    margin-top: var(--ct-space-1);
    font-size: 0.9rem;
}

.ct-patient-hero__badge {
    padding: 0.15rem 0.6rem;
    background: rgba(255, 255, 255, 0.17);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.ct-patient-hero__actions {
    justify-content: flex-end;
}

.ct-patient-hero__clinic {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--ct-space-3);
    text-align: right;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
}

.ct-patient-hero__clinic span {
    font-size: 0.85rem;
    opacity: 0.85;
}

.ct-patient-hero__logout {
    padding: 0.6rem 0.9rem;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--ct-radius-sm);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.ct-patient-hero__logout:hover,
.ct-patient-hero__logout:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
}

.ct-patient-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ct-space-3);
}

.ct-patient-menu[hidden],
.ct-patient-back[hidden],
.ct-patient-toast[hidden] {
    display: none !important;
}

.ct-patient-menu__item {
    display: flex;
    min-height: 82px;
    align-items: center;
    gap: var(--ct-space-3);
    padding: var(--ct-space-3);
    color: var(--ct-text);
    background: #fff;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: 0 2px 8px rgba(20, 40, 80, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ct-patient-menu__item:hover,
.ct-patient-menu__item:focus-visible {
    color: var(--ct-text);
    transform: translateY(-3px);
    box-shadow: var(--ct-shadow);
}

.ct-patient-menu__item.is-active {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.14), var(--ct-shadow);
}

.ct-patient-menu__icon {
    display: inline-flex;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 16px;
}

.ct-patient-menu__item--blue .ct-patient-menu__icon {
    background: linear-gradient(135deg, #2271b1, #0a6ecb);
}

.ct-patient-menu__item--orange .ct-patient-menu__icon {
    background: linear-gradient(135deg, #f28c28, #e65c00);
}

.ct-patient-menu__item--green .ct-patient-menu__icon {
    background: linear-gradient(135deg, #2eaa67, #16834a);
}

.ct-patient-menu__item--purple .ct-patient-menu__icon {
    background: linear-gradient(135deg, #8b5cf6, #6639c6);
}

.ct-patient-menu__item--red .ct-patient-menu__icon {
    background: linear-gradient(135deg, #ef5361, #c52d42);
}

.ct-patient-menu__label {
    flex: 1;
    font-weight: 600;
}

.ct-patient-menu__arrow {
    color: var(--ct-text-muted);
}

.ct-patient-back {
    align-self: flex-start;
    padding: 0.55rem 0.8rem;
    color: #2271b1;
    background: transparent;
    border: 1px solid rgba(34, 113, 177, 0.35);
    border-radius: var(--ct-radius-sm);
    cursor: pointer;
}

.ct-patient-back:hover,
.ct-patient-back:focus-visible {
    background: rgba(34, 113, 177, 0.08);
}

.ct-patient-panel {
    position: relative;
    min-height: 180px;
    padding: var(--ct-space-4);
    background: #fff;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    box-shadow: var(--ct-shadow);
}

.ct-patient-panel[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
}

.ct-patient-toast {
    margin-bottom: var(--ct-space-3);
    padding: var(--ct-space-2) var(--ct-space-3);
    color: #155724;
    background: #e8f7ed;
    border: 1px solid #c4e8d0;
    border-radius: var(--ct-radius-sm);
}

.ct-patient-profile__header {
    display: flex;
    align-items: center;
    gap: var(--ct-space-3);
    margin-bottom: var(--ct-space-4);
    padding-bottom: var(--ct-space-3);
    border-bottom: 1px solid var(--ct-border);
}

.ct-patient-profile__photo {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    border: 4px solid #edf4fa;
    border-radius: 50%;
    object-fit: cover;
}

.ct-patient-profile__header h2,
.ct-patient-profile__header p {
    margin: 0;
}

.ct-patient-profile__header p {
    margin-top: var(--ct-space-1);
    color: var(--ct-text-muted);
}

.ct-patient-profile__sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ct-space-3);
}

.ct-patient-profile__section {
    min-width: 0;
    padding: var(--ct-space-3);
    background: #f8fafc;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius-sm);
}

.ct-patient-profile__section h3 {
    margin: 0 0 var(--ct-space-3);
    font-size: 1rem;
}

@media (max-width: 899px) {
    .ct-patient-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 599px) {
    .ct-patient-portal {
        padding-block: var(--ct-space-3);
    }

    .ct-patient-hero,
    .ct-patient-hero__identity,
    .ct-patient-hero__actions {
        align-items: flex-start;
    }

    .ct-patient-hero {
        flex-direction: column;
        padding: var(--ct-space-3);
    }

    .ct-patient-hero__avatar {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }

    .ct-patient-hero__actions {
        width: 100%;
        justify-content: space-between;
    }

    .ct-patient-hero__clinic {
        padding-left: 0;
        text-align: left;
        border-right: 0;
    }

    .ct-patient-menu,
    .ct-patient-profile__sections {
        grid-template-columns: 1fr;
    }

    .ct-patient-menu__item {
        min-height: 72px;
        padding: var(--ct-space-2) var(--ct-space-3);
    }

    .ct-patient-panel {
        padding: var(--ct-space-3);
    }

    .ct-patient-profile__photo {
        flex-basis: 88px;
        width: 88px;
        height: 88px;
    }
}

.ct-dashboard__section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ct-space-3);
    margin-bottom: var(--ct-space-3);
}

.ct-dashboard__section-heading .ct-dashboard__section-title {
    margin-bottom: 0;
}

.ct-cashier-payment-modal .ct-booking-modal__content {
    max-height: min(90vh, 760px);
    overflow-y: auto;
}

@media (max-width: 600px) {
    .ct-dashboard__section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .ct-cashier-payment-modal .ct-form-row {
        grid-template-columns: 1fr;
    }
}
