/* =========================================================
   STYLE UTAMA SIMULATOR AKREDITASI KLINIK TEFA
   Tema: Putih • Biru • Hijau (Premium Professional)
   ========================================================= */

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(145deg, #e0f2fe, #ecfdf5);
    color: #0f172a;
}

.page {
    max-width: 1200px;
    margin: 24px auto 48px;
    padding: 0 16px;
}

/* HEADER */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(120deg, #0f766e, #1d4ed8);
    color: #f9fafb;
    border-radius: 18px;
    padding: 16px 20px;
    box-shadow: 0 18px 40px rgba(15, 118, 110, 0.45);
    margin-bottom: 18px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 0 0 2px rgba(240, 253, 250, 0.35);
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
}

.app-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.chip-soft-primary {
    background: rgba(59, 130, 246, 0.18);
    color: #e0f2fe;
}

.chip-soft-success {
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

.chip-soft-info {
    background: rgba(45, 212, 191, 0.18);
    color: #ccfbf1;
}

/* CARDS */

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 650;
    color: #022c22;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
}

/* PROFILE */

.card-profile {
    margin-bottom: 22px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
}

.form-group input,
.form-group select {
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    font-size: 0.85rem;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
    background: #ffffff;
}

/* BAB & STANDARD */

.card-bab {
    background: linear-gradient(145deg, #ecfdf5, #eff6ff);
    border: 1px solid rgba(148, 163, 184, 0.45);
}

.standard-block {
    margin-top: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    padding: 10px 12px;
    border: 1px dashed rgba(148, 163, 184, 0.6);
}

.standard-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.standard-code {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.standard-name {
    font-size: 0.9rem;
    font-weight: 600;
}

/* EP ROW */

.ep-row {
    display: grid;
    grid-template-columns: minmax(0, 3.5fr) minmax(0, 1.8fr);
    gap: 10px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.4);
    transition: box-shadow 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}

.ep-row:hover {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    border-color: rgba(34, 197, 94, 0.8);
    transform: translateY(-1px);
}

.ep-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ep-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.ep-code {
    font-weight: 700;
    color: #0f4c81;
}

.ep-weight {
    color: #6b7280;
}

.ep-desc {
    font-size: 0.85rem;
    color: #111827;
}

.ep-side {
    border-left: 1px dashed #d1d5db;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
}

.ep-side-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f172a;
}

.ep-upload input[type="file"] {
    width: 100%;
    font-size: 0.75rem;
}

.ep-preview img {
    max-width: 100%;
    max-height: 120px;
    margin-top: 6px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* NILAI PILL */

.nilai-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
}

.nilai-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f9fafb;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.nilai-pill:hover {
    background: #eff6ff;
    border-color: #0f766e;
}

.nilai-pill input {
    display: none;
}

.nilai-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 2px solid #94a3b8;
}

.nilai-pill-active {
    background: linear-gradient(135deg, #e0f2fe, #dcfce7);
    border-color: #0f766e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
    transform: translateY(-0.5px);
}

.nilai-pill-active .nilai-dot {
    border-color: #0f766e;
    background: #0f766e;
}

.nilai-label {
    white-space: nowrap;
}

/* DOKUMEN SECTION */

.doc-section {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
}

.doc-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.doc-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.78rem;
    color: #374151;
}

.doc-list li {
    margin-bottom: 2px;
}

.doc-templates {
    margin-top: 6px;
    font-size: 0.78rem;
}

.doc-templates-label {
    font-weight: 600;
    color: #0f172a;
}

.doc-templates ul {
    margin: 0;
    padding-left: 18px;
}

.doc-templates a {
    color: #1d4ed8;
    text-decoration: none;
}

.doc-templates a:hover {
    text-decoration: underline;
}

/* ACTIONS */

.card-actions {
    margin-top: 12px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.btn {
    border-radius: 999px;
    padding: 8px 18px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.1s ease, box-shadow 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1d4ed8, #0f766e);
    color: #f9fafb;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.45);
}

.btn-outline {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    background: #ecfeff;
    border-color: #0f766e;
}

.hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #6b7280;
}

/* RESULT */

.card-result {
    margin-top: 18px;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 650;
    margin-bottom: 10px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.result-card {
    border-radius: 14px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.result-card-main {
    background: linear-gradient(135deg, #0f766e, #22c55e);
    color: #ecfdf5;
    border-color: transparent;
}

.result-bab {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 2px;
}

.result-percent {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.result-card-main .result-percent {
    color: #ecfdf5;
}

.result-main-text {
    font-size: 1.4rem;
}

.result-main-sub {
    font-size: 0.8rem;
    opacity: 0.9;
}

.progress-bar {
    margin-top: 4px;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #0ea5e9);
}

/* BADGE PREDIKAT */

.result-label {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-neutral {
    background: #e5e7eb;
    color: #111827;
}

.badge-success {
    background: #bbf7d0;
    color: #166534;
}

.badge-info {
    background: #bae6fd;
    color: #075985;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* CHART */

.card-chart {
    margin-top: 14px;
}

.chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* RTL */

.card-rtl {
    margin-top: 16px;
    background: #fefce8;
    border-color: #facc15;
}

.rtl-title {
    font-size: 0.98rem;
    font-weight: 650;
}

.rtl-desc {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.rtl-table-wrapper {
    margin-top: 6px;
    overflow-x: auto;
}

.rtl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.rtl-table th,
.rtl-table td {
    border: 1px solid #facc15;
    padding: 4px 6px;
    vertical-align: top;
}

.rtl-table th {
    background: #fef3c7;
    text-align: left;
}

.rtl-std {
    font-size: 0.76rem;
    color: #6b7280;
}

/* TTD */

.ttd-blocks {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 0.83rem;
}

.ttd-item {
    flex: 1;
    min-width: 180px;
}

/* PRINT HEADER */

.print-header {
    display: none;
    text-align: center;
    margin-bottom: 8px;
}

.print-header .kop-main {
    font-size: 1.1rem;
    font-weight: 700;
}

.print-header .kop-sub {
    font-size: 0.95rem;
    font-weight: 600;
}

.print-header .kop-addr {
    font-size: 0.75rem;
}

.print-header .kop-form-title {
    font-size: 0.85rem;
    margin-top: 4px;
}

.no-print {
    /* default, ditampilkan di layar */
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .ep-row {
        grid-template-columns: 1fr;
        border-left: 3px solid rgba(34, 197, 94, 0.5);
    }
    .ep-side {
        border-left: none;
        border-top: 1px dashed #d1d5db;
        padding-left: 0;
        padding-top: 6px;
    }
}

@media print {
    body {
        background: #ffffff;
    }
    .page {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    .app-header,
    .no-print {
        display: none !important;
    }
    .card {
        box-shadow: none;
        border-radius: 0;
    }
    .print-header {
        display: block;
    }
}
