/* ==========================================================================
   RSUD Gunungtua - Portal publik
   Dimuat setelah portal-extra.css untuk menimpa palet & menambah komponen.
   ========================================================================== */

:root {
    --portal-primary: #0b5d52;
    --portal-primary-light: #128274;
    --portal-gold: #c9a227;
    --portal-gold-soft: #fbf4da;
    --portal-ink: #1c2b2a;
    --portal-muted: #62716f;
    --portal-border: #dfe8e5;
    --portal-bg: #f2f7f5;
    --rsud-danger: #b3261e;
    --rsud-danger-soft: #fdecea;
    --rsud-info: #135d8a;
    --rsud-info-soft: #e8f3fa;
    --rsud-warning: #8a6108;
    --rsud-warning-soft: #fff6de;
    --rsud-success: #14694c;
    --rsud-success-soft: #e6f5ee;
}

body.portal {
    background: var(--portal-bg);
}

/* --------------------------------------------------------------- Topbar -- */
.rsud-topbar {
    background: var(--rsud-danger);
    color: #fff;
    font-size: 11.5px;
}
.rsud-topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 6px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    flex-wrap: wrap;
}
.rsud-topbar-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rsud-topbar a { color: #fff; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.rsud-topbar a:hover { text-decoration: underline; color: #ffe9a8; }
.rsud-topbar .live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #7CFFB2;
    box-shadow: 0 0 0 0 rgba(124, 255, 178, .7);
    animation: rsudPulse 1.8s infinite;
    flex: 0 0 7px;
}
.rsud-topbar-sub { color: rgba(255, 255, 255, .78); font-weight: 500; }
@keyframes rsudPulse {
    0% { box-shadow: 0 0 0 0 rgba(124, 255, 178, .65); }
    70% { box-shadow: 0 0 0 7px rgba(124, 255, 178, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 255, 178, 0); }
}

/* ---------------------------------------------------------------- Brand -- */
.portal-brand strong { letter-spacing: .2px; }
.portal-brand span { max-width: 210px; }

