/* ============================================================
   Tema Premium — Aplikasi Pesanan Buku (RK Jaya Tech)
   Primary : Deep Ocean Teal   (#1F6A8C)
   Accent  : Warm Emerald       (#2FAE84)
   Luxe    : Champagne Gold      (#D4AF37)  — sorotan mewah, dipakai hemat
   ============================================================ */

:root {
    /* Primary (navy-teal) */
    --pb-primary: #1F6A8C;
    --pb-primary-dark: #145070;
    --pb-primary-darker: #0E3B54;
    --pb-primary-darkest: #0A2E42;
    --pb-primary-light: #EAF3F8;

    /* Accent (emerald) */
    --pb-accent: #2FAE84;
    --pb-accent-dark: #23906B;
    --pb-accent-light: #E6F7F0;

    /* Gold (luxury highlight) */
    --pb-gold: #D4AF37;
    --pb-gold-light: #F0D780;
    --pb-gold-dark: #B8860B;

    /* Surfaces */
    --pb-bg: #F4F7FA;
    --pb-ink: #17303B;
    --pb-muted: #64757F;
    --pb-line: #E7EEF3;
    --pb-card: #ffffff;

    /* Shape & elevation */
    --pb-radius: 16px;
    --pb-radius-sm: 11px;
    --pb-sidebar-width: 268px;
    --pb-shadow-sm: 0 2px 8px rgba(14, 59, 84, .06);
    --pb-shadow-card: 0 10px 30px rgba(14, 59, 84, .08), 0 1px 0 rgba(255, 255, 255, .6) inset;
    --pb-shadow-lg: 0 22px 60px rgba(10, 46, 66, .16);
}

* { box-sizing: border-box; }

body {
    background:
        radial-gradient(1100px 560px at 108% -6%, rgba(47, 174, 132, .07), transparent 55%),
        radial-gradient(900px 500px at -8% 108%, rgba(31, 106, 140, .06), transparent 55%),
        var(--pb-bg);
    color: var(--pb-ink);
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Warna utilitas ---------- */
.text-primary { color: var(--pb-primary) !important; }
.text-accent  { color: var(--pb-accent) !important; }
.text-gold    { color: var(--pb-gold-dark) !important; }
.bg-primary   { background-color: var(--pb-primary) !important; }
.bg-accent    { background-color: var(--pb-accent) !important; }
.bg-primary-light { background-color: var(--pb-primary-light) !important; }
.bg-accent-light  { background-color: var(--pb-accent-light) !important; }

a { color: var(--pb-primary); text-decoration: none; }
a:hover { color: var(--pb-primary-dark); }

/* ---------- Tombol ---------- */
.btn {
    border-radius: var(--pb-radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    transition: transform .16s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(0); }
.btn-sm { border-radius: 9px; }
.btn-lg, .pb-btn-action { padding: .7rem 1.35rem; font-size: 1.02rem; font-weight: 600; }
.btn i { font-size: 1.05em; line-height: 1; }

.btn-primary {
    --bs-btn-bg: var(--pb-primary);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-border-color: transparent;
    background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-primary-dark) 100%);
    border: none;
    box-shadow: 0 8px 18px rgba(31, 106, 140, .26);
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--pb-primary-dark), var(--pb-primary-darker));
    box-shadow: 0 12px 26px rgba(31, 106, 140, .34);
    transform: translateY(-1px);
}

