/* 
 * Alfamart GIS Custom Styling System - Premium Glassmorphism Theme
 * Built with passion for maximum visual excellence and smooth interactions.
 * Supports Light/Dark mode toggle.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
 *  LIGHT THEME — Default (Cheerful & Modern Warm Cream/Peach)
 * ============================================================ */
:root {
    /* Light Theme Background Tokens - Modern Soft Colors */
    --bg-primary: hsl(0, 0%, 98%);
    --bg-secondary: hsl(0, 0%, 96%);
    --glass-bg: hsla(0, 0%, 100%, 0.72);
    --glass-border: hsla(356, 60%, 50%, 0.12);
    --glass-border-focus: hsla(356, 65%, 50%, 0.5);

    --text-primary: hsl(220, 25%, 15%);
    --text-secondary: hsl(220, 15%, 40%);
    --text-muted: hsl(220, 8%, 55%);

    /* Soft Brand Accents (Alfamart Red toned down) */
    --accent-red: hsl(356, 70%, 58%);
    --accent-red-glow: hsla(356, 70%, 58%, 0.2);
    --accent-yellow: hsl(48, 95%, 56%);
    --accent-yellow-glow: hsla(48, 95%, 56%, 0.2);
    --accent-violet: hsl(265, 65%, 62%);
    --accent-violet-glow: hsla(265, 65%, 62%, 0.18);
    --accent-cyan: hsl(190, 75%, 45%);
    --accent-cyan-glow: hsla(190, 75%, 45%, 0.18);

    --success: hsl(145, 65%, 42%);
    --error: hsl(356, 70%, 58%);

    /* Layout Constants */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --navbar-height: 70px;
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Light-specific internal vars - Modern Soft */
    --sidebar-bg: linear-gradient(180deg, hsl(356, 70%, 58%) 0%, hsl(356, 75%, 48%) 100%);
    --sidebar-border: hsla(0, 0%, 100%, 0.1);
    --card-shadow: 0 8px 28px hsla(220, 25%, 15%, 0.08), inset 0 1px 0 hsla(0, 0%, 100%, 0.9);
    --card-shadow-hover: 0 16px 40px hsla(220, 25%, 15%, 0.12), 0 0 18px hsla(356, 70%, 58%, 0.12), inset 0 1px 0 hsla(0,0%,100%,0.95);
    --navbar-bg: hsla(0, 0%, 98%, 0.88);
    --navbar-border: hsla(356, 70%, 58%, 0.1);
    --body-gradient-1: hsla(356, 70%, 58%, 0.05);
    --body-gradient-2: hsla(48, 95%, 56%, 0.06);
    --body-gradient-3: hsla(190, 75%, 45%, 0.04);
    --table-head-bg: hsla(220, 20%, 90%, 0.85);
    --table-row-hover: hsla(220, 20%, 92%, 0.5);
    --input-bg: hsla(0, 0%, 100%, 0.92);
    --scrollbar-thumb: hsla(356, 70%, 58%, 0.2);
    --theme-icon: '\f185'; /* fa-sun */
}

/* ============================================================
 *  DARK THEME — toggled via .dark on <body> (Cheerful Neon Space)
 * ============================================================ */
body.dark {
    /* Dark Backgrounds - Modern Soft */
    --bg-primary: hsl(220, 20%, 8%);
    --bg-secondary: hsl(220, 18%, 12%);
    --glass-bg: hsla(220, 20%, 10%, 0.78);
    --glass-border: hsla(356, 70%, 58%, 0.16);
    --glass-border-focus: hsla(356, 75%, 65%, 0.65);

    --text-primary: hsl(0, 0%, 93%);
    --text-secondary: hsl(0, 0%, 75%);
    --text-muted: hsl(0, 0%, 60%);

    /* Soft Neon Accents */
    --accent-red: hsl(356, 75%, 62%);
    --accent-red-glow: hsla(356, 75%, 62%, 0.3);
    --accent-yellow: hsl(48, 95%, 60%);
    --accent-yellow-glow: hsla(48, 95%, 60%, 0.3);
    --accent-violet: hsl(265, 70%, 68%);
    --accent-violet-glow: hsla(265, 70%, 68%, 0.3);
    --accent-cyan: hsl(190, 80%, 52%);
    --accent-cyan-glow: hsla(190, 80%, 52%, 0.3);

    --success: hsl(145, 72%, 50%);
    --error: hsl(356, 75%, 62%);

    /* Dark-specific internal vars - Modern Soft */
    --sidebar-bg: linear-gradient(180deg, hsl(220, 22%, 12%) 0%, hsl(220, 25%, 8%) 100%);
    --sidebar-border: hsla(356, 70%, 58%, 0.12);
    --card-shadow: 0 12px 32px hsla(0, 0%, 0%, 0.4), inset 0 1px 0 hsla(0, 0%, 100%, 0.08);
    --card-shadow-hover: 0 20px 45px hsla(0, 0%, 0%, 0.55), 0 0 20px hsla(356, 75%, 62%, 0.18), inset 0 1px 0 hsla(0,0%,100%,0.12);
    --navbar-bg: hsla(220, 20%, 8%, 0.9);
    --navbar-border: hsla(356, 70%, 58%, 0.12);
    --body-gradient-1: hsla(356, 75%, 62%, 0.1);
    --body-gradient-2: hsla(48, 95%, 60%, 0.08);
    --body-gradient-3: hsla(190, 80%, 52%, 0.06);
    --table-head-bg: hsla(220, 20%, 15%, 0.88);
    --table-row-hover: hsla(220, 20%, 18%, 0.6);
    --input-bg: hsla(220, 22%, 14%, 0.7);
    --scrollbar-thumb: hsla(356, 75%, 62%, 0.25);
    --theme-icon: '\f186'; /* fa-moon */
}

/* Keyframes for animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 5% 5%, var(--body-gradient-1) 0px, transparent 50%),
        radial-gradient(at 95% 95%, var(--body-gradient-2) 0px, transparent 50%),
        radial-gradient(at 50% 50%, var(--body-gradient-3) 0px, transparent 60%);
    background-attachment: scroll;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 30%),
                radial-gradient(circle at bottom right, rgba(255, 235, 190, 0.08), transparent 28%);
    opacity: 0.8;
    mix-blend-mode: screen;
}

/* Animations are enabled globally to keep all pages lively. */
.app-container,
.auth-container,
.main-content,
.auth-card,
.auth-body,
.auth-left-panel,
.auth-right-panel,
.page-title-area h1,
.top-navbar,
.sidebar-menu > li,
.glass-card,
.live-badge::after,
.hero-badge,
.badge,
.badge-city,
.btn-primary::before,
.menu-item-link,
.menu-item-link:hover i,
.btn-theme-toggle,
.btn,
button[type="submit"],
.btn-action,
.btn-export,
.btn-primary,
.btn-submit-main,
.table-glass tr,
.data-table tbody tr,
.table-glass tbody tr,
#map,
.map-wrapper,
[id*="mapContainer"] {
    transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

/* Subtle page slide/fade for all root containers */
.app-container,
.auth-container {
    animation: gisFadeIn 0.45s ease both;
}

/* Keep live-dot pulse effect */
.live-dot {
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes bgFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-30px, 20px) scale(1.03);
        opacity: 0.85;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
}
.glass-card:hover {
    border-color: var(--glass-border-focus);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.text-gradient-red-yellow {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-yellow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Base Layout */
.app-container {
    position: relative;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    min-width: 0;
}

.app-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 20%),
                      radial-gradient(circle at 80% 25%, rgba(255,235,190,0.05), transparent 18%);
    opacity: 0.7;
}

@keyframes appGlow {
    0%, 100% { transform: translate(0,0) scale(1); opacity: 0.7; }
    50% { transform: translate(-15px, 10px) scale(1.02); opacity: 0.75; }
}

/* Sidebar Backdrop (overlay gelap saat sidebar mobile aktif) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
}

.confirm-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.confirm-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.confirm-modal {
    width: min(460px, 100%);
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: calc(var(--border-radius-lg));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
    padding: 24px;
    animation: gisFadeIn 0.35s ease;
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.confirm-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: hsl(40, 25%, 94%);
}

.confirm-modal-close {
    background: transparent;
    border: none;
    color: hsl(40, 18%, 70%);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 12px;
    transition: background 0.25s ease, color 0.25s ease;
}

.confirm-modal-close:hover {
    background: hsla(0, 0%, 100%, 0.12);
    color: hsl(40, 25%, 94%);
}

.confirm-modal-body p {
    margin: 0;
    color: hsl(40, 20%, 80%);
    line-height: 1.75;
    font-size: 0.95rem;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: hsla(356, 85%, 50%, 0.08);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, var(--accent-red) 0%, hsl(356, 68%, 48%) 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

body.modal-open {
    overflow: hidden;
}

/* -- SIDEBAR -- Theme-aware via CSS Variables -- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 2000;
    transition: var(--transition-smooth);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.07);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent-red), var(--accent-yellow));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px var(--accent-red-glow);
    font-weight: 800; color: white; font-size: 1.3rem;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    line-height: 1;
}

.logo-container:hover .logo-icon {
    transform: rotate(-8deg) scale(1.08);
    box-shadow: 0 6px 24px var(--accent-yellow-glow);
}

.logo-text {
    font-weight: 800; font-size: 1.2rem;
    color: white; letter-spacing: 0.5px;
}

/* Logo image adjustments */
.logo-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255,255,255,0.06);
    object-fit: contain;
    transition: var(--transition-smooth);
}

/* Larger logo on desktop sidebar */
@media (min-width: 1024px) {
    .sidebar .logo-image { 
        width: 70px; 
        height: 70px; 
    }
    .sidebar .logo-text { 
        font-size: 1.25rem; 
    }
}

