/* ===== Physio98 — tema aplikasi ===== */
:root {
    --p98-primary: #0f766e;
    --p98-primary-dark: #115e59;
    --p98-primary-soft: #ccfbf1;
    --p98-accent: #14b8a6;
    --p98-bg: #f1f5f9;
    --p98-sidebar: #0f2e2c;
    --p98-sidebar-hover: rgba(255, 255, 255, .08);
    --p98-card-radius: 1rem;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--p98-bg);
    color: #1e293b;
}

/* ---- Kerangka layout ---- */
.p98-wrapper { display: flex; min-height: 100vh; }

.p98-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0f2e2c 0%, #113b37 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.2) transparent;
}

.p98-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.p98-content { padding: 1.5rem; flex-grow: 1; }

/* ---- Sidebar ---- */
.p98-brand {
    display: flex; align-items: center; gap: .75rem;
    padding: 1.25rem 1.25rem 1rem;
    color: #fff; text-decoration: none;
}
.p98-brand:hover { color: #fff; }
.p98-brand .logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--p98-accent);
    display: grid; place-items: center;
    font-size: 1.3rem; color: #06302b;
}
.p98-brand h5 { margin: 0; font-weight: 700; letter-spacing: .3px; }
.p98-brand small { color: #94c9c2; font-size: .72rem; }

.p98-nav { padding: .5rem .75rem 1.5rem; }
.p98-nav .nav-label {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    color: #6ea8a0; padding: 1rem .75rem .35rem; font-weight: 600;
}
.p98-nav .nav-link {
    display: flex; align-items: center; gap: .65rem;
    color: #cbd5e1; border-radius: .6rem;
    padding: .55rem .75rem; margin-bottom: 2px;
    font-size: .9rem; font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.p98-nav .nav-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.p98-nav .nav-link:hover { background: var(--p98-sidebar-hover); color: #fff; }
.p98-nav .nav-link.active {
    background: var(--p98-accent); color: #06302b; font-weight: 700;
}

/* ---- Topbar ---- */
.p98-topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: .75rem 1.5rem;
    display: flex; align-items: center; gap: 1rem;
    position: sticky; top: 0; z-index: 1020;
}
.p98-topbar .page-title { font-weight: 700; font-size: 1.05rem; margin: 0; }

/* ---- Kartu & tabel ---- */
.card { border: none; border-radius: var(--p98-card-radius); box-shadow: 0 1px 3px rgba(15, 23, 42, .07); }
.card-header { background: transparent; border-bottom: 1px solid #f1f5f9; font-weight: 600; }

.table thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
    color: #64748b; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f0fdfa; }

/* ---- Statistik dashboard ---- */
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.stat-card .icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0;
}
.stat-card .value { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.stat-card .label { color: #64748b; font-size: .8rem; }

/* ---- Tombol & form ---- */
.btn-primary {
    background: var(--p98-primary); border-color: var(--p98-primary);
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus { background: var(--p98-primary-dark); border-color: var(--p98-primary-dark); }
.btn-outline-primary { color: var(--p98-primary); border-color: var(--p98-primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--p98-primary); border-color: var(--p98-primary); }
.btn { border-radius: .6rem; }
.form-control, .form-select { border-radius: .6rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--p98-accent);
    box-shadow: 0 0 0 .2rem rgba(20, 184, 166, .15);
}
.form-label { font-weight: 600; font-size: .85rem; }

.badge { font-weight: 600; }

/* ---- Halaman login ---- */
.login-page {
    min-height: 100vh;
    display: grid; place-items: center;
    background: radial-gradient(1200px 600px at 10% -10%, #134e4a 0%, #0f2e2c 45%, #0b1f1e 100%);
    padding: 1.5rem;
}
.login-card {
    width: 100%; max-width: 420px;
    border-radius: 1.25rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .35);
}

/* ---- POS ---- */
.pos-produk {
    cursor: pointer;
    transition: transform .1s ease, box-shadow .1s ease;
    user-select: none;
}
.pos-produk:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 118, 110, .18); }
.pos-produk .tipe { font-size: .68rem; }

/* ---- Responsif ---- */
@media (max-width: 991.98px) {
    .p98-sidebar { display: none; }
    .p98-content { padding: 1rem; }
}

.offcanvas-sidebar { background: linear-gradient(180deg, #0f2e2c 0%, #113b37 100%); color: #e2e8f0; width: 280px !important; }

/* ---- Dokumen rekam medis ---- */
.dokumen-rm { max-width: 800px; margin: 0 auto; }
.catatan-rm { break-inside: avoid; }

/* ---- Struk (cetak) ---- */
.struk {
    max-width: 380px; margin: 0 auto; background: #fff;
    font-family: 'Courier New', monospace; font-size: .82rem; color: #000;
    padding: 1.25rem;
}
.struk hr { border-top: 1px dashed #000; opacity: 1; margin: .5rem 0; }
.struk table { width: 100%; }

@media print {
    body { background: #fff !important; }

    /* Sembunyikan kerangka aplikasi — hanya konten yang tercetak */
    .p98-sidebar,
    .p98-topbar,
    .offcanvas,
    .alert,
    .pagination,
    .btn,
    form.d-inline,
    .no-print { display: none !important; }

    .p98-wrapper { display: block; }
    .p98-main { display: block; }
    .p98-content { padding: 0 !important; }

    .card { box-shadow: none !important; border: 1px solid #cbd5e1; border-radius: 0; break-inside: avoid; }
    .stat-card { break-inside: avoid; }
    .table { font-size: .8rem; }

    .struk { max-width: 100%; padding: 0; box-shadow: none !important; border: none !important; }
}

/* ===== Panduan interaktif (tur bantuan) ===== */
#turBantuan[hidden] { display: none; }
#turBantuan { position: fixed; inset: 0; z-index: 2000; }
#turBantuan .tur-sorot {
    position: fixed;
    border-radius: .6rem;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, .62);
    outline: 3px solid #14b8a6;
    outline-offset: 2px;
    transition: all .18s ease;
    pointer-events: none;
}
#turBantuan .tur-kartu {
    position: fixed;
    width: min(340px, calc(100vw - 2rem));
    background: #fff;
    border-radius: .75rem;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .35);
    padding: 1rem 1.1rem;
    transition: top .18s ease, left .18s ease;
}
#turBantuan .tur-judul { font-weight: 700; margin-bottom: .35rem; color: #0f766e; }
#turBantuan .tur-isi { font-size: .875rem; color: #334155; line-height: 1.5; }
#turBantuan .tur-kaki {
    display: flex; align-items: center; gap: .4rem;
    margin-top: .9rem; padding-top: .7rem; border-top: 1px solid #e2e8f0;
}
#turBantuan .tur-nomor { font-size: .75rem; color: #64748b; margin-right: auto; }
@media (max-width: 575.98px) {
    #turBantuan .tur-kartu { left: 1rem !important; right: 1rem; width: auto; }
}
