﻿/* ===== admin-style.css ===== */
/* Admin Panel Styles - Extracted from dbadmin.ejs */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    background: var(--primary-dark);
}

/* Sidebar Styles (matching auth-style.css) */
.admin-sidebar {
    width: 260px;
    background: var(--secondary-dark);
    border-right: 1px solid var(--card-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--card-dark);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.sidebar-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    display: block;
    padding: 8px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(163, 78, 120, 0.1);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(163, 78, 120, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* For logout button styled as nav-item */
button.nav-item {
    font-family: 'Roboto Mono', monospace;
}

button.nav-item:hover {
    cursor: pointer;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--card-dark);
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.user-badge {
    background: rgba(163, 78, 120, 0.2);
    border: 1px solid rgba(163, 78, 120, 0.4);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 20px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.user-info-text {
    flex: 1;
    min-width: 0;
}

.user-info-text small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.user-info-text strong {
    display: block;
    font-size: 0.85rem;
    color: var(--success);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Smooth Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(163, 78, 120, 0.5);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Mobile Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(163, 78, 120, 0.4);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(163, 78, 120, 0.6);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Content */
.admin-main {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.admin-container {
    max-width: 100%;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Page Header Animation */
.page-header {
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-30px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.admin-container {
    max-width: 100%;
    background-color: var(--secondary-dark);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease-out;
    padding: 30px;
}

/* Responsive - Base */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }
    .admin-sidebar.active {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
        padding-top: 75px;
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .admin-main {
        padding: 75px 12px 20px 12px;
    }
    .user-badge {
        flex-direction: row;
        text-align: left;
    }
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .sidebar-toggle {
        top: 14px;
        left: 14px;
    }
}

/* Quick Stats Row */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.quick-stat-item {
    background: linear-gradient(135deg, rgba(163, 78, 120, 0.2) 0%, rgba(163, 78, 120, 0.05) 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(163, 78, 120, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quick-stat-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(163, 78, 120, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-stat-item:hover::before {
    opacity: 1;
}

.quick-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(163, 78, 120, 0.3);
}

.quick-stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.quick-stat-item h4 {
    margin: 10px 0 5px 0;
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
}

.quick-stat-item small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stat-card {
    background-color: var(--card-dark);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.table-responsive {
    border: 1px solid var(--card-dark);
    border-radius: var(--border-radius);
    overflow-x: auto;   /* selalu bisa scroll kanan-kiri */
    overflow-y: auto;
    max-height: 500px;
    -webkit-overflow-scrolling: touch; /* smooth scroll iOS */
    will-change: scroll-position;
}

.table-users {
    width: 100%;
    margin-bottom: 0;
    background-color: var(--secondary-dark);
}

.table-users th, .table-users td {
    white-space: nowrap;
    padding: 10px 12px;
    border-color: var(--card-dark);
    font-size: 0.8rem;
}

.table-users th {
    background-color: var(--code-bg);
    color: var(--info);
    font-weight: 600;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 10;
    letter-spacing: 0.5px;
}

.table-users tbody tr {
    transition: all 0.3s ease;
}

.table-users tbody tr:hover {
    background-color: rgba(163, 78, 120, 0.1);
    transform: scale(1.01);
}

/* Badge Styling */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge.bg-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

.modal-content {
    background-color: var(--secondary-dark);
    border: 1px solid var(--primary-color);
    border-radius: 15px;
}

.modal-header {
    border-bottom: 2px solid rgba(163, 78, 120, 0.3);
    background: linear-gradient(135deg, rgba(163, 78, 120, 0.1) 0%, transparent 100%);
}

.modal-footer {
    border-top: 2px solid rgba(163, 78, 120, 0.3);
}

.form-control, .form-select {
    background: var(--code-bg);
    border: 2px solid rgba(163, 78, 120, 0.2);
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: var(--code-bg);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 4px rgba(163, 78, 120, 0.1);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

/* Tab Content Animation */
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(163, 78, 120, 0.3);
    font-size: 1.8rem;
    font-weight: 700;
}

.tab-content h3 i {
    margin-right: 12px;
}

/* Page Title for each tab section */
.section-header {
    background: linear-gradient(135deg, rgba(163, 78, 120, 0.15) 0%, rgba(163, 78, 120, 0.05) 100%);
    padding: 20px 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.section-header h3 {
    margin: 0;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-header p {
    margin: 8px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Search Box */
.user-search {
    margin-bottom: 20px;
}

.user-search input {
    background: var(--code-bg);
    border: 2px solid rgba(163, 78, 120, 0.2);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.user-search input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(163, 78, 120, 0.1);
    transform: translateY(-2px);
}

.user-search input::placeholder {
    color: var(--text-secondary);
}

/* Config Card */
.config-card {
    background: var(--card-dark);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.config-card h5 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--code-bg);
    padding-bottom: 10px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--code-bg);
}

.config-item:last-child {
    border-bottom: none;
}

.config-label {
    color: var(--text-secondary);
}

/* Smooth Scrollbar */
.admin-sidebar::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 8px;
}

.admin-sidebar::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.admin-sidebar::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gradient);
}

/* Better Buttons */
.btn {
    transition: all 0.3s ease;
    border: none;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Alert Animations */
.alert {
    animation: slideDown 0.5s ease;
    border-left: 4px solid;
    border-radius: 8px;
}

/* Card Hover Effects */
.config-card {
    transition: all 0.3s ease;
}

.config-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(163, 78, 120, 0.2);
}

/* Payment Channel Item Styles */
.payment-channel-item {
    background: rgba(163, 78, 120, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-channel-item:hover {
    background: rgba(163, 78, 120, 0.15);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.payment-channel-item input[type="checkbox"]:checked + i {
    transform: scale(1.1);
}

/* ============================
   RESPONSIVE - MOBILE FRIENDLY
   ============================ */

/* iOS smooth scroll support */
.table-responsive,
.sidebar-nav,
.admin-main,
.modal-body {
    -webkit-overflow-scrolling: touch;
}

/* Pastikan tidak ada overflow horizontal pada body itu sendiri, tapi jangan block child scroll */
body {
    overflow-x: clip; /* clip (bukan hidden) agar tidak memblokir scroll pada child element */
    max-width: 100%;
}

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
    .admin-main {
        padding-top: 75px; /* ruang untuk tombol toggle di atas */
    }

    .page-header h1 {
        font-size: 1.8rem !important;
    }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
    .admin-tabs {
        flex-direction: column;
    }
    .admin-tab {
        width: 100%;
        justify-content: center;
    }

    /* Admin main: padding atas lebih besar biar tidak tertutup tombol toggle */
    .admin-main {
        padding: 75px 12px 20px 12px;
    }

    /* Admin container padding lebih kecil di mobile */
    .admin-container {
        padding: 16px;
    }

    /* Page header font menyesuaikan layar */
    .page-header h1 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }

    .page-header p {
        font-size: 0.85rem !important;
    }

    /* Quick stats: 2 kolom di mobile */
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .quick-stat-item {
        padding: 14px 10px;
    }

    .quick-stat-item i {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

    .quick-stat-item h4 {
        font-size: 1.3rem;
        margin: 6px 0 3px 0;
    }

    .quick-stat-item small {
        font-size: 0.75rem;
    }

    /* User search full width */
    .user-search input {
        max-width: 100%;
        width: 100%;
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    /* Table tidak meluas melampaui layar */
    .table-responsive {
        max-height: 420px;
        border-radius: 8px;
        overflow-x: auto;
        overflow-y: auto;
    }

    /* Hilangkan efek scale pada table row (menyebabkan layout shift di mobile) */
    .table-users tbody tr:hover {
        transform: none;
        background-color: rgba(163, 78, 120, 0.15);
    }

    /* Table font lebih kecil di mobile */
    .table-users th,
    .table-users td {
        font-size: 0.72rem;
        padding: 8px 8px;
    }

    /* Config card full width dan padding lebih kecil */
    .config-card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .config-card h5 {
        font-size: 1rem;
    }

    /* Config item wrap jika label terlalu panjang */
    .config-item {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 0;
        align-items: flex-start;
    }

    .config-item > div:first-child {
        flex: 1;
        min-width: 0;
    }

    .config-item .form-check {
        flex-shrink: 0;
    }

    /* Modal: full width di mobile */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100vw - 20px) !important;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tombol lebih ramah sentuh */
    .btn-sm {
        padding: 7px 12px;
        font-size: 0.8rem;
        min-height: 36px;
    }

    /* Row di config tab full width di mobile */
    .row.g-3 > [class*="col-lg"] {
        width: 100%;
    }

    /* Sidebar overlay lebih gelap supaya konten di belakang tidak ganggu */
    .sidebar-overlay {
        backdrop-filter: blur(2px);
    }
}

/* Ekstra kecil: < 480px (HP lebar 360px-480px) */
@media (max-width: 480px) {
    .admin-main {
        padding: 72px 10px 20px 10px;
    }

    .admin-container {
        padding: 12px;
    }

    /* Quick stats: 2 kolom compact */
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-stat-item {
        padding: 12px 8px;
    }

    .quick-stat-item h4 {
        font-size: 1.1rem;
    }

    .quick-stat-item i {
        font-size: 1.2rem;
    }

    /* Page header */
    .page-header h1 {
        font-size: 1.25rem !important;
    }

    /* Sidebar toggle lebih kecil */
    .sidebar-toggle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        top: 14px;
        left: 14px;
    }

    /* Table: font sangat kecil dan bisa scroll kanan */
    .table-users th,
    .table-users td {
        font-size: 0.68rem;
        padding: 6px 6px;
        white-space: nowrap;
    }

    /* Badge lebih kecil */
    .badge {
        padding: 4px 8px;
        font-size: 0.65rem;
    }

    /* Modal ekstra kecil */
    .modal-dialog {
        margin: 6px;
        max-width: calc(100vw - 12px) !important;
    }

    .modal-body {
        padding: 12px;
        max-height: 65vh;
    }

    .modal-header, .modal-footer {
        padding: 10px 14px;
    }

    /* Row col-6 di modal jadi full width */
    .modal .row .col-6 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* User badge horizontal di sidebar */
    .user-badge {
        flex-direction: row;
        text-align: left;
    }
}

/* Landscape mobile (tinggi layar < 500px) */
@media (max-height: 500px) and (max-width: 768px) {
    .modal-body {
        max-height: 55vh;
    }

    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}



/* ===== auth-style.css ===== */
:root {
    --primary-color: #A34E78;
    --secondary-color: #F08080;
    --primary-dark: #0e111a;
    --secondary-dark: #1a1f2e;
    --card-dark: #242a3a;
    --code-bg: #161b22;
    --text-primary: #ffffff;
    --text-secondary: #c0c8d7;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #A34E78 0%, #F08080 100%);
    --border-radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Mono', monospace;
    background: var(--primary-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 260px;
    background: var(--secondary-dark);
    border-right: 1px solid var(--card-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--card-dark);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.sidebar-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    display: block;
    padding: 8px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(163, 78, 120, 0.1);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(163, 78, 120, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--card-dark);
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    background: var(--secondary-dark);
    border: 1px solid var(--card-dark);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-icon {
    width: 70px;
    height: 70px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: white;
}

.auth-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--card-dark);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(163, 78, 120, 0.2);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(163, 78, 120, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--card-dark);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-dark);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.profile-info h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.profile-info .badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(163, 78, 120, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    gap: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--card-dark);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-value {
    font-weight: 500;
}

.info-value.success { color: var(--success); }
.info-value.danger { color: var(--danger); }
.info-value.info { color: var(--info); }

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 25px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-dark);
}

.apikey-box {
    background: var(--code-bg);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: var(--success);
    word-break: break-all;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    background: var(--card-dark);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .auth-card {
        padding: 25px;
    }
}

/* ===== dashboard-style.css ===== */
/* public/css/dashboard-style.css */

/* Variabel warna (sinkron dengan THEME_CONFIG) */
:root {
    --primary-color: #A34E78;
    --secondary-color: #F08080;
    --primary-dark: #0e111a;
    --secondary-dark: #1a1f2e;
    --card-dark: #242a3a;
    --code-bg: #161b22;
    --text-primary: #ffffff;
    --text-secondary: #c0c8d7;
    --accent-gradient: linear-gradient(135deg, #f8a5c2, #a34e78);
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.45);
    --radius-xl: 22px;
}

/* Reset kecil */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

/* Body & layout umum */
.dashboard-body {
    min-height: 100vh;
    /* BACKGROUND DIPINDAHKAN KE EJS UNTUK SUPPORT ADAPTIF */
    background-color: var(--primary-dark);
    /* background-size: cover; */
    /* background-position: center; */
    /* background-repeat: no-repeat; */
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
    line-height: 1.6;
    position: relative;
}

.dashboard-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(163, 78, 120, 0.25), transparent 55%),
        radial-gradient(circle at bottom right, rgba(240, 128, 128, 0.18), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.dashboard-wrapper {
    position: relative;
    z-index: 1;
    padding: 25px 0 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header & branding */
.dashboard-header {
    background: linear-gradient(135deg, rgba(36, 42, 58, 0.96), rgba(26, 31, 46, 0.96));
    border-radius: var(--radius-xl);
    padding: 24px 26px 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    margin-bottom: 25px;
}

.brand-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* Title */
.animated-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.2;
}

.lead-text {
    font-size: 0.96rem;
    color: var(--text-secondary);
    max-width: 520px;
}

/* Buttons */
.btn-doc {
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background-image: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 10px 25px rgba(163, 78, 120, 0.55);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-doc:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(163, 78, 120, 0.7);
    filter: brightness(1.03);
    color: #fff;
}

.btn-outline-soft {
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
    background-color: transparent;
    backdrop-filter: blur(6px);
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn-outline-soft:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

/* Profile badge */
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background-color: rgba(22, 27, 34, 0.92);
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6);
}

.profile-avatar-wrap {
    position: relative;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 999px;
    object-fit: cover;
    border: 3px solid rgba(240, 128, 128, 0.8);
}

.status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #30d158;
    border: 2px solid #12141f;
}

.profile-meta {
    text-align: left;
}

.profile-name {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.02rem;
}

.profile-role {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Code highlight */
.code-highlight {
    background-color: var(--code-bg);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--secondary-color);
}

/* Section titles */
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 18px;
    margin-top: 8px;
}

/* Stat cards */
.stat-card {
    position: relative;
    background: radial-gradient(circle at top left, rgba(240, 128, 128, 0.22), transparent 55%),
        linear-gradient(145deg, rgba(20, 24, 37, 0.98), rgba(28, 33, 49, 0.98));
    border-radius: var(--radius-xl);
    padding: 20px 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    cursor: default;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.stat-card .icon {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 1.9rem;
    opacity: 0.12;
    color: var(--secondary-color);
}

.stat-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* User battery card - Perubahan layout di sini */
.stat-battery {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.98), rgba(36, 42, 58, 0.98));
    padding: 20px 18px; /* Lebih padding */
}

.battery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.battery-header .stat-label {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.battery-header .code-highlight {
    padding: 4px 10px;
    font-size: 0.8rem;
    align-self: flex-start;
}

.battery-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.battery-shell {
    position: relative;
    flex-grow: 1;
    max-width: 260px; /* Lebar max disesuaikan */
    height: 24px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    background: rgba(12, 16, 26, 0.9);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 2px;
}

.battery-level {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #30d158, #f8d86b, #ff9f43, #ff453a);
    transition: width 0.25s ease;
}

.battery-head {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 14px;
    border-radius: 6px;
    background-color: rgba(200, 210, 220, 0.9);
}

.battery-percent {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem; /* Lebih besar */
    font-weight: 700;
    color: var(--text-primary);
}

.stat-subtext {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-left: 10px; /* Agar sejajar */
}

/* Info cards */
.info-card {
    background-color: rgba(26, 31, 46, 0.96);
    border-radius: var(--radius-xl);
    padding: 18px 18px 16px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.info-card .card-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.info-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.info-line .label {
    color: var(--text-secondary);
}

.info-line .value {
    font-weight: 500;
}

/* Accordion category cards */
.category-card {
    background-color: rgba(22, 27, 34, 0.98);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-bottom: 10px;
}

.category-card .accordion-button {
    background: transparent;
    box-shadow: none;
    color: var(--text-primary);
    padding: 10px 16px;
    font-size: 0.88rem;
}

.category-card .accordion-button:not(.collapsed) {
    background: radial-gradient(circle at top left, rgba(240, 128, 128, 0.18), transparent 55%);
}

.category-card .accordion-button::after {
    filter: invert(1);
    opacity: 0.7;
}

.category-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.category-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Endpoint table (Dihapus dari HTML, CSS-nya dipertahankan sebagai backup) */
.endpoint-table {
    font-size: 0.78rem;
    border-radius: 14px;
    overflow: hidden;
    /* display: none; */
}
/* ... */

/* Contact section */
.contact-card {
    background-color: rgba(18, 21, 32, 0.98);
    border-radius: var(--radius-xl);
    padding: 18px 18px 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-item {
    font-size: 0.84rem;
    color: var(--text-primary);
}

.contact-link {
    color: var(--secondary-color);
    text-decoration: none;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Footer */
.dashboard-footer {
    margin-top: 24px;
}

/* Responsiveness */
@media (max-width: 991.98px) {
    .dashboard-header {
        padding: 20px 18px;
    }

    .profile-badge {
        border-radius: 18px;
        width: 100%;  
        justify-content: center;
    }

    .profile-meta {
        text-align: left;
    }
    
    .animated-title {
        font-size: 2rem;
    }
    
    .brand-label {
        font-size: 0.75rem;
    }
    
    /* Sembunyikan tombol Dokumentasi API di mobile agar tidak duplikat dengan tombol aksi baru */
    .btn-doc-login-group .btn-doc-mobile {
        display: none !important;
    }
    
    .stat-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 767.98px) {
    .animated-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .dashboard-wrapper {
        padding: 15px 10px 30px;
    }
    
    .dashboard-header {
        padding: 18px 15px;
        margin-bottom: 20px;
        border-radius: 16px;
    }
    
    .brand-label {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .stat-card {
        padding: 16px 14px;
    }

    .info-card {
        padding: 16px 14px;
    }
    
    .lead-text {
        font-size: 0.85rem;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .btn-group-action {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-action {
        width: 100%;
        justify-content: center;
    }
    
    .contact-card {
        padding: 16px 14px;
    }
    
    .dashboard-footer {
        padding: 15px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .animated-title {
        font-size: 1.4rem;
    }
    
    .dashboard-wrapper {
        padding: 10px 8px 25px;
    }
    
    .dashboard-header {
        padding: 15px 12px;
        margin-bottom: 15px;
    }
    
    .brand-label {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    .lead-text {
        font-size: 0.8rem;
    }
    
    .profile-badge {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .profile-name {
        font-size: 1rem;
    }
    
    .profile-meta small {
        font-size: 0.7rem;
    }
    
    .stat-card {
        padding: 14px 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .info-card {
        padding: 14px 12px;
    }
    
    .info-card h4 {
        font-size: 1rem;
    }
    
    .info-card p {
        font-size: 0.75rem;
    }
    
    .btn-action {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .contact-card {
        padding: 14px 12px;
    }
    
    .contact-card h4 {
        font-size: 1rem;
    }
    
    .contact-card p {
        font-size: 0.75rem;
    }
    
    .dashboard-footer {
        padding: 12px 8px;
        font-size: 0.75rem;
    }
}

/* Perbaikan warna teks */
.profile-badge .text-muted {
    color: var(--text-secondary) !important;
}
/* Ubah warna kalimat "Fast response via WhatsApp..." jadi abu-abu */
.contact-card p.small.text-muted {
    color: var(--text-secondary) !important;
}

/* Ubah warna copyright footer jadi abu-abu */
.dashboard-footer .text-muted {
    color: var(--text-secondary) !important;
}

/* ===== documentation-style.css ===== */
/* public/css/documentation-style.css */

:root {
    --primary-color: #A34E78;
    --secondary-color: #F08080;
    --primary-dark: #121212;
    --secondary-dark: #1e1e1e;
    --card-dark: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --accent-gradient: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    --success: #00e676;
    --warning: #ffeb3b;
    --danger: #ff1744;
    --info: #00bcd4;
    --border-radius: 8px;
    --transition: all 0.2s ease;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --code-bg: #1c1c1c; 
    --button-shadow: rgba(0, 0, 0, 0.6);
    --header-bg: rgba(18, 18, 18, 0.95);
}

body {
    color: var(--text-primary);
    font-family: 'Roboto Mono', monospace;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--primary-dark); }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary-color); }

@keyframes subtle-glow {
    0% { text-shadow: 0 0 5px rgba(var(--primary-color), 0.5); }
    50% { text-shadow: 0 0 15px rgba(var(--secondary-color), 0.7); }
    100% { text-shadow: 0 0 5px rgba(var(--primary-color), 0.5); }
}

.animated-title {
    animation: subtle-glow 3s infinite alternate ease-in-out;
    display: inline-block;
}

.header {
    text-align: center;
    padding: 35px 20px 28px;
    background: var(--header-bg); 
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    margin-bottom: 28px;
    border: 1px solid var(--card-dark);
}

.header h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.header p {
    color: var(--text-secondary) !important;
    font-weight: 400;
    font-size: 0.95rem;
    margin-top: 10px;
}

.profile-pic {
    display: none;
}

.window-control {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    gap: 8px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }

.api-info-card {
    background-color: var(--secondary-dark);
    border: 1px solid var(--card-dark);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 20px auto;
    max-width: 600px;
    box-shadow: var(--shadow);
    text-align: left;
    font-size: 0.9rem;
}

.api-info-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--info);
    border-bottom: 1px solid var(--card-dark);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.api-info-card .info-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.api-info-card .info-line .label {
    color: var(--text-secondary);
    font-weight: 300;
}

.api-info-card .info-line .value {
    color: var(--text-primary);
    font-weight: 500;
}

.base-url {
    background-color: var(--code-bg);
    border: 1px solid var(--primary-color);
    padding: 10px 15px !important;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    margin-top: 20px !important;
}
.base-url code {
    color: var(--success);
    background: transparent;
}

.link-buttons-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

.custom-link-btn {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--primary-color);
    transition: var(--transition);
    position: relative;
    box-shadow: none;
    max-width: 250px;
    justify-content: center;
}

.custom-link-btn:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
    background-color: rgba(255, 133, 210, 0.1); 
    box-shadow: 0 4px 10px rgba(255, 133, 210, 0.3);
}

.custom-link-btn:active {
    transform: translateY(0);
    box-shadow: none;
    background-color: rgba(255, 133, 210, 0.2);
}

.search-container input {
    transition: var(--transition);
    font-size: 0.95rem;
    background-color: var(--card-dark) !important;
    border-color: var(--card-dark) !important;
    color: var(--text-primary) !important;
}
.search-container input:focus {
    box-shadow: 0 0 15px rgba(255, 133, 210, 0.5) !important;
    border-color: var(--primary-color) !important;
}

.api-category-card {
    background-color: var(--secondary-dark);
    border: 1px solid var(--code-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 18px;
    overflow: hidden;
}
.api-category-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 22px rgba(255, 133, 210, 0.25);
    transform: translateY(-2px);
}

.category-toggle-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-dark);
    border-bottom: 1px solid var(--code-bg);
    transition: var(--transition);
}

.category-toggle-header:hover {
    background-color: #333333;
}

.category-toggle-header h3 {
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1rem;
}

.category-toggle-header .icon {
    font-size: 1rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.category-toggle-header.collapsed .icon {
    transform: rotate(0deg);
}

.category-toggle-header:not(.collapsed) .icon {
    transform: rotate(90deg);
}

.category-content {
    padding: 10px 15px;
}

.api-item {
    background-color: var(--secondary-dark);
    border: 1px solid var(--code-bg);
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    padding: 15px !important;
    margin-bottom: 10px !important;
}
.api-item:hover {
    border-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 133, 210, 0.2);
}
.api-item .method {
    background-color: rgba(0, 230, 118, 0.1);
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 700;
}

.endpoint-name {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: var(--primary-color);
}
.endpoint-desc {
    font-size: 0.85rem;
    color: var(--text-secondary) !important;
}

.response-type-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    margin-left: 8px;
}
.response-type-json { background-color: rgba(0, 188, 212, 0.2); color: var(--info); }
.response-type-image { background-color: rgba(156, 39, 176, 0.2); color: #ce93d8; }
.response-type-video { background-color: rgba(244, 67, 54, 0.2); color: #ef9a9a; }
.response-type-audio { background-color: rgba(255, 152, 0, 0.2); color: #ffcc80; }
.response-type-file { background-color: rgba(76, 175, 80, 0.2); color: #a5d6a7; }
.response-type-html { background-color: rgba(233, 30, 99, 0.2); color: #f48fb1; }

.try-btn {
    background: var(--accent-gradient);
    border: none;
    font-size: 0.9rem !important;
    padding: 8px 15px !important;
    border-radius: 6px !important;
}
.try-btn:hover {
    box-shadow: 0 4px 10px rgba(var(--primary-color), 0.4);
}

.modal-content {
    background-color: var(--secondary-dark);
    color: var(--text-primary);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
}
.modal-header {
    border-bottom-color: var(--primary-color);
    background-color: var(--code-bg);
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}
.modal-header .btn-close {
    filter: invert(1);
    opacity: 1;
    color: var(--text-primary);
}

.modal-title, .modal-body h6 {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.form-label {
    color: var(--text-primary) !important;
    font-size: 0.9rem;
}

.form-control {
     background-color: var(--code-bg);
     border: 1px solid var(--card-dark); 
     color: var(--info);
     font-size: 0.9rem;
}
.form-control:focus {
     box-shadow: 0 0 5px var(--secondary-color);
     border-color: var(--secondary-color);
}
.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}
.modal-body .text-secondary {
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
}

.modal-code-block {
    background-color: var(--code-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--card-dark);
}
.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: #1a1a1a;
    border-bottom: 1px solid #333333;
    font-size: 0.85rem;
    font-weight: 500;
}
#apiResponseContent {
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 15px;
    margin-bottom: 0;
    color: #79d2e6;
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.85rem;
    background-color: transparent;
    border: none;
}
.status-badge {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-waiting { background-color: #4a4a4a; color: #e0e0e0; }
.status-loading { background-color: #007bff; color: #fff; }
.status-success { background-color: var(--success); color: #1c1c1c; }
.status-error { background-color: var(--danger); color: #fff; }

.media-preview {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid var(--primary-color);
}
.audio-preview {
    width: 100%;
    margin-top: 10px;
}
.video-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin-top: 10px;
    border: 2px solid var(--primary-color);
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.footer {
    border-top: 1px solid var(--card-dark) !important;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .header {
        padding: 20px 15px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .header p {
        font-size: 0.85rem;
    }
    
    .base-url {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .base-url code {
        font-size: 0.75rem;
        word-break: break-all;
    }
    
    .api-category-section {
        margin-bottom: 20px;
    }
    
    .section-header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .section-count {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    
    .api-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    .api-method {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .api-name {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .api-desc {
        font-size: 0.8rem;
    }
    
    .response-type-badge {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    
    .try-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .custom-link-btn {
        width: 100%;
        max-width: none;
        justify-content: center;
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .api-info-card {
        padding: 12px;
        margin: 15px 10px;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .form-control {
        font-size: 0.9rem;
        padding: 10px;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    #apiResponseContainer {
        max-height: 300px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header {
        padding: 15px 12px;
    }
    
    .header p {
        font-size: 0.8rem;
    }
    
    .base-url {
        padding: 10px;
    }
    
    .base-url code {
        font-size: 0.7rem;
        padding: 6px 10px;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .section-count {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    
    .api-item {
        padding: 10px;
        gap: 8px;
    }
    
    .api-method {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    
    .api-name {
        font-size: 0.85rem;
    }
    
    .api-desc {
        font-size: 0.75rem;
    }
    
    .response-type-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
        display: block;
        margin-top: 4px;
    }
    
    .try-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .form-control {
        font-size: 0.85rem;
        padding: 8px;
    }
    
    .form-label {
        font-size: 0.8rem;
    }
    
    small {
        font-size: 0.7rem;
    }
    
    .modal-footer {
        padding: 10px;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
}


/* ===== layout-style.css ===== */
/* ==========================================================================
   UNIFIED LAYOUT CSS - Sidebar & Navbar for all pages (except dbadmin)
   ========================================================================== */

/* CSS Variables */
:root {
    --primary-color: #A34E78;
    --secondary-color: #F08080;
    --primary-dark: #0e111a;
    --secondary-dark: #1a1f2e;
    --card-dark: #242a3a;
    --code-bg: #161b22;
    --text-primary: #ffffff;
    --text-secondary: #c0c8d7;
    --accent-gradient: linear-gradient(135deg, #A34E78 0%, #F08080 100%);
    --info: #3296fa;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Mono', monospace;
    background: var(--primary-dark);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ==========================================================================
   SIDEBAR STYLES
   ========================================================================== */

.main-sidebar {
    width: 260px;
    background-color: #1a1f2e;
    border-right: 1px solid var(--card-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1100;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.sidebar-header {
    padding: 16px 15px;
    border-bottom: 1px solid var(--card-dark);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sidebar-logo-img {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px !important;
    max-height: 38px !important;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.sidebar-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    opacity: 0.7;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.user-badge {
    background: rgba(163, 78, 120, 0.2);
    border: 1px solid rgba(163, 78, 120, 0.4);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 12px;
    flex-shrink: 0;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.user-info-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-info-text small {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.user-info-text strong {
    display: block;
    font-size: 0.85rem;
    color: var(--success);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0 15px 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section-title {
    display: block;
    padding: 10px 20px 6px 23px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    opacity: 0.8;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 15px 11px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    width: 100%;
}

.nav-item:hover {
    background: rgba(163, 78, 120, 0.1);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

.nav-item.active {
    background: rgba(163, 78, 120, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-item i {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--card-dark);
    background: var(--secondary-dark);
    flex-shrink: 0;
}

.footer-info {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Smooth Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(163, 78, 120, 0.6);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Better scrolling behavior */
.sidebar-nav {
    scroll-behavior: smooth;
}

/* ==========================================================================
   NAVBAR STYLES
   ========================================================================== */

.top-navbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    z-index: 999;
    background: rgba(14, 17, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-dark);
    padding: 12px 0;
    transition: left 0.3s ease;
}

.navbar-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.navbar-logo {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.navbar-title {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(163, 78, 120, 0.15);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(163, 78, 120, 0.2);
    color: var(--primary-color);
}

.nav-link-btn {
    background: var(--accent-gradient);
    color: white !important;
}

.nav-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(163, 78, 120, 0.4);
}

/* Mobile Toggle Button */
.mobile-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
}

.mobile-toggle-btn:hover {
    color: var(--primary-color);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar Close Button (mobile) */
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary-dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
    margin-left: 260px;
    padding: 20px 30px 40px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    background: var(--primary-dark);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
    .main-sidebar {
        transform: translateX(-100%);
        z-index: 1100;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
    }
    
    .main-sidebar.active {
        transform: translateX(0);
    }
    
    .top-navbar {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 80px;
    }
    
    .mobile-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navbar-brand {
        display: none;
    }
    
    .sidebar-close-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px 12px;
    }
    
    .navbar-container {
        padding: 0 12px;
    }
    
    .navbar-menu {
        gap: 4px;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link {
        padding: 8px;
        font-size: 1rem;
        min-width: 40px;
        justify-content: center;
    }
    
    .user-badge {
        margin: 8px 10px;
        padding: 8px;
    }
    
    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .user-info-text strong {
        font-size: 0.8rem;
    }
    
    .user-info-text small {
        font-size: 0.6rem;
    }
    
    .sidebar-header {
        padding: 12px;
    }
    
    .sidebar-title {
        font-size: 1rem;
    }
    
    .sidebar-subtitle {
        font-size: 0.65rem;
    }
    
    .menu-item {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .menu-item i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px 8px;
    }
    
    .top-navbar {
        padding: 10px 0;
    }
    
    .navbar-container {
        padding: 0 10px;
    }
    
    .navbar-logo {
        width: 28px;
        height: 28px;
    }
    
    .navbar-title {
        font-size: 0.9rem;
    }
    
    .nav-link {
        padding: 6px;
        font-size: 0.95rem;
        min-width: 36px;
    }
    
    .mobile-toggle-btn {
        font-size: 1.3rem;
        padding: 6px;
    }
    
    .main-sidebar {
        width: 240px;
    }
    
    .sidebar-header {
        padding: 10px;
    }
    
    .user-badge {
        margin: 6px 8px;
        padding: 6px;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-down {
    animation: slideDown 0.6s ease-out;
}

/* ==========================================================================
   MOBILE ENHANCEMENTS
   ========================================================================== */

/* Touch-friendly tap targets (min 44x44px for iOS) */
@media (max-width: 768px) {
    button,
    a,
    .btn,
    .menu-item,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Prevent text selection on mobile */
    .mobile-no-select {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Better form inputs for mobile */
    input,
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    /* Better modal on mobile */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    /* Smooth scrolling for iOS */
    .main-sidebar,
    .main-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .main-sidebar {
        width: 240px;
    }
    
    .user-badge {
        padding: 6px;
    }
    
    .menu-item {
        padding: 8px 12px;
    }
}



/* ============================================================
   ADMIN CONSOLE — LIGHT PROFESSIONAL THEME
   ============================================================ */
.admin-body {
    background: #f4f7fb;
    color: #0f172a;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.admin-shell { min-height: 100vh; }

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform .25s ease;
}
.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid #eef2f7;
}
.admin-logo {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1rem; box-shadow: 0 8px 18px rgba(79,70,229,.28);
    overflow: hidden;
}
.admin-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}
.admin-sidebar-brand strong { display: block; font-size: 1rem; font-weight: 800; letter-spacing: -.2px; }
.admin-sidebar-brand span { display: block; font-size: .68rem; color: #94a3b8; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.admin-user-card {
    margin: 16px; padding: 12px;
    display: flex; align-items: center; gap: 10px;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px;
}
.admin-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: #eef2ff; color: #4f46e5;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .85rem;
}
.admin-user-card strong { display: block; font-size: .8rem; font-weight: 800; }
.admin-user-card span { display: block; font-size: .68rem; color: #94a3b8; font-weight: 600; }

.admin-nav { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.admin-nav-label {
    font-size: .62rem; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: #94a3b8;
    padding: 14px 12px 6px;
}
.admin-nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; margin-bottom: 2px;
    border-radius: 10px; color: #475569;
    font-size: .82rem; font-weight: 600;
    text-decoration: none; transition: all .15s ease;
}
.admin-nav-item i { width: 18px; text-align: center; font-size: .82rem; color: #94a3b8; }
.admin-nav-item:hover { background: #f1f5f9; color: #0f172a; text-decoration: none; }
.admin-nav-item:hover i { color: #4f46e5; }
.admin-nav-item.active {
    background: #eef2ff; color: #4338ca; font-weight: 800;
}
.admin-nav-item.active i { color: #4f46e5; }
.admin-nav-item.danger { color: #ef4444; }
.admin-nav-item.danger i { color: #ef4444; }
.admin-nav-item.danger:hover { background: #fef2f2; }

.admin-sidebar-footer { padding: 14px 20px; border-top: 1px solid #eef2f7; font-size: .68rem; color: #94a3b8; }

.admin-main {
    margin-left: 264px;
    padding: 0 28px 40px;
    min-height: 100vh;
}
.admin-topbar {
    position: sticky; top: 0; z-index: 1030;
    margin: 0 -28px 24px;
    padding: 0 28px;
    height: 64px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
}
.admin-topbar-left, .admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-breadcrumb { font-size: .78rem; font-weight: 700; color: #64748b; }
.admin-breadcrumb span { color: #cbd5e1; margin: 0 6px; }
.admin-breadcrumb strong { color: #0f172a; }
.admin-menu-toggle {
    display: none; width: 38px; height: 38px;
    border-radius: 10px; border: 1px solid #e2e8f0;
    background: #fff; color: #0f172a; cursor: pointer;
}
.admin-search {
    display: flex; align-items: center; gap: 8px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 8px 12px; min-width: 220px;
}
.admin-search i { color: #94a3b8; font-size: .75rem; }
.admin-search input { border: 0; background: transparent; outline: none; font-size: .78rem; width: 100%; color: #0f172a; }
.admin-topbar-btn {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid #e2e8f0; background: #fff;
    color: #64748b; display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none;
}
.admin-topbar-btn:hover { background: #f1f5f9; color: #4f46e5; text-decoration: none; }
.admin-topbar-user {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 10px 5px 5px; border: 1px solid #e2e8f0;
    border-radius: 999px; background: #fff;
}
.admin-topbar-user .admin-avatar { width: 30px; height: 30px; border-radius: 999px; font-size: .7rem; }
.admin-topbar-user strong { font-size: .72rem; font-weight: 800; display: block; line-height: 1.1; }
.admin-topbar-user span { font-size: .62rem; color: #94a3b8; font-weight: 600; }

.admin-container { max-width: 1280px; margin: 0 auto; }
.admin-page-head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 22px;
}
.admin-page-head h1 { font-size: 1.5rem; font-weight: 900; letter-spacing: -.4px; margin: 0; color: #0f172a; }
.admin-page-head p { margin: 4px 0 0; font-size: .82rem; color: #64748b; font-weight: 500; }
.admin-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    color: #4f46e5; background: #eef2ff; border: 1px solid #e0e7ff;
    padding: 4px 9px; border-radius: 999px; margin-bottom: 8px;
}

.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.admin-stat {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 16px 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.admin-stat .label { font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; }
.admin-stat .value { font-size: 1.45rem; font-weight: 900; color: #0f172a; margin-top: 6px; letter-spacing: -.5px; }
.admin-stat .hint { font-size: .68rem; color: #94a3b8; margin-top: 2px; font-weight: 600; }
.admin-stat .icon {
    width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-size: .8rem; margin-bottom: 10px; background: #eef2ff; color: #4f46e5;
}

.admin-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    padding: 20px; margin-bottom: 18px;
}
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-card-head h3 { font-size: .95rem; font-weight: 900; margin: 0; color: #0f172a; }
.admin-card-head p { font-size: .72rem; color: #64748b; margin: 2px 0 0; }

.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.admin-table thead th {
    background: #f8fafc; color: #64748b; font-size: .64rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
.admin-table tbody td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.admin-table tbody tr:hover td { background: #f8fafc; }
.admin-table tbody tr:last-child td { border-bottom: 0; }

.admin-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 999px; font-size: .64rem; font-weight: 800;
    background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.admin-badge.success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.admin-badge.danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.admin-badge.warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.admin-badge.indigo { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }

.admin-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 14px; border-radius: 10px; border: 1px solid #e2e8f0;
    background: #fff; color: #334155; font-size: .76rem; font-weight: 800;
    cursor: pointer; text-decoration: none; transition: all .15s ease;
}
.admin-btn:hover { background: #f8fafc; color: #0f172a; text-decoration: none; }
.admin-btn.primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.admin-btn.primary:hover { background: #4338ca; }
.admin-btn.success { background: #16a34a; border-color: #16a34a; color: #fff; }
.admin-btn.success:hover { background: #15803d; }
.admin-btn.danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.admin-btn.danger:hover { background: #dc2626; }
.admin-btn.secondary { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.admin-btn.secondary:hover { background: #e0e7ff; color: #3730a3; }
.admin-btn.sm { padding: 6px 10px; font-size: .68rem; }
.admin-btn:disabled { opacity: .6; cursor: not-allowed; }

.admin-input, .admin-select, .admin-textarea,
.admin-main .form-control, .admin-main .form-select {
    width: 100%; padding: 9px 12px; border-radius: 10px;
    border: 1px solid #e2e8f0; background: #fff; color: #0f172a;
    font-size: .8rem; font-weight: 500; outline: none;
}
.admin-input:focus, .admin-select:focus, .admin-textarea:focus,
.admin-main .form-control:focus, .admin-main .form-select:focus {
    border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.admin-main .form-label { font-size: .72rem; font-weight: 800; color: #334155 !important; margin-bottom: 6px; }
.admin-main .text-muted { color: #94a3b8 !important; }
.admin-main .fw-bold { font-weight: 800 !important; }

/* Bootstrap overrides inside admin */
.admin-main .stat-card, .admin-main .config-card {
    background: #fff !important; border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important; padding: 18px !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
    color: #0f172a !important; margin-bottom: 16px;
}
.admin-main .table { color: #334155; margin-bottom: 0; }
.admin-main .table-dark { --bs-table-bg: #fff; --bs-table-striped-bg: #f8fafc; --bs-table-color: #334155; --bs-table-border-color: #e2e8f0; }
.admin-main .table > :not(caption) > * > * { padding: .7rem .75rem; border-bottom-color: #f1f5f9; }
.admin-main .table thead th { background: #f8fafc; color: #64748b; font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid #e2e8f0; }
.admin-main .btn { border-radius: 10px; font-size: .74rem; font-weight: 800; padding: 8px 12px; }
.admin-main .btn-sm { padding: 5px 9px; font-size: .66rem; }
.admin-main .btn-info { background: #eef2ff; border-color: #c7d2fe; color: #4338ca; }
.admin-main .btn-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.admin-main .btn-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.admin-main .btn-success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.admin-main .btn-primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.admin-main .alert { border-radius: 12px; font-size: .78rem; font-weight: 600; border: 1px solid; }
.admin-main .alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.admin-main .alert-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.admin-main .alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.admin-main .alert-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.admin-main .form-check-input:checked { background-color: #4f46e5; border-color: #4f46e5; }
.admin-main .modal-content { border-radius: 16px; border: 1px solid #e2e8f0; box-shadow: 0 24px 60px rgba(15,23,42,.18); }
.admin-main .modal-header { border-bottom: 1px solid #eef2f7; }
.admin-main .modal-footer { border-top: 1px solid #eef2f7; }
.admin-main .user-search input { width: 100%; padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: .8rem; }
.admin-main .quick-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.admin-main .quick-stat-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; text-align: left; }
.admin-main .quick-stat-item i { color: #4f46e5; }
.admin-main .quick-stat-item h4 { font-size: 1.2rem; font-weight: 900; margin: 6px 0 0; color: #0f172a; }
.admin-main .quick-stat-item small { font-size: .66rem; color: #94a3b8; font-weight: 700; text-transform: uppercase; }
.admin-main .badge { font-size: .62rem; font-weight: 800; }
.admin-main .text-info { color: #4f46e5 !important; }
.admin-main .text-warning { color: #b45309 !important; }
.admin-main .table-responsive { border-radius: 14px; border: 1px solid #eef2f7; overflow: hidden; }

.admin-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.45);
    z-index: 1035; display: none;
}
.admin-overlay.show { display: block; }

@media (max-width: 1024px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; padding: 0 16px 32px; }
    .admin-topbar { margin: 0 -16px 18px; padding: 0 16px; }
    .admin-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .admin-search { display: none; }
}
@media (max-width: 640px) {
    .admin-topbar-user .admin-user-meta { display: none; }
    .admin-page-head h1 { font-size: 1.25rem; }
}

/* ===== ADMIN FORCE LIGHT (anti-dark) ===== */
body.admin-body,
body.admin-body .admin-shell,
body.admin-body .admin-main,
body.admin-body .admin-container {
    background: #f4f7fb !important;
    color: #0f172a !important;
}
body.admin-body .admin-topbar,
body.admin-body .admin-sidebar {
    background: #ffffff !important;
}
body.admin-body .tab-content,
body.admin-body .admin-main > * {
    background-color: transparent;
}
.admin-main .table,
.admin-main .table-responsive,
.admin-main .table-dark,
.admin-main .stat-card,
.admin-main .config-card,
.admin-main .quick-stat-item {
    background: #ffffff !important;
    color: #334155 !important;
}
.admin-main .table tbody td,
.admin-main .table thead th {
    background-color: #ffffff !important;
    color: #334155 !important;
    border-color: #eef2f7 !important;
}
.admin-main .table thead th { background-color: #f8fafc !important; color: #64748b !important; }
.admin-main .table tbody tr:hover td { background-color: #f8fafc !important; }
.admin-main .user-search input {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}
.admin-main .user-search input::placeholder { color: #94a3b8 !important; }
.admin-main .form-control,
.admin-main .form-select,
.admin-main textarea,
.admin-main input[type="text"],
.admin-main input[type="email"],
.admin-main input[type="password"],
.admin-main input[type="number"] {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}
.admin-main select option { background: #ffffff; color: #0f172a; }
.admin-main .modal-content { background: #ffffff !important; color: #0f172a !important; }
.admin-main .modal-body { background: #ffffff !important; }
.admin-main .border-bottom { border-color: #eef2f7 !important; }
.admin-main h1, .admin-main h2, .admin-main h3, .admin-main h4, .admin-main h5, .admin-main h6 { color: #0f172a; }
.admin-main p, .admin-main small, .admin-main label { color: #475569; }
.admin-main .text-muted { color: #94a3b8 !important; }
.admin-main .ai-message { background: #f1f5f9 !important; }
.admin-main #ai-chat-container { background: #f8fafc !important; border: 1px solid #e2e8f0; }

/* ===== Admin table column fix (read-only badge not clipped) ===== */
.admin-main .table-responsive {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
}
.admin-main .table {
    width: 100% !important;
    min-width: 980px;
    table-layout: auto;
}
.admin-main .table th,
.admin-main .table td {
    white-space: nowrap;
    vertical-align: middle;
}
.admin-main .table th:last-child,
.admin-main .table td:last-child {
    min-width: 150px;
    width: 150px;
    text-align: left;
}
.admin-main .table td:last-child .badge,
.admin-main .table td:last-child .btn {
    white-space: nowrap;
}
.admin-main .badge {
    white-space: nowrap !important;
}
.admin-main .table td code {
    white-space: nowrap;
}

/* Admin topbar user dropdown */
.admin-user-dropdown { position: relative; }
.admin-topbar-user { font-family: inherit; cursor: pointer; }
.admin-user-chevron { color: #94a3b8; font-size: .58rem; transition: transform .2s ease; }
.admin-topbar-user[aria-expanded="true"] .admin-user-chevron { transform: rotate(180deg); }
.admin-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all .18s ease;
    z-index: 1200;
}
.admin-user-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.admin-user-menu a,
.admin-user-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: .74rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.admin-user-menu a i,
.admin-user-menu button i { width: 15px; text-align: center; color: #94a3b8; }
.admin-user-menu a:hover,
.admin-user-menu button:hover { background: #f5f7ff; color: #4f46e5; }
.admin-user-menu button.danger { color: #dc2626; }
.admin-user-menu button.danger i { color: #f87171; }
.admin-user-menu button.danger:hover { background: #fef2f2; color: #b91c1c; }
.admin-user-menu-sep { height: 1px; margin: 5px 4px; background: #f1f5f9; }

@media (max-width: 640px) {
    .admin-topbar-user .admin-user-meta { display: none; }
}

/* ==========================================================================
   Site design system (merged from site.css)
   ========================================================================== */

:root {
    --site-bg: #f4f6fb;
    --site-card: #ffffff;
    --site-ink: #0f172a;
    --site-muted: #64748b;
    --site-line: #e8ecf4;
    --site-indigo: #4f46e5;
    --site-indigo-strong: #4338ca;
    --site-indigo-soft: #eef2ff;
    --site-emerald: #10b981;
    --site-emerald-soft: #ecfdf5;
    --site-amber: #f59e0b;
    --site-amber-soft: #fffbeb;
    --site-red: #ef4444;
    --site-red-soft: #fef2f2;
    --site-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
    --site-shadow-sm: 0 10px 28px rgba(15, 23, 42, 0.05);
    --site-radius: 18px;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.site-body {
    min-height: 100vh;
    background-color: var(--site-bg);
    background-image: var(--site-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--site-ink);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

body.site-body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(244, 246, 251, 0.82) 0%, rgba(244, 246, 251, 0.92) 48%, rgba(244, 246, 251, 0.97) 100%),
        radial-gradient(circle at 8% 0%, rgba(99, 102, 241, 0.09), transparent 32%),
        radial-gradient(circle at 92% 8%, rgba(14, 165, 233, 0.07), transparent 30%);
}

.site-body > * {
    position: relative;
    z-index: 1;
}

body.site-body a {
    color: var(--site-indigo);
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(18px);
}

.site-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 72px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--site-ink);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.site-brand:hover {
    color: var(--site-ink);
}

.site-brand img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c7d2fe;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.09);
}

.site-brand em {
    font-style: normal;
    color: var(--site-indigo);
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 14px;
}

.site-nav-link {
    padding: 8px 12px;
    border-radius: 9px;
    color: #475569;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.18s ease;
}

.site-nav-link:hover {
    color: var(--site-indigo);
    background: #f5f7ff;
}

.site-nav-link.active {
    color: var(--site-indigo-strong);
    background: var(--site-indigo-soft);
}

.site-nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
}

.site-user-dropdown {
    position: relative;
}

.site-user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 9px 4px 4px;
    border: 1px solid var(--site-line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--site-ink);
    font-family: inherit;
    cursor: pointer;
}

.site-user-chip img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e7ff;
}

.site-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

.site-user-meta strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 800;
}

.site-user-meta span {
    color: var(--site-muted);
    font-size: 0.62rem;
}

.site-user-chevron {
    color: #94a3b8;
    font-size: 0.57rem;
    transition: transform 0.18s ease;
}

.site-user-chip[aria-expanded="true"] .site-user-chevron {
    transform: rotate(180deg);
}

.site-user-menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 238px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    border: 1px solid var(--site-line);
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.18s ease;
    z-index: 1200;
}

.site-user-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-user-menu-head {
    padding: 9px 11px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 5px;
}

.site-user-menu-head strong {
    display: block;
    font-size: 0.76rem;
    color: var(--site-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-user-menu-head span {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 0.63rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-user-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.site-user-menu-item i {
    width: 15px;
    text-align: center;
    color: #94a3b8;
}

.site-user-menu-item:hover {
    background: #f5f7ff;
    color: var(--site-indigo);
}

.site-user-menu-item.danger {
    color: #dc2626;
}

.site-user-menu-item.danger i {
    color: #f87171;
}

.site-user-menu-item.danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.site-user-menu-sep {
    height: 1px;
    margin: 5px 4px;
    background: #f1f5f9;
}

/* --------------------------------------------------------------------------
   Generic components
   -------------------------------------------------------------------------- */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-main {
    padding: 34px 0 56px;
}

.site-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid #e0e7ff;
    border-radius: 999px;
    background: var(--site-indigo-soft);
    color: var(--site-indigo-strong);
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-title {
    margin: 10px 0 8px;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.site-subtitle {
    margin: 0;
    color: var(--site-muted);
    font-size: 0.9rem;
}

.site-section-title {
    margin: 0 0 4px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-section-subtitle {
    margin: 0 0 18px;
    color: var(--site-muted);
    font-size: 0.8rem;
}

.site-card {
    background: #ffffff;
    border: 1px solid var(--site-line);
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow-sm);
}

.site-card-pad {
    padding: 22px;
}

.site-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.site-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.site-btn-primary:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.28);
}

.site-btn-ghost {
    border-color: var(--site-line);
    background: #ffffff;
    color: var(--site-ink);
}

.site-btn-ghost:hover {
    border-color: #c7d2fe;
    background: #f8faff;
    color: var(--site-indigo);
}

.site-btn-soft {
    border-color: #e0e7ff;
    background: var(--site-indigo-soft);
    color: var(--site-indigo-strong);
}

.site-btn-soft:hover {
    background: #e0e7ff;
    color: var(--site-indigo-strong);
}

.site-btn-danger {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.site-btn-block {
    width: 100%;
}

.site-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.site-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 700;
}

.site-badge-indigo {
    background: var(--site-indigo-soft);
    color: var(--site-indigo-strong);
}

.site-badge-emerald {
    background: var(--site-emerald-soft);
    color: #047857;
}

.site-badge-amber {
    background: var(--site-amber-soft);
    color: #b45309;
}

.site-badge-red {
    background: var(--site-red-soft);
    color: #b91c1c;
}

.site-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.76rem;
    margin-bottom: 14px;
}

.site-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.site-alert-success {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.site-alert-info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.site-field {
    margin-bottom: 14px;
}

.site-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
}

.site-input,
.site-select,
.site-textarea {
    width: 100%;
    border: 1px solid var(--site-line);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--site-ink);
    font-family: inherit;
    font-size: 0.8rem;
    outline: 0;
    transition: all 0.18s ease;
}

.site-input,
.site-select {
    height: 42px;
    padding: 0 12px;
}

.site-textarea {
    min-height: 110px;
    padding: 11px 12px;
    resize: vertical;
}

.site-input:focus,
.site-select:focus,
.site-textarea:focus {
    background: #ffffff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
}

.site-input:disabled {
    color: #94a3b8;
    background: #f1f5f9;
}

.site-hint {
    margin-top: 5px;
    color: #94a3b8;
    font-size: 0.66rem;
}

.site-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #94a3b8;
    font-size: 0.68rem;
}

.site-divider::before,
.site-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--site-line);
}

.site-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.site-table th {
    padding: 9px 12px;
    border-bottom: 1px solid #eef2f7;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.site-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.site-table tr:last-child td {
    border-bottom: 0;
}

.site-code {
    margin: 0;
    padding: 15px;
    border-radius: 11px;
    background: #0b1220;
    color: #c7d2fe;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.site-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.72);
    padding: 22px 0;
    margin-top: 20px;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: #94a3b8;
    font-size: 0.7rem;
}

.site-footer a {
    color: #64748b;
    text-decoration: none;
    margin-left: 12px;
}

.site-footer a:hover {
    color: var(--site-indigo);
}

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
}

.auth-shell {
    width: 100%;
    max-width: 1060px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
    min-height: 600px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 26px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
}

.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 34px;
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(49, 46, 129, 0.86)),
        var(--site-bg-image, none);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(99, 102, 241, 0.45), transparent 38%),
        radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.26), transparent 42%);
    pointer-events: none;
}

.auth-visual > * {
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth-brand img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.55);
}

.auth-headline {
    margin: 26px 0 10px;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
}

.auth-copy {
    margin: 0;
    color: rgba(226, 232, 240, 0.86);
    font-size: 0.88rem;
    max-width: 420px;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-top: 24px;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(241, 245, 249, 0.9);
    font-size: 0.78rem;
}

.auth-feature i {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.12);
    color: #c7d2fe;
    font-size: 0.68rem;
    margin-top: 1px;
}

.auth-visual-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.66rem;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 38px 36px;
    background: #ffffff;
}

.auth-panel-inner {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
}

.auth-form-head {
    margin-bottom: 20px;
}

.auth-form-head h1 {
    margin: 6px 0 5px;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.auth-form-head p {
    margin: 0;
    color: var(--site-muted);
    font-size: 0.8rem;
}

.auth-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #ffffff;
    color: #3c4043;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.auth-google:hover {
    background: #f8f9fa;
    border-color: #c7d2fe;
}

.auth-google svg {
    width: 18px;
    height: 18px;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--site-muted);
    font-size: 0.76rem;
    text-align: center;
}

.auth-switch a {
    font-weight: 700;
    text-decoration: none;
}

.auth-legal {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    color: #94a3b8;
    font-size: 0.66rem;
    text-align: center;
}

.auth-legal a {
    color: #64748b;
    text-decoration: none;
    margin: 0 6px;
}

.auth-legal a:hover {
    color: var(--site-indigo);
}

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */
.blog-hero {
    padding: 46px 0 30px;
}

.blog-hero h1 {
    margin: 12px 0 10px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.08;
}

.blog-hero p {
    margin: 0;
    max-width: 560px;
    color: var(--site-muted);
    font-size: 0.92rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.blog-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--site-line);
    border-radius: 16px;
    box-shadow: var(--site-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--site-shadow);
}

.blog-card-cover {
    height: 160px;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe);
    position: relative;
    overflow: hidden;
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-cover-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #818cf8;
    font-size: 2rem;
}

.blog-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.65rem;
    margin-bottom: 8px;
}

.blog-tag {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--site-indigo-soft);
    color: var(--site-indigo-strong);
    font-size: 0.6rem;
    font-weight: 800;
}

.blog-card h2 {
    margin: 0 0 7px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.blog-card h2 a {
    color: var(--site-ink);
    text-decoration: none;
}

.blog-card h2 a:hover {
    color: var(--site-indigo);
}

.blog-card p {
    margin: 0 0 12px;
    color: var(--site-muted);
    font-size: 0.76rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.65rem;
}

.blog-readmore {
    color: var(--site-indigo);
    font-weight: 700;
    text-decoration: none;
}

.blog-empty {
    padding: 44px;
    border: 1px dashed #dbe3f0;
    border-radius: 16px;
    text-align: center;
    color: var(--site-muted);
    background: #ffffff;
}

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */
.pricing-hero {
    padding: 44px 0 24px;
    text-align: center;
}

.pricing-hero h1 {
    margin: 12px auto 10px;
    max-width: 720px;
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
}

.pricing-hero p {
    margin: 0 auto;
    max-width: 620px;
    color: var(--site-muted);
    font-size: 0.9rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
    margin-top: 26px;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px 18px 18px;
    border: 1px solid var(--site-line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--site-shadow-sm);
}

.pricing-card.featured {
    border-color: #c7d2fe;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.12);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--site-indigo);
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pricing-name {
    margin: 0 0 4px;
    font-size: 0.92rem;
    font-weight: 800;
}

.pricing-desc {
    margin: 0 0 14px;
    color: var(--site-muted);
    font-size: 0.7rem;
    min-height: 34px;
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 4px;
}

.pricing-price strong {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.pricing-price span {
    color: var(--site-muted);
    font-size: 0.66rem;
}

.pricing-duration {
    color: #94a3b8;
    font-size: 0.66rem;
    margin-bottom: 14px;
}

.pricing-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

.pricing-list li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: #475569;
    font-size: 0.7rem;
}

.pricing-list i {
    color: var(--site-emerald);
    font-size: 0.65rem;
    margin-top: 2px;
}

.pricing-note {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid #e0e7ff;
    border-radius: 13px;
    background: #f8faff;
    color: #475569;
    font-size: 0.72rem;
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */
.profile-page {
    padding: 32px 0 50px;
}

.profile-header-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e0e7ff;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
}

.profile-identity {
    min-width: 0;
    flex: 1;
}

.profile-identity h1 {
    margin: 0 0 3px;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.profile-identity p {
    margin: 0 0 6px;
    color: var(--site-muted);
    font-size: 0.78rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.profile-stat {
    padding: 15px;
    border: 1px solid var(--site-line);
    border-radius: 14px;
    background: #ffffff;
}

.profile-stat small {
    display: block;
    color: #94a3b8;
    font-size: 0.65rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-stat strong {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.profile-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-tabs {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-tab {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475569;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.profile-tab i {
    width: 16px;
    text-align: center;
    color: #94a3b8;
}

.profile-tab:hover {
    background: #f5f7ff;
    color: var(--site-indigo);
}

.profile-tab.active {
    background: var(--site-indigo-soft);
    color: var(--site-indigo-strong);
}

.profile-tab.active i {
    color: var(--site-indigo);
}

.profile-panel {
    padding: 22px;
}

.profile-panel-head {
    margin-bottom: 18px;
    padding-bottom: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.profile-panel-head h2 {
    margin: 0 0 3px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.profile-panel-head p {
    margin: 0;
    color: var(--site-muted);
    font-size: 0.72rem;
}

.profile-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px dashed #eef2f7;
    font-size: 0.76rem;
}

.profile-info-row:last-child {
    border-bottom: 0;
}

.profile-info-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
}

.profile-info-label i {
    width: 15px;
    text-align: center;
    color: #94a3b8;
}

.profile-info-value {
    color: #334155;
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-info-value code {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.68rem;
    color: var(--site-indigo-strong);
    background: var(--site-indigo-soft);
    padding: 3px 6px;
    border-radius: 5px;
}

.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-form-grid .site-field.full {
    grid-column: 1 / -1;
}

.profile-quota-bar {
    height: 8px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
    margin-top: 8px;
}

.profile-quota-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #6366f1, #0ea5e9);
}

.profile-tab-panel[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Checkout / payment
   -------------------------------------------------------------------------- */
.checkout-page {
    padding: 32px 0 50px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 18px;
    align-items: start;
}

.checkout-card {
    padding: 22px;
}

.checkout-card + .checkout-card {
    margin-top: 16px;
}

.checkout-card h2 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.checkout-card p {
    margin: 0 0 16px;
    color: var(--site-muted);
    font-size: 0.76rem;
}

.checkout-summary {
    position: sticky;
    top: 92px;
    padding: 22px;
}

.checkout-summary h2 {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 800;
}

.checkout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed #eef2f7;
    color: #64748b;
    font-size: 0.74rem;
}

.checkout-row:last-of-type {
    border-bottom: 0;
}

.checkout-row strong {
    color: var(--site-ink);
    font-weight: 700;
}

.checkout-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--site-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 800;
}

.checkout-total strong {
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--site-line);
    border-radius: 11px;
    background: #ffffff;
    color: var(--site-ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
}

.payment-option + .payment-option {
    margin-top: 8px;
}

.payment-option:hover {
    border-color: #c7d2fe;
    background: #f8faff;
}

.payment-option.active {
    border-color: #a5b4fc;
    background: var(--site-indigo-soft);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}

.payment-option-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #f1f5f9;
    color: var(--site-indigo);
}

.payment-option-text {
    min-width: 0;
    flex: 1;
}

.payment-option-text strong {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
}

.payment-option-text span {
    display: block;
    color: #94a3b8;
    font-size: 0.64rem;
}

.payment-option input {
    accent-color: var(--site-indigo);
}

/* --------------------------------------------------------------------------
   Legal
   -------------------------------------------------------------------------- */
.legal-page {
    padding: 34px 0 50px;
}

.legal-hero {
    margin-bottom: 20px;
}

.legal-hero h1 {
    margin: 10px 0 6px;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.legal-hero p {
    margin: 0;
    color: var(--site-muted);
    font-size: 0.84rem;
}

.legal-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.legal-toc {
    position: sticky;
    top: 92px;
    padding: 16px;
}

.legal-toc h2 {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 800;
}

.legal-toc a {
    display: block;
    padding: 5px 0;
    color: #64748b;
    font-size: 0.7rem;
    text-decoration: none;
}

.legal-toc a:hover {
    color: var(--site-indigo);
}

.legal-content {
    padding: 26px 28px;
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.8;
}

.legal-content h2 {
    margin: 24px 0 8px;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--site-ink);
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    margin: 18px 0 6px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--site-ink);
}

.legal-content p {
    margin: 0 0 12px;
}

.legal-content ul {
    margin: 0 0 14px;
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 5px;
}

.legal-content a {
    color: var(--site-indigo);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 560px;
    }

    .auth-visual {
        display: none;
    }

    .auth-panel {
        padding: 34px 28px;
    }

    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-layout,
    .checkout-grid,
    .legal-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .checkout-summary,
    .legal-toc {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .site-nav-inner {
        height: 66px;
        gap: 10px;
        padding: 0 14px;
    }

    .site-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        order: 3;
        margin-left: 0;
    }

    .site-brand {
        order: 1;
    }

    .site-nav-actions {
        order: 2;
        margin-left: auto;
    }

    .site-nav-links {
        display: none;
        position: absolute;
        top: 66px;
        left: 12px;
        right: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px;
        border: 1px solid var(--site-line);
        border-radius: 13px;
        background: #ffffff;
        box-shadow: var(--site-shadow);
    }

    .site-nav-links.open {
        display: flex;
    }

    .site-nav-link {
        padding: 10px 12px;
    }

    .site-user-meta {
        display: none;
    }

    .site-user-chip {
        padding: 3px;
        border: 0;
        background: transparent;
    }

    .site-main {
        padding: 24px 0 40px;
    }

    .site-container {
        padding: 0 14px;
    }

    .blog-grid,
    .pricing-grid,
    .profile-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-header-card {
        padding: 18px;
    }

    .profile-panel {
        padding: 16px;
    }

    .profile-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .legal-content {
        padding: 20px;
    }

    .site-footer-inner {
        justify-content: center;
        text-align: center;
    }

    .site-footer a {
        margin: 0 5px;
    }
}

/* Blog toolbar, featured card, modal */
.blog-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.blog-search {
    width: min(340px, 100%);
}

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.blog-filter {
    padding: 7px 11px;
    border: 1px solid var(--site-line);
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.blog-filter:hover {
    border-color: #c7d2fe;
    color: var(--site-indigo);
}

.blog-filter.active {
    background: var(--site-indigo-soft);
    border-color: #c7d2fe;
    color: var(--site-indigo-strong);
}

.blog-card-featured {
    grid-column: span 2;
}

.blog-card-featured .blog-card-cover {
    height: 230px;
}

.blog-card-featured h2 {
    font-size: 1.3rem;
}

.blog-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.blog-modal.open {
    opacity: 1;
    visibility: visible;
}

.blog-modal-card {
    width: 100%;
    max-width: 720px;
    max-height: 86vh;
    overflow-y: auto;
    padding: 28px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.25);
    transform: translateY(8px);
    transition: transform 0.2s ease;
}

.blog-modal.open .blog-modal-card {
    transform: translateY(0);
}

.blog-modal-close {
    float: right;
    width: 34px;
    height: 34px;
    border: 1px solid var(--site-line);
    border-radius: 9px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
}

.blog-modal-card h2 {
    margin: 8px 0 8px;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.blog-modal-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: #94a3b8;
    font-size: 0.68rem;
    margin-bottom: 16px;
}

.blog-modal-body {
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

@media (max-width: 1024px) {
    .blog-card-featured {
        grid-column: span 2;
    }
}

@media (max-width: 767.98px) {
    .blog-card-featured {
        grid-column: span 1;
    }

    .blog-card-featured .blog-card-cover {
        height: 180px;
    }

    .blog-modal-card {
        padding: 20px;
    }
}

/* Legal content inner components (legacy content, new shell) */
.legal-content .legal-section {
    margin-bottom: 18px;
}

.legal-content .section-header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 22px 0 8px;
}

.legal-content .section-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--site-indigo-soft);
    color: var(--site-indigo);
    font-size: 0.8rem;
}

.legal-content .section-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--site-ink);
}

.legal-content .section-content {
    color: #334155;
}

.legal-content .section-content h3 {
    margin: 16px 0 5px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--site-ink);
}

.legal-content .info-box {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e0e7ff;
    border-radius: 11px;
    background: #f8faff;
    margin: 12px 0;
}

.legal-content .info-box-icon {
    flex: 0 0 auto;
    font-size: 1rem;
}

.legal-content .info-box-content h4 {
    margin: 0 0 3px;
    font-size: 0.8rem;
    font-weight: 800;
}

.legal-content .info-box-content p {
    margin: 0;
    font-size: 0.78rem;
}

.legal-content .contact-card {
    padding: 16px;
    border: 1px solid var(--site-line);
    border-radius: 12px;
    background: #f8faff;
    margin-top: 18px;
}

.legal-content .contact-card h3 {
    margin: 0 0 6px;
    font-size: 0.88rem;
    font-weight: 800;
}

.legal-content .contact-links {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
}

.legal-content .contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--site-indigo);
    text-decoration: none;
    font-size: 0.78rem;
}

.legal-content .contact-link:hover {
    text-decoration: underline;
}

.legal-content .update-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.64rem;
    margin-top: 8px;
}

.legal-content .legal-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.legal-content .legal-subtitle {
    margin: 4px 0 0;
    color: var(--site-muted);
    font-size: 0.8rem;
}

.legal-content .legal-icon {
    font-size: 1.5rem;
}

.legal-content .legal-hero {
    display: none;
}

/* Dynamic brand name safety */
.site-brand > span {
    display: inline-block;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
@media (max-width: 767.98px) {
    .site-brand > span {
        max-width: 150px;
    }
}

/* ==========================================================================
   Playground (merged from playground.css)
   ========================================================================== */

:root {
    --pg-bg: #f4f6fb;
    --pg-card: #ffffff;
    --pg-ink: #0f172a;
    --pg-muted: #64748b;
    --pg-line: #e8ecf4;
    --pg-indigo: #4f46e5;
    --pg-indigo-strong: #4338ca;
    --pg-indigo-soft: #eef2ff;
    --pg-emerald: #10b981;
    --pg-emerald-soft: #ecfdf5;
    --pg-amber: #f59e0b;
    --pg-amber-soft: #fffbeb;
    --pg-red: #ef4444;
    --pg-red-soft: #fef2f2;
    --pg-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
    --pg-radius: 18px;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.playground-body {
    min-height: 100vh;
    background-color: var(--pg-bg);
    background-image: var(--pg-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--pg-ink);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    line-height: 1.55;
    overflow-x: hidden;
}

body.playground-body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(244, 246, 251, 0.76) 0%, rgba(244, 246, 251, 0.87) 45%, rgba(244, 246, 251, 0.94) 100%),
        radial-gradient(circle at 8% 0%, rgba(99, 102, 241, 0.10), transparent 32%),
        radial-gradient(circle at 92% 12%, rgba(14, 165, 233, 0.08), transparent 30%);
}

/* --------------------------------------------------------------------------
   Shared light sidebar for the playground
   -------------------------------------------------------------------------- */
.playground-body .main-sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid var(--pg-line);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(18px);
}

.playground-body .sidebar-header {
    border-bottom-color: #eef2f7;
}

.playground-body .sidebar-title {
    background: linear-gradient(135deg, #0f172a 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: -0.02em;
}

.playground-body .sidebar-logo-img {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.10);
}

.playground-body .nav-section-title {
    color: #94a3b8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.14em;
}

.playground-body .nav-item {
    color: #475569;
    border-left-color: transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    border-radius: 0 10px 10px 0;
    margin: 2px 10px 2px 0;
    padding-left: 18px;
}

.playground-body .nav-item:hover {
    background: #f5f7ff;
    color: var(--pg-indigo);
    border-left-color: #c7d2fe;
}

.playground-body .nav-item.active {
    background: var(--pg-indigo-soft);
    color: var(--pg-indigo-strong);
    border-left-color: var(--pg-indigo);
}

.playground-body .nav-item i {
    color: #818cf8;
}

.playground-body .sidebar-footer {
    background: #f8fafc;
    border-top-color: #eef2f7;
}

.playground-body .sidebar-footer .footer-info {
    color: #94a3b8;
}

.playground-body .sidebar-close-btn {
    color: #64748b;
}

.playground-body .sidebar-nav::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.playground-body .sidebar-nav::-webkit-scrollbar-thumb {
    background: #c7d2fe;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.pg-topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 76px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 26px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(18px);
}

.pg-topbar-left,
.pg-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pg-topbar-right {
    margin-left: auto;
}

.pg-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--pg-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.pg-breadcrumb i {
    color: #cbd5e1;
    font-size: 0.58rem;
}

.pg-breadcrumb strong {
    color: var(--pg-ink);
    font-weight: 700;
}

.pg-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--pg-line);
    border-radius: 11px;
    background: #ffffff;
    color: var(--pg-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.pg-icon-btn:hover {
    color: var(--pg-indigo);
    border-color: #c7d2fe;
    background: #f8faff;
}

.pg-mobile-toggle {
    display: none;
}

.pg-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--pg-emerald-soft);
    color: #047857;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.pg-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pg-emerald);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.13);
    animation: pgPulse 2s infinite;
}

@keyframes pgPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.86); }
}

.pg-key {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 240px;
    padding: 0 10px;
    height: 40px;
    border: 1px solid var(--pg-line);
    border-radius: 11px;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pg-key:focus-within {
    background: #ffffff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.10);
}

.pg-key > i {
    color: #94a3b8;
    font-size: 0.75rem;
}

.pg-key input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--pg-ink);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
}

.pg-key input::placeholder {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #94a3b8;
}

.pg-key-toggle {
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    font-size: 0.7rem;
}

.pg-key-toggle:hover {
    color: var(--pg-indigo);
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.pg-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.pg-btn-primary:hover {
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.28);
}

.pg-btn-ghost {
    background: #ffffff;
    border-color: var(--pg-line);
    color: var(--pg-ink);
}

.pg-btn-ghost:hover {
    border-color: #c7d2fe;
    color: var(--pg-indigo);
    background: #f8faff;
}

.pg-user-dropdown {
    position: relative;
}

.pg-user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px 5px 5px;
    border: 1px solid var(--pg-line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--pg-ink);
    font-family: inherit;
    cursor: pointer;
}

.pg-user-chip img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e7ff;
}

.pg-user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

.pg-user-meta strong {
    font-size: 0.72rem;
    font-weight: 800;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-user-meta span {
    font-size: 0.62rem;
    color: var(--pg-muted);
}

.pg-user-chevron {
    color: #94a3b8;
    font-size: 0.58rem;
    transition: transform 0.2s ease;
}

.pg-user-chip[aria-expanded="true"] .pg-user-chevron {
    transform: rotate(180deg);
}

.pg-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    border: 1px solid var(--pg-line);
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.18s ease;
    z-index: 1200;
}

.pg-user-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pg-user-menu-head {
    padding: 9px 11px 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 5px;
}

.pg-user-menu-head strong {
    display: block;
    font-size: 0.76rem;
    color: var(--pg-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-user-menu-head span {
    display: block;
    margin-top: 2px;
    font-size: 0.64rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-user-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.pg-user-menu-item i {
    width: 15px;
    text-align: center;
    color: #94a3b8;
}

.pg-user-menu-item:hover {
    background: #f5f7ff;
    color: var(--pg-indigo);
}

.pg-user-menu-item.danger {
    color: #dc2626;
}

.pg-user-menu-item.danger i {
    color: #f87171;
}

.pg-user-menu-item.danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.pg-user-menu-sep {
    height: 1px;
    margin: 5px 4px;
    background: #f1f5f9;
}

/* --------------------------------------------------------------------------
   Main shell
   -------------------------------------------------------------------------- */
.pg-main {
    margin-left: 260px;
    padding: 100px 26px 28px;
    position: relative;
    z-index: 1;
}

.pg-shell {
    max-width: 1620px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.pg-panel {
    background: #ffffff;
    border: 1px solid var(--pg-line);
    border-radius: var(--pg-radius);
    box-shadow: var(--pg-shadow);
}

/* Endpoint catalog */
.pg-catalog {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pg-catalog-head {
    padding: 20px 18px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.pg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--pg-indigo);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pg-catalog-head h1 {
    margin: 7px 0 5px;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.pg-catalog-head p {
    margin: 0;
    color: var(--pg-muted);
    font-size: 0.7rem;
}

.pg-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 13px 14px 8px;
    padding: 0 10px;
    height: 36px;
    border: 1px solid var(--pg-line);
    border-radius: 9px;
    background: #f8fafc;
}

.pg-search i {
    color: #94a3b8;
    font-size: 0.7rem;
}

.pg-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.72rem;
    color: var(--pg-ink);
}

.pg-endpoint-list {
    padding: 4px 10px 12px;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

.pg-endpoint-list::-webkit-scrollbar {
    width: 5px;
}

.pg-endpoint-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.pg-category-block {
    margin-top: 10px;
}

.pg-category-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.pg-category-label i {
    color: #a5b4fc;
    font-size: 0.65rem;
}

.pg-category-label span {
    margin-left: auto;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.56rem;
    color: #cbd5e1;
}

.pg-endpoint-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #334155;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.16s ease;
}

.pg-endpoint-item:hover {
    background: #f8faff;
    border-color: #eef2ff;
}

.pg-endpoint-item.active {
    background: var(--pg-indigo-soft);
    border-color: #e0e7ff;
    color: var(--pg-indigo-strong);
}

.pg-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 2px 5px;
    border-radius: 5px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
}

.pg-method-get {
    background: var(--pg-emerald-soft);
    color: #047857;
}

.pg-method-post {
    background: var(--pg-indigo-soft);
    color: #4338ca;
}

.pg-method-put {
    background: var(--pg-amber-soft);
    color: #b45309;
}

.pg-method-patch {
    background: #f5f3ff;
    color: #6d28d9;
}

.pg-method-delete {
    background: var(--pg-red-soft);
    color: #b91c1c;
}

.pg-endpoint-item-name {
    font-size: 0.72rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-empty-catalog {
    padding: 24px 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.72rem;
}

/* Workbench */
.pg-workbench {
    min-width: 0;
}

.pg-empty-state {
    min-height: 520px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.pg-empty-icon {
    width: 66px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--pg-indigo-soft);
    color: var(--pg-indigo);
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.pg-empty-state h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.pg-empty-state p {
    margin: 0;
    color: var(--pg-muted);
    font-size: 0.8rem;
    max-width: 420px;
}

.pg-endpoint-head {
    padding: 22px 24px 18px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.pg-endpoint-head .pg-method {
    min-width: 50px;
    padding: 5px 8px;
    font-size: 0.6rem;
    margin-top: 2px;
}

.pg-endpoint-head-main {
    min-width: 0;
    flex: 1;
}

.pg-endpoint-head h2 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.pg-endpoint-head p {
    margin: 0;
    color: var(--pg-muted);
    font-size: 0.76rem;
    max-width: 760px;
}

.pg-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}

.pg-auth-badge.required {
    background: var(--pg-amber-soft);
    color: #b45309;
}

.pg-urlbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 24px 0;
    padding: 5px 6px 5px 12px;
    border: 1px solid var(--pg-line);
    border-radius: 11px;
    background: #f8fafc;
}

.pg-url-method {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--pg-indigo);
}

.pg-url-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    color: #334155;
}

.pg-copy-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 7px;
    background: #ffffff;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.18s ease;
}

.pg-copy-btn:hover {
    color: var(--pg-indigo);
    background: var(--pg-indigo-soft);
}

.pg-tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 12px 24px 0;
    border-bottom: 1px solid #f1f5f9;
}

.pg-tab {
    padding: 9px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.pg-tab:hover {
    color: var(--pg-indigo);
}

.pg-tab.active {
    color: var(--pg-indigo-strong);
    border-bottom-color: var(--pg-indigo);
}

.pg-tab-panel {
    padding: 20px 24px 24px;
}

.pg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pg-card {
    border: 1px solid var(--pg-line);
    border-radius: 13px;
    background: #ffffff;
    overflow: hidden;
}

.pg-card + .pg-card {
    margin-top: 14px;
}

.pg-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.pg-card-head h3 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
}

.pg-card-head span {
    color: #94a3b8;
    font-size: 0.62rem;
}

.pg-card-body {
    padding: 14px;
}

.pg-field {
    margin-bottom: 10px;
}

.pg-field:last-child {
    margin-bottom: 0;
}

.pg-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    color: #475569;
    font-size: 0.66rem;
    font-weight: 700;
}

.pg-field label em {
    font-style: normal;
    color: #94a3b8;
    font-weight: 500;
}

.pg-input,
.pg-textarea,
.pg-select {
    width: 100%;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--pg-ink);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    outline: 0;
    transition: all 0.18s ease;
}

.pg-input,
.pg-select {
    height: 36px;
    padding: 0 10px;
}

.pg-textarea {
    min-height: 150px;
    padding: 10px;
    resize: vertical;
    line-height: 1.6;
}

.pg-input:focus,
.pg-textarea:focus,
.pg-select:focus {
    background: #ffffff;
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.pg-empty-fields {
    padding: 13px;
    border: 1px dashed #dbe3f0;
    border-radius: 9px;
    color: #94a3b8;
    font-size: 0.7rem;
    text-align: center;
}

.pg-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pg-send {
    min-width: 150px;
    height: 40px;
}

.pg-send:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.pg-hint {
    color: #94a3b8;
    font-size: 0.66rem;
}

.pg-table-wrap {
    overflow-x: auto;
}

.pg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
}

.pg-table th {
    padding: 9px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 800;
    text-align: left;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pg-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: top;
}

.pg-table tr:last-child td {
    border-bottom: 0;
}

.pg-table code {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.64rem;
    color: var(--pg-indigo-strong);
    background: var(--pg-indigo-soft);
    padding: 2px 5px;
    border-radius: 4px;
}

.pg-req {
    color: #dc2626;
    font-weight: 800;
}

.pg-opt {
    color: #94a3b8;
    font-weight: 600;
}

.pg-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pg-lang-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pg-lang {
    padding: 6px 10px;
    border: 1px solid var(--pg-line);
    border-radius: 7px;
    background: #ffffff;
    color: #475569;
    font-family: inherit;
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}

.pg-lang:hover {
    border-color: #c7d2fe;
    color: var(--pg-indigo);
}

.pg-lang.active {
    background: var(--pg-indigo-soft);
    border-color: #c7d2fe;
    color: var(--pg-indigo-strong);
}

.pg-code {
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.13);
    border-radius: 11px;
    background: #0b1220;
    color: #c7d2fe;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.75;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.pg-code .tok-key { color: #93c5fd; }
.pg-code .tok-string { color: #6ee7b7; }
.pg-code .tok-number { color: #fcd34d; }
.pg-code .tok-bool { color: #f0abfc; }
.pg-code .tok-null { color: #94a3b8; }
.pg-code .tok-punct { color: #64748b; }

.pg-response-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pg-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.64rem;
    font-weight: 700;
}

.pg-status.ok {
    background: var(--pg-emerald-soft);
    color: #047857;
}

.pg-status.warn {
    background: var(--pg-amber-soft);
    color: #b45309;
}

.pg-status.err {
    background: var(--pg-red-soft);
    color: #b91c1c;
}

.pg-meta {
    color: #94a3b8;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.62rem;
}

.pg-response {
    min-height: 180px;
}

.pg-notes {
    color: #475569;
    font-size: 0.74rem;
    line-height: 1.7;
}

.pg-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: all 0.2s ease;
}

.pg-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .pg-shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .pg-key {
        width: 200px;
    }
}

@media (max-width: 1024px) {
    .pg-topbar {
        left: 0;
        padding: 0 16px;
    }

    .pg-main {
        margin-left: 0;
        padding: 94px 16px 24px;
    }

    .pg-mobile-toggle {
        display: inline-flex;
    }

    .pg-breadcrumb span,
    .pg-breadcrumb i {
        display: none;
    }

    .pg-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .pg-catalog {
        position: static;
        max-height: 340px;
    }
}

@media (max-width: 767.98px) {
    .pg-topbar {
        gap: 8px;
        padding: 0 10px;
    }

    .pg-topbar-right {
        gap: 6px;
    }

    .pg-live,
    .pg-key,
    .pg-topbar-right > .pg-icon-btn {
        display: none;
    }

    .pg-user-meta {
        display: none;
    }

    .pg-user-chip {
        padding: 3px;
        border: 0;
        background: transparent;
    }

    .pg-tab-panel {
        padding: 16px;
    }

    .pg-endpoint-head {
        padding: 18px 16px 14px;
    }

    .pg-urlbar {
        margin: 12px 16px 0;
    }

    .pg-tabs {
        padding: 10px 16px 0;
        overflow-x: auto;
    }

    .pg-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Dedicated playground sidebar (single sidebar, grouped by category)
   -------------------------------------------------------------------------- */
.pg-topbar {
    left: 300px;
}

.pg-main {
    margin-left: 300px;
    padding: 100px 26px 28px;
}

.pg-workbench-shell {
    max-width: 1280px;
    margin: 0 auto;
}

.pg-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border-right: 1px solid var(--pg-line);
    box-shadow: 12px 0 36px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(18px);
}

.pg-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid #eef2f7;
    flex: 0 0 auto;
}

.pg-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--pg-ink);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.pg-brand img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #c7d2fe;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.09);
}

.pg-brand em {
    font-style: normal;
    color: var(--pg-indigo);
}

.pg-sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.pg-sidebar-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 12px 12px;
}

.pg-sidebar-body > .pg-eyebrow {
    margin-left: 4px;
}

.pg-sidebar-body > h1 {
    margin: 7px 4px 3px;
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.pg-sidebar-body > p {
    margin: 0 4px 12px;
    color: var(--pg-muted);
    font-size: 0.68rem;
}

.pg-sidebar-body .pg-search {
    margin: 0 0 10px;
}

.pg-endpoint-list {
    padding: 0;
    overflow-y: auto;
}

.pg-sidebar-body::-webkit-scrollbar,
.pg-endpoint-list::-webkit-scrollbar {
    width: 5px;
}

.pg-sidebar-body::-webkit-scrollbar-thumb,
.pg-endpoint-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.pg-category-block {
    margin-bottom: 3px;
}

.pg-category-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease;
}

.pg-category-toggle:hover {
    background: #f8faff;
}

.pg-category-icon {
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--pg-indigo-soft);
    color: var(--pg-indigo);
    font-size: 0.68rem;
}

.pg-category-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-category-count {
    color: #94a3b8;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.58rem;
}

.pg-category-chevron {
    color: #94a3b8;
    font-size: 0.56rem;
    transition: transform 0.2s ease;
}

.pg-category-toggle[aria-expanded="true"] .pg-category-chevron {
    transform: rotate(180deg);
}

.pg-category-endpoints {
    padding: 2px 0 7px 35px;
}

.pg-category-endpoints .pg-endpoint-item {
    padding: 7px 7px;
}

.pg-sidebar-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border-top: 1px solid #eef2f7;
    background: #f8fafc;
}

.pg-sidebar-footer a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--pg-line);
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    font-size: 0.66rem;
    font-weight: 700;
}

.pg-sidebar-footer a:hover {
    color: var(--pg-indigo);
    border-color: #c7d2fe;
    background: #f8faff;
}

.pg-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

@media (max-width: 1024px) {
    .pg-topbar {
        left: 0;
        padding: 0 14px;
    }

    .pg-main {
        margin-left: 0;
        padding: 94px 16px 24px;
    }

    .pg-sidebar {
        width: 300px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .pg-sidebar.open {
        transform: translateX(0);
    }

    .pg-sidebar-close {
        display: inline-flex;
    }

    .pg-sidebar-overlay.active {
        display: block;
    }

    .pg-workbench-shell {
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .pg-sidebar {
        width: min(86vw, 320px);
    }

    .pg-sidebar-brand {
        padding: 14px 12px;
    }

    .pg-sidebar-body {
        padding: 12px 9px;
    }
}

.pg-brand > span {
    display: inline-block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.pg-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--pg-indigo-soft);
    color: var(--pg-indigo-strong);
    font-size: 0.62rem;
    font-weight: 700;
    white-space: nowrap;
}
