/* ============================================================
   BersihBersih Admin Panel - Premium Minimalist Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700&display=swap');

:root {
    /* Admin Color Palette - Light (Default) */
    --ad-bg:          #f3f4f6;
    --ad-surface:     #ffffff;
    --ad-surface-2:   #f8fafc;
    --ad-border:      rgba(0, 0, 0, 0.1);
    --ad-border-hover: rgba(0, 0, 0, 0.2);
    --ad-topbar-bg:   rgba(255, 255, 255, 0.9);

    /* Accent Colors */
    --ad-blue:    #0284c7;
    --ad-green:   #16a34a;
    --ad-yellow:  #ca8a04;
    --ad-red:     #dc2626;
    --ad-purple:  #9333ea;
    --ad-teal:    #0d9488;

    /* Gradients */
    --ad-grad-primary: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    --ad-grad-sidebar: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);

    /* Text */
    --ad-text:        #1f2937;
    --ad-text-muted:  #4b5563;
    --ad-text-subtle: #6b7280;
    
    /* Frontend variables for Summernote compatibility */
    --text-dark:      #1f2937;
    --text-muted:     #4b5563;
    --border-color:   rgba(0, 0, 0, 0.1);
    --border-light:   rgba(0, 0, 0, 0.05);
    --bg-light:       rgba(0, 0, 0, 0.03);

    /* Sidebar */
    --sidebar-width:  250px;
    --navbar-height:  64px;

    /* Transitions */
    --trans: all 0.2s ease;
}

body.admin-body.theme-dark {
    /* Admin Color Palette - Dark + Elegant */
    --ad-bg:          #0d1117;
    --ad-surface:     #161b22;
    --ad-surface-2:   #1c2333;
    --ad-border:      rgba(255, 255, 255, 0.08);
    --ad-border-hover: rgba(255, 255, 255, 0.15);
    --ad-topbar-bg:   rgba(13, 17, 23, 0.9);

    /* Frontend variables for Summernote compatibility */
    --text-dark:      #e6edf3;
    --text-muted:     #8b949e;
    --border-color:   rgba(255, 255, 255, 0.1);
    --border-light:   rgba(255, 255, 255, 0.05);
    --bg-light:       rgba(255, 255, 255, 0.03);

    /* Accent Colors */
    --ad-blue:    #58a6ff;
    --ad-green:   #3fb950;
    --ad-yellow:  #d29922;
    --ad-red:     #f85149;
    --ad-purple:  #a371f7;
    --ad-teal:    #39d353;

    /* Gradients */
    --ad-grad-sidebar: linear-gradient(180deg, #0d1117 0%, #0a1628 100%);

    /* Text */
    --ad-text:        #e6edf3;
    --ad-text-muted:  #7d8590;
    --ad-text-subtle: #6e7681;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--ad-bg);
    color: var(--ad-text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--ad-grad-sidebar);
    border-right: 1px solid var(--ad-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transition: var(--trans);
    overflow-y: auto;
}

.sidebar-logo {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--ad-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ad-grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar-logo-text strong {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ad-text);
}

.sidebar-logo-text span {
    font-size: 0.7rem;
    color: var(--ad-text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ad-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.25rem 0.4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    text-decoration: none;
    color: var(--ad-text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 0;
    transition: var(--trans);
    position: relative;
    margin: 0.1rem 0.75rem;
    border-radius: 8px;
}

.sidebar-link:hover {
    color: var(--ad-text);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: var(--ad-blue);
    background: rgba(88, 166, 255, 0.1);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--ad-blue);
    border-radius: 0 3px 3px 0;
}

.sidebar-link-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.sidebar-badge {
    margin-left: auto;
    background: rgba(248, 81, 73, 0.2);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--ad-red);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--ad-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ad-grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-info strong {
    display: block;
    font-size: 0.82rem;
    color: var(--ad-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-info span {
    font-size: 0.7rem;
    color: var(--ad-text-muted);
}

.sidebar-logout {
    color: var(--ad-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--trans);
    padding: 0.3rem;
    border-radius: 6px;
}

.sidebar-logout:hover { color: var(--ad-red); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    max-width: 100vw;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--ad-topbar-bg, rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ad-border);
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
}

.topbar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-content {
    flex: 1;
    padding: 2rem;
}

/* ============================================================
   ADMIN CARDS
   ============================================================ */
.ad-card {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--trans);
}

.ad-card:hover { border-color: var(--ad-border-hover); }

.ad-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ad-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ad-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ad-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ad-card-body { padding: 1.5rem; }

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.ad-stat-card {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--trans);
    position: relative;
    overflow: hidden;
    min-width: 0;
    word-break: break-word;
}

.ad-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--stat-color, var(--ad-blue));
    opacity: 0.8;
}

