:root {
    --primary: #0d6e6e;
    --primary-dark: #095454;
    --accent: #14b8a6;
    --bg: #f0f7f7;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --error: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content { flex: 1; }

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
    padding: 2rem 0;
}

.container-narrow { width: min(720px, 92%); }

.text-muted { color: var(--muted); }

/* Header */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 0;
    flex-wrap: wrap;
}

.logo {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-size: 1.1rem;
}

.nav-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.site-header nav {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.site-header nav a,
.dropdown-trigger {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: color 0.15s;
}

.site-header nav a:hover,
.dropdown:hover .dropdown-trigger {
    color: var(--primary);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card);
    min-width: 170px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 100;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

.dropdown-content a {
    color: var(--text) !important;
    padding: 0.5rem 1.25rem;
    text-decoration: none;
    display: block !important;
    font-size: 0.85rem;
    transition: background-color 0.15s, color 0.15s;
}

.dropdown-content a:hover {
    background-color: var(--bg);
    color: var(--primary) !important;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-trigger .caret {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-trigger .caret {
    transform: rotate(180deg);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.15s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.78rem; border-radius: 6px; gap: 0.25rem; }
.btn-block { width: 100%; }

/* Tombol Edit — kuning/amber */
.btn-edit {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}
.btn-edit:hover {
    background: #fde68a;
    border-color: #f59e0b;
}

/* Tombol Hapus — merah */
.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.btn-danger:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* Kolom aksi di tabel */
td.actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
    white-space: nowrap;
}

/* Cards & layout */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-head h1 { font-size: 1.75rem; color: var(--primary-dark); }

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 1rem;
    color: var(--muted);
    margin: 1.25rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card h2:first-child { margin-top: 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-card strong { font-size: 2rem; display: block; color: var(--primary-dark); }
.stat-label { font-size: 0.85rem; color: var(--muted); }
.stat-success strong { color: var(--success); }
.stat-info strong { color: var(--accent); }

/* Forms */
.form label,
.form-grid label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.form input,
.form select,
.form textarea,
.form-grid input,
.form-grid select,
.form-grid textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.form input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .form-row { grid-template-columns: 1fr; }
}

.settings-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.75rem;
}

.theme-list {
    display: grid;
    gap: 0.5rem;
}

.theme-list a {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid transparent;
    transition: 0.2s;
}

.theme-list a:hover,
.theme-list a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-dark);
}

.theme-preview {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--card);
}

.theme-preview-header {
    padding: 1rem 1.25rem;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.theme-preview-body {
    padding: 1.25rem;
}

.image-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.image-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.image-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.image-card.active {
    border-color: var(--primary);
}

.image-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.image-card span {
    display: block;
    padding: 0.85rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--card);
    text-align: center;
}

.theme-image-preview {
    margin-bottom: 1rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.theme-image-preview img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.theme-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    color: var(--muted);
    background: #f8fafc;
    font-size: 0.95rem;
    font-weight: 600;
}

.color-field {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.75rem;
    align-items: center;
}

.color-field input[type="text"] {
    margin: 0;
}

@media (max-width: 900px) {
    .settings-grid { grid-template-columns: 1fr; }
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-bar input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

/* Table */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

.actions a {
    margin-right: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.actions a:hover { text-decoration: underline; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-success { background: #dcfce7; color: var(--success); }
.badge-muted { background: #f1f5f9; color: var(--muted); }

.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }

.empty { color: var(--muted); padding: 1rem 0; }

code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Auth */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(rgba(13, 110, 110, 0.75), rgba(20, 184, 166, 0.75)), url('../../img/backgroud.png') no-repeat center center/cover;
}

.auth-page .main-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.auth-page .site-footer { display: none; }

.auth-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: min(420px, 100%);
    box-shadow: var(--shadow);
}

.auth-brand { text-align: center; margin-bottom: 1.5rem; }

.auth-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.auth-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 1.5rem;
}

.auth-brand h1 { font-size: 1.35rem; color: var(--primary-dark); }
.auth-brand p { color: var(--muted); font-size: 0.9rem; }

.auth-hint {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
}

.auth-hint a { color: var(--primary); }

/* Verify public page */
.verify-page {
    background: var(--bg);
}

.verify-hero {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.verify-hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.4rem);
    margin-bottom: 0.75rem;
}

.verify-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    font-size: 0.92rem;
    font-weight: 600;
}

.verify-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 24px;
}

.verify-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.verify-dl {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(180px, 1fr);
    gap: 0.8rem 1.5rem;
    align-items: start;
}

.verify-dl dt {
    color: var(--muted);
    font-weight: 700;
}

.verify-dl dd {
    margin: 0;
    color: var(--text);
}