.sidebar-menu {
    list-style: none;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-section-title {
    font-size: 0.68rem;
    color: hsla(0, 0%, 100%, 0.65);
    padding: 16px 10px 8px 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    list-style: none;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section-title::before {
    content: '';
    width: 3px;
    height: 3px;
    background: hsla(0, 0%, 100%, 0.7);
    border-radius: 50%;
    flex-shrink: 0;
}

.menu-item-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    color: hsla(0, 0%, 100%, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
        transition: background-color 0.2s ease, color 0.2s ease;
    color: hsla(0, 0%, 100%, 0.95);
    opacity: 0.95;
}

.menu-item-link:hover {
    color: white;
    background: hsla(0, 0%, 100%, 0.12);
}

.menu-item-link:hover i {
    color: white;
    opacity: 1;

    background: linear-gradient(135deg, hsla(356, 85%, 50%, 0.22) 0%, hsla(356, 85%, 50%, 0.08) 100%);
    border: 1px solid hsla(356, 85%, 50%, 0.3);
    box-shadow: 0 0 20px hsla(356, 85%, 50%, 0.15), inset 0 1px 0 hsla(0,0%,100%,0.08);
}

.menu-item-link.active i {
    color: white;
    text-shadow: 0 0 8px hsla(356, 85%, 50%, 0.6);
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid hsla(0, 0%, 100%, 0.07);
    background: hsla(0, 0%, 0%, 0.15);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem; color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: white;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.72rem;
    color: var(--accent-yellow);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content Layout */
.main-content {
    position: relative;
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 30px;
    transition: var(--transition-smooth);
    min-width: 0;
}

.main-content::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.06), transparent 18%),
                radial-gradient(circle at 85% 20%, rgba(255, 220, 150, 0.08), transparent 18%),
                radial-gradient(circle at 50% 80%, rgba(255,255,255,0.05), transparent 22%);
    opacity: 1;
}

/* ── TOP NAVBAR ── */
.top-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 14px 20px;
    margin-bottom: 6px;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: var(--transition-smooth);
}

.navbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.navbar-actions > * {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-chip {
    min-height: 42px;
    padding: 8px 12px;
}

.live-badge {
    background: hsla(145, 80%, 45%, 0.12);
    border: 1px solid hsla(145, 80%, 45%, 0.35);
    color: var(--success);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 7px;
}

.live-dot {
    width: 7px; height: 7px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

@keyframes pulse {
    0%   { transform: scale(0.9); opacity: 0.6; }
    50%  { transform: scale(1.25); opacity: 1; box-shadow: 0 0 14px var(--success); }
    100% { transform: scale(0.9); opacity: 0.6; }
}

@keyframes menuGlow {
    0%, 100% { box-shadow: 0 0 12px hsla(356, 85%, 50%, 0.2), inset 0 1px 0 hsla(0,0%,100%,0.08); }
    50% { box-shadow: 0 0 20px hsla(356, 85%, 50%, 0.35), inset 0 1px 0 hsla(0,0%,100%,0.12); }
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.btn-logout:hover {
    background: hsla(356, 85%, 50%, 0.08);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* ── THEME TOGGLE BUTTON ── */
.btn-theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: var(--text-secondary);
        transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    background: hsla(38, 95%, 45%, 0.1);
    transform: rotate(20deg) scale(1.08);
    box-shadow: 0 0 16px var(--accent-yellow-glow);
}

body.dark .btn-theme-toggle:hover {
    border-color: var(--accent-violet);
    color: var(--accent-violet);
    background: hsla(265, 85%, 65%, 0.12);
    box-shadow: 0 0 16px var(--accent-violet-glow);
}

/* Animate icon swap */
.btn-theme-toggle .icon-sun,
.btn-theme-toggle .icon-moon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.btn-theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.btn-theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

body.dark .btn-theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

body.dark .btn-theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Forms Styling */
.form-group {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: gisSlideInFromBottom 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

.form-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.4px;
    transition: color 0.3s ease;
}

.form-input-container {
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.form-input-container i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--glass-border);
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
    letter-spacing: 0.3px;
}

.form-control:hover {
    border-color: hsla(356, 85%, 50%, 0.3);
    background: var(--input-bg);
}

.form-control:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px var(--accent-red-glow), inset 0 0 8px hsla(356, 85%, 50%, 0.08);
    background: var(--input-bg);
    transform: translateY(-2px);
}

.form-control:focus ~ i {
    color: var(--accent-red);
    transform: scale(1.15) rotate(15deg);
}

/* For inputs that have icons inside form-input-container */
.form-input-container:has(i) .form-control {
    padding-left: 48px;
}

/* Loading spinner inside form */
.form-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.form-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent-red-glow);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: gisSpin 0.8s linear infinite;
}

/* Select Control */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 46px;
}

/* Responsive Grid Form Layouts */
.form-grid-2col {
    display: grid;
    grid-template-columns: 1.2fr 1.0fr;
    gap: 30px;
}

.form-coords-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 992px) {
    .form-grid-2col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .form-coords-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.form-error-msg {
    font-size: 0.8rem;
    color: var(--accent-red);
    margin-top: 4px;
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-red) 0%, hsl(356, 68%, 48%) 100%);
    border: none;
    padding: 13px 22px;
    border-radius: 14px;
    color: white;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px var(--accent-red-glow);
    text-transform: uppercase;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px var(--accent-red-glow);
    filter: brightness(1.08);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-red-glow);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-yellow);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.auth-footer a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px var(--accent-yellow-glow);
}

/* Alert Notification Boxes */
.alert-box {
    padding: 14px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: gisSlideInDown 0.5s cubic-bezier(0.16,1,0.3,1) both;
    transition: all 0.4s ease;
}

.alert-box:hover {
    transform: translateX(4px);
}

.alert-box i {
    animation: gisHeartBeat 2s ease-in-out infinite;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(255, 75, 85, 0.15), rgba(255, 75, 85, 0.08));
    border: 1px solid var(--error);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(255, 75, 85, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, rgba(30, 215, 96, 0.15), rgba(30, 215, 96, 0.08));
    border: 1px solid var(--success);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(30, 215, 96, 0.1);
}

/* Dashboard Statistics Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.5), 0 0 20px var(--card-glow, var(--accent-red-glow));
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--card-glow, var(--accent-red-glow));
    filter: blur(40px);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.stat-card:hover::after {
    transform: scale(1.2);
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: var(--card-icon-bg, hsla(354, 90%, 50%, 0.1));
    border: 1px solid var(--card-icon-border, var(--accent-red));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--card-icon-color, var(--accent-red));
    z-index: 2;
    transition: var(--transition-smooth);
    animation: float 4s ease-in-out infinite;
}

.stat-card:hover .stat-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 15px var(--card-icon-border);
}

/* Chart and Dashboard Layouts */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* Beautiful Interactive Tables */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-md);
}

.table-glass {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    text-align: left;
    background: transparent;
}

.table-glass th {
    background: var(--table-head-bg);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--glass-border);
    text-align: center;
}

.table-glass td {
    padding: 16px 20px;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    white-space: normal;
    word-break: break-word;
}

.table-glass tr {
    transition: var(--transition-smooth);
}

.table-glass tr:hover td {
    background: var(--table-row-hover);
}

.badge-city {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-kisaran {
    background: hsla(260, 85%, 60%, 0.15);
    border: 1px solid var(--accent-violet);
    color: hsl(260, 100%, 75%);
}

.badge-tanjungbalai {
    background: hsla(45, 100%, 50%, 0.1);
    border: 1px solid var(--accent-yellow);
    color: var(--accent-yellow);
}

/* Location Photo Thumbnail inside Table */
.store-thumbnail {
    width: 100px;
    height: 70px;
    border-radius: 10px;
    object-fit: cover;
    border: 1.5px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.store-thumbnail:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15), 0 0 10px var(--accent-red-glow);
    border-color: var(--accent-red);
}

.store-name-col {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Action Controls Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-icon-edit {
    color: var(--accent-yellow);
}

.btn-icon-edit:hover {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: var(--bg-primary);
    box-shadow: 0 0 10px var(--accent-yellow-glow);
}

.btn-icon-delete {
    color: var(--accent-red);
}

.btn-icon-delete:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: var(--text-primary);
    box-shadow: 0 0 10px var(--accent-red-glow);
}

/* Search Area & Pagination Row Controllers */
.table-header-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-form {
    position: relative;
    max-width: 350px;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 14px 18px 14px 46px;
    border-radius: var(--border-radius-md);
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    outline: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    transition: var(--transition-smooth);
}

.search-input:focus {
    border-color: var(--accent-red);
    background: var(--input-bg);
    box-shadow: 0 4px 15px var(--accent-red-glow);
    transform: translateY(-1px);
}

.search-form i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.btn-add {
    background: linear-gradient(135deg, var(--accent-violet) 0%, hsl(260, 85%, 50%) 100%);
    border: none;
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--accent-violet-glow);
    transition: var(--transition-smooth);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-violet-glow);
    filter: brightness(1.1);
}

/* Beautiful Premium Pagination Controllers */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

ul.pagination {
    display: flex;
    list-style: none;
    gap: 6px;
}

ul.pagination li a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

ul.pagination li a:hover {
    color: var(--text-primary);
    border-color: var(--accent-red);
}

ul.pagination li.active a {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: var(--text-primary);
    box-shadow: 0 0 10px var(--accent-red-glow);
}

ul.pagination li.disabled a {
    opacity: 0.35;
    pointer-events: none;
}

/* Interactive Map Page Layout */
.map-page-container {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    height: 75vh;
    min-height: 600px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

#leaflet-map {
    width: 100%;
    height: 100%;
    z-index: 10;
}

.map-overlay-controls {
    position: absolute;
    bottom: 28px;
    right: 28px;
    left: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    padding: 14px;
    border-radius: calc(var(--border-radius-md) - 2px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
    width: 240px;
    min-width: 220px;
}

    .map-control-title {
        font-size: 0.85rem;
        font-weight: 700;
        color: var(--text-primary);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        margin-bottom: 6px;
    }

    .btn-map-filter {
        background: var(--surface);
        border: 1px solid rgba(220,38,38,0.12);
        color: var(--text-primary);
        padding: 10px 14px;
        border-radius: 10px;
        cursor: pointer;
        font-size: 0.9rem;
        font-weight: 600;
        text-align: left;
        transition: var(--transition-smooth);
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .btn-map-filter:hover {
        background: var(--accent-red);
        border-color: var(--accent-red);
        color: var(--text-primary);
        box-shadow: 0 4px 12px var(--accent-red-glow);
    }

/* Custom Styled Leaflet Popups */
.leaflet-popup-content-wrapper {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 8px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-tip {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
}

.map-popup-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 280px;
}

.map-popup-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.map-popup-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.map-popup-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.map-popup-detail i {
    color: var(--accent-red);
    margin-top: 2px;
    font-size: 0.95rem;
}

/* Mini Map for Location Form Placement Selection */
.mini-map-container {
    height: 420px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    margin-top: 10px;
    transition: var(--transition-smooth);
}

/* Reports Layout */
.report-action-row {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-report {
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-report-print {
    background: linear-gradient(135deg, hsl(200, 85%, 50%) 0%, hsl(200, 85%, 40%) 100%);
    box-shadow: 0 4px 15px hsla(200, 85%, 50%, 0.3);
}

.btn-report-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(200, 85%, 50%, 0.4);
}

.btn-report-pdf {
    background: linear-gradient(135deg, var(--accent-red) 0%, hsl(354, 85%, 40%) 100%);
    box-shadow: 0 4px 15px var(--accent-red-glow);
}

.btn-report-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-red-glow);
}

.btn-report-excel {
    background: linear-gradient(135deg, hsl(145, 80%, 40%) 0%, hsl(145, 80%, 30%) 100%);
    box-shadow: 0 4px 15px hsla(145, 80%, 40%, 0.3);
}

.btn-report-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px hsla(145, 80%, 40%, 0.4);
}