.ad-stat-card:hover {
    border-color: var(--ad-border-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--stat-bg, rgba(88, 166, 255, 0.1));
    border: 1px solid var(--stat-border, rgba(88, 166, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ad-text);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--ad-text-muted);
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-change.up   { color: var(--ad-green); }
.stat-change.down { color: var(--ad-red); }

/* ============================================================
   TABLE
   ============================================================ */
.ad-table-wrapper {
    overflow-x: auto;
}

.ad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.ad-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ad-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--ad-border);
    white-space: nowrap;
}

.ad-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--ad-border);
    color: var(--ad-text);
    vertical-align: middle;
}

.ad-table tr:last-child td { border-bottom: none; }

.ad-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ============================================================
   ADMIN BADGES
   ============================================================ */
.ad-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid;
}

.ad-badge-green   { background: rgba(63, 185, 80, 0.12);  color: #3fb950; border-color: rgba(63, 185, 80, 0.25); }
.ad-badge-yellow  { background: rgba(210, 153, 34, 0.12); color: #d29922; border-color: rgba(210, 153, 34, 0.25); }
.ad-badge-red     { background: rgba(248, 81, 73, 0.12);  color: #f85149; border-color: rgba(248, 81, 73, 0.25); }
.ad-badge-blue    { background: rgba(88, 166, 255, 0.12); color: #58a6ff; border-color: rgba(88, 166, 255, 0.25); }
.ad-badge-purple  { background: rgba(163, 113, 247, 0.12);color: #a371f7; border-color: rgba(163, 113, 247, 0.25); }
.ad-badge-gray    { background: rgba(255, 255, 255, 0.06); color: var(--ad-text-muted); border-color: var(--ad-border); }

/* ============================================================
   BUTTONS (Admin)
   ============================================================ */
.ad-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: var(--trans);
    white-space: nowrap;
}

.ad-btn-primary {
    background: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.3);
    color: var(--ad-blue);
}
.ad-btn-primary:hover { background: rgba(88, 166, 255, 0.25); }

.ad-btn-success {
    background: rgba(63, 185, 80, 0.15);
    border-color: rgba(63, 185, 80, 0.3);
    color: var(--ad-green);
}
.ad-btn-success:hover { background: rgba(63, 185, 80, 0.25); }

.ad-btn-danger {
    background: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.3);
    color: var(--ad-red);
}
.ad-btn-danger:hover { background: rgba(248, 81, 73, 0.25); }

.ad-btn-ghost {
    background: transparent;
    border-color: var(--ad-border);
    color: var(--ad-text-muted);
}
.ad-btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--ad-text); }

.ad-btn-wa {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.25);
    color: #25d366;
}
.ad-btn-wa:hover { background: rgba(37, 211, 102, 0.22); }

/* ============================================================
   FORMS (Admin)
   ============================================================ */
.ad-input {
    width: 100%;
    background: var(--ad-surface-2);
    border: 1px solid var(--ad-border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    color: var(--ad-text);
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--trans);
}

.ad-input::placeholder { color: var(--ad-text-subtle); }
.ad-input:focus {
    border-color: var(--ad-blue);
    background: rgba(88, 166, 255, 0.05);
}

.ad-input option { background: var(--ad-surface); }

.ad-form-group { margin-bottom: 1rem; }
.ad-form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--ad-text-muted); margin-bottom: 0.4rem; }

/* ============================================================
   ALERTS (Admin)
   ============================================================ */
.ad-alert {
    padding: 0.85rem 1.1rem;
    border-radius: 8px;
    font-size: 0.86rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: adFadeIn 0.3s ease;
}

.ad-alert-success { background: rgba(63, 185, 80, 0.1);  border: 1px solid rgba(63, 185, 80, 0.2);  color: #56d364; }
.ad-alert-error   { background: rgba(248, 81, 73, 0.1);  border: 1px solid rgba(248, 81, 73, 0.2);  color: #ff7b72; }
.ad-alert-warning { background: rgba(210, 153, 34, 0.1); border: 1px solid rgba(210, 153, 34, 0.2); color: #e3b341; }
.ad-alert-info    { background: rgba(88, 166, 255, 0.1); border: 1px solid rgba(88, 166, 255, 0.2); color: #79c0ff; }

/* ============================================================
   ADMIN LOGIN PAGE (Elegant)
   ============================================================ */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 20% 50%, #0d2137 0%, #0d1117 60%);
    position: relative;
    overflow: hidden;
}

.login-bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.login-card {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    animation: loginSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--ad-grad-primary);
    border-radius: 16px 16px 0 0;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--ad-grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
}

.login-logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.login-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ad-text);
}

