
:root {
    --green-950: #0f2f24;
    --green-900: #163d31;
    --green-700: #1f5a48;
    --green-500: #2f8b6b;
    --mint: #dff7ee;
    --blue: #0f74ff;
    --ink: #10231d;
    --muted: #65756f;
    --line: #e5eee9;
    --bg: #f4f8f6;
    --card: rgba(255, 255, 255, .86);
    --white: #fff;
    --danger: #c23b3b;
    --warning: #b98212;
    --shadow: 0 22px 60px rgba(15, 47, 36, .12);
    --radius: 24px;
}

[data-theme="dark"] {
    --bg: #091c16;
    --card: rgba(18, 48, 39, .82);
    --white: #10271f;
    --ink: #edf8f4;
    --muted: #aec2bb;
    --line: rgba(255, 255, 255, .12);
    --shadow: 0 22px 60px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
img { object-fit: cover; }
button, input, select, textarea { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.section { padding: 92px 0; }
.eyebrow { color: var(--green-700); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.section-title { font-size: clamp(30px, 4vw, 52px); line-height: 1.02; margin: 8px 0 16px; letter-spacing: 0; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card, .glass {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.card { padding: 24px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 20px;
    padding: 13px 20px;
    background: var(--green-900);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(31, 90, 72, .24); background: var(--green-700); }
.btn.secondary { background: #fff; color: var(--green-900); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.icon-badge {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--green-700);
    background: linear-gradient(135deg, #e5fff4, #f3f6ff);
}

.loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 9999;
    background: var(--green-950);
    transition: opacity .35s ease, visibility .35s ease;
}
.loader span { width: 54px; height: 54px; border: 4px solid rgba(255,255,255,.22); border-top-color: #fff; border-radius: 50%; animation: spin .85s linear infinite; }
.loaded .loader { opacity: 0; visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1200; display: grid; gap: 10px; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--green-900); color: #fff; box-shadow: var(--shadow); animation: slideIn .35s ease; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--green-700); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }

.site-nav {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(244, 248, 246, .8);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
[data-theme="dark"] .site-nav { background: rgba(9, 28, 22, .82); }
.nav-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 3px; font-weight: 300; color: var(--green-950); }
[data-theme="dark"] .brand { color: #fff; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--green-950), var(--green-500)); }
.nav-links { display: flex; align-items: center; gap: 22px; color: var(--muted); font-weight: 700; font-size: 14px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.hamburger { display: none; }

.hero { position: relative; overflow: hidden; padding: 72px 0 54px; }
.hero::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto auto;
    width: 62vw;
    height: 62vw;
    background: radial-gradient(circle, rgba(47,139,107,.18), transparent 68%);
    pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: 46px; align-items: center; }
.hero h1 { font-size: clamp(44px, 6vw, 82px); line-height: .96; margin: 14px 0 18px; letter-spacing: 0; }
.hero p { color: var(--muted); font-size: 18px; max-width: 640px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.hero-visual { min-height: 540px; position: relative; border-radius: 36px; overflow: hidden; background: linear-gradient(135deg, #dff7ee, #fff); box-shadow: var(--shadow); }
.photo-hero img { position: absolute; inset: 0; width: 100%; height: 100%; }
.photo-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15,47,36,.5), transparent 52%), linear-gradient(0deg, rgba(15,47,36,.3), transparent 52%);
}
.hero-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(90deg, rgba(15,47,36,.05) 1px, transparent 1px) 0 0 / 36px 36px,
      linear-gradient(rgba(15,47,36,.05) 1px, transparent 1px) 0 0 / 36px 36px;
    z-index: 1;
}
.photo-hero .floating-panel { z-index: 2; }
.doctor-figure {
    position: absolute;
    right: 8%;
    bottom: 0;
    width: 62%;
    height: 88%;
    border-radius: 220px 220px 0 0;
    background: linear-gradient(180deg, #fff, #d9eee6);
    box-shadow: inset 0 -20px 50px rgba(15,47,36,.12);
}
.doctor-figure::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 9%;
    width: 98px;
    height: 98px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #f0cbb7;
    box-shadow: 0 116px 0 52px #fff, 0 210px 0 78px #163d31;
}
.floating-panel { position: absolute; padding: 18px; border-radius: 22px; background: rgba(255,255,255,.86); border: 1px solid #fff; box-shadow: var(--shadow); animation: float 5s ease-in-out infinite; }
.floating-panel.one { left: 28px; top: 54px; width: 230px; }
.floating-panel.two { left: 42px; bottom: 42px; width: 260px; animation-delay: -1s; }
.floating-panel.three { right: 28px; top: 72px; width: 170px; animation-delay: -2s; }
@keyframes float { 50% { transform: translateY(-12px); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; }
.stat { padding: 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.stat strong { display: block; font-size: 30px; color: var(--green-700); }

.service-card, .doctor-card, .department-card { transition: transform .2s ease, box-shadow .2s ease; }
.service-card:hover, .doctor-card:hover, .department-card:hover { transform: translateY(-6px); }
.department-card { min-height: 170px; }
.photo-card { overflow: hidden; padding: 0; }
.photo-card > img { width: 100%; height: 180px; }
.photo-card > :not(img) { margin-left: 22px; margin-right: 22px; }
.photo-card .icon-badge { margin-top: -24px; position: relative; background: #fff; box-shadow: 0 12px 30px rgba(15,47,36,.14); }
.photo-card p { padding-bottom: 22px; }
.image-tile {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    background-size: cover;
    background-position: center;
    color: #fff;
    overflow: hidden;
}
.image-tile .muted { color: rgba(255,255,255,.78); }
.image-tile .icon-badge { background: rgba(255,255,255,.9); }
.doctor-avatar { height: 220px; border-radius: 22px; background: linear-gradient(160deg, #eaf6f1, #cfeee2); position: relative; overflow: hidden; }
.doctor-avatar::after { content: ""; position: absolute; left: 50%; bottom: -28px; width: 118px; height: 210px; transform: translateX(-50%); border-radius: 80px 80px 0 0; background: linear-gradient(#f0cbb7 0 28%, #fff 29% 62%, var(--green-900) 63%); }
.real-doctor-card { overflow: hidden; padding: 0 0 22px; }
.real-doctor-card img { width: 100%; height: 280px; object-position: center top; }
.real-doctor-card h3, .real-doctor-card p, .real-doctor-card .status { margin-left: 22px; margin-right: 22px; }
.cta-band, .emergency { border-radius: 32px; padding: 36px; color: #fff; background: linear-gradient(135deg, var(--green-950), var(--green-700)); position: relative; overflow: hidden; }
.cta-band::after, .emergency::after { content: ""; position: absolute; right: -80px; top: -80px; width: 240px; height: 240px; border: 34px solid rgba(255,255,255,.08); border-radius: 50%; }
.photo-cta { display: grid; grid-template-columns: .82fr 1fr; gap: 28px; align-items: stretch; }
.photo-cta > img { width: 100%; height: 100%; min-height: 300px; border-radius: 24px; position: relative; z-index: 1; }
.photo-cta > .grid { position: relative; z-index: 1; }
.testimonial { display: grid; gap: 18px; }
.patient-story { overflow: hidden; padding: 0 0 24px; }
.patient-story img { width: 100%; height: 280px; }
.patient-story p, .patient-story strong { margin-left: 24px; margin-right: 24px; }
.emergency-photo { min-height: 360px; }
.footer { background: var(--green-950); color: #dbe8e3; padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.footer a { color: #dbe8e3; display: block; margin: 8px 0; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(circle at top left, rgba(47,139,107,.18), transparent 35%), var(--bg); }
.auth-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.auth-art { background: linear-gradient(135deg, var(--green-950), var(--green-700)); color: #fff; padding: 46px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-form { padding: 46px; background: var(--card); }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-weight: 800; font-size: 13px; }
.field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px 14px;
    background: rgba(255,255,255,.72);
    color: var(--ink);
    outline: none;
}
.field textarea { min-height: 120px; resize: vertical; }

.dashboard { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px; background: var(--green-950); color: #eafff7; overflow: auto; }
.sidebar .brand { color: #fff; margin-bottom: 28px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; color: rgba(255,255,255,.78); margin: 4px 0; font-weight: 750; }
.side-link.active, .side-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.main { min-width: 0; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.avatar { width: 54px; height: 54px; border-radius: 18px; object-fit: cover; background: var(--mint); }
.patient-hero-card {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 22px;
    overflow: hidden;
}
.patient-hero-photo {
    width: 100%;
    min-height: 280px;
    border-radius: 22px;
    background: var(--mint);
}
.patient-hero-meta { display: grid; align-content: center; gap: 12px; }
.patient-hero-meta h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1; margin: 0; }
.patient-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.kpi { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.kpi strong { display: block; font-size: 28px; }
.table-wrap { overflow: auto; border-radius: 22px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 760px; background: var(--card); }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 800; background: var(--mint); color: var(--green-900); }
.status.pending { background: #fff4da; color: var(--warning); }
.status.suspended, .status.rejected { background: #ffe5e5; color: var(--danger); }
.profile-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.profile-list div { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.5); border: 1px solid var(--line); }
.profile-list span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.message-thread { max-height: 460px; overflow: auto; display: grid; gap: 12px; padding-right: 8px; }
.bubble { padding: 13px 15px; border-radius: 18px; background: rgba(255,255,255,.65); border: 1px solid var(--line); max-width: 76%; }
.bubble.admin { margin-left: auto; background: green; color: #fff; }
.chart-bars { display: flex; align-items: end; gap: 12px; height: 220px; padding-top: 18px; }
.chart-bars span { flex: 1; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, var(--green-500), var(--green-950)); min-height: 24px; }
.history-cards { display: none; }
.history-card { display: grid; gap: 14px; }
.history-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.history-card-grid div { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.52); }
.history-card-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.payment-method-card { box-shadow: none; margin-bottom: 12px; display: grid; gap: 12px; }
.payment-details-box { padding: 12px; border-radius: 14px; border: 1px dashed var(--line); background: rgba(255,255,255,.54); white-space: pre-wrap; word-break: break-word; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: none; }

@media (max-width: 980px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-grid, .grid-2, .auth-shell, .photo-cta, .patient-hero-card { grid-template-columns: 1fr; }
    .hero-visual { min-height: 440px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .dashboard { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 1000; transform: translateX(-100%); transition: transform .25s ease; }
    .sidebar.open { transform: translateX(0); }
    .dash-menu { display: grid; }
}

@media (max-width: 760px) {
    .section { padding: 64px 0; }
    .nav-links { position: fixed; left: 16px; right: 16px; top: 84px; display: none; flex-direction: column; align-items: stretch; padding: 18px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); }
    .nav-links.open { display: flex; }
    .hamburger { display: grid; }
    .stats, .grid-4, .grid-3, .profile-list { grid-template-columns: 1fr; }
    .hero { padding-top: 42px; }
    .hero-visual { min-height: 390px; }
    .floating-panel.one { width: 190px; }
    .floating-panel.two { width: 210px; }
    .doctor-figure { width: 70%; right: -4%; }
    .footer-grid { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-form, .card, .cta-band, .emergency { padding: 22px; }
    .main { padding: 16px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .topbar .nav-actions { width: 100%; justify-content: space-between; }
    .topbar .avatar { display: none; }
    .patient-hero-photo { min-height: 340px; }
    .table-wrap.history-table { display: none; }
    .history-cards { display: grid; gap: 16px; }
    .history-card-grid { grid-template-columns: 1fr; }
    table { min-width: 680px; }
    .bubble { max-width: 92%; }
}