@media (max-width: 760px) {
    .verify-hero {
        padding: 1.25rem 1rem;
        margin-bottom: 1.5rem;
    }

    .verify-result {
        padding: 1.25rem;
    }

    .verify-dl {
        grid-template-columns: 1fr;
    }

    .verify-dl dt {
        font-size: 0.95rem;
    }

    .verify-dl dd {
        font-size: 0.98rem;
    }

    .verify-hero h1 {
        font-size: 1.75rem;
    }

    .verify-status-row {
        flex-direction: column;
        gap: 0.6rem;
    }
}

.verify-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 1.5rem;
}

.verify-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.verify-form input {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: monospace;
}

.verify-result h2 { margin-bottom: 1rem; }

.verify-valid { border-left: 4px solid var(--success); }
.verify-warning { border-left: 4px solid var(--warning); }
.verify-invalid { border-left: 4px solid var(--error); }

.verify-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.status-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-success { background: #dcfce7; color: var(--success); }
.status-warning { background: #fef3c7; color: var(--warning); }
.status-danger { background: #fef2f2; color: var(--error); }
.status-info { background: #f1f5f9; color: var(--muted); }

.verify-dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.95rem;
}

.verify-dl dt { color: var(--muted); font-weight: 500; }
.verify-dl dd { margin: 0; }

.verify-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

.verify-login-link {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.verify-login-link a { color: var(--primary); }

/* Print surat */
.print-toolbar {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    justify-content: center;
    flex-wrap: wrap;
}

/* Background abu2 mirip PDF viewer agar kertas A4 terlihat jelas */
body.page-cetak {
    background: #d0d0d0;
}

/* Toolbar di atas, kertas A4 di tengah bawahnya */
body.page-cetak .main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Toolbar full lebar */
body.page-cetak .print-toolbar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Wrapper kertas — memberi padding di sekeliling */
.page-wrapper {
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.surat-cetak {
    width: 210mm;
    min-height: 297mm;
    margin: 2rem auto;
    background: #fff;
    padding: 40px 50px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.18);
    position: relative;
    box-sizing: border-box;
}



/* Core print surat styles */
.surat-header {
    padding-bottom: 1.25rem;
    margin-bottom: 1.75rem;
}

.surat-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* THEME 1: SILOAM (Modern Blue/Green) */
.theme-siloam {
    font-family: 'Segoe UI', system-ui, sans-serif;
    border-top: 6px solid #0d6e6e;
}
.theme-siloam .surat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #0d6e6e;
}
.theme-siloam .surat-header-info {
    text-align: left;
}
.theme-siloam .surat-logo {
    height: 48px;
    margin-bottom: 0.5rem;
}
.theme-siloam .surat-header-info p {
    color: var(--muted);
    font-size: 0.85rem;
}
.theme-siloam .surat-meta {
    text-align: right;
}
.theme-siloam .surat-meta strong {
    color: #0d6e6e;
    font-size: 1.2rem;
    display: block;
}

/* THEME 2: HERMINA (Teal/Orange rounded) */
.theme-hermina {
    font-family: 'Segoe UI', system-ui, sans-serif;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
}
.theme-hermina .surat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed #14b8a6;
}
.theme-hermina .surat-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.theme-hermina .surat-logo {
    height: 52px;
    border-radius: 8px;
    padding: 2px;
    background: #f0fdfa;
}
.theme-hermina .surat-header-text h3 {
    color: #0f766e;
    font-size: 1.15rem;
    font-weight: 700;
}
.theme-hermina .surat-header-text p {
    font-size: 0.8rem;
    color: #64748b;
}
.theme-hermina .surat-meta {
    text-align: right;
    background: #fff7ed;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #ffedd5;
}
.theme-hermina .surat-meta strong {
    color: #ea580c;
    font-size: 1.1rem;
    display: block;
}
.theme-hermina .surat-meta p {
    color: #7c2d12;
    font-size: 0.85rem;
    font-family: monospace;
}

/* THEME 3: BHAKTI HUSADA (Classic Serif Red) */
.theme-bhakti {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1e293b;
    border: 3px double #be123c;
}
.theme-bhakti .surat-header {
    text-align: center;
    border-bottom: 4px double #be123c;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.theme-bhakti .surat-logo {
    height: 60px;
    margin: 0 auto 0.5rem;
}
.theme-bhakti .surat-header-info h2 {
    color: #be123c;
    font-size: 1.35rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0.25rem 0;
}
.theme-bhakti .surat-header-info p {
    font-size: 0.85rem;
    font-style: italic;
    color: #475569;
}
.theme-bhakti .surat-meta-centered {
    text-align: center;
    margin: 1.5rem 0;
}
.theme-bhakti .surat-meta-centered strong {
    font-size: 1.25rem;
    color: #be123c;
    text-decoration: underline;
    letter-spacing: 0.05em;
    display: block;
}
.theme-bhakti .surat-meta-centered p {
    font-size: 0.95rem;
    margin-top: 0.25rem;
}
.theme-bhakti .surat-detail td {
    font-size: 1rem;
}
.theme-bhakti .surat-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

/* THEME 4: RS MATA NUSA TENGGARA BARAT (Clean Sans) */
.theme-rsmata {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #000;
    border: none;
    box-shadow: none;
    padding: 1.5rem 2.5rem;
}

.theme-rsmata .surat-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-bottom: none;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.theme-rsmata .surat-logo {
    height: 65px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.theme-rsmata .surat-header-info {
    flex: 1;
    text-align: center;
}

.theme-rsmata .surat-header-info h2 {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #000;
    letter-spacing: 0.01em;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.theme-rsmata .surat-header-info p {
    font-size: 0.8rem;
    color: #334155;
    margin: 0;
    line-height: 1.35;
    font-weight: 500;
}

.theme-rsmata .surat-meta-centered {
    text-align: center;
    margin: 1.75rem 0 1.25rem 0;
}

.theme-rsmata .surat-meta-centered strong {
    font-size: 1.2rem;
    text-decoration: underline;
    letter-spacing: 0.05em;
    display: block;
    text-transform: uppercase;
    font-weight: bold;
}

.theme-rsmata .surat-meta-centered p {
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.theme-rsmata .surat-detail {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.theme-rsmata .surat-detail td {
    padding: 0.25rem 0;
    font-size: 0.95rem;
    color: #000;
    line-height: 1.4;
}

.theme-rsmata .surat-body {
    text-align: justify;
    font-size: 0.98rem;
    line-height: 1.7;
    margin: 1.5rem 0;
    color: #000;
}

.theme-rsmata .surat-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 3rem;
}

.theme-rsmata .ttd {
    text-align: center;
    width: 250px;
    font-size: 0.95rem;
    color: #000;
}

.theme-rsmata .ttd p {
    margin-bottom: 0.15rem;
}

.theme-rsmata .qr-block {
    margin: 0.5rem auto;
}

.theme-rsmata .qr-block img {
    display: block;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    padding: 4px;
    background: #fff;
}

/* THEME 5: RUMAH SAKIT MANDALIKA (Dua Logo & Solid Line) */
.theme-mandalika {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #000;
    border: none;
    box-shadow: none;
}

.theme-mandalika .surat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2.5px solid #000;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.theme-mandalika .logo-pemprov {
    height: 75px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.theme-mandalika .surat-logo {
    height: 75px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.theme-mandalika .surat-header-info {
    flex: 1;
    text-align: center;
    min-width: 0;
}

/* Teks kecil pemprov */
.theme-mandalika .hdr-pemprov {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 0.05rem;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Teks dinas kesehatan */
.theme-mandalika .hdr-dinas {
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    color: #000;
}

/* Nama RS besar & bold */
.theme-mandalika .hdr-rs {
    font-size: 1.35rem;
    font-weight: 900;
    margin: 0.1rem 0 0.1rem;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Baris alamat */
.theme-mandalika .hdr-alamat {
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
    color: #000;
}

/* Baris kontak (kode pos, email, website) */
.theme-mandalika .hdr-kontak {
    font-size: 0.72rem;
    line-height: 1.5;
    margin: 0.15rem 0 0;
    color: #000;
}

.theme-mandalika .surat-header-mandalika {
    display: block;
}

.theme-mandalika .header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.theme-mandalika .header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.theme-mandalika .clinic-name {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

.theme-mandalika .clinic-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.88rem;
    color: #334155;
    letter-spacing: 0.05em;
}

.theme-mandalika .header-contact {
    text-align: right;
    font-size: 0.78rem;
    line-height: 1.4;
}

.theme-mandalika .header-contact p {
    margin: 0.08rem 0;
}

.theme-mandalika .surat-meta-centered {
    text-align: center;
    margin: 1.5rem 0 1rem 0;
}

.theme-mandalika .surat-meta-centered strong {
    font-size: 1.2rem;
    text-decoration: underline;
    letter-spacing: 0.05em;
    display: block;
    text-transform: uppercase;
    font-weight: bold;
}

.theme-mandalika .surat-meta-centered p {
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.theme-mandalika .surat-detail {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}

.theme-mandalika .surat-detail td {
    padding: 0.25rem 0;
    font-size: 0.95rem;
    color: #000;
    line-height: 1.4;
}

.theme-mandalika .surat-body {
    text-align: justify;
    font-size: 0.98rem;
    line-height: 1.7;
    margin: 1.5rem 0;
    color: #000;
}

.theme-mandalika .surat-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2.5rem;
}

.theme-mandalika .ttd {
    text-align: center;
    width: 250px;
    font-size: 0.95rem;
    color: #000;
}

.theme-mandalika .ttd p {
    margin-bottom: 0.15rem;
}

.theme-mandalika .qr-block {
    margin: 0.5rem auto;
}

.theme-mandalika .qr-block img {
    display: block;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    padding: 4px;
    background: #fff;
}


.surat-detail td { padding: 0.35rem 0; vertical-align: top; }
.surat-body { margin: 1.25rem 0; }

.surat-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    align-items: flex-end;
}

.ttd-space { height: 70px; }

.qr-block { text-align: center; }
.barcode-text {
    font-family: monospace;
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
}

.qr-hint { font-size: 0.75rem; color: var(--muted); }

.stamp-cancelled {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-size: 3rem;
    font-weight: 900;
    color: rgba(220, 38, 38, 0.35);
    border: 6px solid rgba(220, 38, 38, 0.35);
    padding: 0.5rem 2rem;
    pointer-events: none;
}

.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
}

@media print {
    .no-print, .site-footer { display: none !important; }
    body { 
        background: #fff; 
        font-size: 10pt;
        line-height: 1.4;
        color: #000;
    }
    .surat-cetak { 
        box-shadow: none; 
        margin: 0; 
        width: 100%;
        min-height: unset;
        padding: 0;
    }
    /* @page ukuran kertas diatur dinamis di cetak.php per theme */
    
    /* Make adjustments for rsmata theme to fit A4 perfectly */
    .theme-rsmata {
        padding: 0;
    }
    .theme-rsmata .surat-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    .theme-rsmata .surat-logo {
        height: 55px;
        width: auto;
        object-fit: contain;
        flex-shrink: 0;
    }
    .theme-rsmata .surat-header-info {
        flex: 1;
        text-align: center;
    }
    .theme-rsmata .surat-header-info h2 {
        font-size: 1.1rem;
        margin-bottom: 0.15rem;
    }
    .theme-rsmata .surat-header-info p {
        font-size: 0.72rem;
        line-height: 1.25;
    }
    .theme-rsmata .surat-meta-centered {
        margin: 1rem 0 0.75rem 0;
    }
    .theme-rsmata .surat-meta-centered strong {
        font-size: 1.05rem;
    }
    .theme-rsmata .surat-meta-centered p {
        font-size: 0.85rem;
    }
    .theme-rsmata .surat-detail {
        margin: 0.75rem 0;
    }
    .theme-rsmata .surat-detail td {
        padding: 0.15rem 0;
        font-size: 0.85rem;
    }
    .theme-rsmata .surat-body {
        font-size: 0.88rem;
        line-height: 1.5;
        margin: 1rem 0;
    }
    .theme-rsmata .surat-footer {
        margin-top: 1.5rem;
    }
    .theme-rsmata .ttd {
        width: 200px;
        font-size: 0.85rem;
    }
    .theme-rsmata .qr-block img {
        width: 80px;
        height: 80px;
    }
    
    /* Make adjustments for mandalika theme to fit A5 landscape */
    .theme-mandalika {
        padding: 0;
    }
    .theme-mandalika .surat-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        border-bottom: 2px solid #000;
        padding-bottom: 0.75rem;
        margin-bottom: 1.25rem;
    }
    .theme-mandalika .logo-pemprov,
    .theme-mandalika .surat-logo {
        height: 70px;
    }
    .theme-mandalika .hdr-pemprov {
        font-size: 0.85rem;
    }
    .theme-mandalika .hdr-dinas {
        font-size: 0.85rem;
    }
    .theme-mandalika .hdr-rs {
        font-size: 1.3rem;
    }
    .theme-mandalika .hdr-alamat {
        font-size: 0.78rem;
    }
    .theme-mandalika .hdr-kontak {
        font-size: 0.72rem;
    }
    .theme-mandalika .surat-meta-centered {
        margin: 1rem 0 0.75rem;
    }
    .theme-mandalika .surat-meta-centered strong {
        font-size: 1.1rem;
    }
    .theme-mandalika .surat-meta-centered p {
        font-size: 0.9rem;
    }
    .theme-mandalika .surat-detail {
        margin: 0.75rem 0;
    }
    .theme-mandalika .surat-detail td {
        padding: 0.15rem 0;
        font-size: 0.85rem;
    }
    .theme-mandalika .surat-body {
        font-size: 0.88rem;
        line-height: 1.5;
        margin: 0.75rem 0;
    }
    .theme-mandalika .surat-footer {
        margin-top: 1.5rem;
    }
    .theme-mandalika .ttd {
        width: 200px;
        font-size: 0.85rem;
    }
    .theme-mandalika .qr-block img {
        width: 80px;
        height: 80px;
    }
}