.login-subtitle {
    font-size: 0.82rem;
    color: var(--ad-text-muted);
}

.login-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--ad-grad-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans);
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}

.login-btn:active { transform: translateY(0); }

.login-hint {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: var(--ad-text-subtle);
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--ad-border);
    background: transparent;
    color: var(--ad-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--trans);
    text-decoration: none;
}

.filter-btn:hover { border-color: var(--ad-border-hover); color: var(--ad-text); }
.filter-btn.active {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.4);
    color: var(--ad-blue);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--ad-surface-2);
    border: 1px solid var(--ad-border);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
    flex: 1;
    max-width: 300px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--ad-text);
    font-size: 0.86rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    flex: 1;
}

.search-box input::placeholder { color: var(--ad-text-subtle); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: adFadeIn 0.2s ease;
}

.modal {
    background: var(--ad-surface);
    border: 1px solid var(--ad-border);
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ad-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--ad-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    font-size: 1.1rem;
    transition: var(--trans);
}

.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--ad-text); }

.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--ad-border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
    flex-wrap: wrap;
    min-width: 0;
}

.page-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header p {
    font-size: 0.85rem;
    color: var(--ad-text-muted);
    margin-top: 0.2rem;
    word-break: break-word;
}

/* ============================================================
   GRID
   ============================================================ */
.ad-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.ad-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes adFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes loginSlideIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
        width: 240px;
    }
    .hide-on-mobile {
        display: none !important;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-link {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        margin: 0.1rem 0.5rem;
    }
    .admin-main {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
    }
    .admin-topbar {
        padding: 0 0.75rem;
        height: 56px;
    }
    #sidebar-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    .topbar-title {
        font-size: 0.95rem;
    }
    .topbar-logout, .theme-label {
        display: none !important;
    }
    .topbar-actions {
        gap: 0.25rem;
    }
    .admin-content {
        padding: 0.75rem;
    }
    .ad-card-header {
        padding: 0.85rem 1rem;
        flex-wrap: wrap;
    }
    .ad-card-title {
        font-size: 0.85rem;
    }
    .ad-card-body {
        padding: 0.85rem !important;
    }
    .stat-grid { 
        grid-template-columns: 1fr !important; 
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .filter-bar form,
    .filter-bar .search-box {
        margin-left: 0 !important;
        width: 100%;
        margin-top: 0.5rem;
    }
    .ad-stat-card {
        padding: 0.85rem 1rem;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "icon value"
            "icon label"
            "icon change";
        column-gap: 1rem;
        row-gap: 0.15rem;
        align-items: center;
    }
    .stat-icon {
        grid-area: icon;
        width: 38px;
        height: 38px;
        font-size: 1rem;
        margin-bottom: 0 !important;
    }
    .stat-value {
        grid-area: value;
        font-size: 1.35rem;
        margin-bottom: 0 !important;
        line-height: 1.1;
    }
    .stat-label {
        grid-area: label;
        font-size: 0.8rem;
        align-self: start;
    }
    .stat-change {
        grid-area: change;
        align-self: start;
    }
    .ad-table-wrapper {
        margin: 0;
        padding: 0;
        overflow-x: visible;
    }
    .ad-table {
        border: none;
    }
    .ad-table thead {
        display: none;
    }
    .ad-table tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--ad-surface);
        border: 1px solid var(--ad-border);
        border-radius: 12px;
        padding: 0.5rem;
    }
    .ad-table td {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
        border-bottom: 1px dashed var(--ad-border);
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
        flex-wrap: nowrap;
        gap: 0.35rem;
    }
    .ad-table td:last-child {
        border-bottom: none;
    }
    .ad-table td::before {
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--ad-text-muted);
        text-align: left;
        margin-right: 0;
        flex-shrink: 0;
    }
    .ad-table tr.empty-state {
        display: flex;
        justify-content: center;
        align-items: center;
        background: transparent;
        border: none;
    }
    .ad-table tr.empty-state td {
        display: block;
        text-align: center;
        border: none;
        width: 100%;
        color: var(--ad-text-muted) !important;
    }
    .ad-table tr.empty-state td::before {
        display: none;
    }
    .ad-card.table-card-mobile {
        background: transparent !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .ad-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    .page-header {
        margin-bottom: 1rem;
    }
    .page-header h1 {
        font-size: 1.25rem;
    }
    .ad-grid-2, .ad-grid-3 { 
        grid-template-columns: 1fr; 
        gap: 0.75rem;
    }
}