/* Printing Report Stylesheet */
@media print {
    body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .bg-orbs-container, .sidebar, .top-navbar, .navbar, .report-action-row, .pagination-container, .table-header-control, .app-footer {
        display: none !important;
    }
    
    .app-container, .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    
    .glass-card {
        background: transparent !important;
        border: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        color: black !important;
    }
    
    .table-glass {
        color: black !important;
        border: 1px solid #ddd !important;
        width: 100% !important;
        background: white !important;
    }
    
    .table-glass th {
        background: #f5f5f5 !important;
        color: black !important;
        border: 1px solid #ddd !important;
        border-bottom: 2px solid #ddd !important;
        text-align: center !important;
        font-weight: bold !important;
    }
    
    .table-glass td {
        color: black !important;
        border: 1px solid #ddd !important;
        background: white !important;
    }
    
    .table-glass th:first-child,
    .table-glass td:first-child {
        border-left: 1px solid #ddd !important;
    }
    .table-glass th:last-child,
    .table-glass td:last-child {
        border-right: 1px solid #ddd !important;
    }
    
    /* Text colors for print - specific selectors only */
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
    }
    
    .report-title, .report-subtitle, .print-header, .print-footer {
        color: black !important;
    }
    
    .print-header {
        display: block !important;
        margin-bottom: 25px;
    }
    
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: -15px;
        left: 0;
        right: 0;
        border-top: 1px dashed #666;
        padding-top: 6px;
        background: transparent !important;
    }
    
    .badge-city {
        border: 1px solid #555 !important;
        color: black !important;
        background: transparent !important;
    }
}

/* Better print handling: page breaks, table header repeat, images */
@media print {
    /* Ensure tables paginate correctly */
    table {
        page-break-inside: auto !important;
        border-collapse: collapse !important;
    }
    thead { display: table-header-group !important; }
    tfoot { display: table-footer-group !important; }
    tr { page-break-inside: avoid !important; page-break-after: auto !important; }
    .page-break { page-break-before: always !important; }

    /* Make sure images scale and don't overflow */
    img, svg { max-width: 100% !important; height: auto !important; }

    /* Stop animations and transitions that may hide content */
    * {
        -webkit-animation: none !important;
        animation: none !important;
        transition: none !important;
    }

    /* Ensure main containers expand to page width */
    .app-container, .main-content, .auth-container, .auth-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Explicitly hide decorative backgrounds */
    .bg-orbs-container, .bg-orb, .bg-grid, .hero-image, .hero-buttons { display: none !important; }

    /* Footer/header safe area */
    @page { margin: 10mm 8mm; }
}

/* Non-printing elements of header & footer */
.print-header,
.print-footer {
    display: none;
}

/* Sidebar Toggle and Close Buttons (Desktop Hidden) */
.btn-sidebar-toggle {
    display: none;
}

.btn-sidebar-close {
    display: none;
}