.btn-success, .btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    background: linear-gradient(135deg, var(--pb-accent) 0%, var(--pb-accent-dark) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 8px 18px rgba(47, 174, 132, .28);
}
.btn-success:hover, .btn-accent:hover, .btn-success:focus, .btn-accent:focus {
    background: linear-gradient(135deg, var(--pb-accent-dark), #1c7659);
    box-shadow: 0 12px 26px rgba(47, 174, 132, .36);
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline-primary {
    --bs-btn-color: var(--pb-primary);
    --bs-btn-border-color: var(--pb-primary);
    --bs-btn-hover-bg: var(--pb-primary);
    --bs-btn-hover-border-color: var(--pb-primary);
    --bs-btn-active-bg: var(--pb-primary-dark);
    --bs-btn-active-border-color: var(--pb-primary-dark);
    border-width: 1.5px;
}
.btn-outline-secondary { border-width: 1.5px; }

/* Tombol emas premium — untuk CTA sorotan */
.btn-gold {
    position: relative;
    overflow: hidden;
    border: none;
    color: #3a2c05;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pb-gold-light) 0%, var(--pb-gold) 55%, var(--pb-gold-dark) 100%);
    box-shadow: 0 10px 22px rgba(184, 134, 11, .32);
}
.btn-gold:hover { color: #3a2c05; transform: translateY(-1px); box-shadow: 0 14px 28px rgba(184, 134, 11, .42); }
.btn-gold::after {
    content: ""; position: absolute; top: 0; left: -120%;
    width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
    transform: skewX(-18deg); transition: .6s;
}
.btn-gold:hover::after { left: 130%; }

/* Grup tombol aksi baris tabel */
.pb-actions { display: inline-flex; gap: .35rem; justify-content: flex-end; flex-wrap: nowrap; }
.pb-actions form { display: inline-flex; margin: 0; }
.pb-btn-icon { width: 36px; height: 36px; padding: 0; flex: 0 0 auto; }
.pb-btn-icon i { font-size: 1.05rem; }

/* ---------- Sidebar ---------- */
.pb-sidebar {
    width: var(--pb-sidebar-width);
    background:
        radial-gradient(520px 260px at 84% -8%, rgba(212, 175, 55, .16), transparent 60%),
        linear-gradient(178deg, var(--pb-primary-dark) 0%, var(--pb-primary-darker) 56%, var(--pb-primary-darkest) 100%);
    color: #fff;
    min-height: 100vh;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .04), 10px 0 34px rgba(10, 46, 66, .18);
}

.pb-sidebar .pb-brand {
    padding: 1.35rem 1.25rem 1.15rem;
    font-weight: 700;
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: linear-gradient(180deg, rgba(212, 175, 55, .08), transparent);
}
.pb-sidebar .pb-brand .pb-brand-logo {
    width: 46px; height: 46px; border-radius: 13px; flex: 0 0 46px;
    background: linear-gradient(140deg, var(--pb-accent), var(--pb-primary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.45rem; overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .24), 0 0 0 3px rgba(212, 175, 55, .35);
}
.pb-sidebar .pb-brand .pb-brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.pb-sidebar .pb-brand .pb-brand-text { line-height: 1.15; }
.pb-sidebar .pb-brand .pb-brand-text small {
    display: block; font-size: .7rem; font-weight: 500;
    letter-spacing: .02em; color: var(--pb-gold-light); opacity: .95;
}

/* Area menu scrollable */
.pb-sidebar .nav {
    flex: 1 1 auto; flex-wrap: nowrap; min-height: 0;
    overflow-y: auto; overflow-x: hidden; padding-bottom: 1rem;
}
.pb-sidebar .nav::-webkit-scrollbar { width: 7px; }
.pb-sidebar .nav::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .18); border-radius: 8px; }
.pb-sidebar .nav::-webkit-scrollbar-thumb:hover { background-color: rgba(240, 215, 128, .4); }
.pb-sidebar .nav { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }

.pb-sidebar .nav-link {
    color: rgba(233, 250, 246, .82);
    padding: .72rem 1.25rem;
    display: flex; align-items: center; gap: .8rem;
    font-size: .93rem;
    border-left: 4px solid transparent;
    border-radius: 0;
    transition: background .18s ease, color .18s ease;
}
.pb-sidebar .nav-link i { font-size: 1.15rem; width: 1.45rem; text-align: center; transition: color .18s ease; }
.pb-sidebar .nav-link:hover { color: #fff; background-color: rgba(255, 255, 255, .09); }
.pb-sidebar .nav-link:hover i { color: var(--pb-gold-light); }
.pb-sidebar .nav-link.active {
    color: #fff; font-weight: 600;
    background: linear-gradient(90deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .05) 70%, transparent);
    border-left-color: var(--pb-gold);
}
.pb-sidebar .nav-link.active i { color: var(--pb-gold-light); }

.pb-sidebar .pb-section-label {
    padding: 1rem 1.25rem .35rem;
    font-size: .68rem; letter-spacing: .12em;
    text-transform: uppercase; color: rgba(255, 255, 255, .55);
}

/* Layout sidebar tetap di desktop */
@media (min-width: 992px) {
    .pb-sidebar {
        position: fixed; top: 0; left: 0; z-index: 1030; height: 100vh;
        display: flex; flex-direction: column; transition: transform .25s ease;
    }
    .pb-main { margin-left: var(--pb-sidebar-width); transition: margin-left .25s ease; }
    body.pb-sidebar-collapsed .pb-sidebar { transform: translateX(-100%); }
    body.pb-sidebar-collapsed .pb-main { margin-left: 0; }
}

/* ---------- Topbar (glass) ---------- */
.pb-topbar {
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(1.25) blur(8px);
    -webkit-backdrop-filter: saturate(1.25) blur(8px);
    border-bottom: 1px solid var(--pb-line);
    padding: .8rem 1.5rem;
    position: sticky; top: 0; z-index: 1020;
    box-shadow: 0 6px 20px rgba(14, 59, 84, .05);
}
.pb-topbar h1 { letter-spacing: -.01em; display: inline-flex; align-items: center; }
.pb-topbar h1::before {
    content: ""; display: inline-block; width: 4px; height: 1.05em;
    margin-right: 10px; border-radius: 4px;
    background: linear-gradient(180deg, var(--pb-gold-light), var(--pb-gold-dark));
}
.pb-topbar .btn-light { border-radius: var(--pb-radius-sm); }

/* ---------- Kartu ---------- */
.card {
    border: 1px solid var(--pb-line);
    border-radius: var(--pb-radius);
    box-shadow: var(--pb-shadow-card);
    background: var(--pb-card);
    transition: box-shadow .2s ease, transform .2s ease;
}
a.card:hover, .card.hover-lift:hover { box-shadow: var(--pb-shadow-lg); transform: translateY(-3px); }
.card-header {
    background: linear-gradient(180deg, rgba(234, 243, 248, .55), transparent);
    border-bottom: 1px solid var(--pb-line);
    border-radius: var(--pb-radius) var(--pb-radius) 0 0 !important;
    font-weight: 700;
    padding: 1rem 1.25rem;
    color: var(--pb-ink);
}

/* ---------- Stat cards ---------- */
.pb-stat-card { transition: transform .16s ease, box-shadow .2s ease; }
.pb-stat-card:hover { transform: translateY(-3px); box-shadow: var(--pb-shadow-lg); }
.pb-stat-icon {
    width: 54px; height: 54px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 1.55rem;
    flex: 0 0 auto;
}

/* Stat card gradien penuh (mewah) */
.pb-stat-gradient {
    position: relative; overflow: hidden; border: none; color: #fff;
    box-shadow: 0 14px 32px rgba(14, 59, 84, .16);
}
.pb-stat-gradient::after {
    content: ""; position: absolute; inset: -45% -25% auto auto;
    width: 190px; height: 190px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 65%);
    pointer-events: none;
}
.pb-stat-gradient .pb-stat-num { font-size: 1.7rem; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.pb-stat-gradient .pb-stat-ico { font-size: 1.9rem; opacity: .92; }
.pb-grad-primary { background: linear-gradient(140deg, #2f88b0, var(--pb-primary-dark)); }
.pb-grad-accent  { background: linear-gradient(140deg, #3fc7a0, var(--pb-accent-dark)); }
.pb-grad-gold    { background: linear-gradient(140deg, var(--pb-gold-light), var(--pb-gold-dark)); color: #3a2c05; }
.pb-grad-ink     { background: linear-gradient(140deg, #2a5568, var(--pb-primary-darkest)); }
.pb-grad-danger  { background: linear-gradient(140deg, #e8705f, #b23b30); }

/* Hero / banner sorotan */
.pb-hero {
    position: relative; overflow: hidden; color: #fff; border: none;
    border-radius: var(--pb-radius);
    background:
        radial-gradient(600px 300px at 90% -20%, rgba(212, 175, 55, .28), transparent 60%),
        linear-gradient(120deg, var(--pb-primary) 0%, var(--pb-primary-dark) 55%, var(--pb-primary-darker) 100%);
    box-shadow: var(--pb-shadow-lg);
}
.pb-hero .text-muted { color: rgba(255, 255, 255, .78) !important; }
.pb-hero .text-primary { color: #fff !important; }

/* ---------- Form ---------- */
.form-control, .form-select {
    border-radius: var(--pb-radius-sm);
    border-color: #d8e4ea;
    padding: .55rem .8rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--pb-accent);
    box-shadow: 0 0 0 .22rem rgba(47, 174, 132, .16);
}
.form-label { font-weight: 600; font-size: .9rem; color: var(--pb-ink); }
.input-group-text { border-radius: var(--pb-radius-sm); background: #fff; border-color: #d8e4ea; }
.input-group-lg > .form-control, .input-group-lg > .input-group-text { border-radius: var(--pb-radius-sm); }
.form-check-input:checked { background-color: var(--pb-accent); border-color: var(--pb-accent); }
.form-check-input:focus { border-color: var(--pb-accent); box-shadow: 0 0 0 .22rem rgba(47, 174, 132, .16); }

/* ---------- Tabel ---------- */
.table { --bs-table-hover-bg: var(--pb-primary-light); border-color: var(--pb-line); }
.table > :not(caption) > * > * { padding: .8rem .75rem; }
.table thead th {
    background: linear-gradient(180deg, #eaf3f8, #ddecf3);
    color: var(--pb-primary-dark);
    font-weight: 700; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 2px solid rgba(31, 106, 140, .16);
    white-space: nowrap;
}
.table td, .table th { vertical-align: middle; }
.table-hover tbody tr { transition: background .12s; }
.table-responsive { border-radius: var(--pb-radius); }

/* ---------- DataTables ---------- */
.dataTables_wrapper .dt-length select, .dataTables_wrapper .dt-search input,
div.dt-container .dt-length select, div.dt-container .dt-search input {
    border: 1px solid #cfdbe2; border-radius: var(--pb-radius-sm); padding: .4rem .7rem;
}
div.dt-container .dt-search input:focus, div.dt-container .dt-length select:focus {
    border-color: var(--pb-accent); box-shadow: 0 0 0 .2rem rgba(47, 174, 132, .18); outline: none;
}
div.dt-container .dt-length, div.dt-container .dt-search { margin-bottom: .75rem; }
div.dt-container .dt-info { color: var(--pb-muted); font-size: .88rem; padding-top: .75rem; }
div.dt-container .dt-paging .dt-paging-button.current {
    background: var(--pb-primary) !important; border-color: var(--pb-primary) !important; color: #fff !important;
    border-radius: 9px;
}
div.dt-container .dt-paging .dt-paging-button { border-radius: 9px; margin: 0 1px; }
table.dataTable > tbody > tr > td.dt-control::before,
table.dataTable td.dtr-control > button::before {
    background-color: var(--pb-primary) !important; border-color: var(--pb-primary) !important;
}
table.dataTable { border-collapse: separate !important; }

/* ---------- Badge ---------- */
.badge { font-weight: 600; padding: .45em .8em; border-radius: 2rem; }
.badge-aktif { background-color: var(--pb-accent-light); color: var(--pb-accent-dark); }
.badge-nonaktif { background-color: #FDECEC; color: #C0392B; }
.badge-pending { background-color: #FFF6DD; color: #9A7B0A; }

/* ---------- Alert ---------- */
.alert { border: none; border-radius: var(--pb-radius); box-shadow: 0 6px 18px rgba(14, 59, 84, .06); }
.alert-success { background: #e7f6f0; color: #1c7a5e; }
.alert-warning { background: #fdf5e2; color: #8a6a12; }
.alert-danger  { background: #fdecea; color: #b23b30; }
.alert-info    { background: #e9f3fa; color: #1c6187; }

/* ---------- Pagination ---------- */
.page-link { color: var(--pb-primary); border-radius: 9px; margin: 0 1px; }
.page-item.active .page-link { background-color: var(--pb-primary); border-color: var(--pb-primary); }

/* ---------- Notifikasi (lonceng) ---------- */
.pb-notif-menu { width: 344px; max-width: 92vw; border: 1px solid var(--pb-line); border-radius: var(--pb-radius); }
.pb-notif-list { max-height: 380px; overflow-y: auto; }
.pb-notif-item { border-bottom: 1px solid #f1f4f7; transition: background-color .12s ease; align-items: flex-start; }
.pb-notif-item:hover { background-color: var(--pb-primary-light); }
.pb-notif-item:last-child { border-bottom: none; }
.pb-notif-unread { background-color: #f3faf7; }
.pb-notif-icon {
    width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%;
    background: #eef4f7; display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.pb-notif-time { font-size: .72rem; color: #9aa4ad; margin-top: 2px; }
.pb-notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pb-accent); flex: 0 0 auto; margin-top: 6px; }
#pbNotifBadge { font-size: .68rem; }

/* ---------- Halaman login (premium) ---------- */
.pb-login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1000px 500px at 12% 8%, rgba(212, 175, 55, .12), transparent 60%),
        radial-gradient(820px 460px at 88% 92%, rgba(47, 174, 132, .18), transparent 55%),
        linear-gradient(135deg, #0F3A50 0%, var(--pb-primary-darker) 48%, var(--pb-primary-darkest) 100%);
    padding: 1.25rem;
    position: relative;
}
.pb-login-card { width: 100%; max-width: 430px; position: relative; z-index: 1; }
.pb-login-logo {
    width: 76px; height: 76px; border-radius: 22px;
    background: linear-gradient(140deg, var(--pb-accent), var(--pb-primary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 2.1rem; margin: 0 auto 1rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3), 0 0 0 5px rgba(212, 175, 55, .28);
    overflow: hidden;
}
.pb-login-logo img { width: 100%; height: 100%; object-fit: cover; }
.pb-login-card .card { border: 1px solid rgba(255, 255, 255, .5); box-shadow: 0 26px 70px rgba(0, 0, 0, .35); }
.pb-login-title-white { color: #fff; }
.pb-login-sub-white { color: rgba(255, 255, 255, .82); }
.pb-login-foot { color: rgba(255, 255, 255, .78); }

/* ---------- PWA banner ---------- */
.pb-install-banner {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 1080;
    width: calc(100% - 1.5rem); max-width: 480px;
    background: #fff; border: 1px solid #e3e8ec; border-radius: var(--pb-radius);
    box-shadow: 0 8px 30px rgba(14, 59, 84, .18);
    padding: .7rem .85rem; display: flex; align-items: center; gap: .7rem;
}

/* ---------- PWA safe-area ---------- */
@supports (padding: env(safe-area-inset-top)) {
    .pb-topbar { padding-top: calc(.8rem + env(safe-area-inset-top, 0px)); }
    .pb-sidebar { padding-top: env(safe-area-inset-top, 0px); }
    @media (min-width: 992px) { .pb-sidebar { padding-top: 0; } }
}

/* ---------- Panduan PWA ---------- */
.pb-guide-steps li { padding: .3rem 0; line-height: 1.6; }
.pb-guide-steps li::marker { color: var(--pb-primary); font-weight: 700; }

/* ---------- Empty state ---------- */
.pb-empty-state { padding: 3rem 1rem; text-align: center; color: #8a949e; }
.pb-empty-state i { font-size: 3rem; color: #cfd8df; }

/* ---------- Cetak ---------- */
@media print {
    .pb-sidebar, .pb-topbar, .no-print, footer,
    .btn, button, input[type=button], input[type=submit] { display: none !important; }
    .pb-main { margin-left: 0 !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .card-header { background: #fff !important; }
    .table thead th { background: #f1f1f1 !important; color: #000 !important; }
    @page { margin: 12mm; }
}