/* ----------------------------------------------------------------- Nav -- */
.portal-nav-dropdown-menu { min-width: 196px; }
.portal-login.rsud-cta {
    background: var(--portal-gold);
    color: #3c2c05 !important;
}
.portal-login.rsud-cta:hover { background: #a97c15; color: #fff !important; }
.portal-nav .portal-nav-link-plain { padding: 8px 9px; color: #4b5563; }
.portal-nav .portal-nav-link-plain:hover { background: #eef5f0; color: var(--portal-primary); }
.rsud-metrics.in-flow { margin-top: 0; }

/* ---------------------------------------------------------------- Hero -- */
.portal-hero.rsud-hero {
    background:
        linear-gradient(118deg, #063b34 0%, #0a5146 48%, #0f7363 100%);
}
.portal-hero.rsud-hero::before {
    background:
        radial-gradient(circle at 84% 16%, rgba(201, 162, 39, .30), transparent 32%),
        radial-gradient(circle at 6% 92%, rgba(255, 255, 255, .10), transparent 36%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 22px);
}
.rsud-hero-grid {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 52px 18px 56px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
    gap: 36px;
    align-items: center;
}
.rsud-hero-grid h1 {
    margin: 16px 0 12px;
    font-size: clamp(28px, 3.8vw, 44px);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #fff;
}
.rsud-hero-grid h1 span { color: #ffe9a8; }
.rsud-hero-grid p { margin: 0; max-width: 620px; color: #d8e9e3; font-size: 14.5px; line-height: 1.7; }
.rsud-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.rsud-hero-trust {
    display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px;
    padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .16);
    color: #cfe6dd; font-size: 11.5px;
}
.rsud-hero-trust span { display: inline-flex; align-items: center; gap: 6px; }

.rsud-hero-leaders {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
}
.rsud-hero-leaders img {
    width: clamp(132px, 13vw, 158px);
    max-width: calc(50% - 5px);
    height: auto;
    display: block;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .32);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .26);
    background: rgba(255, 255, 255, .08);
}

/* --------------------------------------------------------------- Metric -- */
.rsud-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: -28px;
    position: relative;
    z-index: 3;
}
.rsud-metric {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    padding: 14px 15px;
    display: flex;
    align-items: center;
    gap: 11px;
    box-shadow: 0 12px 26px rgba(16, 24, 40, .07);
}
.rsud-metric .ic {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    background: #e9f4f0; color: var(--portal-primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.rsud-metric strong { display: block; font-size: 20px; line-height: 1.1; }
.rsud-metric span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--portal-muted); font-weight: 700; margin-top: 2px; }

/* --------------------------------------------------------- Quick action -- */
.rsud-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rsud-quick-item {
    display: flex; align-items: flex-start; gap: 11px;
    background: #fff; border: 1px solid var(--portal-border); border-radius: 14px;
    padding: 14px; text-decoration: none; color: inherit;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.rsud-quick-item:hover { text-decoration: none; color: inherit; transform: translateY(-2px); border-color: #b9d4c9; box-shadow: 0 12px 26px rgba(16, 24, 40, .08); }
.rsud-quick-item .ic {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e9f4f0; color: var(--portal-primary);
}
.rsud-quick-item.tone-danger .ic { background: var(--rsud-danger-soft); color: var(--rsud-danger); }
.rsud-quick-item.tone-gold .ic { background: var(--portal-gold-soft); color: #8a6a10; }
.rsud-quick-item strong { display: block; font-size: 13px; line-height: 1.3; }
.rsud-quick-item small { display: block; color: var(--portal-muted); font-size: 11px; margin-top: 2px; line-height: 1.45; }

/* --------------------------------------------------------------- Notice -- */
.rsud-notice {
    display: flex; gap: 12px; align-items: flex-start;
    border: 1px solid var(--portal-border);
    border-left: 4px solid var(--rsud-info);
    background: var(--rsud-info-soft);
    border-radius: 12px;
    padding: 13px 15px;
    margin: 0 0 16px;
    font-size: 12.5px;
    line-height: 1.65;
    color: #22403f;
}
.rsud-notice .ic { flex: 0 0 auto; margin-top: 2px; color: var(--rsud-info); }
.rsud-notice strong { display: block; margin-bottom: 2px; font-size: 12.5px; }
.rsud-notice p { margin: 0; }
.rsud-notice.tone-danger { border-left-color: var(--rsud-danger); background: var(--rsud-danger-soft); color: #5c1d18; }
.rsud-notice.tone-danger .ic { color: var(--rsud-danger); }
.rsud-notice.tone-warning { border-left-color: #c08a12; background: var(--rsud-warning-soft); color: #5c4408; }
.rsud-notice.tone-warning .ic { color: var(--rsud-warning); }
.rsud-notice.tone-success { border-left-color: var(--rsud-success); background: var(--rsud-success-soft); color: #104435; }
.rsud-notice.tone-success .ic { color: var(--rsud-success); }

/* ---------------------------------------------------------------- Table -- */
.rsud-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--portal-border); border-radius: 14px; }
table.rsud-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.rsud-table th,
table.rsud-table td { padding: 11px 14px !important; text-align: left !important; border-bottom: 1px solid var(--portal-border); vertical-align: top !important; }
table.rsud-table th { background: #f3f8f5; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; color: #42524f; font-weight: 800; }
table.rsud-table td { color: #334441; }
table.rsud-table tr:last-child td { border-bottom: 0; }
table.rsud-table td:last-child { white-space: nowrap; }

/* ---------------------------------------------------------------- Steps -- */
.rsud-steps { list-style: none; margin: 0; padding: 0; counter-reset: rsudstep; }
.rsud-step {
    position: relative;
    padding: 0 0 20px 46px;
    counter-increment: rsudstep;
}
.rsud-step:last-child { padding-bottom: 0; }
.rsud-step::before {
    content: counter(rsudstep);
    position: absolute; left: 0; top: 0;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--portal-primary); color: #fff;
    font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.rsud-step::after {
    content: "";
    position: absolute; left: 14px; top: 34px; bottom: 4px;
    width: 2px; background: #cfe3da;
}
.rsud-step:last-child::after { display: none; }
.rsud-step h3 { margin: 4px 0 3px; font-size: 13px; font-weight: 800; }
.rsud-step p { margin: 0; color: var(--portal-muted); font-size: 12px; line-height: 1.6; }

/* ------------------------------------------------------------- Contacts -- */
.rsud-contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.rsud-contact {
    display: flex; gap: 11px; align-items: flex-start;
    background: #fff; border: 1px solid var(--portal-border); border-radius: 14px; padding: 14px;
    text-decoration: none; color: inherit;
}
.rsud-contact:hover { text-decoration: none; color: inherit; border-color: #b9d4c9; }
.rsud-contact .ic {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    background: #e9f4f0; color: var(--portal-primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.rsud-contact small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--portal-muted); font-weight: 700; }
.rsud-contact strong { display: block; font-size: 12.5px; line-height: 1.45; margin-top: 2px; font-weight: 700; }

/* ----------------------------------------------------------------- Form -- */
.rsud-form { background: #fff; border: 1px solid var(--portal-border); border-radius: 16px; padding: 20px; }
.rsud-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rsud-field { display: flex; flex-direction: column; }
.rsud-field.full { grid-column: 1 / -1; }
.rsud-field .req { color: var(--rsud-danger); }
.rsud-error { color: var(--rsud-danger); font-size: 11px; margin-top: 4px; }
.rsud-help { color: var(--portal-muted); font-size: 10.5px; margin-top: 4px; line-height: 1.45; }
.rsud-check { display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; line-height: 1.55; color: #384744; }
.rsud-check input { margin-top: 2px; }
.rsud-form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }
.portal-input.is-invalid { border-color: var(--rsud-danger); }
select.portal-input { appearance: auto; }
textarea.portal-input { resize: vertical; min-height: 88px; }

/* ------------------------------------------------------------- Side card -- */
.rsud-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 92px; }
.rsud-side .portal-sidebar-card h3 { display: flex; align-items: center; gap: 7px; }
.rsud-side-list { list-style: none; margin: 0; padding: 0; }
.rsud-side-list li { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--portal-border); font-size: 11.5px; line-height: 1.5; color: #41524f; }
.rsud-side-list li:last-child { border-bottom: 0; }
.rsud-side-list .ic { color: var(--portal-primary); flex: 0 0 auto; margin-top: 1px; }

/* ------------------------------------------------------------- Two col -- */
.rsud-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 22px; align-items: start; }

/* ---------------------------------------------------------------- Cards -- */
.rsud-link-card { display: block; height: 100%; text-decoration: none; color: inherit; }
.rsud-link-card:hover { text-decoration: none; color: inherit; }
.rsud-link-card .more { display: inline-flex; align-items: center; gap: 5px; color: var(--portal-primary); font-size: 11px; font-weight: 800; margin-top: 10px; }
.rsud-icon-tile {
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e9f4f0; color: var(--portal-primary);
    margin-bottom: 10px;
}

/* ---------------------------------------------------------------- Badge -- */
.rsud-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 10px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase;
    background: #e9f4f0; color: var(--portal-primary);
}
.rsud-badge.gold { background: var(--portal-gold-soft); color: #7d5c07; }
.rsud-badge.danger { background: var(--rsud-danger-soft); color: var(--rsud-danger); }
.rsud-badge.muted { background: #eef1f0; color: #5b6a67; }

/* ---------------------------------------------------------------- Empty -- */
.rsud-empty {
    background: #fff; border: 1px dashed #c9d9d3; border-radius: 14px;
    padding: 26px 18px; text-align: center; color: var(--portal-muted);
}
.rsud-empty .ic { color: #9fb6ae; margin-bottom: 8px; }
.rsud-empty h3 { margin: 0 0 4px; font-size: 13px; color: #42524f; font-weight: 800; }
.rsud-empty p { margin: 0; font-size: 11.5px; line-height: 1.6; }

/* ----------------------------------------------------------- CTA strip -- */
.rsud-cta {
    background: linear-gradient(120deg, #0a5146, #0f7363);
    border-radius: 18px;
    color: #fff;
    padding: 26px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.rsud-cta h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.rsud-cta p { margin: 0; color: #d8e9e3; font-size: 12.5px; max-width: 620px; line-height: 1.6; }
.rsud-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------------------------------------- Prose -- */
.portal-prose table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.portal-prose table th, .portal-prose table td { border: 1px solid var(--portal-border); padding: 8px 10px; text-align: left; }
.portal-prose table th { background: #f3f8f5; }
.portal-prose blockquote {
    margin: 0 0 14px; padding: 12px 16px; border-left: 4px solid var(--portal-gold);
    background: var(--portal-gold-soft); border-radius: 0 10px 10px 0; color: #4b3c0c;
}

/* -------------------------------------------------------------- Footer -- */
.portal-footer { background: linear-gradient(150deg, #07332d, #0a443b 60%, #0b5045); }
.portal-footer .footer-brand img { background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 2px; }
.portal-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); }

/* --------------------------------------------------------- Page header -- */
.portal-page-head.rsud-page-head {
    background: linear-gradient(120deg, #0a4a40, #0f6b5c);
}
.portal-page-head.rsud-page-head .crumbs { color: #a9cfc4; }
.portal-page-head.rsud-page-head .crumbs a { color: #d8ece5; }

/* -------------------------------------------------- Admin: tabel daftar -- */
.rsud-admin-table { font-size: 12px; }

/* ------------------------------------------------------------ Responsive -- */
@media (max-width: 980px) {
    .rsud-hero-grid { grid-template-columns: 1fr; padding-top: 40px; }
    .rsud-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rsud-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rsud-split { grid-template-columns: 1fr; }
    .rsud-side { position: static; }
    .rsud-contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .rsud-topbar-inner { justify-content: center; text-align: center; }
    .rsud-topbar-group { justify-content: center; gap: 10px 14px; }
    .rsud-topbar-sub { display: none; }
    .rsud-metrics, .rsud-quick { grid-template-columns: 1fr; }
    .rsud-form-grid { grid-template-columns: 1fr; }
    .rsud-hero-grid { padding: 32px 16px 40px; }
    .rsud-cta { padding: 22px; }
    .rsud-cta h2 { font-size: 18px; }
}

/* Anatomy Mirror embed (shared by Puskesmas & RSUD) */
.anatomy-embed {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr);
    gap: 22px;
    align-items: center;
    padding: 22px;
    border: 1px solid var(--portal-border);
    border-radius: 22px;
    background:
        radial-gradient(120% 150% at 100% 0%, var(--portal-gold-soft) 0%, rgba(251, 244, 218, 0) 55%),
        linear-gradient(120deg, #eef6f4 0%, #ffffff 62%);
    box-shadow: 0 18px 38px -30px rgba(11, 93, 82, .5);
}
.anatomy-copy h2 { margin: 2px 0 8px; font-size: 22px; font-weight: 800; color: var(--portal-ink); letter-spacing: -.2px; }
.anatomy-lead { margin: 0; max-width: 58ch; font-size: 12.5px; line-height: 1.65; color: var(--portal-muted); }
.anatomy-lead strong { color: var(--portal-ink); font-weight: 700; }
.anatomy-points { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; }
.anatomy-points li { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--portal-ink); }
.anatomy-points li svg { color: var(--portal-primary); flex: none; }
.anatomy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.anatomy-tab-link { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--portal-primary); text-decoration: none; }
.anatomy-tab-link:hover { text-decoration: underline; }
.anatomy-privacy { margin: 12px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--portal-muted); }

.anatomy-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    min-width: 0;
    justify-self: end;
    aspect-ratio: 16 / 10;
    min-height: 300px;
    overflow: hidden;
    border: 1px solid rgba(159, 243, 214, .18);
    border-radius: 16px;
    background: #061014;
    box-shadow: 0 22px 44px -30px rgba(6, 16, 20, .9);
}
.anatomy-viewport { position: relative; flex: 1; overflow: hidden; background: #061014; }
.anatomy-viewport iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 900px; max-width: none; border: 0; background: #061014; transform-origin: 0 0; }

.anatomy-poster {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px;
    text-align: center;
    color: #eaf6f4;
    background:
        radial-gradient(circle at 50% 38%, rgba(94, 217, 192, .16), transparent 55%),
        repeating-linear-gradient(0deg, rgba(159, 243, 214, .05) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(90deg, rgba(159, 243, 214, .05) 0 1px, transparent 1px 26px),
        #061014;
}
.anatomy-poster strong { font-size: 15px; letter-spacing: .2px; }
.anatomy-poster > span:not(.anatomy-orb) { font-size: 11px; color: #8ca8a8; }
.anatomy-poster .portal-btn { margin-top: 10px; }
.anatomy-poster small { font-size: 10px; color: #5f7c7c; }

.anatomy-orb { position: relative; display: grid; place-items: center; width: 78px; height: 78px; margin-bottom: 8px; }
.anatomy-orb span { position: absolute; border: 1px solid rgba(159, 243, 214, .22); border-radius: 50%; }
.anatomy-orb span:nth-child(1) { inset: 0; }
.anatomy-orb span:nth-child(2) { inset: 14px; border-color: rgba(119, 201, 255, .22); }
.anatomy-orb i {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(159, 243, 214, .5);
    border-radius: 50%;
    background: radial-gradient(circle at 36% 30%, rgba(210, 255, 242, .7), rgba(159, 243, 214, .12) 45%, transparent 72%);
}

.anatomy-stage-bar { display: none; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 6px 12px; border-top: 1px solid rgba(159, 243, 214, .14); background: rgba(6, 16, 20, .96); font-size: 10px; color: #9ff3d6; }
.anatomy-stage-bar > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.anatomy-stage.is-live .anatomy-stage-bar { display: flex; }
.anatomy-stage-bar button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; padding: 2px 0; border: 0; background: none; color: #9ff3d6; font-size: 10.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.anatomy-stage-bar button:hover { text-decoration: underline; }

.anatomy-stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border: 0; border-radius: 0; }


@media (max-width: 980px) {
    .anatomy-embed { grid-template-columns: 1fr; }
    .anatomy-stage { max-width: 560px; justify-self: center; min-height: 0; }
}

@media (max-width: 560px) {
    .anatomy-embed { gap: 18px; padding: 18px; border-radius: 18px; }
    .anatomy-copy h2 { font-size: 20px; }
    .anatomy-actions .portal-btn { flex: 1 1 100%; }
    .anatomy-stage { min-height: 0; height: min(78vh, 620px); aspect-ratio: auto; }
}