/* Animations for views */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.glass-card {
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Fold 2-column layouts earlier on desktop to prevent horizontal squeezing */
@media (max-width: 1200px) {
    .form-grid-2col {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Responsive Styles for Mobile and Tablet (<= 1024px) */
@media (max-width: 1024px) {
    .btn-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        cursor: pointer;
        font-size: 1.15rem;
        transition: var(--transition-smooth);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }
    
    .btn-sidebar-toggle:hover {
        background: var(--bg-secondary);
        border-color: var(--accent-red);
    }

    .btn-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: hsla(0, 0%, 100%, 0.08);
        border: 1px solid hsla(0, 0%, 100%, 0.12);
        color: hsla(0, 0%, 100%, 0.7);
        cursor: pointer;
        font-size: 1rem;
        transition: var(--transition-smooth);
    }
    
    .btn-sidebar-close:hover {
        background: hsla(356, 85%, 50%, 0.2);
        color: var(--accent-red);
        border-color: hsla(356, 85%, 50%, 0.4);
    }

    /* Sidebar Drawer Slide-in Effect */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Main content expands to full-screen */
    .main-content {
        margin-left: 0 !important;
        padding: 20px;
        gap: 20px;
    }
    
    .glass-card {
        padding: 20px;
    }

    .page-title-area h1 {
        font-size: 1.45rem;
    }

    /* Grid elements wrap vertically */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }

    .table-header-control {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .search-form {
        max-width: 100%;
    }

    .btn-add {
        justify-content: center;
    }

    /* Leaflet popup customization on mobile/tablet */
    .map-overlay-controls {
        width: auto;
        left: 20px;
        right: 20px;
        top: auto;
        bottom: 20px;
        flex-direction: row;
        justify-content: space-around;
        padding: 10px;
    }

    .map-control-title {
        display: none;
    }

    .btn-map-filter {
        padding: 8px 10px;
        font-size: 0.78rem;
    }
}

/* Breakpoint for wrapping Navbar items and stacking controls vertically */
@media (max-width: 768px) {
    .top-navbar {
        height: auto;
        padding: 10px 14px;
        border-bottom: 1px solid var(--glass-border);
    }

    .page-title-area {
        width: auto;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .navbar-actions {
        width: auto;
        justify-content: flex-end;
    }
}

/* Small mobile devices viewport sizing */
@media (max-width: 576px) {
    .main-content {
        padding: 12px;
        gap: 16px;
    }
    
    .glass-card {
        padding: 14px;
        border-radius: var(--border-radius-md);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .map-page-container {
        height: 65vh;
        min-height: 450px;
    }
    
    .mini-map-container {
        height: 320px;
    }
    
    .map-overlay-controls {
        flex-direction: column !important;
        width: calc(100% - 32px) !important;
        left: 16px !important;
        right: 16px !important;
        bottom: 16px !important;
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .btn-map-filter {
        justify-content: center;
        width: 100%;
        padding: 10px;
    }
}


/* ============================================================
 *  RESPONSIVE UTILITY CLASSES & ENHANCEMENTS
 *  Menambah dukungan penuh untuk mobile, tablet, dan desktop kecil
 * ============================================================ */

/* Page Header Row — digunakan di halaman form (create / edit) */
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-header-row h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Page title truncation di navbar */
.page-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.page-title-area h1 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tabel: scroll hint gradient di sisi kanan */
.table-responsive {
    position: relative;
}

.table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, transparent, hsla(222, 30%, 7%, 0.8));
    pointer-events: none;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Tampilkan scroll hint hanya jika konten melebihi lebar container */
.table-responsive.is-overflowing::after {
    opacity: 1;
}

/* ============================================================
 *  BREAKPOINT ≤ 768px — Tablet & Mobile Landscape
 * ============================================================ */
@media (max-width: 768px) {

    /* Tombol laporan: baris menjadi 2 kolom */
    .report-action-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .btn-report {
        justify-content: center;
        text-align: center;
        width: 100%;
    }

    /* Page header row wraps dengan baik di tablet */
    .page-header-row {
        gap: 12px;
    }

    /* Pagination — stack info dan tombol */
    .pagination-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Stat cards — lebih kecil di tablet */
    .stat-value {
        font-size: 1.75rem;
    }
}

/* ============================================================
 *  BREAKPOINT ≤ 640px — Mobile (umum)
 * ============================================================ */
@media (max-width: 640px) {

    /* Tombol laporan: full-width, satu kolom */
    .report-action-row {
        grid-template-columns: 1fr;
    }

    .btn-report {
        padding: 14px 20px;
        font-size: 0.92rem;
    }

    /* Page header wrap: judul di atas, tombol di bawah */
    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-header-row h2 {
        white-space: normal;
        font-size: 1.1rem;
    }

    .page-header-row .btn-logout {
        align-self: flex-start;
    }
}

/* ============================================================
 *  BREAKPOINT ≤ 576px — Mobile Portrait (sempit)
 * ============================================================ */
@media (max-width: 576px) {

    /* Stat value: angka besar lebih proporsional */
    .stat-value {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.78rem;
    }

    /* Pagination: tengah & stack */
    .pagination-container {
        align-items: center;
    }

    ul.pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    ul.pagination li a {
        padding: 7px 10px;
        font-size: 0.8rem;
    }

    /* Mini map lebih pendek di mobile */
    .mini-map-container {
        height: 300px;
    }

    /* Form input: touch target minimum 48px */
    .form-control {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 48px;
    }

    .form-input-container:has(i) .form-control {
        padding-left: 44px;
    }

    /* Select touch */
    select.form-control {
        min-height: 48px;
    }

    /* Textarea */
    textarea.form-control {
        min-height: 100px;
    }

    /* Tombol submit full width */
    .btn-primary {
        padding: 16px 20px;
        font-size: 1rem;
    }

    /* Koordinat grid: 1 kolom di mobile */
    .form-coords-grid {
        grid-template-columns: 1fr;
    }


    /* Action buttons di tabel lebih compact */
    .btn-icon {
        width: 34px;
        height: 34px;
        font-size: 0.88rem;
    }

    /* Store thumbnail sedikit lebih kecil */
    .store-thumbnail {
        width: 70px;
        height: 50px;
    }

    /* Stat icon sedikit lebih kecil */
    .stat-icon-wrapper {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }

    /* Glass card padding minimal */
    .glass-card {
        padding: 14px;
    }
}

/* ============================================================
 *  BREAKPOINT ≤ 400px — Layar sangat sempit
 * ============================================================ */
@media (max-width: 400px) {

    .stat-value {
        font-size: 1.4rem;
    }

    .stats-grid {
        gap: 10px;
    }

    .page-title-area h1 {
        font-size: 1.1rem;
    }

    .btn-report {
        font-size: 0.88rem;
        padding: 12px 14px;
    }
}

/* ============================================================
 *  COLUMN VISIBILITY UTILITIES
 *  Sembunyikan kolom tidak penting di layar kecil
 * ============================================================ */

/* Sembunyikan kolom ini di tablet (≤ 900px) */
@media (max-width: 900px) {
    .col-hide-tablet {
        display: none !important;
    }
}

/* Sembunyikan kolom ini di mobile (≤ 640px) */
@media (max-width: 640px) {
    .col-hide-mobile {
        display: none !important;
    }
    /* Kurangi min-width tabel agar pas tanpa kolom tersembunyi */
    .table-glass {
        min-width: 320px;
        table-layout: fixed;
    }

    .table-glass th,
    .table-glass td {
        padding: 10px 10px;
        font-size: 0.87rem;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: anywhere !important;
    }

    .store-name-col {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }

    .store-name-col span {
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .store-thumbnail {
        width: 60px;
        height: 50px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================================
 *  SIDEBAR BACKDROP — Aktifkan di mobile
 * ============================================================ */
@media (max-width: 1024px) {
    .sidebar-backdrop {
        display: block; /* Aktif, tapi opacity:0 sampai .active */
    }
}


/* ============================================================
 *  ROLE-BASED UI STYLES - Admin vs User
 * ============================================================ */
.role-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px; font-size: 0.68rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px;
}
.role-badge-admin {
    background: linear-gradient(135deg, hsla(356, 85%, 50%, 0.15), hsla(40, 95%, 50%, 0.08));
    border: 1px solid hsla(356, 85%, 50%, 0.4); color: var(--accent-red);
}
.role-badge-user {
    background: hsla(185, 75%, 42%, 0.12);
    border: 1px solid hsla(185, 75%, 42%, 0.4); color: var(--accent-cyan);
}
.sidebar-admin-label {
    font-size: 0.68rem; color: hsla(356, 85%, 50%, 0.75);
    padding: 14px 16px 4px 16px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; list-style: none; display: flex; align-items: center; gap: 7px;
}
.sidebar-admin-label::before {
    content: ''; display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: var(--accent-red);
    box-shadow: 0 0 6px var(--accent-red-glow); flex-shrink: 0;
}
.role-chip {
    display: flex; align-items: center; gap: 6px; padding: 5px 12px;
    border-radius: 20px; font-size: 0.78rem; font-weight: 600; border: 1px solid; white-space: nowrap;
}
.role-chip-admin { background: hsla(356, 85%, 50%, 0.1); border-color: hsla(356, 85%, 50%, 0.3); color: var(--accent-red); }
.role-chip-user  { background: hsla(185, 75%, 42%, 0.1); border-color: hsla(185, 75%, 42%, 0.3); color: var(--accent-cyan); }
.role-chip-guest { background: hsla(218, 100%, 40%, 0.16); border-color: hsla(218, 100%, 40%, 0.28); color: var(--accent-violet); }
.role-chip i { font-size: 0.8rem; }
.user-info-banner {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: hsla(185, 75%, 42%, 0.07); border: 1px solid hsla(185, 75%, 42%, 0.22);
    border-left: 4px solid var(--accent-cyan); border-radius: var(--border-radius-md);
    margin-bottom: 20px; font-size: 0.88rem; color: var(--text-secondary);
}
.user-info-banner i { color: var(--accent-cyan); font-size: 1.1rem; flex-shrink: 0; }
.admin-quick-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.user-welcome-note {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
    background: hsla(185, 75%, 42%, 0.07); border: 1px solid hsla(185, 75%, 42%, 0.18);
    border-radius: var(--border-radius-md); font-size: 0.88rem; color: var(--text-secondary); line-height: 1.55;
}
.user-welcome-note i { color: var(--accent-cyan); margin-top: 2px; flex-shrink: 0; }
@media (max-width: 480px) {
    .role-chip span { display: none; }
    .role-chip { padding: 5px 8px; }
}

/* ============================================================
 *  VISUAL POLISH � Extra premium touches
 * ============================================================ */

/* Shimmer sweep on stat cards hover */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, hsla(0,0%,100%,0.12) 50%, transparent 100%);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 3;
}
.stat-card:hover::before { left: 160%; }

/* Stat value � bolder and larger */
.stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
}

/* Glass card � stronger shadow + border glow on hover */
.glass-card {
    transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}
.glass-card:hover {
    border-color: hsla(210, 30%, 70%, 0.6);
    box-shadow: 0 20px 50px rgba(140, 160, 200, 0.28), 0 0 0 1px hsla(0,0%,100%,0.5);
}

/* Page header area � add subtle underline bar */
.page-title-area {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Dashboard layout spacing */
.dashboard-layout {
    align-items: start;
}

/* Sidebar  smooth scrollbar for overflow */
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu::-webkit-scrollbar-thumb {
    background: hsla(0,0%,100%,0.15);
    border-radius: 4px;
}

/* ============================================================
 *  MOTION & ANIMATION SYSTEM — Alfamart GIS
 *  Comprehensive keyframes + utility classes for the full app
 * ============================================================ */

/* ── Core Keyframes ── */

@keyframes gisSlideInLeft {
    from { opacity: 0; transform: translateX(-32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes gisSlideInRight {
    from { opacity: 0; transform: translateX(32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes gisSlideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes gisSlideInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes gisFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes gisScaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes gisPopIn {
    0%   { opacity: 0; transform: scale(0.8); }
    70%  { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes gisSlideInFromBottom {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes gisHeartBeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

@keyframes gisLoadingPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes gisGlowFade {
    0% { opacity: 1; box-shadow: 0 0 20px var(--accent-red-glow); }
    50% { opacity: 0.6; box-shadow: 0 0 40px var(--accent-red-glow), 0 0 60px var(--accent-red-glow); }
    100% { opacity: 1; box-shadow: 0 0 20px var(--accent-red-glow); }
}

@keyframes gisCheckMark {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ── Continuous Motion Keyframes ── */

@keyframes gisFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-7px); }
}
@keyframes gisBreathe {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}
@keyframes gisSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes gisSpinReverse {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}
@keyframes gisPingRing {
    0%   { transform: scale(1);   opacity: 0.7; }
    100% { transform: scale(2.5); opacity: 0; }
}
@keyframes gisDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.35; transform: scale(0.7); }
}
@keyframes gisShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
@keyframes gisGlowPulse {
    0%, 100% { box-shadow: 0 0 12px var(--accent-red-glow); }
    50%       { box-shadow: 0 0 28px var(--accent-red-glow), 0 0 50px var(--accent-red-glow); }
}
@keyframes gisCyanGlowPulse {
    0%, 100% { box-shadow: 0 0 10px var(--accent-cyan-glow); }
    50%       { box-shadow: 0 0 24px var(--accent-cyan-glow), 0 0 48px var(--accent-cyan-glow); }
}
@keyframes gisBounceX {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-4px); }
    75%       { transform: translateX(4px); }
}
@keyframes gisWiggle {
    0%, 100% { transform: rotate(0deg); }
    25%       { transform: rotate(-8deg); }
    75%       { transform: rotate(8deg); }
}
@keyframes gisCountUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes gisProgressFill {
    from { width: 0%; }
    to   { width: var(--target-width, 100%); }
}
@keyframes gisRipple {
    0%   { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}
@keyframes gisBarLoad {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@keyframes gisToastSlide {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes gisToastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(120%); }
}
@keyframes gisSkeleton {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}
@keyframes gisMapPing {
    0%   { transform: translate(-50%,-50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%,-50%) scale(2.8); opacity: 0; }
}
@keyframes gisTypewriter {
    from { width: 0; }
    to   { width: 100%; }
}
@keyframes gisBlink {
    50% { border-color: transparent; }
}


/* ── Utility Animation Classes ── */

.anim-fade-in      { animation: gisFadeIn     0.5s ease both; }
.anim-slide-up     { animation: gisSlideInUp  0.55s cubic-bezier(0.16,1,0.3,1) both; }
.anim-slide-down   { animation: gisSlideInDown 0.5s cubic-bezier(0.16,1,0.3,1) both; }
.anim-slide-left   { animation: gisSlideInLeft 0.55s cubic-bezier(0.16,1,0.3,1) both; }
.anim-slide-right  { animation: gisSlideInRight 0.55s cubic-bezier(0.16,1,0.3,1) both; }
.anim-scale-in     { animation: gisScaleIn    0.5s cubic-bezier(0.16,1,0.3,1) both; }
.anim-pop-in       { animation: gisPopIn      0.5s cubic-bezier(0.16,1,0.3,1) both; }
.anim-float        { animation: gisFloat      3.5s ease-in-out infinite; }
.anim-breathe      { animation: gisBreathe    4s ease-in-out infinite; }
.anim-spin         { animation: gisSpin       1.2s linear infinite; }
.anim-spin-slow    { animation: gisSpin       4s linear infinite; }
.anim-wiggle       { animation: gisWiggle     0.5s ease; }

/* Enhanced hover animations for cards and buttons */
.glass-card {
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), 
                box-shadow 0.4s ease, 
                border-color 0.4s ease;
    position: relative;
}

.glass-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.35),
                0 0 32px rgba(220, 38, 38, 0.15);
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, hsla(356, 85%, 50%, 0.1), transparent 60%);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glass-card:hover::before {
    opacity: 1;
}

.stat-card {
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.4);
}

/* Button animations */
.btn, button, .btn-primary, .btn-secondary, .btn-add, .btn-action {
    transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
    position: relative;
}

.btn:hover, button:hover, .btn-primary:hover, .btn-secondary:hover, .btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.btn:active, button:active {
    transform: translateY(0) scale(0.96);
}

.btn-logout:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.2);
}

/* Table row animations */
.data-table tbody tr, .table-glass tbody tr {
    transition: background 0.35s ease,
                transform 0.35s ease,
                box-shadow 0.35s ease;
    position: relative;
}

.data-table tbody tr:hover, .table-glass tbody tr:hover {
    transform: translateX(6px) scale(1.01);
    background: hsla(40, 25%, 94%, 0.04);
    box-shadow: inset 4px 0 0 var(--accent-red);
}

/* Icon pulse on hover */
.btn i, .menu-item-link i, .stat-icon-wrapper i {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}

.btn:hover i, .menu-item-link:hover i, .stat-icon-wrapper:hover i {
    animation: gisPopIn 0.4s ease;
}

/* Smooth input focus animations */
input, textarea, select {
    transition: border-color 0.3s ease,
                box-shadow 0.3s ease,
                background 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px hsla(356, 85%, 50%, 0.15),
                inset 0 0 8px hsla(356, 85%, 50%, 0.08);
}

/* Badge continuous animation */
.badge, .badge-city, .live-badge {
    animation: gisBreathe 3s ease-in-out infinite;
}

/* Modal backdrop fade */
.confirm-modal-backdrop {
    animation: gisFadeIn 0.3s ease;
}

.confirm-modal {
    animation: gisPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Continuous subtle glow on glass elements */
.glass-card, .auth-container {
    animation: contentPulse 20s ease-in-out infinite;
}

/* Image hover zoom */
img {
    transition: transform 0.4s ease;
}

.glass-card img:hover {
    transform: scale(1.05);
}

/* Link underline animation */
a {
    transition: color 0.3s ease;
}

.menu-item-link {
    position: relative;
}

.menu-item-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}

.menu-item-link:hover::after {
    width: 100%;
}

/* Smooth page transitions */
.main-content {
    animation: gisFadeIn 0.4s ease;
}

/* Stagger delays */
.delay-1  { animation-delay: 0.05s; }
.delay-2  { animation-delay: 0.10s; }
.delay-3  { animation-delay: 0.15s; }
.delay-4  { animation-delay: 0.20s; }
.delay-5  { animation-delay: 0.25s; }
.delay-6  { animation-delay: 0.30s; }
.delay-7  { animation-delay: 0.35s; }
.delay-8  { animation-delay: 0.40s; }


/* ── Page Entry Animations ── */

/* Main content wrapper fades in on page load */
.main-content {
    animation: gisFadeIn 0.4s ease both;
    transition: background 0.35s var(--transition-smooth), color 0.35s var(--transition-smooth);
}

/* Navbar enters from top */
.top-navbar {
    animation: gisSlideInDown 0.55s cubic-bezier(0.16,1,0.3,1) both;
    transition: background 0.35s var(--transition-smooth), border-color 0.35s var(--transition-smooth);
}

/* Smooth motion for common cards and panels */
.glass-card,
.card-panel,
.panel-card,
.section-card,
.map-panel,
.map-card,
.widget-card,
.review-card {
    transition: transform 0.35s var(--transition-smooth), box-shadow 0.35s var(--transition-smooth), border-color 0.35s var(--transition-smooth), background 0.35s var(--transition-smooth);
    will-change: transform, box-shadow;
}

.glass-card:hover,
.card-panel:hover,
.panel-card:hover,
.section-card:hover,
.map-panel:hover,
.map-card:hover,
.widget-card:hover,
.review-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.dashboard-layout > *,
.stats-grid > *,
.table-responsive > *,
.panel-grid > * {
    opacity: 0;
    animation: gisSlideInUp 0.48s cubic-bezier(0.16,1,0.3,1) both;
}

.dashboard-layout > *:nth-child(1),
.stats-grid > *:nth-child(1),
.panel-grid > *:nth-child(1) { animation-delay: 0.05s; }
.dashboard-layout > *:nth-child(2),
.stats-grid > *:nth-child(2),
.panel-grid > *:nth-child(2) { animation-delay: 0.10s; }
.dashboard-layout > *:nth-child(3),
.stats-grid > *:nth-child(3),
.panel-grid > *:nth-child(3) { animation-delay: 0.15s; }
.dashboard-layout > *:nth-child(4),
.stats-grid > *:nth-child(4),
.panel-grid > *:nth-child(4) { animation-delay: 0.18s; }
.dashboard-layout > *:nth-child(5),
.stats-grid > *:nth-child(5),
.panel-grid > *:nth-child(5) { animation-delay: 0.22s; }

.table-glass tr {
    transition: transform 0.35s var(--transition-smooth), background 0.35s var(--transition-smooth);
}

.table-glass tr:hover {
    transform: translateX(2px);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-report,
.btn-map-filter,
.btn-add,
.btn-icon {
    transition: transform 0.25s var(--transition-smooth), box-shadow 0.25s var(--transition-smooth), background 0.25s var(--transition-smooth), color 0.25s var(--transition-smooth);
}

.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-report:hover,
.btn-map-filter:hover,
.btn-add:hover,
.btn-icon:hover {
    transform: translateY(-1px);
}

/* subtle floating accent for active highlights */
.highlight,
.hero-badge,
.badge-city,
.badge {
    animation: gisBreathe 6s ease-in-out infinite;
}


/* Sidebar menu items stagger in */
.sidebar-menu > li:nth-child(1)  { animation: gisSlideInLeft 0.45s 0.05s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(2)  { animation: gisSlideInLeft 0.45s 0.10s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(3)  { animation: gisSlideInLeft 0.45s 0.15s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(4)  { animation: gisSlideInLeft 0.45s 0.20s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(5)  { animation: gisSlideInLeft 0.45s 0.25s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(6)  { animation: gisSlideInLeft 0.45s 0.30s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(7)  { animation: gisSlideInLeft 0.45s 0.35s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(8)  { animation: gisSlideInLeft 0.45s 0.40s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(9)  { animation: gisSlideInLeft 0.45s 0.45s cubic-bezier(0.16,1,0.3,1) both; }
.sidebar-menu > li:nth-child(10) { animation: gisSlideInLeft 0.45s 0.50s cubic-bezier(0.16,1,0.3,1) both; }


/* ── Stat Cards ── */

/* Stagger stat cards */
.stats-grid > *:nth-child(1) { animation: gisSlideInUp 0.55s 0.05s cubic-bezier(0.16,1,0.3,1) both; }
.stats-grid > *:nth-child(2) { animation: gisSlideInUp 0.55s 0.12s cubic-bezier(0.16,1,0.3,1) both; }
.stats-grid > *:nth-child(3) { animation: gisSlideInUp 0.55s 0.19s cubic-bezier(0.16,1,0.3,1) both; }
.stats-grid > *:nth-child(4) { animation: gisSlideInUp 0.55s 0.26s cubic-bezier(0.16,1,0.3,1) both; }

/* Stat card icon hover float */
.stat-card:hover .stat-icon-wrapper {
    animation: gisFloat 2s ease-in-out infinite;
}

/* Stat value counts up on load */
.stat-value {
    animation: gisCountUp 0.7s 0.3s cubic-bezier(0.16,1,0.3,1) both;
}

/* Shimmer sweep on hover */
.stat-card {
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; bottom: 0;
    width: 60%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        hsla(0,0%,100%,0.08) 50%,
        transparent 100%
    );
    transition: left 0s;
    pointer-events: none;
}
.stat-card:hover::after {
    left: 150%;
    transition: left 0.65s ease;
}


/* ── Glass Card ── */

.glass-card {
    animation: gisSlideInUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

/* Ripple effect on glass-card click */
.glass-card {
    position: relative;
    overflow: hidden;
}
.glass-card .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: hsla(356, 85%, 50%, 0.12);
    width: 10px; height: 10px;
    margin-top: -5px; margin-left: -5px;
    animation: gisRipple 0.7s ease-out forwards;
    pointer-events: none;
}


/* ── Table ── */

/* Table rows stagger in */
.data-table tbody tr, .table-glass tbody tr {
    animation: gisSlideInLeft 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.data-table tbody tr:nth-child(1), .table-glass tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.data-table tbody tr:nth-child(2), .table-glass tbody tr:nth-child(2)  { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(3), .table-glass tbody tr:nth-child(3)  { animation-delay: 0.08s; }
.data-table tbody tr:nth-child(4), .table-glass tbody tr:nth-child(4)  { animation-delay: 0.11s; }
.data-table tbody tr:nth-child(5), .table-glass tbody tr:nth-child(5)  { animation-delay: 0.14s; }
.data-table tbody tr:nth-child(6), .table-glass tbody tr:nth-child(6)  { animation-delay: 0.17s; }
.data-table tbody tr:nth-child(7), .table-glass tbody tr:nth-child(7)  { animation-delay: 0.20s; }
.data-table tbody tr:nth-child(8), .table-glass tbody tr:nth-child(8)  { animation-delay: 0.23s; }
.data-table tbody tr:nth-child(9), .table-glass tbody tr:nth-child(9)  { animation-delay: 0.26s; }
.data-table tbody tr:nth-child(10), .table-glass tbody tr:nth-child(10) { animation-delay: 0.29s; }

.data-table tbody tr, .table-glass tbody tr {
    transition: background 0.25s ease, transform 0.25s ease;
}
.data-table tbody tr:hover, .table-glass tbody tr:hover {
    transform: translateX(3px);
}

/* Table header slides in from top */
.data-table thead tr, .table-glass thead tr {
    animation: gisSlideInDown 0.45s cubic-bezier(0.16,1,0.3,1) both;
}


/* ── Buttons ── */

/* All buttons: lift + subtle glow on hover */
.btn, button[type="submit"], .btn-action, .btn-export {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease !important;
}
.btn:hover, button[type="submit"]:hover {
    transform: translateY(-2px);
}
.btn:active, button[type="submit"]:active {
    transform: translateY(0) scale(0.98);
}

/* Ripple on button click */
.btn .btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: hsla(0,0%,100%,0.25);
    width: 8px; height: 8px;
    margin-top: -4px; margin-left: -4px;
    animation: gisRipple 0.6s ease-out forwards;
    pointer-events: none;
}

/* Shimmer on primary button */
.btn-primary, .btn-submit-main {
    position: relative;
    overflow: hidden;
}
.btn-primary::before, .btn-submit-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        hsla(0,0%,100%,0.15) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.btn-primary:hover::before, .btn-submit-main:hover::before {
    transform: translateX(100%);
}


/* ── Sidebar Hover Enhancements ── */

.menu-item-link {
    position: relative;
}
.menu-item-link::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent-red);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.menu-item-link:hover::before {
    transform: scaleY(1);
}
.menu-item-link.active::before {
    transform: scaleY(1);
    box-shadow: 0 0 10px var(--accent-red);
}

/* Icon bounce on menu hover */
.menu-item-link:hover i {
    animation: gisWiggle 0.4s ease;
}

/* Logo icon breathes */
.logo-icon {
    animation: gisBreathe 4s ease-in-out infinite;
}

/* Sidebar footer user badge entrance */
.sidebar-footer {
    animation: gisSlideInUp 0.5s 0.4s cubic-bezier(0.16,1,0.3,1) both;
}


/* ── Navbar Enhancements ── */

/* Page title slides in */
.page-title-area h1 {
    animation: gisSlideInLeft 0.5s 0.1s cubic-bezier(0.16,1,0.3,1) both;
}

/* Live badge pulse ring */
.live-badge {
    position: relative;
}
.live-badge::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 1px solid hsla(145, 80%, 45%, 0.4);
    animation: gisPingRing 2s ease-out infinite;
    pointer-events: none;
}

/* Navbar actions slide in from right */
.navbar-actions {
    animation: gisSlideInRight 0.5s 0.15s cubic-bezier(0.16,1,0.3,1) both;
}

/* Logout button: smooth icon rotation on hover */
.btn-logout:hover i {
    animation: gisWiggle 0.4s ease;
}


/* ── Map Section ── */

/* Map container entrance */
#map, .map-wrapper, [id*="mapContainer"] {
    animation: gisScaleIn 0.7s cubic-bezier(0.16,1,0.3,1) both;
}

/* Floating map pin pulse */
.map-pin-live {
    position: relative;
}
.map-pin-live::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--accent-red);
    animation: gisMapPing 1.8s ease-out infinite;
    pointer-events: none;
}


/* ── Dashboard Specific ── */

/* Welcome/hero section */
.dashboard-hero, .welcome-section {
    animation: gisSlideInUp 0.6s cubic-bezier(0.16,1,0.3,1) both;
}

/* Quick action buttons pop in */
.quick-action-btn, .admin-quick-actions > * {
    animation: gisPopIn 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
.admin-quick-actions > *:nth-child(1) { animation-delay: 0.05s; }
.admin-quick-actions > *:nth-child(2) { animation-delay: 0.10s; }
.admin-quick-actions > *:nth-child(3) { animation-delay: 0.15s; }
.admin-quick-actions > *:nth-child(4) { animation-delay: 0.20s; }


/* ── Skeleton Loading ── */

.skeleton {
    background: linear-gradient(
        90deg,
        hsla(210, 15%, 88%, 0.6) 0%,
        hsla(210, 15%, 94%, 0.9) 50%,
        hsla(210, 15%, 88%, 0.6) 100%
    );
    background-size: 600px 100%;
    animation: gisSkeleton 1.4s ease-in-out infinite;
    border-radius: 8px;
}
.skeleton-text  { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-title { height: 24px; margin-bottom: 12px; border-radius: 6px; }
.skeleton-card  { height: 120px; border-radius: 14px; }


/* ── Toast / Notification System ── */

.toast-container {
    position: fixed;
    top: 24px; right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    min-width: 280px;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 14px;
    background: hsla(0,0%,100%,0.92);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    pointer-events: all;
    animation: gisToastSlide 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
.toast.toast-out {
    animation: gisToastOut 0.4s ease forwards;
}
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error   { border-left: 4px solid var(--accent-red); }
.toast-error   .toast-icon { color: var(--accent-red); }
.toast-info    { border-left: 4px solid var(--accent-cyan); }
.toast-info    .toast-icon { color: var(--accent-cyan); }
.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    transition: color 0.2s;
}
.toast-close:hover { color: var(--text-primary); }


/* ── Floating Action Button (FAB) ── */

.fab {
    position: fixed;
    bottom: 32px; right: 32px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-red), hsl(354, 85%, 42%));
    color: white;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 6px 28px hsla(356, 85%, 50%, 0.45);
    transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
    z-index: 500;
    animation: gisPopIn 0.6s 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
.fab:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 12px 40px hsla(356, 85%, 50%, 0.6);
}
.fab:active {
    transform: scale(0.95);
}
.fab::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid hsla(356, 85%, 50%, 0.35);
    animation: gisPingRing 2.5s ease-out infinite;
}


/* ── Progress / Loading Bar ── */

.page-loading-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-yellow));
    transform-origin: left center;
    animation: gisBarLoad 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
    z-index: 9999;
    box-shadow: 0 0 10px var(--accent-red-glow);
}


/* ── Form Input Animations ── */

/* Float label effect */
.input-wrap input:focus ~ .f-label,
.input-wrap input:not(:placeholder-shown) ~ .f-label {
    transform: translateY(-22px) scale(0.82);
    color: var(--accent-red);
}
.f-label {
    position: absolute;
    left: 44px; top: 14px;
    font-size: 0.92rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
    transform-origin: left center;
}

/* Input shake on validation error */
.input-error {
    animation: gisBounceX 0.4s ease;
    border-color: var(--error) !important;
}

/* Focus ring glow */
.form-control:focus, .field-input:focus {
    /* keep interactive focus without disabling animation globally */
}


/* ── Badge / Chip Animations ── */

.badge, .role-badge, .status-badge {
    animation: gisPopIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}


/* ── Alert Animations ── */

.alert, .alert-new {
    animation: gisSlideInDown 0.45s cubic-bezier(0.16,1,0.3,1) both;
}




/* ── Leaflet Map Marker Override ── */

/* Pulsing ring behind custom markers */
.leaflet-marker-icon {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1) !important;
}
.leaflet-marker-icon:hover {
    transform: scale(1.2) !important;
    filter: drop-shadow(0 4px 12px hsla(356,85%,50%,0.6)) !important;
}


