.glass-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.hero-gradient {
    background:
        linear-gradient(rgba(30, 58, 138, 0.86), rgba(30, 58, 138, 0.86)),
        url("https://images.unsplash.com/photo-1581092160562-40aa08e78837?auto=format&fit=crop&q=80&w=2070");
    background-size: cover;
    background-position: center;
}

.auth-bg,
.auth-page {
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.94)),
        linear-gradient(90deg, rgba(30, 58, 138, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(30, 58, 138, 0.06) 1px, transparent 1px);
    background-color: #f8fafc;
    background-size: auto, 46px 46px, 46px 46px;
    background-attachment: fixed;
}

.auth-brand-grid {
    background:
        linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0 1px, transparent 1px 100%),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, #020617 0%, #0f1f4d 45%, #1e3a8a 100%);
    background-size: 100% 100%, 54px 54px, 54px 54px, 100% 100%;
}

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

/*
 * Sakelar integrasi memakai input transparan berukuran penuh. Pola ini menjaga
 * fokus keyboard tetap berada di posisi visual sakelar dan menghindari loncatan
 * scroll/repaint yang dapat terjadi pada input `sr-only` di dalam kartu
 * `overflow-hidden`.
 */
.integration-switch {
    position: relative;
    display: inline-flex;
    width: 2.75rem;
    height: 1.5rem;
    flex: 0 0 auto;
    cursor: pointer;
}

.integration-switch__input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    opacity: 0;
}

.integration-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: #e5e7eb;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
    pointer-events: none;
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.integration-switch__track::after {
    content: "";
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.24);
    transition: transform 160ms ease;
}

.integration-switch__input:checked + .integration-switch__track {
    background: #1e3a8a;
}

.integration-switch__input:checked + .integration-switch__track::after {
    transform: translateX(1.25rem);
}

.integration-switch__input:focus-visible + .integration-switch__track {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22);
}

.integration-switch__input:disabled {
    cursor: not-allowed;
}

