:root {
    --pub-teal: #14b8bd;
    --pub-teal-dark: #0d9ba0;
    --pub-teal-deep: #0b7d82;
    --pub-teal-soft: #e6f8f8;
    --pub-ink: #1c2536;
    --pub-muted: #8a93a6;
    --pub-border: #eceff4;
    --pub-bg-soft: #f4f6f9;
    --pub-danger: #d64545;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--pub-ink);
    background: #fff;
}

a {
    color: inherit;
}

/* ============ Header ============
   Gradient sama persis dengan .gm-header di admin, biar brand
   konsisten walau areanya beda (public vs admin panel). */
.pub-header {
    background: linear-gradient(100deg, var(--pub-teal) 0%, var(--pub-teal-dark) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    position: sticky;
    top: 0;
    z-index: 40;
    transition: box-shadow .2s ease;
}

.pub-header.is-scrolled {
    box-shadow: 0 6px 20px rgba(11, 125, 130, 0.18);
}

.pub-header-inner {
    max-width: 1120px;
    margin-inline: auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* ============ Brand / logo ============ */
.pub-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    min-width: 0;
    flex-shrink: 0;
}

.pub-brand-logo-img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.pub-brand-icon-fallback {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.pub-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pub-brand-name {
    font-weight: 800;
    font-size: 16px;
}

.pub-brand-tag {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
}

/* ============ Nav links (desktop) ============ */
.pub-nav-links {
    display: flex;
    gap: 22px;
    flex: 1;
}

.pub-nav-links a {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.78);
    padding-block: 4px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease;
}

.pub-nav-links a:hover,
.pub-nav-links a.is-active {
    color: #fff;
    border-color: #fff;
}

/* ============ Actions / buttons ============ */
.pub-header-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.pub-btn {
    font-size: 13px;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 10px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: box-shadow .15s ease, transform .1s ease;
}

.pub-btn:active {
    transform: translateY(1px);
}

.pub-btn-primary {
    background: #ffffff;
    color: var(--pub-teal-deep);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.pub-btn-primary:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

/* tombol lebar penuh di menu HP */
.pub-btn-block {
    width: 100%;
    padding: 13px 18px;
    font-size: 15px;
    background: var(--pub-teal-dark);
    color: #fff;
}

.pub-btn-block:hover {
    background: var(--pub-teal-deep);
}

/* ============ User dropdown (desktop) ============ */
.pub-user-menu {
    position: relative;
}

.pub-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    max-width: 240px;
}

.pub-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pub-user-avatar {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--pub-teal-deep);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.pub-user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 180px;
    background: #fff;
    border: 1px solid var(--pub-border);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(20, 25, 40, 0.15);
    padding: 6px;
    display: none;
    flex-direction: column;
}

.pub-user-dropdown.is-open {
    display: flex;
}

.pub-user-dropdown a,
.pub-user-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--pub-ink);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.pub-user-dropdown a:hover,
.pub-user-dropdown button:hover {
    background: var(--pub-bg-soft);
}

/* ============ Tombol ☰ ============ */
.pub-menu-toggle {
    display: none;                 /* desktop: disembunyikan */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0 11px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    flex-shrink: 0;
}

.pub-menu-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform .2s ease, opacity .2s ease;
}

.pub-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.pub-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pub-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Menu HP ============ */
.pub-mobile-menu,
.pub-mobile-backdrop {
    display: none;                 /* desktop: tidak ada sama sekali */
}

/* ============ Fokus keyboard ============ */
.pub-header a:focus-visible,
.pub-header button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    border-radius: 8px;
}

.pub-mobile-menu a:focus-visible,
.pub-mobile-menu button:focus-visible,
.pub-user-dropdown a:focus-visible,
.pub-user-dropdown button:focus-visible {
    outline-color: var(--pub-teal-dark);
}

/* ============ Main / Footer ============ */
.pub-main {
    min-height: calc(100vh - 130px);
}

.pub-footer {
    border-top: 1px solid var(--pub-border);
    margin-top: 40px;
}

.pub-footer-inner {
    max-width: 1120px;
    margin-inline: auto;
    padding: 20px 24px;
    font-size: 12px;
    color: var(--pub-muted);
}

/* =====================================================================
   RESPONSIVE
   900px: 4 menu + nama user mulai sesak, jadi pindah ke menu ☰
   ===================================================================== */
@media (max-width: 900px) {
    .pub-header-inner {
        padding: 10px 16px;
        gap: 12px;
    }

    .pub-nav-links,
    .pub-header-actions {
        display: none;
    }

    .pub-menu-toggle {
        display: inline-flex;
    }

    /* backdrop gelap di belakang panel (klik = tutup) */
    .pub-mobile-backdrop {
        display: block;
        position: absolute;        /* mulai tepat di bawah header, header tidak ikut gelap */
        left: 0;
        right: 0;
        top: 100%;
        height: 100vh;
        height: 100dvh;
        z-index: -1;               /* di bawah panel menu, di atas isi halaman */
        background: rgba(20, 25, 40, 0.35);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s;
    }

    .pub-mobile-menu {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        max-height: calc(100vh - 64px);
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #fff;
        border-radius: 0 0 18px 18px;
        box-shadow: 0 18px 40px rgba(20, 25, 40, 0.18);
        padding: 8px 12px 16px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }

    .pub-header.is-menu-open .pub-mobile-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .pub-header.is-menu-open .pub-mobile-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .pub-mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .pub-mobile-nav a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 12px;
        border-radius: 12px;
        font-size: 15px;
        font-weight: 600;
        color: var(--pub-ink);
        text-decoration: none;
    }

    .pub-mobile-nav a i {
        font-size: 13px;
        color: var(--pub-muted);
    }

    .pub-mobile-nav a:hover {
        background: var(--pub-bg-soft);
    }

    .pub-mobile-nav a.is-active {
        background: var(--pub-teal-soft);
        color: var(--pub-teal-deep);
    }

    .pub-mobile-nav a.is-active i {
        color: var(--pub-teal-deep);
    }

    .pub-mobile-account {
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--pub-border);
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .pub-mobile-account form {
        margin: 0;
    }

    .pub-mobile-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 12px 10px;
        min-width: 0;
    }

    .pub-mobile-user .pub-user-avatar {
        width: 34px;
        height: 34px;
        font-size: 14px;
        background: var(--pub-teal-dark);
        color: #fff;
    }

    .pub-mobile-user-name {
        font-size: 14px;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pub-mobile-action {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 12px;
        border: none;
        border-radius: 12px;
        background: none;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        color: var(--pub-ink);
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    .pub-mobile-action:hover {
        background: var(--pub-bg-soft);
    }

    .pub-mobile-action.is-danger {
        color: var(--pub-danger);
    }

    .pub-footer-inner {
        padding: 18px 16px;
    }
}

/* HP sangat kecil: sembunyikan tagline supaya logo & ☰ tetap muat */
@media (max-width: 360px) {
    .pub-brand-tag {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pub-header,
    .pub-menu-toggle span,
    .pub-mobile-menu,
    .pub-mobile-backdrop {
        transition: none;
    }
}