/* ── Scroll-triggered Fade (via JS intersection) ── */

.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.scroll-reveal.delay-1 { transition-delay: 0.05s; }
.scroll-reveal.delay-2 { transition-delay: 0.12s; }
.scroll-reveal.delay-3 { transition-delay: 0.19s; }
.scroll-reveal.delay-4 { transition-delay: 0.26s; }


/* ── Stat Card Glow Colors ── */

.stat-card:hover .stat-icon-wrapper[class*="red"],
.stat-card:hover .stat-icon-wrapper.icon-red {
    animation: gisGlowPulse 1.5s ease-in-out infinite;
}
.stat-card:hover .stat-icon-wrapper[class*="cyan"],
.stat-card:hover .stat-icon-wrapper.icon-cyan {
    animation: gisCyanGlowPulse 1.5s ease-in-out infinite;
}


/* ── Sidebar Logo Entrance ── */

.sidebar-header {
    animation: gisSlideInDown 0.5s cubic-bezier(0.16,1,0.3,1) both;
}


/* ── Unified Cheerful Animated Orbs ── */
.bg-orbs-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    transition: background-color 0.4s ease, opacity 0.4s ease;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}
.bg-orb-1 {
    width: 500px; height: 500px;
    background: hsla(356, 85%, 52%, 0.1);
    top: -120px; left: -100px;
    animation: orbFloatA 15s ease-in-out infinite;
}
.bg-orb-2 {
    width: 400px; height: 400px;
    background: hsla(45, 100%, 50%, 0.08);
    bottom: -100px; right: -80px;
    animation: orbFloatB 18s ease-in-out infinite;
}
.bg-orb-3 {
    width: 300px; height: 300px;
    background: hsla(185, 80%, 50%, 0.06);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloatC 12s ease-in-out infinite;
}
body.dark .bg-orb-1 { background: hsla(356, 95%, 60%, 0.16); }
body.dark .bg-orb-2 { background: hsla(45, 100%, 55%, 0.12); }
body.dark .bg-orb-3 { background: hsla(180, 85%, 50%, 0.1); }
 