/* ============================================================
   PENGAJUAN DESA — Table Grouping Visual
   ============================================================ */
.agen-group-first td:first-child,
.agen-group-first td:nth-child(2) {
    padding-top: 1.25rem;
}

.agen-group-first > td {
    border-top: 1px solid rgba(88, 166, 255, 0.1);
}

.ad-table tbody tr:first-child > td.agen-group-first {
    border-top: none;
}

/* Disable btn when disabled */
.ad-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   WORD ART CUSTOM CLASSES (PREVENTS CKEDITOR STRIPPING GRADIENTS)
   ============================================================ */
.wordart-silver-blue {
    background: linear-gradient(135deg, #e0e0e0 0%, #ffffff 50%, #ececec 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    font-weight: 800;
    -webkit-text-stroke: 0.5px #0ea5e9 !important;
    filter: drop-shadow(0 0 1px rgba(14, 165, 233, 0.3));
}

.wordart-gradient-purple-orange {
    background: linear-gradient(to right, #8b5cf6, #f97316) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    font-weight: 800;
}

.wordart-gradient-tosca-blue {
    background: linear-gradient(to right, #0d9488, #2563eb) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    font-weight: 800;
}

.wordart-gradient-emerald-gold {
    background: linear-gradient(to right, #059669, #d97706) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    font-weight: 800;
}

.wordart-gradient-bronze-gold {
    background: linear-gradient(to right, #78350f, #d97706) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    font-weight: 800;
}

.wordart-gradient-rose-purple {
    background: linear-gradient(to right, #db2777, #6d28d9) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    color: transparent !important;
    font-weight: 800;
}

/* ============================================================
   RESPONSIVE H1-H6 SIZING FOR CKEDITOR OUTPUTS
   ============================================================ */
.hero-title h1, .section-subtitle h1, .layanan-content-wrapper h1, .ck-content h1 { font-size: 2.6rem !important; line-height: 1.2 !important; margin: 0.5rem 0 0.2rem 0 !important; }
.hero-title h2, .section-subtitle h2, .layanan-content-wrapper h2, .ck-content h2 { font-size: 2.2rem !important; line-height: 1.25 !important; margin: 0.5rem 0 0.2rem 0 !important; }
.hero-title h3, .section-subtitle h3, .layanan-content-wrapper h3, .ck-content h3 { font-size: 1.8rem !important; line-height: 1.3 !important; margin: 0.5rem 0 0.2rem 0 !important; }
.hero-title h4, .section-subtitle h4, .layanan-content-wrapper h4, .ck-content h4 { font-size: 1.5rem !important; line-height: 1.35 !important; margin: 0.5rem 0 0.2rem 0 !important; }
.hero-title h5, .section-subtitle h5, .layanan-content-wrapper h5, .ck-content h5 { font-size: 1.2rem !important; line-height: 1.4 !important; margin: 0.5rem 0 0.2rem 0 !important; }
.hero-title h6, .section-subtitle h6, .layanan-content-wrapper h6, .ck-content h6 { font-size: 1.0rem !important; line-height: 1.45 !important; margin: 0.5rem 0 0.2rem 0 !important; }

/* Mobile (max-width: 991px) overrides */
@media (max-width: 991px) {
    .hero-title h1, .section-subtitle h1, .layanan-content-wrapper h1, .ck-content h1 { font-size: 2.0rem !important; }
    .hero-title h2, .section-subtitle h2, .layanan-content-wrapper h2, .ck-content h2 { font-size: 1.7rem !important; }
    .hero-title h3, .section-subtitle h3, .layanan-content-wrapper h3, .ck-content h3 { font-size: 1.4rem !important; }
    .hero-title h4, .section-subtitle h4, .layanan-content-wrapper h4, .ck-content h4 { font-size: 1.2rem !important; }
    .hero-title h5, .section-subtitle h5, .layanan-content-wrapper h5, .ck-content h5 { font-size: 1.05rem !important; }
    .hero-title h6, .section-subtitle h6, .layanan-content-wrapper h6, .ck-content h6 { font-size: 0.95rem !important; }
}