.integration-switch__input:disabled + .integration-switch__track {
    opacity: 0.55;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.public-mobile-menu {
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dashboard-shell {
    height: 100vh;
}

.dashboard-sidebar {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.dashboard-sidebar-nav {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

[data-modal-backdrop] {
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}

[data-modal-backdrop] > :first-child {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.overflow-x-auto {
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

@supports (height: 100dvh) {
    .public-mobile-menu {
        max-height: calc(100dvh - 5rem);
    }

    .dashboard-shell,
    .dashboard-sidebar {
        height: 100dvh;
        max-height: 100dvh;
    }

    [data-modal-backdrop] > :first-child {
        max-height: calc(100dvh - 2rem);
    }
}

@media (min-width: 1024px) {
    .public-mobile-menu {
        max-height: none;
        overflow: visible;
    }
}

html[data-theme="dark"] body,
html[data-theme="dark"] .bg-slate-50 {
    background-color: #0f172a !important;
    color: #dbeafe;
}

html[data-theme="dark"] .bg-white {
    background-color: #111827 !important;
}

html[data-theme="dark"] .bg-gray-50 {
    background-color: #1f2937 !important;
}

html[data-theme="dark"] .bg-gray-100 {
    background-color: #374151 !important;
}

html[data-theme="dark"] .bg-blue-50 {
    background-color: rgba(37, 99, 235, 0.16) !important;
}

html[data-theme="dark"] .bg-slate-50\/70,
html[data-theme="dark"] .bg-gray-50\/70,
html[data-theme="dark"] .bg-gray-50\/60,
html[data-theme="dark"] .bg-blue-50\/50 {
    background-color: #111827 !important;
}

html[data-theme="dark"] .bg-white\/5 {
    background-color: rgba(15, 23, 42, 0.62) !important;
}

html[data-theme="dark"] .border-white\/10 {
    border-color: rgba(148, 163, 184, 0.28) !important;
}

html[data-theme="dark"] [data-cms-tab] {
    background-color: #1e293b !important;
    border: 1px solid #334155;
}

html[data-theme="dark"] [data-cms-tab][data-active="true"] {
    background-color: #1e3a8a !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

html[data-theme="dark"] [data-cms-tab][data-active="true"] span {
    color: #ffffff !important;
}

html[data-theme="dark"] .bg-green-50,
html[data-theme="dark"] .bg-green-100 {
    background-color: rgba(34, 197, 94, 0.16) !important;
}

html[data-theme="dark"] .bg-emerald-50,
html[data-theme="dark"] .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.16) !important;
}

html[data-theme="dark"] .bg-red-50,
html[data-theme="dark"] .bg-red-100 {
    background-color: rgba(239, 68, 68, 0.16) !important;
}

html[data-theme="dark"] .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.16) !important;
}

html[data-theme="dark"] .bg-amber-50\/60 {
    background-color: rgba(245, 158, 11, 0.12) !important;
}

html[data-theme="dark"] .bg-red-50\/60 {
    background-color: rgba(239, 68, 68, 0.12) !important;
}

html[data-theme="dark"] .bg-purple-50,
html[data-theme="dark"] .bg-purple-100 {
    background-color: rgba(168, 85, 247, 0.16) !important;
}

html[data-theme="dark"] .bg-slate-100 {
    background-color: #1e293b !important;
}

html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-700 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .text-gray-950,
html[data-theme="dark"] .text-slate-950,
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-slate-800 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-400 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-waskita-blue,
html[data-theme="dark"] .hover\:text-waskita-blue:hover {
    color: #93c5fd !important;
}

html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-blue-700 {
    color: #60a5fa !important;
}

html[data-theme="dark"] .bg-amber-300.text-slate-950,
html[data-theme="dark"] .bg-amber-400.text-slate-950,
html[data-theme="dark"] .bg-yellow-300.text-slate-950,
html[data-theme="dark"] .bg-yellow-400.text-slate-950 {
    color: #0f172a !important;
}

html[data-theme="dark"] .text-emerald-600 {
    color: #34d399 !important;
}

html[data-theme="dark"] .text-emerald-700 {
    color: #a7f3d0 !important;
}

html[data-theme="dark"] .text-amber-600 {
    color: #fbbf24 !important;
}

html[data-theme="dark"] .text-amber-700 {
    color: #fcd34d !important;
}

html[data-theme="dark"] .text-purple-600 {
    color: #c4b5fd !important;
}

html[data-theme="dark"] .text-purple-700 {
    color: #ddd6fe !important;
}

html[data-theme="dark"] .text-slate-700 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-green-600 {
    color: #86efac !important;
}

html[data-theme="dark"] .text-red-600,
html[data-theme="dark"] .text-red-700,
html[data-theme="dark"] .text-red-500 {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .text-green-800 {
    color: #86efac !important;
}

html[data-theme="dark"] .text-green-700 {
    color: #bbf7d0 !important;
}

html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-red-100,
html[data-theme="dark"] .border-purple-100,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-emerald-100,
html[data-theme="dark"] .border-amber-100 {
    border-color: #334155 !important;
}

html[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #334155 !important;
}

html[data-theme="dark"] .shadow-sm,
html[data-theme="dark"] .shadow-md,
html[data-theme="dark"] .shadow-xl {
    box-shadow: 0 16px 40px -24px rgba(0, 0, 0, 0.8) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #94a3b8 !important;
}

html[data-theme="dark"] table thead,
html[data-theme="dark"] .hover\:bg-gray-50:hover,
html[data-theme="dark"] .hover\:bg-blue-50:hover {
    background-color: #1e293b !important;
}

html[data-theme="dark"] .hover\:bg-red-50:hover {
    background-color: rgba(239, 68, 68, 0.18) !important;
}

html[data-theme="dark"] .hover\:bg-amber-50:hover {
    background-color: rgba(245, 158, 11, 0.18) !important;
}

html[data-theme="dark"] .hover\:bg-green-50:hover {
    background-color: rgba(34, 197, 94, 0.18) !important;
}

html[data-theme="dark"] .hover\:bg-gray-50:hover {
    background-color: #1e293b !important;
}

html[data-theme="dark"] .swal2-popup {
    background: #111827 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .swal2-title,
html[data-theme="dark"] .swal2-html-container {
    color: #f8fafc !important;
}

.rich-editor-surface {
    background: #ffffff;
    overflow-x: auto;
}

.rich-editor-mode-button {
    color: #64748b;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.rich-editor-mode-button[data-active="true"] {
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    color: #1e3a8a;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rich-editor-toolbar-group {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    display: inline-flex;
    gap: 0.15rem;
    padding: 0.25rem;
}

.rich-editor-button {
    align-items: center;
    border-radius: 0.625rem;
    color: #475569;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    height: 2rem;
    justify-content: center;
    min-width: 2rem;
    padding: 0 0.55rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rich-editor-button:hover,
.rich-editor-button:focus-visible {
    background: #eff6ff;
    color: #1e3a8a;
    outline: none;
}

.rich-editor-source {
    resize: vertical;
    tab-size: 4;
}

.rich-editor-surface:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(30, 58, 138, 0.22);
}

.rich-editor-surface:empty::before {
    color: #94a3b8;
    content: "Tulis konten halaman di sini...";
}

.rich-editor-surface h1,
.public-content h1 {
    color: #0f172a;
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.18;
    margin: 1.75rem 0 0.85rem;
}

.rich-editor-surface h2,
.public-content h2 {
    color: #0f172a;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 1.5rem 0 0.75rem;
}

.rich-editor-surface h3,
.public-content h3 {
    color: #111827;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 1.25rem 0 0.625rem;
}

.rich-editor-surface h4,
.public-content h4 {
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
    margin: 1rem 0 0.5rem;
}

.rich-editor-surface h5,
.public-content h5,
.rich-editor-surface h6,
.public-content h6 {
    color: #334155;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.45;
    margin: 0.85rem 0 0.45rem;
}

.rich-editor-surface p,
.public-content p {
    margin: 0.85rem 0;
}

.rich-editor-surface ul,
.public-content ul {
    list-style: disc;
    margin: 0.85rem 0;
    padding-left: 1.5rem;
}

.rich-editor-surface ol,
.public-content ol {
    list-style: decimal;
    margin: 0.85rem 0;
    padding-left: 1.5rem;
}

.rich-editor-surface li,
.public-content li {
    margin: 0.35rem 0;
}

.rich-editor-surface blockquote,
.public-content blockquote {
    border-left: 4px solid #fbbf24;
    color: #334155;
    font-weight: 600;
    margin: 1rem 0;
    padding: 0.25rem 0 0.25rem 1rem;
}

.rich-editor-surface a,
.public-content a {
    color: #1e3a8a;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rich-editor-surface figure,
.public-content figure {
    margin: 1.25rem 0;
}

.rich-editor-surface figcaption,
.public-content figcaption {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
}

.rich-editor-surface img,
.public-content img {
    border-radius: 1rem;
    display: block;
    height: auto;
    max-width: 100%;
}

.rich-editor-surface hr,
.public-content hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

.rich-editor-surface table,
.public-content table {
    border-collapse: collapse;
    margin: 1.25rem 0;
    min-width: 100%;
    width: 100%;
}

.rich-editor-surface th,
.rich-editor-surface td,
.public-content th,
.public-content td {
    border: 1px solid #cbd5e1;
    padding: 0.75rem 0.9rem;
    text-align: left;
    vertical-align: top;
}

.rich-editor-surface th,
.public-content th {
    background: #eff6ff;
    color: #0f172a;
    font-weight: 800;
}

.public-content {
    overflow-x: auto;
}

.public-content > *:first-child {
    margin-top: 0;
}

.public-content > *:last-child {
    margin-bottom: 0;
}

html[data-theme="dark"] .rich-editor-surface {
    background: #0f172a;
    color: #f8fafc;
}

html[data-theme="dark"] .rich-editor-mode-button[data-active="true"] {
    background: #0f172a;
    color: #93c5fd;
}

html[data-theme="dark"] .rich-editor-toolbar-group {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .rich-editor-button {
    color: #cbd5e1;
}

html[data-theme="dark"] .rich-editor-button:hover,
html[data-theme="dark"] .rich-editor-button:focus-visible {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

html[data-theme="dark"] .rich-editor-source {
    background: #020617 !important;
    color: #dbeafe !important;
}

html[data-theme="dark"] .rich-editor-surface h1,
html[data-theme="dark"] .rich-editor-surface h2,
html[data-theme="dark"] .rich-editor-surface h3,
html[data-theme="dark"] .rich-editor-surface h4,
html[data-theme="dark"] .rich-editor-surface h5,
html[data-theme="dark"] .rich-editor-surface h6 {
    color: #f8fafc;
}

html[data-theme="dark"] .rich-editor-surface blockquote {
    color: #dbeafe;
}

html[data-theme="dark"] .rich-editor-surface figcaption {
    color: #cbd5e1;
}

html[data-theme="dark"] .rich-editor-surface hr {
    border-top-color: #334155;
}

html[data-theme="dark"] .rich-editor-surface th,
html[data-theme="dark"] .rich-editor-surface td {
    border-color: #334155;
}

html[data-theme="dark"] .rich-editor-surface th {
    background: #1e293b;
    color: #f8fafc;
}

/* Public pages: shared readable hero and media cards. */
.public-page-hero {
    isolation: isolate;
}

.public-page-hero::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
    border-radius: 9999px;
    content: "";
    height: min(34rem, 70vw);
    pointer-events: none;
    position: absolute;
    right: -10rem;
    top: -16rem;
    width: min(34rem, 70vw);
    z-index: 0;
}

.public-media-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.public-media-card__visual {
    aspect-ratio: 4 / 3;
    background: #e2e8f0;
    overflow: hidden;
}

.public-media-card__visual img {
    display: block;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
    width: 100%;
}

.public-media-card:hover .public-media-card__visual img {
    transform: scale(1.04);
}

.public-line-clamp-2,
.public-line-clamp-3 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

.public-line-clamp-2 {
    -webkit-line-clamp: 2;
}

.public-line-clamp-3 {
    -webkit-line-clamp: 3;
}

.public-contact-value {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 639px) {
    .public-page-hero::after {
        height: 20rem;
        right: -9rem;
        top: -10rem;
        width: 20rem;
    }
}