@keyframes orbFloatA {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
}
@keyframes orbFloatB {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -60px) scale(1.08); }
}
@keyframes orbFloatC {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-30px, -20px) scale(1.15); }
}
 
/* Grid overlay */
.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(var(--glass-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.22;
    /* Dinonaktifkan untuk menghemat CPU/GPU paint cost saat scroll */
    /* animation: gridSweep 18s linear infinite; */
}

@keyframes gridSweep {
    0% { background-position: 0 0, 0 0; }
    50% { background-position: 40px 40px, -40px -40px; }
    100% { background-position: 0 0, 0 0; }
}

/* ── Modern Trendy Auth Pages with Soft Aesthetics ── */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 5% 5%, var(--body-gradient-1) 0px, transparent 50%),
        radial-gradient(at 95% 95%, var(--body-gradient-2) 0px, transparent 50%),
        radial-gradient(at 50% 50%, var(--body-gradient-3) 0px, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

.auth-body::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.16), transparent 24%),
                radial-gradient(circle at 80% 80%, rgba(255, 220, 150, 0.12), transparent 28%);
    opacity: 1;
    animation: authGlow 22s ease-in-out infinite;
}

.auth-left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 15% 20%, rgba(255,255,255,0.14), transparent 22%),
                radial-gradient(circle at 80% 25%, rgba(255,255,255,0.08), transparent 18%);
    opacity: 0.9;
    filter: blur(28px);
    animation: authWave 30s ease-in-out infinite;
}

.auth-left-panel::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    top: 15%;
    right: -40px;
    z-index: 0;
    pointer-events: none;
    box-shadow: 0 0 80px rgba(255,255,255,0.12);
    animation: authOrb 20s ease-in-out infinite;
}

@keyframes authGlow {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
    50% { transform: translate(10px, 10px) scale(1.02); opacity: 0.94; }
}

@keyframes authWave {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-18px, 12px) scale(1.01); }
}

@keyframes authOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-28px, 28px) scale(1.05); }
}
.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: grid;
    grid-template-columns: minmax(340px, 1fr) 480px;
    animation: cardEntrance 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: var(--transition-smooth);
}
.auth-card:hover {
    border-color: var(--glass-border-focus);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}
.auth-card.single-panel {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
}
.auth-card.single-panel .auth-right-panel {
    padding: 48px 40px;
    max-width: none;
    margin: 0 auto;
}
.auth-form-inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}
@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(35px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-left-panel {
    background: linear-gradient(135deg, hsl(356, 70%, 58%) 0%, hsl(356, 65%, 50%) 45%, hsl(48, 95%, 56%) 100%);
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: white;
}
.auth-left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 90% 15%, hsla(48, 100%, 65%, 0.12), transparent 40%),
        radial-gradient(circle at 10% 90%, hsla(356, 70%, 50%, 0.08), transparent 40%);
    pointer-events: none;
}
.auth-left-panel .brand-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-transform: uppercase;
    text-decoration: none;
    transition: 0.3s ease;
}

.brand-logo-image {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    object-fit: contain;
    transition: 0.3s ease;
}

.auth-left-panel .brand-text:hover .brand-logo-image {
    transform: scale(1.1) rotate(-4deg);
    box-shadow: 0 8px 24px rgba(220,38,38,0.2);
}

.brand-logo-text {
    display: flex;
    align-items: center;
    gap: 0;
}

