/* ============================================================
   SBS Mobile & Desktop App Shell
   Komunitas Sukorejo Bonsai Society
   ============================================================ */

:root {
    --sbs-900: #05392a;
    --sbs-800: #065f46;
    --sbs-700: #047857;
    --sbs-600: #059669;
    --sbs-300: #6ee7b7;
    --sbs-100: #d1fae5;
    --surface: #f1f5f9;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--surface);
    color: var(--ink);
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- App bar (mobile) ---------- */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(135deg, var(--sbs-800), var(--sbs-600));
    color: #fff;
    box-shadow: 0 6px 18px -10px rgba(6, 95, 70, .9);
    padding-top: env(safe-area-inset-top);
}

.app-title {
    font-weight: 700;
    letter-spacing: .2px;
}

/* ---------- Bottom navigation (mobile) ---------- */
.app-bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
    border-top: 1px solid #e2e8f0;
    padding-bottom: env(safe-area-inset-bottom);
}

.app-bottomnav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 9px 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    transition: color .18s ease;
}

.app-bottomnav a.is-active {
    color: var(--sbs-700);
}

.app-bottomnav a.is-active .nav-dot {
    opacity: 1;
    transform: scaleX(1);
}

.nav-dot {
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: var(--sbs-600);
    opacity: 0;
    transform: scaleX(.2);
    transition: all .2s ease;
}

/* ---------- Sidebar (desktop) ---------- */
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 16rem;
    background: linear-gradient(180deg, var(--sbs-900), var(--sbs-800) 55%, var(--sbs-700));
    color: #d1fae5;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.app-sidebar a.side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .9rem;
    border-radius: .7rem;
    font-size: .875rem;
    font-weight: 600;
    color: #a7f3d0;
    transition: all .18s ease;
}

.app-sidebar a.side-link:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.app-sidebar a.side-link.is-active {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--sbs-300);
}

/* ---------- Cards & list ---------- */
.card {
    background: var(--card);
    border-radius: 1rem;
    border: 1px solid #e8edf3;
    box-shadow: 0 10px 26px -22px rgba(15, 23, 42, .55);
}

/* Panel sambutan: latar gradien eksplisit agar teks putih selalu kontras */
.hero-panel {
    background: linear-gradient(135deg, var(--sbs-800) 0%, var(--sbs-600) 100%) !important;
    color: #ffffff !important;
}

.hero-panel .hero-muted {
    color: rgba(255, 255, 255, .85) !important;
}

.stat-card {
    background: var(--card);
    border-radius: 1rem;
    border: 1px solid #e8edf3;
    padding: 1rem;
    box-shadow: 0 10px 26px -22px rgba(15, 23, 42, .55);
}

.list-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem .95rem;
    transition: background .15s ease;
}

.list-row:hover {
    background: #f8fafc;
}

.avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}

/* ---------- Buttons & inputs ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-weight: 600;
    font-size: .875rem;
    border-radius: .75rem;
    padding: .6rem 1rem;
    transition: all .18s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--sbs-700);
    color: #fff;
    box-shadow: 0 12px 22px -14px rgba(4, 120, 87, .95);
}

.btn-primary:hover {
    background: var(--sbs-800);
}

.btn-soft {
    background: #eef2f7;
    color: #334155;
}

.btn-soft:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-danger:hover {
    background: #fecaca;
}

.field {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid #d8e0ea;
    border-radius: .75rem;
    font-size: .9rem;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field:focus {
    outline: none;
    border-color: var(--sbs-600);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .16);
}

/* ---------- Paginasi ---------- */
.page-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .6rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: .8rem;
    font-weight: 700;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.page-btn:hover {
    background: #ecfdf5;
    border-color: var(--sbs-300);
    color: var(--sbs-800);
}

.page-btn.is-active {
    background: var(--sbs-700);
    border-color: var(--sbs-700);
    color: #fff;
}

.page-btn.is-disabled {
    pointer-events: none;
    opacity: .4;
}

/* Kolom pencarian dengan ikon di dalam */
.field-search {
    padding-left: 2.4rem;
}

/* Kolom dengan tombol lihat password di sisi kanan */
.field-has-toggle {
    padding-right: 2.75rem;
}

.pw-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 2.75rem;
    display: grid;
    place-items: center;
    color: #64748b;
    border-radius: 0 .75rem .75rem 0;
    transition: color .15s ease, background .15s ease;
}

.pw-toggle:hover {
    color: var(--sbs-700);
    background: #f1f5f9;
}

.label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* ---------- Utility ---------- */
.content-pad {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
}

.flash {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .9rem;
    border-radius: .8rem;
    font-size: .85rem;
    font-weight: 600;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    background: var(--sbs-100);
    color: #065f46;
}

/* ---------- Responsive switch ---------- */
@media (min-width: 768px) {
    .mobile-only { display: none !important; }
    .app-main { margin-left: 16rem; }
}

@media (max-width: 767px) {
    .desktop-only { display: none !important; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- Login ---------- */
.login-hero {
    background:
        radial-gradient(1100px 420px at 12% -10%, rgba(110, 231, 183, .35), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(4, 120, 87, .45), transparent 55%),
        linear-gradient(160deg, var(--sbs-900), #032e21 70%);
}

@media print {
    .app-sidebar, .app-topbar, .app-bottomnav, .no-print { display: none !important; }
    .app-main { margin-left: 0 !important; }
}