.auth-left-panel .brand-text em {
    color: hsla(0, 0%, 100%, 0.95);
    font-style: normal;
    font-weight: 900;
    letter-spacing: 1px;
}
.auth-right-panel {
    background: transparent;
    padding: 60px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-form-inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    animation: slideUp 0.6s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth-body {
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.auth-body .auth-left-panel .hero-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 35px 0;
}
.auth-body .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: white;
    margin-bottom: 26px;
    width: fit-content;
    backdrop-filter: blur(6px);
    transition: var(--transition-smooth);
}
.auth-body .hero-badge:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.3);
}
.auth-body .hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: hsla(0, 0%, 100%, 0.9);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}
.auth-body .hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}
.auth-body .hero-title .highlight {
    color: hsla(0, 0%, 100%, 0.98);
    font-weight: 900;
}
.auth-body .hero-copy {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.88);
    line-height: 1.65;
    max-width: 380px;
    margin-bottom: 32px;
}
.auth-body .hero-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.auth-body .hero-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    backdrop-filter: blur(4px);
    transition: var(--transition-smooth);
}
.auth-body .hero-feature:hover {
    background: rgba(255,255,255,0.13);
    border-color: rgba(255,255,255,0.22);
    transform: translateX(4px);
}
.auth-body .hero-feature-icon {
    font-size: 1.15rem;
    color: hsla(0, 0%, 100%, 0.95);
    flex-shrink: 0;
}
.auth-body .hero-feature-text {
    font-size: 0.87rem;
    font-weight: 500;
    color: rgba(255,255,255,0.92);
}
.auth-body .hero-stats {
    display: flex;
    gap: 24px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,0.12);
    justify-content: space-around;
}
.auth-body .hero-stat-amount {
    font-size: 1.4rem;
    font-weight: 800;
    color: hsla(0, 0%, 100%, 0.98);
}
.auth-body .hero-stat-label {
    font-size: 0.68rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.auth-body .brand-icon {
    display: none;
}
.auth-body .footer-note {
    font-size: 0.75rem;
    opacity: 0.7;
}
..auth-body .alert-box .fa-circle-check {
    margin-top: 3px;
}
.auth-body .alert-body {
    flex: 1;
}
.auth-body .token-label i,
.auth-body .token-box p i {
    margin-right: 5px;
}
.auth-body .token-box p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 10px;
}
.auth-body .auth-intro {
    margin-bottom: 28px;
}
.auth-body .auth-tag {
    display: inline-block;
    padding: 5px 14px;
    background: hsla(356, 70%, 58%, 0.08);
    border: 1px solid hsla(356, 70%, 58%, 0.18);
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-red);
    margin-bottom: 14px;
}
.auth-body .auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    margin-bottom: 8px;
}
.auth-body .auth-copy {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
}
.auth-body .page-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}
.auth-body .page-copy {
    font-size: 0.94rem;
    color: var(--text-secondary);
    line-height: 1.68;
    margin-bottom: 32px;
}
.auth-body .auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.auth-body .auth-form-small {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-body .btn-reg {
    margin-top: 10px;
}
.auth-body .field-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}
.auth-body .field-header-row .field-label {
    margin-bottom: 0;
}
.auth-body .form-foot {
    margin-top: 24px;
}
.auth-body .hero-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 25px 0;
}
.auth-body .hero-title-lg {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 12px;
}
.auth-body .hero-copy-sm {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.88);
    line-height: 1.65;
    margin-bottom: 26px;
}
.auth-body .note-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-left: 3px solid var(--accent-yellow);
    border-radius: 11px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.auth-body .note-panel .note-icon {
    color: var(--accent-yellow);
    flex-shrink: 0;
    font-size: 1rem;
}
.auth-body .auth-left-panel .step-track {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    margin-top: 28px;
}
.auth-body .step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    animation: stepAppear 0.5s ease-out forwards;
}
.auth-body .step-item:nth-child(2) { animation-delay: 0.1s; }
.auth-body .step-item:nth-child(3) { animation-delay: 0.2s; }
@keyframes stepAppear {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}
.auth-body .step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}
.auth-body .step-content { padding-top: 6px; }
.auth-body .step-title { 
    font-size: 0.9rem; 
    font-weight: 700; 
    color: white; 
    margin-bottom: 3px; 
}
.auth-body .step-text { 
    font-size: 0.78rem; 
    color: rgba(255, 255, 255, 0.82); 
    line-height: 1.45; 
}
.auth-body .auth-card.single-panel .auth-right-panel {
    overflow-y: auto;
}
.auth-body .forgot-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-smooth);
}
.auth-body .forgot-link:hover {
    color: var(--accent-red);
    transform: translateX(2px);
}
.auth-body .forgot-link .fa-key {
    font-size: 0.72rem;
}
.auth-body .alert-compact {
    padding: 14px 16px;
    font-size: 0.87rem;
    gap: 12px;
}
.auth-body .alert-start {
    align-items: flex-start;
}
.auth-body .input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.auth-body .input-grid .full {
    grid-column: 1 / -1;
}
.auth-body .pw-strength {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}
.auth-body .pw-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--glass-border);
    transition: background 0.3s ease;
}
.auth-body .pw-bar.s1 { background: hsl(0, 75%, 55%); }
.auth-body .pw-bar.s2 { background: hsl(30, 80%, 55%); }
.auth-body .pw-bar.s3 { background: var(--accent-yellow); }
.auth-body .pw-bar.s4 { background: var(--success); }
.auth-body .divider {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 24px 0;
}
.auth-body .divider::before,
.auth-body .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}
.auth-body .role-info-box {
    margin-top: 28px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-left: 4px solid hsla(0, 0%, 100%, 0.95);
    border-radius: 14px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.6;
    backdrop-filter: blur(4px);
}
.auth-body .role-info-box .fa-circle-info {
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}
.auth-body .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 32px;
    transition: var(--transition-smooth);
}
.auth-body .back-link:hover {
    color: var(--accent-red);
    transform: translateX(-3px);
}
.auth-body .back-link i {
    transition: var(--transition-smooth);
    font-size: 0.8rem;
}
.auth-body .back-link:hover i {
    transform: translateX(-3px);
}
.auth-body .icon-hero {
    width: 64px;
    height: 64px;
    background: hsla(356, 85%, 52%, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-red);
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}
.auth-body .steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 30px;
}
.auth-body .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.auth-body .step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid var(--glass-border);
    color: var(--text-muted);
    background: var(--bg-secondary);
    transition: var(--transition-smooth);
}
.auth-body .step-dot.active {
    background: linear-gradient(135deg, var(--accent-red), hsl(340, 85%, 45%));
    border-color: var(--accent-red);
    color: white;
    box-shadow: 0 4px 15px var(--accent-red-glow);
}
.auth-body .step-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.auth-body .step-label.active {
    color: var(--accent-red);
}
.auth-body .step-line {
    flex: 1;
    height: 1px;
    background: var(--glass-border);
    margin-top: -20px;
}
.auth-body .token-box {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px dashed var(--accent-yellow);
    border-radius: 12px;
}
.auth-body .token-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-yellow);
    margin-bottom: 10px;
}
.auth-body .token-url {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    word-break: break-all;
    line-height: 1.6;
    font-family: monospace;
    background: var(--input-bg);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    margin-bottom: 10px;
}
.auth-body .btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: hsla(45,100%,50%,0.12);
    border: 1px solid hsla(45,100%,50%,0.3);
    border-radius: 8px;
    color: var(--accent-yellow);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.auth-body .btn-copy:hover {
    background: hsla(45,100%,50%,0.2);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Auth input fields & groups */
.auth-body .field-group {
    margin-bottom: 22px;
}
.auth-body .field-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}
.auth-body .field-wrap {
    position: relative;
}
.auth-body .field-wrap .f-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.3s;
}
.auth-body .field-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: var(--input-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    font-size: 0.93rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-smooth);
}
.auth-body .field-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}
.auth-body .field-input:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px var(--accent-red-glow);
    background: var(--bg-primary);
}
.auth-body .field-input:focus ~ .f-icon {
    color: var(--accent-red);
}

/* Toggle password */
.auth-body .toggle-pass {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    transition: color 0.2s;
}
.auth-body .toggle-pass:hover {
    color: var(--accent-red);
}

/* Submit Button */
.auth-body .btn-reg {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-red) 0%, hsl(340, 85%, 45%) 100%);
    color: white;
    font-size: 0.97rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 4px 24px var(--accent-red-glow);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.auth-body .btn-reg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, hsla(0,0%,100%,0.1) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
.auth-body .btn-reg:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 36px hsla(356, 85%, 52%, 0.45);
}
.auth-body .btn-reg:hover::before {
    transform: translateX(100%);
}
.auth-body .btn-reg:active {
    transform: translateY(0);
}

/* Footer & Divider links */
.auth-body .form-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 0.86rem;
    color: var(--text-muted);
}
.auth-body .form-foot a {
    color: var(--accent-yellow);
    font-weight: 600;
    text-decoration: none;
    position: relative;
}
.auth-body .form-foot a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-yellow);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.auth-body .form-foot a:hover::after {
    transform: scaleX(1);
}

/* Auth Theme Toggle — floating top-right on auth pages */
.auth-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Responsive adjustment for auth cards */
@media (max-width: 860px) {
    .auth-card { grid-template-columns: 1fr; }
    .auth-left-panel { display: none; }
    .auth-right-panel { padding: 48px 28px; }
}

/* Single-panel auth card (forgot/reset password) */
.auth-card.single-panel .auth-right-panel {
    padding: 48px 44px;
}

/* Auth mobile responsiveness */
@media (max-width: 640px) {
    .auth-container {
        padding: 20px 16px;
        align-items: flex-start;
        padding-top: 60px;
    }
    .auth-card.single-panel {
        max-width: 100%;
    }
    .auth-card.single-panel .auth-right-panel {
        padding: 36px 24px;
    }
    .auth-theme-toggle {
        top: 14px;
        right: 14px;
    }
}
@media (max-width: 480px) {
    .auth-container {
        padding: 16px 12px;
        padding-top: 56px;
    }
    .auth-card.single-panel .auth-right-panel {
        padding: 28px 18px;
    }
    .auth-right-panel {
        padding: 28px 18px !important;
    }
}

/* ============================================================
 *  GLOBAL RESPONSIVE ENHANCEMENTS
 *  Memperkuat responsivitas dashboard, tabel, sidebar, dan form
 * ============================================================ */
@media (max-width: 1200px) {
    .dashboard-layout,
    .form-grid-2col,
    .report-action-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 20px 18px 24px;
        gap: 22px;
    }

    .top-navbar {
        padding: 14px 18px;
        gap: 14px;
    }

    .navbar-actions,
    .page-title-area,
    .page-header-row {
        width: 100%;
    }

    .page-title-area {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 14px;
    }

    .navbar-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 20px;
    }

    .table-responsive,
    .table-glass {
        overflow-x: auto;
        width: 100%;
        min-width: 0;
    }

    .table-glass {
        min-width: 100%;
    }

    .form-control,
    .btn-primary,
    .btn-add,
    .btn-report,
    .btn-icon {
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .top-navbar {
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 14px;
    }

    .navbar-actions {
        justify-content: flex-start;
        width: 100%;
        gap: 12px;
    }

    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .report-action-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .btn-report {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 16px 14px;
        gap: 16px;
    }

    .report-action-row,
    .dashboard-layout,
    .form-grid-2col {
        grid-template-columns: 1fr;
    }

    .page-header-row h2,
    .page-title-area h1 {
        white-space: normal;
        font-size: 1.2rem;
    }

    .pagination-container {
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .btn-icon {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 14px 12px;
        gap: 14px;
    }

    .top-navbar {
        padding: 12px 14px;
    }

    .btn-report {
        padding: 14px 18px;
        font-size: 0.9rem;
    }

    .table-glass {
        min-width: 320px;
    }
}

/* ── Reduce Motion (accessibility) ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Global footer styling */
.app-footer {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 20px 28px;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 50px hsla(220, 25%, 15%, 0.06);
    backdrop-filter: blur(18px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    z-index: 0;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-main {
    flex: 1 1 100%;
    min-width: 0;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-logo i {
    font-size: 1rem;
    color: var(--accent-red);
}

.footer-tagline {
    display: block;
    color: var(--text-muted);
    max-width: 680px;
    line-height: 1.55;
}

.footer-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    white-space: nowrap;
    padding: 0; /* remove pill padding */
    border-radius: 0; /* no pill */
    background: transparent; /* follow theme */
    color: var(--text-muted);
    font-size: 0.88rem; /* slightly smaller for subtle look */
}

.app-footer .footer-note {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .app-footer {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    .footer-meta {
        justify-content: center;
        gap: 12px;
        white-space: normal;
    }
}

/* ============================================================
 *  RESPONSIVE MASTER BLOCK — Full Mobile & Tablet Support
 *  Alfamart GIS — Semua halaman responsif sempurna
 * ============================================================ */

/* ── Touch Optimization Global ── */
button, a, .btn-add, .btn-logout, .btn-primary, .btn-report,
.btn-icon, .btn-map-filter, .btn-sidebar-toggle, .menu-item-link {
    touch-action: manipulation; /* Hilangkan 300ms tap delay di mobile */
    -webkit-tap-highlight-color: transparent;
}

/* ── Breakpoint ≤ 1024px — Tablet ── */
@media (max-width: 1024px) {

    /* Navbar: semua elemen tetap satu baris, compact */
    .top-navbar {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px 16px !important;
        flex-wrap: nowrap !important;
    }

    .page-title-area {
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px;
    }

    .page-title-area h1 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .navbar-actions {
        flex-shrink: 0;
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: flex-end;
    }

    /* Dashboard layout: selalu satu kolom di tablet */
    .dashboard-layout {
        grid-template-columns: 1fr !important;
    }

    /* Admin distribusi grid: tetap 2 kolom */
    .admin-dist-grid {
        grid-template-columns: 1fr 1fr;
    }

    .app-footer {
        width: 100%;
        margin-left: 0;
    }
}

/* ── Breakpoint ≤ 768px — Tablet Kecil & Mobile Landscape ── */
@media (max-width: 768px) {

    /* Navbar actions: sembunyikan teks role chip, tampilkan hanya ikon */
    .role-chip span {
        display: none;
    }
    .role-chip {
        padding: 6px 8px;
        min-height: 36px;
    }

    /* Live badge: sembunyikan teks, tampilkan hanya dot */
    .live-badge span {
        display: none;
    }
    .live-badge {
        padding: 6px 8px;
        border-radius: 50%;
        gap: 0;
    }

    /* Logout button: ikon saja */
    .btn-logout span {
        display: none;
    }
    .btn-logout {
        padding: 8px 10px;
    }

    /* Glass card padding */
    .glass-card {
        padding: 18px;
    }

    /* Report action row: 2 kolom */
    .report-action-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Stat cards: 2 kolom */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    /* Admin quick actions: wrap rapi */
    .admin-quick-actions {
        flex-direction: column;
        gap: 10px;
    }
    .admin-quick-actions a,
    .admin-quick-actions button {
        width: 100%;
        justify-content: center;
    }

    /* Footer responsive stack */
    .app-footer {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        align-items: center;
        text-align: center;
    }
    .footer-main {
        align-items: center;
    }
    .footer-meta {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    .footer-tagline {
        max-width: 100%;
    }
}

/* ── Breakpoint ≤ 640px — Mobile Portrait ── */
@media (max-width: 640px) {

    /* Main content: padding lebih kecil */
    .main-content {
        padding: 10px !important;
        gap: 14px !important;
    }

    /* Glass card */
    .glass-card {
        padding: 14px;
        border-radius: var(--border-radius-md);
    }

    /* Stats: 2 kolom di mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* Stat card: compact */
    .stat-card {
        padding: 14px 12px;
    }
    .stat-value {
        font-size: 1.6rem;
    }
    .stat-icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Report: 1 kolom */
    .report-action-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .btn-report {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }

    /* Form controls: touch friendly */
    .form-control {
        padding: 13px 16px;
        font-size: 0.97rem;
        min-height: 48px;
    }
    .form-input-container:has(i) .form-control {
        padding-left: 44px;
    }
    select.form-control {
        min-height: 48px;
    }
    textarea.form-control {
        min-height: 90px;
    }

    /* Btn submit: touch friendly */
    .btn-primary {
        padding: 15px 20px;
        font-size: 0.97rem;
        min-height: 48px;
    }

    /* Page header row: stack */
    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .page-header-row h2 {
        white-space: normal;
        font-size: 1.05rem;
    }
    .page-header-row .btn-logout {
        align-self: flex-start;
        padding: 9px 14px !important;
    }
    .page-header-row .btn-logout span {
        display: inline !important; /* Tampilkan teks "Kembali" di page header */
    }

    /* Table: compact */
    .table-glass th,
    .table-glass td {
        padding: 10px 10px;
        font-size: 0.82rem;
    }

    /* Store thumbnail */
    .store-thumbnail {
        width: 55px;
        height: 40px;
    }

    /* Action buttons */
    .btn-icon {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    /* Footer: compact */
    .app-footer {
        padding: 16px;
        gap: 10px;
    }
    .footer-logo {
        font-size: 0.92rem;
    }
    .footer-tagline {
        font-size: 0.78rem;
        max-width: 100%;
    }
    .footer-meta {
        width: 100%;
    }

    /* Ensure role/user name is visible on small mobile screens */
    .role-chip span {
        display: inline !important;
    }
    .role-chip {
        gap: 6px;
        padding: 6px 8px;
    }

    /* Dashboard distribusi grid: stack */
    .admin-dist-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    /* Map overlay controls: full width */
    .map-overlay-controls {
        left: 10px !important;
        right: 10px !important;
        bottom: 12px !important;
        gap: 6px !important;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ── Breakpoint ≤ 480px — Mobile Sempit ── */
@media (max-width: 480px) {

    /* Stats: 1 kolom saat layar sangat sempit */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Navbar title: lebih kecil */
    .page-title-area h1 {
        font-size: 1rem;
    }

    /* Btn sidebar toggle: touch target */
    .btn-sidebar-toggle {
        width: 40px !important;
        height: 40px !important;
    }

    /* Form label: lebih kecil */
    .form-label {
        font-size: 0.85rem;
    }

    /* Table action buttons: hanya ikon */
    .btn-icon {
        width: 32px;
        height: 32px;
    }

    /* Theme toggle */
    .btn-theme-toggle {
        width: 38px;
        height: 38px;
    }

    /* Pagination: compact */
    ul.pagination li a {
        padding: 7px 9px;
        font-size: 0.78rem;
    }

    /* User badge di sidebar footer */
    .user-name {
        max-width: 110px;
    }
}

/* ── Profile Page Responsive ── */
@media (max-width: 900px) {
    /* Profile grid: stack avatar di atas, form di bawah */
    .profile-grid-2col {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Avatar card: horizontal layout di tablet */
    .profile-avatar-col {
        flex-direction: row !important;
        align-items: center !important;
        padding: 16px !important;
        gap: 20px !important;
    }

    .profile-avatar-col > div:first-child {
        /* Avatar circle */
        flex-shrink: 0;
    }
}

@media (max-width: 640px) {
    /* Profile avatar card: full column lagi di mobile */
    .profile-avatar-col {
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Ubah sandi card: stack button */
    .profile-password-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .profile-password-card a {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Username & email grid: 1 kolom */
    .profile-info-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
}

/* ── Auth Pages Responsive ── */
@media (max-width: 640px) {
    .auth-card {
        padding: 24px 18px !important;
        margin: 16px !important;
        border-radius: var(--border-radius-md) !important;
    }

    .auth-container {
        padding: 12px !important;
    }

    .auth-header h1 {
        font-size: 1.5rem !important;
    }

    .auth-header p {
        font-size: 0.88rem !important;
    }

    .auth-left-panel,
    .auth-right-panel {
        padding: 20px 16px !important;
    }

    /* Split layout: stack vertically */
    .auth-split-layout {
        flex-direction: column !important;
    }

    .auth-left-panel {
        min-height: 0 !important;
        padding-bottom: 24px !important;
    }
}

/* ── Peta Halaman Responsive ── */
@media (max-width: 768px) {
    .map-page-container {
        height: 60vh;
        min-height: 400px;
        border-radius: var(--border-radius-md);
    }

    .mini-map-container {
        height: 260px;
    }
}

@media (max-width: 480px) {
    .map-page-container {
        height: 55vh;
        min-height: 350px;
    }

    .mini-map-container {
        height: 220px;
    }
}

/* ── Mencegah horizontal overflow global ── */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* ── Table: selalu scrollable horizontal di mobile ── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Form grid di halaman input: responsive ── */
@media (max-width: 768px) {
    .form-grid-2col {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .form-coords-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .form-coords-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ── Leaflet popup: compact di mobile ── */
@media (max-width: 640px) {
    .leaflet-popup-content-wrapper {
        max-width: 260px !important;
    }
    .map-popup-card {
        max-width: 240px;
    }
    .map-popup-image {
        height: 110px !important;
    }
}

/* ── Sidebar: close button selalu tampil di mobile ── */
@media (min-width: 1025px) {
    .btn-sidebar-close {
        display: none !important;
    }
    .btn-sidebar-toggle {
        display: none !important;
    }
}

