@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

/* ========================================
   VILLA BINTARO REGENCY - Premium UI Theme
   Modern, Elegant & Professional Design
   ======================================== */

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

:root {
    /* Premium Color Palette */
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --primary-gradient-dark: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    
    --secondary-color: #059669;
    --secondary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    
    --accent-color: #d97706;
    --accent-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    
    --danger-color: #dc2626;
    --danger-gradient: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    
    /* Sophisticated Grays */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;
    
    /* Gold Accent for Premium Feel */
    --gold-400: #fbbf24;
    --gold-500: #f59e0b;
    --gold-600: #d97706;
    
    /* Shadows - Multi-layered for depth */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 50px 100px -20px rgba(0, 0, 0, 0.3);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    
    /* Glow Effects */
    --glow-primary: 0 0 20px rgba(59, 130, 246, 0.5);
    --glow-gold: 0 0 20px rgba(245, 158, 11, 0.4);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========================================
   Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #f0f4ff 0%, #e8efff 100%);
    color: var(--slate-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition);
}

ul {
    list-style: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--slate-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-light), var(--primary-color));
    border-radius: var(--radius-full);
    border: 2px solid var(--slate-100);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
}

/* ========================================
   Buttons - Premium Style
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
    border-radius: inherit;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

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

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-ghost {
    background: transparent;
    color: var(--slate-600);
}

.btn-ghost:hover {
    background: var(--slate-100);
    color: var(--slate-800);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-icon {
    padding: var(--space-3);
    border-radius: var(--radius);
}

/* ========================================
   Forms - Modern Style
   ======================================== */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--slate-700);
    letter-spacing: 0.025em;
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--slate-800);
    background: white;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.form-control::placeholder {
    color: var(--slate-400);
}

.form-control:hover {
    border-color: var(--slate-300);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-control:disabled {
    background: var(--slate-100);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 44px;
}

select.form-control:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ========================================
   Cards - Elevated Design
   ======================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-slow);
    border: 1px solid var(--slate-100);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--slate-50) 0%, white 100%);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--slate-800);
    letter-spacing: -0.01em;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--slate-500);
    margin-top: var(--space-1);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--slate-100);
    background: var(--slate-50);
}

/* Card Variants */
.card-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
}

.card-gradient .card-title,
.card-gradient .card-subtitle {
    color: white;
}

.card-gradient .card-header {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   Landing Page - Premium
   ======================================== */
.landing-page {
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: var(--space-4) 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.navbar-menu {
    display: flex;
    gap: var(--space-3);
}

.navbar-menu .btn {
    border-radius: var(--radius-full);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
    padding: 180px var(--space-8) 120px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-icon {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-8);
    font-size: 4rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: var(--space-8);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn-primary {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-buttons .btn-primary:hover {
    background: var(--slate-50);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.hero-buttons .btn-outline {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    backdrop-filter: blur(10px);
}

.hero-buttons .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-color: white;
}

/* Features Section */
.features {
    padding: 120px var(--space-8);
    max-width: 1280px;
    margin: 0 auto;
}

.features-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.features-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--slate-800);
    margin-bottom: var(--space-4);
}

.features-header p {
    color: var(--slate-600);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
}

.feature-card {
    background: white;
    padding: var(--space-10);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all var(--transition-slow);
    border: 1px solid var(--slate-100);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-slow);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    font-size: 2.5rem;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.feature-card h3 {
    font-size: 1.25rem;
    color: var(--slate-800);
    margin-bottom: var(--space-3);
}

.feature-card p {
    color: var(--slate-600);
    line-height: 1.7;
}

/* Stats Section */
.stats {
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
    padding: 80px var(--space-8);
    color: white;
    position: relative;
}

.stats-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-10);
    text-align: center;
}

.stat-item h3 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--gold-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
}

.stat-item p {
    opacity: 0.8;
    font-size: 1rem;
    color: var(--slate-300);
}

/* Footer */
.footer {
    background: var(--slate-950);
    color: var(--slate-400);
    padding: var(--space-12) var(--space-8);
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
}

.footer p {
    margin-bottom: var(--space-4);
}

.footer-links {
    display: flex;
    gap: var(--space-8);
    justify-content: center;
    margin-bottom: var(--space-8);
}

.footer-links a {
    color: var(--slate-400);
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
}

/* ========================================
   Auth Pages - Premium Design
   ======================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e40af 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1200px;
    margin: auto;
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    position: relative;
    z-index: 1;
}

.auth-left {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: var(--space-16);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

.auth-left h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
    position: relative;
    z-index: 1;
}

.auth-left p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: var(--space-8);
    position: relative;
    z-index: 1;
}

.auth-features {
    list-style: none;
    position: relative;
    z-index: 1;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    font-size: 1rem;
}

.auth-feature-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.auth-right {
    padding: var(--space-16);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.auth-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--slate-800);
    margin-bottom: var(--space-2);
}

.auth-header p {
    color: var(--slate-500);
    font-size: 1rem;
}

.auth-form {
    width: 100%;
}

.auth-form .form-group {
    margin-bottom: var(--space-6);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-8);
    color: var(--slate-500);
    font-size: 0.9375rem;
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    transition: color var(--transition);
}

.auth-footer a:hover {
    color: var(--primary-dark);
}

/* ========================================
   Dashboard Layout
   ======================================== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Modern Dark Theme */
.sidebar {
    width: 300px;
    background: linear-gradient(180deg, var(--slate-900) 0%, var(--slate-800) 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    transition: transform var(--transition-slow);
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    padding: var(--space-8) var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, transparent 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: 'Playfair Display', serif;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-brand-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.sidebar-menu {
    padding: var(--space-4) 0;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    margin: var(--space-1) var(--space-3);
    color: var(--slate-400);
    transition: all var(--transition);
    cursor: pointer;
    border-radius: var(--radius-md);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform var(--transition);
}

.sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-menu-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: white;
}

.sidebar-menu-item.active::before {
    transform: scaleY(1);
}

.sidebar-menu-icon {
    width: 24px;
    text-align: center;
    font-size: 1.25rem;
}

.sidebar-user {
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

.sidebar-user-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: white;
}

.sidebar-user-role {
    font-size: 0.8125rem;
    color: var(--slate-400);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 300px;
    background: linear-gradient(180deg, #f0f4ff 0%, #e8efff 100%);
    min-height: 100vh;
}

.topbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: var(--space-5) var(--space-8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--slate-100);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--slate-600);
    padding: var(--space-2);
    border-radius: var(--radius);
    transition: background var(--transition);
}

.menu-toggle:hover {
    background: var(--slate-100);
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--slate-800);
    letter-spacing: -0.01em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.notification-btn {
    position: relative;
    background: var(--slate-100);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--slate-600);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    background: var(--danger-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.content {
    padding: var(--space-8);
}

/* Dashboard Stats - Premium Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--space-5);
    transition: all var(--transition-slow);
    border: 1px solid var(--slate-100);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-slow);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-card-icon.blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
}

.stat-card-icon.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--secondary-color);
}

.stat-card-icon.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: var(--accent-color);
}

.stat-card-icon.red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: var(--danger-color);
}

.stat-card-content h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--slate-800);
    margin-bottom: var(--space-1);
}

.stat-card-content p {
    color: var(--slate-500);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Tables - Modern Design */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--slate-100);
}

.table-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--slate-50) 0%, white 100%);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-4) var(--space-6);
    text-align: left;
}

.table th {
    background: var(--slate-50);
    font-weight: 700;
    color: var(--slate-600);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--slate-200);
}

.table tr {
    border-bottom: 1px solid var(--slate-100);
    transition: background var(--transition);
}

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

.table tr:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.03) 0%, transparent 100%);
}

.table-actions {
    display: flex;
    gap: var(--space-2);
}

/* Badge - Premium Style */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.badge-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--secondary-color);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: var(--accent-color);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: var(--danger-color);
}

.badge-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
}

.badge-primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
}

/* Modal - Enhanced */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--slate-100);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--slate-50) 0%, white 100%);
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--slate-800);
}

.modal-close {
    background: var(--slate-100);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--slate-500);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--slate-100);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    background: var(--slate-50);
}

/* Alert - Modern */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 500;
    border: 1px solid;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    color: var(--secondary-color);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    color: var(--accent-color);
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--slate-100);
    transition: all var(--transition);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    transform: translateX(4px);
}

.activity-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.activity-icon.blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
}

.activity-icon.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--secondary-color);
}

.activity-icon.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: var(--accent-color);
}

.activity-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: var(--space-1);
}

.activity-content p {
    font-size: 0.875rem;
    color: var(--slate-500);
    margin-bottom: var(--space-1);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--slate-400);
}

/* ========================================
   Responsive Design - Enhanced Mobile UX
   ======================================== */

/* Tablet & Below (1024px) */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-2xl);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        transition: opacity var(--transition-slow);
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .menu-toggle {
        display: block;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .stat-card {
        padding: var(--space-4);
        gap: var(--space-4);
    }

    .stat-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .stat-card-content h3 {
        font-size: 1.5rem;
    }

    /* Two column layout for content */
    .content > div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile (768px) */
@media (max-width: 768px) {
    /* Typography - Scale down for mobile */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.125rem; }

    /* Spacing adjustments */
    :root {
        --space-8: 24px;
        --space-10: 32px;
        --space-12: 40px;
        --space-16: 48px;
    }

    /* Navbar - Mobile */
    .navbar {
        padding: var(--space-3) 0;
    }

    .navbar-container {
        padding: 0 var(--space-4);
    }

    .navbar-brand {
        font-size: 1.125rem;
        gap: var(--space-2);
    }

    .navbar-brand-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .navbar-menu {
        gap: var(--space-2);
    }

    .navbar-menu .btn {
        padding: var(--space-2) var(--space-4);
        font-size: 0.875rem;
    }

    /* Hero Section - Mobile */
    .hero {
        padding: 120px var(--space-4) 80px;
    }

    .hero-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
        margin-bottom: var(--space-6);
    }

    .hero h1 {
        font-size: 1.75rem;
        margin-bottom: var(--space-3);
    }

    .hero h2 {
        font-size: 1.25rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: var(--space-6);
    }

    .hero-buttons {
        flex-direction: column;
        gap: var(--space-3);
        padding: 0 var(--space-4);
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    /* Features Section - Mobile */
    .features {
        padding: 60px var(--space-4);
    }

    .features-header h2 {
        font-size: 1.75rem;
    }

    .features-header p {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .feature-card {
        padding: var(--space-6);
    }

    .feature-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    /* Stats Section - Mobile */
    .stats {
        padding: 60px var(--space-4);
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .stat-item h3 {
        font-size: 2rem;
    }

    .stat-item p {
        font-size: 0.875rem;
    }

    /* Footer - Mobile */
    .footer {
        padding: var(--space-8) var(--space-4);
    }

    .footer-links {
        flex-wrap: wrap;
        gap: var(--space-4);
    }

    /* Auth Pages - Mobile */
    .auth-page {
        background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    }

    .auth-container {
        grid-template-columns: 1fr;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .auth-left {
        padding: var(--space-8) var(--space-6);
        text-align: center;
    }

    .auth-left h1 {
        font-size: 1.75rem;
        margin-bottom: var(--space-3);
    }

    .auth-left p {
        font-size: 0.9375rem;
        margin-bottom: var(--space-6);
    }

    .auth-features {
        display: none;
    }

    .auth-right {
        padding: var(--space-8) var(--space-6);
        justify-content: flex-start;
    }

    .auth-header {
        margin-bottom: var(--space-6);
    }

    .auth-header h2 {
        font-size: 1.75rem;
    }

    .auth-form .form-group {
        margin-bottom: var(--space-4);
    }

    .auth-footer {
        margin-top: var(--space-6);
        font-size: 0.875rem;
    }

    /* Dashboard - Mobile */
    .topbar {
        padding: var(--space-4);
        position: sticky;
    }

    .topbar-left {
        gap: var(--space-3);
    }

    .menu-toggle {
        font-size: 1.25rem;
        padding: var(--space-2);
    }

    .page-title {
        font-size: 1.25rem;
    }

    .card-subtitle {
        font-size: 0.8125rem;
    }

    .topbar-right {
        gap: var(--space-2);
    }

    .notification-btn {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .content {
        padding: var(--space-4);
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .stat-card {
        padding: var(--space-4);
    }

    .card {
        border-radius: var(--radius-md);
    }

    .card-header {
        padding: var(--space-4);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .card-body {
        padding: var(--space-4);
    }

    .card-title {
        font-size: 1rem;
    }

    .card-subtitle {
        font-size: 0.75rem;
    }

    /* Activity List - Mobile */
    .activity-item {
        gap: var(--space-3);
    }

    .activity-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .activity-content h4 {
        font-size: 0.875rem;
    }

    .activity-content p {
        font-size: 0.8125rem;
    }

    /* Quick Actions - Mobile */
    .card-body .btn {
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
        justify-content: center;
    }

    /* Sidebar - Mobile */
    .sidebar {
        width: 280px;
    }

    .sidebar-header {
        padding: var(--space-6) var(--space-4);
    }

    .sidebar-brand {
        font-size: 1.125rem;
    }

    .sidebar-brand-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .sidebar-menu-item {
        padding: var(--space-3) var(--space-4);
        margin: var(--space-1) var(--space-2);
        font-size: 0.9375rem;
    }

    .sidebar-menu-icon {
        font-size: 1.125rem;
    }

    .sidebar-user {
        padding: var(--space-4);
    }

    .sidebar-user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .sidebar-user-name {
        font-size: 0.875rem;
    }

    .sidebar-user-role {
        font-size: 0.75rem;
    }

    /* Tables - Mobile Scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Modal - Mobile */
    .modal {
        max-width: calc(100% - var(--space-4));
        margin: var(--space-4);
        border-radius: var(--radius-lg);
    }

    .modal-header {
        padding: var(--space-4);
    }

    .modal-title {
        font-size: 1.125rem;
    }

    .modal-body {
        padding: var(--space-4);
    }

    .modal-footer {
        padding: var(--space-4);
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }

    /* Alerts - Mobile */
    .alert {
        padding: var(--space-3) var(--space-4);
        font-size: 0.875rem;
    }

    /* Buttons - Touch-friendly sizing */
    .btn {
        min-height: 44px;
        padding: var(--space-3) var(--space-5);
    }

    .btn-sm {
        min-height: 36px;
        padding: var(--space-2) var(--space-3);
    }

    .btn-lg {
        min-height: 52px;
        padding: var(--space-4) var(--space-6);
    }

    /* Form Controls - Mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: var(--space-3) var(--space-4);
    }

    .form-label {
        font-size: 0.8125rem;
    }

    select.form-control {
        background-position: right 10px center;
        padding-right: 40px;
    }
}

/* Small Mobile (480px) */
@media (max-width: 480px) {
    /* Further scale down typography */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }

    .navbar-brand span {
        display: none;
    }

    .navbar-brand-icon {
        width: 36px;
        height: 36px;
    }

    .hero {
        padding: 100px var(--space-3) 60px;
    }

    .hero-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero h2 {
        font-size: 1.125rem;
    }

    .hero p {
        font-size: 0.9375rem;
    }

    .features {
        padding: 40px var(--space-3);
    }

    .feature-card {
        padding: var(--space-5);
    }

    .stats {
        padding: 40px var(--space-3);
    }

    .stats-container {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .stat-item h3 {
        font-size: 1.75rem;
    }

    .auth-left,
    .auth-right {
        padding: var(--space-6) var(--space-4);
    }

    .content {
        padding: var(--space-3);
    }

    .page-title {
        font-size: 1.125rem;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .card-header {
        padding: var(--space-3);
    }

    .card-body {
        padding: var(--space-3);
    }

    .sidebar {
        width: 100%;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 80px var(--space-4) 40px;
    }

    .hero-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: var(--space-6);
    }

    .hero-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
        margin-bottom: 0;
    }

    .hero-text {
        text-align: left;
    }

    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 48px;
    }

    .sidebar-menu-item {
        min-height: 48px;
    }

    .navbar-menu .btn {
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .card:hover,
    .stat-card:hover,
    .feature-card:hover {
        transform: none;
    }

    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-outline:hover {
        transform: none;
    }

    /* Better scrolling on mobile */
    .sidebar,
    .main-content,
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .topbar,
    .menu-toggle,
    .notification-btn,
    .btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease;
}

/* Utility Classes */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gold {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: var(--glow-primary);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   Production UI refinements
   ======================================== */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

.sidebar-section-label {
    margin: var(--space-4) var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-section-label span {
    color: var(--slate-500);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: inherit;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    width: 100%;
    min-width: 760px;
}

.table th,
.table td {
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.card-header {
    gap: var(--space-3);
    flex-wrap: wrap;
}

.card-header > * {
    min-width: 0;
}

.dashboard-stats {
    align-items: stretch;
}

.stat-card {
    min-width: 0;
}

.detail-list {
    display: grid;
    gap: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
    gap: var(--space-4);
    padding: 13px 15px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row strong {
    color: var(--gray-600);
}

.detail-row span {
    color: var(--gray-800);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.activity-item {
    gap: var(--space-3);
}

.activity-content {
    min-width: 0;
}

.activity-content h4,
.activity-content p {
    overflow-wrap: anywhere;
}

.modal {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-body {
    min-width: 0;
}

.form-control,
.btn,
select,
textarea,
input {
    max-width: 100%;
}

.btn:disabled,
.form-control:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 99999;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    padding: 13px 16px;
    border-radius: var(--radius);
    background: var(--slate-900);
    color: #fff;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: var(--success-600, #15803d); }
.toast-warning { background: var(--warning-600, #b45309); }
.toast-danger { background: var(--danger-600, #b91c1c); }

.button-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: buttonSpin 0.65s linear infinite;
}

@keyframes buttonSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .topbar {
        min-height: 64px;
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    .topbar-right {
        gap: 8px;
    }

    .topbar-right .btn {
        white-space: normal;
        line-height: 1.25;
    }

    .content {
        width: 100%;
        min-width: 0;
    }

    .card {
        border-radius: 14px;
    }

    .card-header,
    .card-body {
        min-width: 0;
    }

    .card-header > div,
    .card-header form {
        width: 100%;
    }

    .card-header select.form-control,
    .card-header input.form-control {
        width: 100% !important;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal,
    .modal.modal-lg {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        margin: 0;
        border-radius: 20px 20px 0 0;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        background: #fff;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1 1 140px;
    }

    .detail-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .activity-item {
        align-items: flex-start;
    }

    .notification-actions {
        flex-direction: column;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }
}

@media (max-width: 480px) {
    .page-title {
        max-width: 45vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-stats {
        gap: var(--space-3);
    }

    .stat-card {
        padding: var(--space-4);
    }

    .table-responsive .table {
        min-width: 680px;
    }

    .activity-item {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Modul lanjutan RT/RW Digital ===== */
.page-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-bottom:var(--space-4)}
.compact-control{width:auto;min-width:170px}
.content-grid{display:grid;gap:var(--space-6);align-items:start}.content-grid.two-columns{grid-template-columns:minmax(0,1.45fr) minmax(300px,.8fr)}
.feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:var(--space-5)}
.feature-card{position:relative;display:flex;flex-direction:column;gap:12px;min-width:0;padding:20px;border:1px solid var(--gray-200);border-radius:18px;background:#fff;box-shadow:var(--shadow-sm);transition:.2s ease}
.feature-card:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}.feature-card.compact{padding:18px}.feature-card h3{margin:4px 0;font-size:1.05rem;overflow-wrap:anywhere}.feature-card p{margin:0;color:var(--gray-600);line-height:1.55;overflow-wrap:anywhere}.feature-card>small{color:var(--gray-500)}
.feature-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.feature-card-head>div{min-width:0}.feature-card .feature-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:var(--gray-100);font-size:1.35rem;flex:0 0 auto}
.metric-row{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--gray-500);font-size:.85rem;flex-wrap:wrap}.card-actions,.inline-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.feature-card .card-actions{margin-top:auto}
.stack-list{display:grid;gap:12px}.stack-item{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px;border:1px solid var(--gray-200);border-radius:14px;background:var(--gray-50)}.stack-item.align-start{align-items:flex-start}.stack-item>div:first-child{display:grid;gap:4px;min-width:0}.stack-item strong,.stack-item small,.stack-item b{overflow-wrap:anywhere}.stack-item small{display:block;color:var(--gray-500)}
.empty-state{grid-column:1/-1;text-align:center;padding:50px 20px;color:var(--gray-500);border:1px dashed var(--gray-300);border-radius:16px;background:#fff}.empty-state.compact{padding:24px 16px}
.border-top{border-top:1px solid var(--gray-200)}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.inline-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.upload-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:16px}.upload-box{display:grid;gap:8px;padding:16px;border:1px dashed var(--gray-300);border-radius:14px;background:var(--gray-50);font-weight:700}.upload-box input{font-weight:400}.upload-box small{color:var(--success-600,#15803d)}
.check-row{display:flex;align-items:flex-start;gap:10px;padding:10px;border-radius:10px;cursor:pointer}.check-row:hover{background:var(--gray-50)}.check-row input{width:18px;height:18px;margin-top:2px;flex:0 0 auto}.check-row span{display:grid;gap:2px}.check-row small{color:var(--gray-500)}
.permission-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:18px}.permission-group{border:1px solid var(--gray-200);border-radius:14px;padding:12px}.permission-group h4{margin:0 0 8px;padding-bottom:8px;border-bottom:1px solid var(--gray-200)}
.change-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px;margin-top:8px}.change-preview span{font-size:.85rem;color:var(--gray-700)}
.channel-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}.channel-card{display:grid;justify-items:start;gap:6px;padding:16px;border:1px solid var(--gray-200);border-radius:14px;background:var(--gray-50)}.channel-card h3,.channel-card p{margin:0}.channel-card img,.qris-preview{display:block;max-width:180px;width:100%;max-height:180px;object-fit:contain;border-radius:10px;background:#fff;padding:6px;border:1px solid var(--gray-200)}
.payment-summary{display:flex;justify-content:space-between;gap:12px;padding:14px;border-radius:12px;background:var(--primary-50,#eff6ff);margin-bottom:16px}.info-box{display:grid;gap:5px;padding:12px;border-radius:12px;background:var(--gray-50);border:1px solid var(--gray-200);margin-bottom:16px;overflow-wrap:anywhere}
.amount-income{color:var(--success-600,#15803d)}.amount-expense{color:var(--danger-600,#b91c1c)}
.ticket-card{border-top-width:4px}.ticket-card.priority-darurat{border-top-color:#dc2626}.ticket-card.priority-tinggi{border-top-color:#f59e0b}.ticket-card.priority-normal{border-top-color:#3b82f6}.ticket-card.priority-rendah{border-top-color:#94a3b8}
.timeline{display:grid;gap:0;margin:20px 0;padding-left:18px;border-left:2px solid var(--gray-200)}.timeline-item{position:relative;padding:0 0 18px 18px}.timeline-item:before{content:"";position:absolute;left:-24px;top:5px;width:10px;height:10px;border-radius:50%;background:var(--primary-500,#3b82f6);box-shadow:0 0 0 4px #fff}.timeline-item p{margin:6px 0;white-space:pre-wrap}.timeline-item small{display:block;color:var(--gray-500)}.staff-ticket-tools{margin-top:20px;padding:16px;border-radius:14px;background:var(--gray-50);border:1px solid var(--gray-200)}
.poll-options{display:grid;gap:9px}.poll-option{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:12px 14px;border:1px solid var(--gray-200);border-radius:12px;background:#fff;text-align:left;cursor:pointer}.poll-option:hover:not(:disabled){border-color:var(--primary-500,#3b82f6)}.poll-option.selected{border-color:var(--success-500,#22c55e);background:#f0fdf4}.poll-option:disabled{cursor:default;opacity:.9}.poll-option span,.poll-option b{position:relative;z-index:1}.poll-option b{font-size:.78rem;color:var(--gray-500);white-space:nowrap}.poll-option i{position:absolute;inset:0 auto 0 0;background:rgba(59,130,246,.09);pointer-events:none}.option-input-row{display:flex;gap:8px;margin-bottom:8px}.option-input-row .form-control{flex:1}
.sidebar-section-label{margin:var(--space-4) var(--space-6);padding-top:var(--space-4);border-top:1px solid rgba(255,255,255,.07);font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;color:var(--slate-500);font-weight:700}
.stat-link{text-decoration:none;color:inherit}.stat-link:hover{transform:translateY(-2px);box-shadow:var(--shadow-md)}
.activity-content h4 a{color:inherit;text-decoration:none}.activity-content h4 a:hover{text-decoration:underline}
.card-footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 20px;border-top:1px solid var(--gray-200)}
.badge-danger{background:#fee2e2;color:#991b1b}.badge-warning{background:#fef3c7;color:#92400e}.badge-secondary{background:#e2e8f0;color:#334155}.badge-success{background:#dcfce7;color:#166534}
.stat-card-icon.red{background:#fee2e2;color:#dc2626}
@media(max-width:1024px){.content-grid.two-columns{grid-template-columns:1fr}.permission-groups{grid-template-columns:1fr}.page-actions{justify-content:flex-start}}
@media(max-width:640px){.form-grid,.upload-grid,.change-preview{grid-template-columns:1fr}.feature-grid{grid-template-columns:1fr}.stack-item{align-items:flex-start;flex-direction:column}.stack-item .inline-actions{width:100%}.stack-item .inline-actions .btn{flex:1}.page-actions>*{width:100%}.compact-control{width:100%}.payment-summary{flex-direction:column}.permission-group{padding:10px}.channel-grid{grid-template-columns:1fr}}

/* ===== AWebServer mobile, branding, SweetAlert2, dan penyempurnaan responsif ===== */
html,
body {
    min-height: 100%;
}

body {
    opacity: 1;
    transform: none;
}

body.ui-ready {
    animation: rtrwPageReveal .3s ease both;
}

@keyframes rtrwPageReveal {
    from { opacity: .25; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

.auth-page {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding: clamp(16px, 4vw, 44px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-container {
    margin: auto;
    align-self: center;
    overflow: visible;
}

.auth-left,
.auth-right {
    min-width: 0;
}

.auth-right {
    overflow: visible;
}

.auth-brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
}

.auth-brand-logo,
.navbar-brand-logo,
.sidebar-brand-logo,
.hero-brand-logo {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,.96);
    padding: 5px;
    box-shadow: 0 12px 30px rgba(15,23,42,.18);
}

.navbar-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.sidebar-brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
}

.hero-brand-logo {
    width: 92px;
    height: 92px;
    margin: 0 auto 24px;
    border-radius: 24px;
}

.brand-logo-fallback {
    display: grid;
    place-items: center;
}

.auth-brand-name {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.25;
    color: #fff;
    text-align: left;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    flex-wrap: wrap;
}

.checkbox-label,
.consent {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    line-height: 1.45;
}

.checkbox-label input,
.consent input {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--primary-color);
}

.auth-form .form-control {
    min-height: 52px;
}

.auth-form .btn-block {
    width: 100%;
    min-height: 52px;
}

.toast-source-hidden {
    display: none !important;
}

.toast-container {
    top: 14px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 24px));
}

.rtrw-swal-toast {
    width: min(430px, calc(100vw - 24px)) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(15,23,42,.2) !important;
    padding: 10px 14px !important;
}

.rtrw-swal-toast .swal2-title {
    font-size: .95rem !important;
    line-height: 1.45 !important;
    text-align: left !important;
}

.rtrw-swal-popup {
    border-radius: 20px !important;
}

.form-span-2 {
    grid-column: 1 / -1;
}

.settings-section {
    margin-bottom: var(--space-6);
}

.settings-grid-gap {
    margin-top: var(--space-6);
}

.settings-subtitle {
    margin: 20px 0 12px;
}

.settings-toggle {
    margin-top: 14px;
    border: 1px solid var(--slate-200);
    background: var(--slate-50);
}

.color-input-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.color-input-row input[type="color"] {
    width: 56px;
    height: 48px;
    padding: 4px;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    background: #fff;
}

.stat-settings-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.mini-setting-card {
    display: grid;
    gap: 7px;
    padding: 13px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: var(--slate-50);
}

.mini-setting-card label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--slate-600);
}

.home-feature-settings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.home-feature-setting {
    align-content: start;
}

.feature-setting-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.feature-icon-input {
    width: 64px;
    min-width: 64px;
    text-align: center;
    font-size: 1.3rem;
    padding-inline: 6px;
}

.logo-preview-wrap {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--slate-200);
    border-radius: 14px;
    background: var(--slate-50);
}

.logo-preview-wrap[hidden] {
    display: none;
}

.logo-preview-wrap img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 5px;
    border: 1px solid var(--slate-200);
}

.installer-page {
    opacity: 1;
    transform: none;
}

@media (max-width: 900px) {
    .stat-settings-grid,
    .home-feature-settings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .auth-page {
        display: block;
        padding: 0;
        background: #fff;
        overflow-y: auto !important;
    }

    .auth-container {
        display: block;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        height: auto;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        overflow: visible;
    }

    .auth-left {
        min-height: auto;
        padding: 42px 20px 38px;
    }

    .auth-left h1 {
        font-size: clamp(1.7rem, 8vw, 2.15rem);
        line-height: 1.16;
    }

    .auth-left p {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
        font-size: .98rem;
    }

    .auth-right {
        min-height: auto;
        padding: 32px 20px 48px;
        justify-content: flex-start;
    }

    .auth-header {
        margin-bottom: 24px;
    }

    .auth-header h2 {
        font-size: 1.8rem;
    }

    .auth-footer {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .form-grid.two-columns,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-span-2 {
        grid-column: auto;
    }

    .auth-options {
        align-items: flex-start;
    }

    .auth-options .text-link {
        margin-left: auto;
    }

    .navbar-brand-logo {
        width: 40px;
        height: 40px;
    }

    .hero-brand-logo {
        width: 78px;
        height: 78px;
    }
}

@media (max-width: 520px) {
    .stat-settings-grid,
    .home-feature-settings {
        grid-template-columns: 1fr;
    }

    .auth-left {
        padding-top: 34px;
        padding-bottom: 32px;
    }

    .auth-right {
        padding-left: 18px;
        padding-right: 18px;
    }

    .auth-options {
        display: grid;
        grid-template-columns: 1fr;
    }

    .auth-options .text-link {
        margin-left: 30px;
    }

    .rtrw-swal-toast {
        width: calc(100vw - 16px) !important;
    }
}


/* Halaman status, reset password, dan utilitas publik */
.auth-container.single.auth-compact-page {
    width: min(560px, 100%);
    max-width: 560px;
    grid-template-columns: 1fr;
}

.auth-brand-dark {
    color: var(--slate-900);
}

.auth-message-page {
    text-align: center;
    align-items: stretch;
}

.message-page-icon {
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    line-height: 1;
    margin-bottom: 18px;
}

.message-page-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.message-user-info {
    text-align: left;
}

@media (max-width: 520px) {
    .message-page-actions .btn {
        width: 100%;
    }
}

.verification-page {
    max-width: 680px !important;
}
.verification-list .stack-item {
    flex-direction: row;
    align-items: center;
}
.verification-list .stack-item strong {
    text-align: right;
}
@media (max-width: 520px) {
    .verification-list .stack-item {
        align-items: flex-start;
        flex-direction: column;
    }
    .verification-list .stack-item strong {
        text-align: left;
    }
}

/* Dialog lokal saat SweetAlert2 CDN tidak tersedia */
.rtrw-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .54);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}
.rtrw-dialog-overlay.active { opacity: 1; visibility: visible; }
.rtrw-dialog {
    width: min(440px, 100%);
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    text-align: center;
    transform: translateY(10px) scale(.98);
    transition: transform .18s ease;
}
.rtrw-dialog-overlay.active .rtrw-dialog { transform: none; }
.rtrw-dialog-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border: 3px solid #93c5fd;
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 1.65rem;
    font-weight: 800;
}
.rtrw-dialog-icon.warning { border-color: #fcd34d; color: #d97706; }
.rtrw-dialog-icon.error { border-color: #fca5a5; color: #dc2626; }
.rtrw-dialog h3 { margin: 0 0 9px; font-size: 1.25rem; }
.rtrw-dialog p { margin: 0 0 18px; color: var(--slate-600); line-height: 1.55; white-space: pre-line; }
.rtrw-dialog-input { margin-bottom: 8px; text-align: left; }
.rtrw-dialog-error { display: block; margin-bottom: 10px; color: #dc2626; text-align: left; }
.rtrw-dialog-error[hidden] { display: none; }
.rtrw-dialog-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
@media (max-width: 480px) {
    .rtrw-dialog { padding: 20px 16px; }
    .rtrw-dialog-actions { flex-direction: column-reverse; }
    .rtrw-dialog-actions .btn { width: 100%; }
}

/* ========================================================================== 
   FIGMA UI REFRESH — AUTH, SIDEBAR, LOGO & FEEDBACK
   Lapisan terakhir ini sengaja menjadi sumber gaya utama tanpa merusak modul.
   ========================================================================== */
:root {
    --ui-primary: var(--primary-color, #3157b7);
    --ui-primary-dark: #23439a;
    --ui-primary-soft: #eef3ff;
    --ui-bg: #f5f7fc;
    --ui-surface: #ffffff;
    --ui-text: #172033;
    --ui-muted: #718096;
    --ui-border: #e5eaf3;
    --ui-danger: #dc3545;
    --ui-success: #149c67;
    --ui-warning: #d98b16;
    --ui-shadow-sm: 0 8px 24px rgba(31, 49, 90, .08);
    --ui-shadow-lg: 0 28px 70px rgba(23, 43, 88, .16);
    --ui-radius: 18px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--ui-bg);
    color: var(--ui-text);
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
.btn,
.sidebar-menu-item,
.notification-btn,
.topbar-logout,
.sidebar-logout-button {
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease,
        border-color .18s ease, color .18s ease, opacity .18s ease;
}

button:active,
.btn:active,
.sidebar-menu-item:active,
.notification-btn:active,
.topbar-logout:active,
.sidebar-logout-button:active {
    transform: scale(.98);
}

.card,
.stat-card,
.content-card,
.modal-content {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}

/* Logo tunggal dan fallback bersih. Tidak memakai emoji agar konsisten. */
.brand-logo {
    display: block;
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.brand-logo-fallback {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    background: #fff;
    color: var(--ui-primary);
}

.brand-logo-fallback[hidden] {
    display: none !important;
}

.brand-logo-fallback:not([hidden]) {
    display: grid !important;
}

.brand-logo-fallback::before {
    content: "";
    width: 62%;
    height: 62%;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.3 12 4l9 7.3v8.2a1.5 1.5 0 0 1-1.5 1.5H15v-6H9v6H4.5A1.5 1.5 0 0 1 3 19.5v-8.2Z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.3 12 4l9 7.3v8.2a1.5 1.5 0 0 1-1.5 1.5H15v-6H9v6H4.5A1.5 1.5 0 0 1 3 19.5v-8.2Z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ui-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Sidebar dan topbar modern
   -------------------------------------------------------------------------- */
.dashboard {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--ui-bg);
}

.sidebar {
    z-index: 1010;
    display: flex;
    flex-direction: column;
    width: 286px;
    padding: 14px;
    overflow: hidden;
    border-right: 1px solid #e8edf6;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    box-shadow: 12px 0 38px rgba(31, 55, 107, .06);
}

.sidebar-header {
    flex: 0 0 auto;
    min-height: 70px;
    padding: 7px 8px 17px;
    border-bottom: 1px solid #edf1f7;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.sidebar-brand-logo {
    width: 46px;
    height: 46px;
    padding: 7px;
    border: 1px solid #e3e9f4;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(42, 78, 169, .12);
}

.sidebar-brand-text {
    min-width: 0;
    line-height: 1.15;
}

.sidebar-brand-text strong {
    display: block;
    overflow: hidden;
    color: var(--ui-text);
    font-size: 1rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-brand-text small {
    display: block;
    margin-top: 5px;
    color: #8a97ac;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.sidebar-menu {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 2px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #ced8ea transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #ced8ea;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    min-height: 50px;
    margin: 3px 0;
    padding: 7px 11px;
    gap: 11px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: #5d6a7f;
    font-size: .9rem;
    font-weight: 650;
    text-decoration: none;
}

.sidebar-menu-item:hover {
    border-color: #e2e9f5;
    background: #f4f7fd;
    color: var(--ui-primary);
    transform: translateX(2px);
}

.sidebar-menu-icon {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    border-radius: 10px;
    background: #eef3fc;
    color: #607297;
    font-size: 0;
}

.sidebar-menu-item.active {
    border-color: rgba(49, 87, 183, .12);
    background: linear-gradient(135deg, var(--ui-primary) 0%, #4874dc 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(49, 87, 183, .23);
}

.sidebar-menu-item.active .sidebar-menu-icon {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.sidebar-user {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: wrap;
    padding: 11px;
    gap: 10px;
    border: 1px solid #e4eaf4;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(31, 49, 90, .07);
}

.sidebar-user-profile {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 10px;
}

.sidebar-user > .sidebar-user-avatar {
    flex: 0 0 auto;
}

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

.sidebar-user-avatar {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border: 2px solid #dfe7f6;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ui-primary), #5580e8);
    color: #fff;
    font-size: .8rem;
    font-weight: 800;
}

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

.sidebar-user-name {
    overflow: hidden;
    color: var(--ui-text);
    font-size: .85rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-role {
    margin-top: 2px;
    overflow: hidden;
    color: #8793a7;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    gap: 8px;
    border: 1px solid #f3d5d9;
    border-radius: 11px;
    background: #fff5f6;
    color: #c73345;
    font-size: .8rem;
    font-weight: 800;
    text-decoration: none;
}

.sidebar-logout-button:hover {
    border-color: #efc0c6;
    background: #ffecef;
    color: #a92334;
}

.main-content {
    min-height: 100vh;
    min-height: 100dvh;
    margin-left: 286px;
    background: var(--ui-bg);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: 76px;
    padding: 13px clamp(18px, 3vw, 32px);
    border-bottom: 1px solid rgba(221, 228, 241, .84);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 8px 24px rgba(25, 44, 85, .04);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.topbar-left {
    min-width: 0;
    gap: 13px;
}

.page-title {
    color: var(--ui-text);
    font-size: clamp(1.05rem, 2.2vw, 1.4rem);
    font-weight: 800;
    letter-spacing: -.02em;
}

.topbar .card-subtitle {
    margin-top: 3px;
    overflow: hidden;
    color: #8793a6;
    font-size: .75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-toggle,
.notification-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #e3e9f3;
    border-radius: 13px;
    background: #fff;
    color: #51617c;
    box-shadow: 0 7px 16px rgba(31, 49, 90, .05);
}

.notification-btn:hover,
.menu-toggle:hover {
    border-color: #d1dcf0;
    background: #f7f9fd;
    color: var(--ui-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 9px;
}

.topbar-logout {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    gap: 8px;
    border: 1px solid #f0d4d8;
    border-radius: 13px;
    background: #fff6f7;
    color: #c53345;
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
}

.topbar-logout:hover {
    border-color: #edbec5;
    background: #ffecef;
    color: #a72234;
}

.content {
    padding: clamp(18px, 3vw, 32px);
}

/* --------------------------------------------------------------------------
   Halaman login dan register gaya Figma
   -------------------------------------------------------------------------- */
body.auth-page {
    display: block;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(14px, 2.3vw, 28px);
    overflow-x: hidden;
    overflow-y: auto !important;
    overscroll-behavior-y: auto;
    background:
        radial-gradient(circle at 9% 12%, rgba(63, 104, 205, .15), transparent 28%),
        radial-gradient(circle at 92% 88%, rgba(88, 130, 226, .12), transparent 27%),
        #edf2fb;
    -webkit-overflow-scrolling: touch;
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    z-index: 0;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(1px);
}

.auth-page::before {
    top: -120px;
    right: -90px;
    width: 300px;
    height: 300px;
    background: rgba(49, 87, 183, .08);
}

.auth-page::after {
    bottom: -140px;
    left: -100px;
    width: 340px;
    height: 340px;
    background: rgba(49, 87, 183, .07);
}

.auth-container {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(1180px, 100%);
    min-height: min(760px, calc(100dvh - 56px));
    margin: 0 auto;
    overflow: hidden;
    grid-template-columns: minmax(380px, .92fr) minmax(500px, 1.08fr);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 30px;
    background: #fff;
    box-shadow: var(--ui-shadow-lg);
}

.auth-container.auth-register {
    width: min(1320px, 100%);
    min-height: max(780px, calc(100dvh - 56px));
    grid-template-columns: minmax(360px, .72fr) minmax(650px, 1.28fr);
}

.auth-left {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: clamp(38px, 5vw, 64px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 78% 12%, rgba(255, 255, 255, .18), transparent 27%),
        radial-gradient(circle at 10% 88%, rgba(255, 255, 255, .10), transparent 31%),
        linear-gradient(145deg, var(--ui-primary-dark) 0%, var(--ui-primary) 56%, #4c78dc 100%);
}

.auth-left::before,
.auth-left::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    pointer-events: none;
}

.auth-left::before {
    right: -98px;
    bottom: -96px;
    width: 270px;
    height: 270px;
}

.auth-left::after {
    right: -35px;
    bottom: -38px;
    width: 145px;
    height: 145px;
}

.auth-visual-top,
.auth-showcase,
.register-benefits,
.auth-security-note {
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-width: 0;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.auth-brand-logo {
    width: 50px;
    height: 50px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 15px;
    box-shadow: 0 12px 28px rgba(16, 36, 82, .2);
}

.auth-brand-copy {
    min-width: 0;
}

.auth-brand-copy strong {
    display: block;
    max-width: 235px;
    overflow: hidden;
    color: #fff;
    font-size: 1rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-brand-copy small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, .68);
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.auth-copy {
    max-width: 480px;
    margin-top: clamp(52px, 8vh, 92px);
}

.auth-eyebrow,
.auth-form-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 13px;
    color: inherit;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.auth-eyebrow {
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .11);
    color: rgba(255, 255, 255, .9);
}

.auth-copy h1 {
    max-width: 560px;
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: clamp(2rem, 4.2vw, 3.65rem);
    font-weight: 850;
    line-height: 1.06;
    letter-spacing: -.045em;
}

.auth-copy p {
    max-width: 490px;
    margin: 19px 0 0;
    color: rgba(255, 255, 255, .76);
    font-size: clamp(.93rem, 1.6vw, 1.06rem);
    line-height: 1.7;
}

.auth-showcase {
    display: grid;
    margin-top: 38px;
    gap: 10px;
}

.showcase-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.showcase-card {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 13px;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 15px;
    background: rgba(255, 255, 255, .10);
    box-shadow: none;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.showcase-main {
    padding: 15px;
}

.showcase-icon,
.mini-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    font-size: .86rem;
}

.showcase-card > div {
    min-width: 0;
}

.showcase-card strong,
.showcase-card small {
    display: block;
}

.showcase-card strong {
    overflow: hidden;
    color: #fff;
    font-size: .77rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.showcase-card small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .62);
    font-size: .64rem;
}

.showcase-badge {
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(83, 227, 158, .16);
    color: #baffdf;
    font-size: .62rem;
    font-weight: 800;
}

.auth-security-note {
    display: flex;
    align-items: center;
    margin-top: 22px;
    gap: 8px;
    color: rgba(255, 255, 255, .65);
    font-size: .7rem;
    line-height: 1.5;
}

.register-benefits {
    display: grid;
    margin-top: clamp(42px, 7vh, 72px);
    gap: 12px;
}

.register-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, .84);
    font-size: .85rem;
}

.register-benefit > span:first-child {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    background: rgba(255, 255, 255, .11);
}

.auth-right {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: clamp(36px, 5vw, 72px);
    overflow: visible;
    background: #fff;
}

.auth-register .auth-right {
    align-items: flex-start;
    padding: clamp(30px, 4vw, 54px);
    overflow-y: auto;
}

.auth-panel-inner {
    width: min(470px, 100%);
    margin: auto;
}

.auth-panel-register {
    width: min(750px, 100%);
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    margin-bottom: 23px;
    gap: 10px;
    color: var(--ui-text);
}

.auth-mobile-brand .auth-brand-logo {
    width: 42px;
    height: 42px;
    border-color: #e0e7f2;
    box-shadow: 0 8px 18px rgba(31, 49, 90, .1);
}

.auth-mobile-brand strong {
    overflow: hidden;
    font-size: .95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-header {
    margin-bottom: 28px;
    text-align: left;
}

.auth-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.auth-form-kicker {
    margin-bottom: 9px;
    color: var(--ui-primary);
}

.auth-header h2 {
    margin: 0;
    color: var(--ui-text);
    font-family: inherit;
    font-size: clamp(1.75rem, 3.2vw, 2.45rem);
    font-weight: 850;
    line-height: 1.12;
    letter-spacing: -.04em;
}

.auth-header p {
    margin: 10px 0 0;
    color: var(--ui-muted);
    font-size: .92rem;
    line-height: 1.6;
}

.auth-step-badge {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid #dfe7f5;
    border-radius: 999px;
    background: #f7f9fd;
    color: #62718a;
    font-size: .68rem;
    font-weight: 800;
}

.auth-form {
    display: grid;
    gap: 17px;
}

.auth-form .form-group {
    min-width: 0;
    margin: 0;
}

.auth-form .form-label {
    display: block;
    margin: 0 0 8px;
    color: #344158;
    font-size: .78rem;
    font-weight: 800;
}

.input-shell {
    position: relative;
    min-width: 0;
}

.input-shell .form-control {
    width: 100%;
    min-height: 54px;
    padding: 13px 16px 13px 49px;
    border: 1.5px solid #dfe5ef;
    border-radius: 14px;
    outline: 0;
    background: #fbfcff;
    color: var(--ui-text);
    font-size: .91rem;
    box-shadow: none;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.input-shell textarea.form-control {
    min-height: 112px;
    resize: vertical;
}

.input-shell .form-control:hover {
    border-color: #ccd7e9;
}

.input-shell .form-control:focus {
    border-color: var(--ui-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(49, 87, 183, .11);
}

.input-shell .form-control::placeholder {
    color: #a4afc1;
}

.input-shell .form-control.has-trailing-button {
    padding-right: 51px;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: #8b98ad;
    font-size: .82rem;
    font-weight: 800;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 9px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8290a6;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: #edf2fa;
    color: var(--ui-primary);
}

.password-toggle:active {
    transform: translateY(-50%) scale(.96);
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1px;
    gap: 14px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    color: #5e6b80;
    font-size: .78rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 0;
    accent-color: var(--ui-primary);
}

.text-link,
.auth-footer a,
.auth-back-link {
    color: var(--ui-primary);
    font-weight: 800;
    text-decoration: none;
}

.text-link:hover,
.auth-footer a:hover,
.auth-back-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 54px;
    margin-top: 3px;
    padding: 0 19px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ui-primary-dark), var(--ui-primary) 58%, #4f7ee4);
    color: #fff;
    font-size: .92rem;
    font-weight: 850;
    box-shadow: 0 12px 25px rgba(49, 87, 183, .24);
}

.auth-submit:hover {
    box-shadow: 0 15px 31px rgba(49, 87, 183, .31);
    transform: translateY(-1px);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0 17px;
    gap: 12px;
    color: #a0aabc;
    font-size: .68rem;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #e7ebf2;
}

.auth-footer {
    text-align: center;
}

.auth-footer p {
    margin: 0 0 10px;
    color: #7b879a;
    font-size: .82rem;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    padding: 7px 0;
    font-size: .77rem;
}

.auth-page .alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-width: 1px;
    border-style: solid;
    border-radius: 12px;
    font-size: .78rem;
    line-height: 1.5;
    box-shadow: none;
}

.auth-page .alert-success {
    border-color: #bee9d4;
    background: #eefbf5;
    color: #147449;
}

.auth-page .alert-error,
.auth-page .alert-danger {
    border-color: #f1c6cc;
    background: #fff2f4;
    color: #ad2f40;
}

.register-form {
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.form-span-2 {
    grid-column: span 2;
}

.form-section-title {
    display: flex;
    align-items: center;
    margin-top: 3px;
    gap: 11px;
}

.form-section-title > span {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    flex: 0 0 33px;
    border-radius: 10px;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    font-size: .76rem;
    font-weight: 900;
}

.form-section-title strong,
.form-section-title small {
    display: block;
}

.form-section-title strong {
    color: #263248;
    font-size: .83rem;
}

.form-section-title small {
    margin-top: 2px;
    color: #929caf;
    font-size: .68rem;
}

/* --------------------------------------------------------------------------
   SweetAlert2 solid + fallback lokal. Seluruh toast tampil atas-tengah.
   -------------------------------------------------------------------------- */
.swal2-container {
    position: fixed !important;
    inset: 0 !important;
    z-index: 20000 !important;
    display: grid !important;
    box-sizing: border-box !important;
    place-items: center !important;
    padding: 16px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: rgba(15, 23, 42, .46) !important;
    font-family: inherit !important;
    -webkit-overflow-scrolling: touch;
}

.swal2-container.swal2-top,
.swal2-container.swal2-top-start,
.swal2-container.swal2-top-end {
    align-items: start !important;
    justify-items: center !important;
    padding-top: max(14px, env(safe-area-inset-top)) !important;
}

.swal2-container:has(.swal2-toast),
.swal2-container.swal2-top:has(.swal2-toast),
.swal2-container.swal2-top-start:has(.swal2-toast),
.swal2-container.swal2-top-end:has(.swal2-toast) {
    pointer-events: none !important;
    background: transparent !important;
}

.swal2-popup {
    position: relative !important;
    display: grid !important;
    width: min(430px, calc(100vw - 28px)) !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 26px 24px 22px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f2 !important;
    border-radius: 20px !important;
    outline: none !important;
    background: #fff !important;
    color: var(--ui-text) !important;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .26) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    text-align: center !important;
}

.swal2-popup.swal2-toast,
.rtrw-swal-toast {
    display: grid !important;
    width: min(460px, calc(100vw - 20px)) !important;
    min-height: 62px !important;
    padding: 12px 14px !important;
    overflow: visible !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    column-gap: 11px !important;
    border: 1px solid #dfe6f1 !important;
    border-radius: 15px !important;
    background: #fff !important;
    color: var(--ui-text) !important;
    box-shadow: 0 15px 42px rgba(20, 37, 76, .22) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    text-align: left !important;
}

.swal2-title {
    position: relative !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--ui-text) !important;
    font-size: 1.26rem !important;
    font-weight: 850 !important;
    line-height: 1.28 !important;
}

.swal2-toast .swal2-title,
.rtrw-swal-toast .swal2-title {
    grid-column: 2 !important;
    color: #263248 !important;
    font-size: .82rem !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    text-align: left !important;
}

.swal2-html-container {
    margin: 11px 0 0 !important;
    padding: 0 !important;
    overflow-wrap: anywhere !important;
    color: #657187 !important;
    font-size: .88rem !important;
    line-height: 1.58 !important;
}

.swal2-icon {
    position: relative !important;
    display: grid !important;
    place-items: center !important;
    width: 58px !important;
    height: 58px !important;
    margin: 0 auto 17px !important;
    border-width: 3px !important;
    border-style: solid !important;
    border-radius: 50% !important;
    box-sizing: content-box !important;
    background: #fff !important;
}

.swal2-toast .swal2-icon,
.rtrw-swal-toast .swal2-icon {
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    border-width: 2px !important;
    transform: none !important;
}

.swal2-icon.swal2-success {
    border-color: #54c695 !important;
    color: #169361 !important;
}

.swal2-icon.swal2-error {
    border-color: #ef8d99 !important;
    color: #d43d50 !important;
}

.swal2-icon.swal2-warning {
    border-color: #efc15e !important;
    color: #c8840f !important;
}

.swal2-icon.swal2-info,
.swal2-icon.swal2-question {
    border-color: #7ca1e8 !important;
    color: var(--ui-primary) !important;
}

.swal2-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 22px 0 0 !important;
    gap: 10px !important;
}

.swal2-actions button {
    min-height: 43px !important;
    margin: 0 !important;
    padding: 0 17px !important;
    border: 0 !important;
    border-radius: 11px !important;
    font-family: inherit !important;
    font-size: .8rem !important;
    font-weight: 850 !important;
    cursor: pointer !important;
}

.rtrw-swal-confirm,
.swal2-confirm {
    background: linear-gradient(135deg, var(--ui-primary-dark), var(--ui-primary)) !important;
    color: #fff !important;
    box-shadow: 0 9px 21px rgba(49, 87, 183, .23) !important;
}

.rtrw-swal-cancel,
.swal2-cancel {
    border: 1px solid #dde4ef !important;
    background: #f5f7fb !important;
    color: #4d5c73 !important;
}

.swal2-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 2 !important;
    width: 36px !important;
    height: 36px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #f2f5fa !important;
    color: #7f8ca1 !important;
    font-size: 1.35rem !important;
}

.swal2-input,
.swal2-textarea,
.swal2-select {
    width: 100% !important;
    min-height: 48px !important;
    margin: 17px 0 0 !important;
    padding: 11px 13px !important;
    border: 1.5px solid #dfe5ef !important;
    border-radius: 11px !important;
    background: #fbfcff !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
    font-family: inherit !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: var(--ui-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(49, 87, 183, .11) !important;
}

.swal2-timer-progress-bar-container {
    position: absolute !important;
    right: 12px !important;
    bottom: 0 !important;
    left: 12px !important;
    height: 3px !important;
    overflow: hidden !important;
    border-radius: 999px !important;
    background: #edf1f7 !important;
}

.swal2-timer-progress-bar {
    height: 100% !important;
    border-radius: inherit !important;
    background: var(--ui-primary) !important;
}

.rtrw-swal-show {
    animation: rtrwPopupIn .2s cubic-bezier(.2, .8, .2, 1) both !important;
}

.rtrw-swal-hide {
    animation: rtrwPopupOut .16s ease both !important;
}

@keyframes rtrwPopupIn {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rtrwPopupOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-8px) scale(.98); }
}

.toast-container {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    z-index: 19990;
    display: grid;
    justify-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    width: min(460px, 100%);
    min-height: 60px;
    padding: 12px 14px;
    gap: 11px;
    border: 1px solid #dfe6f1;
    border-radius: 15px;
    background: #fff !important;
    color: var(--ui-text) !important;
    box-shadow: 0 15px 42px rgba(20, 37, 76, .22);
    opacity: 1 !important;
    pointer-events: auto;
    animation: rtrwPopupIn .2s cubic-bezier(.2, .8, .2, 1) both;
}

.toast-success { border-left: 4px solid var(--ui-success); }
.toast-error { border-left: 4px solid var(--ui-danger); }
.toast-warning { border-left: 4px solid var(--ui-warning); }
.toast-info { border-left: 4px solid var(--ui-primary); }

.rtrw-dialog-overlay {
    z-index: 19980;
    padding: 16px;
    background: rgba(15, 23, 42, .48);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.rtrw-dialog {
    width: min(430px, 100%);
    padding: 26px 23px 22px;
    border: 1px solid #e2e8f2;
    border-radius: 20px;
    background: #fff !important;
    color: var(--ui-text);
    box-shadow: 0 28px 70px rgba(15, 23, 42, .26);
    opacity: 1 !important;
}

/* --------------------------------------------------------------------------
   Responsif tablet dan ponsel Android
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .auth-container,
    .auth-container.auth-register {
        grid-template-columns: minmax(320px, .8fr) minmax(500px, 1.2fr);
    }

    .auth-left {
        padding: 38px;
    }

    .auth-right,
    .auth-register .auth-right {
        padding: 38px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: min(286px, calc(100vw - 58px));
        transform: translateX(-105%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .menu-toggle {
        display: grid;
    }

    body.auth-page {
        padding: 0;
        background: #fff;
    }

    .auth-page::before,
    .auth-page::after {
        display: none;
    }

    .auth-container,
    .auth-container.auth-register {
        display: block;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: #fff;
        box-shadow: none;
    }

    .auth-left {
        min-height: 280px;
        padding: max(24px, env(safe-area-inset-top)) 22px 72px;
        justify-content: flex-start;
    }

    .auth-page-register .auth-left {
        min-height: 245px;
    }

    .auth-left .auth-brand,
    .auth-showcase,
    .register-benefits,
    .auth-security-note {
        display: none;
    }

    .auth-copy {
        max-width: 600px;
        margin: auto 0;
        padding-top: 18px;
        text-align: center;
    }

    .auth-copy h1 {
        max-width: 600px;
        font-size: clamp(1.9rem, 8.5vw, 2.75rem);
    }

    .auth-copy p {
        max-width: 560px;
        margin: 13px auto 0;
        font-size: .91rem;
        line-height: 1.6;
    }

    .auth-eyebrow {
        margin-right: auto;
        margin-left: auto;
    }

    .auth-right,
    .auth-register .auth-right {
        position: relative;
        z-index: 3;
        display: block;
        min-height: calc(100dvh - 230px);
        margin-top: -42px;
        padding: 30px 20px max(38px, env(safe-area-inset-bottom));
        overflow: visible;
        border-radius: 30px 30px 0 0;
        background: #fff;
        box-shadow: 0 -15px 35px rgba(21, 42, 86, .10);
    }

    .auth-page-register .auth-right {
        min-height: calc(100dvh - 200px);
    }

    .auth-panel-inner,
    .auth-panel-register {
        width: min(650px, 100%);
    }

    .auth-mobile-brand {
        display: flex;
    }
}

@media (max-width: 640px) {
    .topbar {
        min-height: 66px;
        padding: 10px 13px;
    }

    .topbar .card-subtitle {
        display: none;
    }

    .topbar-right {
        gap: 6px;
    }

    .topbar-logout {
        width: 42px;
        padding: 0;
        justify-content: center;
    }

    .topbar-logout span {
        display: none;
    }

    .content {
        padding: 15px 12px 28px;
    }

    .auth-left {
        min-height: 250px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .auth-page-register .auth-left {
        min-height: 220px;
    }

    .auth-right,
    .auth-register .auth-right {
        min-height: calc(100dvh - 205px);
        margin-top: -34px;
        padding: 27px 17px max(36px, env(safe-area-inset-bottom));
        border-radius: 25px 25px 0 0;
    }

    .auth-mobile-brand {
        margin-bottom: 21px;
    }

    .auth-header {
        margin-bottom: 23px;
    }

    .auth-header-row {
        display: block;
    }

    .auth-step-badge {
        margin-top: 12px;
    }

    .auth-header h2 {
        font-size: 1.82rem;
    }

    .auth-header p {
        font-size: .84rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-span-2 {
        grid-column: auto;
    }

    .input-shell .form-control {
        min-height: 52px;
        font-size: 16px; /* mencegah auto zoom Chrome Android */
    }

    .auth-submit {
        min-height: 53px;
    }

    .swal2-popup {
        padding: 23px 17px 19px !important;
        border-radius: 17px !important;
    }

    .swal2-popup.swal2-toast,
    .rtrw-swal-toast {
        width: calc(100vw - 18px) !important;
        padding: 11px 12px !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 390px) {
    .auth-left {
        min-height: 235px;
    }

    .auth-copy h1 {
        font-size: 1.82rem;
    }

    .auth-copy p {
        font-size: .82rem;
    }

    .auth-options {
        align-items: flex-start;
        gap: 9px;
    }

    .checkbox-label,
    .text-link {
        font-size: .72rem;
    }

    .auth-footer p,
    .auth-back-link {
        font-size: .74rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Penyempurnaan komponen input dan fallback tanpa CDN */
.auth-form .form-control {
    width: 100%;
    min-height: 54px;
    padding: 13px 15px;
    border: 1.5px solid #dfe5ef;
    border-radius: 14px;
    outline: 0;
    background: #fbfcff;
    color: var(--ui-text);
    font-size: .91rem;
    box-shadow: none;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.auth-form select.form-control {
    padding-right: 38px;
    background-color: #fbfcff;
}

.auth-form .form-control:hover {
    border-color: #ccd7e9;
}

.auth-form .form-control:focus {
    border-color: var(--ui-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(49, 87, 183, .11);
}

.input-shell .form-control {
    padding-left: 49px;
}

.password-eye {
    position: relative;
    display: block;
    width: 19px;
    height: 13px;
    border: 1.8px solid currentColor;
    border-radius: 50% / 58%;
}

.password-eye::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.password-eye.is-visible::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -2px;
    width: 23px;
    height: 1.8px;
    border-radius: 999px;
    background: currentColor;
    transform: rotate(-40deg);
}

.rtrw-swal-toast-container {
    align-items: start !important;
    justify-items: center !important;
    padding-top: max(14px, env(safe-area-inset-top)) !important;
    background: transparent !important;
    pointer-events: none !important;
}

.rtrw-swal-toast-container .swal2-popup {
    pointer-events: auto !important;
}

.toast-danger {
    border-left: 4px solid var(--ui-danger);
}

.toast-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: var(--ui-primary);
    box-shadow: 0 0 0 5px rgba(49, 87, 183, .10);
}

.toast-success .toast-dot { background: var(--ui-success); box-shadow: 0 0 0 5px rgba(20, 156, 103, .10); }
.toast-danger .toast-dot { background: var(--ui-danger); box-shadow: 0 0 0 5px rgba(220, 53, 69, .10); }
.toast-warning .toast-dot { background: var(--ui-warning); box-shadow: 0 0 0 5px rgba(217, 139, 22, .10); }

.toast > span:nth-child(2) {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
    font-size: .8rem;
    font-weight: 750;
    line-height: 1.45;
}

.toast > button {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #f1f4f9;
    color: #7f8b9e;
    font-size: 1.1rem;
}

.ui-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 19980;
    display: grid;
    place-items: center;
    padding: 16px;
    overflow-y: auto;
    background: rgba(15, 23, 42, .48);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.ui-dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ui-dialog-card {
    width: min(430px, 100%);
    max-height: calc(100dvh - 32px);
    padding: 26px 23px 22px;
    overflow-y: auto;
    border: 1px solid #e2e8f2;
    border-radius: 20px;
    background: #fff;
    color: var(--ui-text);
    box-shadow: 0 28px 70px rgba(15, 23, 42, .26);
    opacity: 1;
    text-align: center;
    transform: translateY(10px) scale(.98);
    transition: transform .18s ease;
}

.ui-dialog-overlay.active .ui-dialog-card {
    transform: translateY(0) scale(1);
}

.ui-dialog-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border: 3px solid #7ca1e8;
    border-radius: 50%;
    color: var(--ui-primary);
    font-size: 1.45rem;
    font-weight: 900;
}

.ui-dialog-icon.error { border-color: #ef8d99; color: #d43d50; }
.ui-dialog-icon.warning { border-color: #efc15e; color: #c8840f; }
.ui-dialog-icon.success { border-color: #54c695; color: #169361; }

.ui-dialog-card h3 {
    margin: 0;
    color: var(--ui-text);
    font-size: 1.25rem;
    font-weight: 850;
}

.ui-dialog-card p {
    margin: 10px 0 0;
    color: #657187;
    font-size: .87rem;
    line-height: 1.6;
    white-space: pre-line;
}

.ui-dialog-input {
    margin-top: 17px !important;
    text-align: left;
}

.ui-dialog-error {
    display: block;
    margin-top: 7px;
    color: var(--ui-danger);
    font-size: .72rem;
    text-align: left;
}

.ui-dialog-error[hidden] {
    display: none;
}

.ui-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
    gap: 10px;
}

.ui-dialog-actions .btn {
    min-height: 43px;
    padding: 0 17px;
    border-radius: 11px;
}

.toast-source-hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .auth-form .form-control {
        min-height: 52px;
        font-size: 16px;
    }

    .ui-dialog-card {
        padding: 23px 17px 19px;
        border-radius: 17px;
    }

    .ui-dialog-actions {
        flex-direction: column-reverse;
    }

    .ui-dialog-actions .btn {
        width: 100%;
    }
}

.installer-logo.brand-logo-fallback {
    width: 62px;
    height: 62px;
    margin-bottom: 14px;
    border: 1px solid #dfe6f2;
    border-radius: 18px;
    background: #eef3ff;
    color: var(--ui-primary);
    box-shadow: 0 10px 24px rgba(49, 87, 183, .13);
    font-size: 0;
}

/* Konsistensi seluruh halaman aplikasi */
.sidebar-section-label,
.sidebar-menu > div[style*="border-top"] {
    margin: 13px 9px 6px !important;
    padding: 12px 3px 0 !important;
    border-top: 1px solid #e7ecf4 !important;
    color: #97a3b5 !important;
    font-size: .62rem !important;
    font-weight: 850 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
}

.sidebar-menu > div[style*="border-top"] span {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
}

.btn {
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.1;
    box-shadow: none;
}

.btn::before {
    display: none;
}

.btn-primary {
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--ui-primary-dark), var(--ui-primary) 64%, #4f7ee4);
    box-shadow: 0 9px 20px rgba(49, 87, 183, .19);
}

.btn-primary:hover {
    box-shadow: 0 12px 25px rgba(49, 87, 183, .25);
    transform: translateY(-1px);
}

.btn-outline {
    border: 1px solid #d7e0ee;
    background: #fff;
    color: #516078;
}

.btn-outline:hover {
    border-color: #c5d2e7;
    background: #f4f7fc;
    color: var(--ui-primary);
    transform: translateY(-1px);
}

.btn-danger {
    border: 1px solid transparent;
    background: linear-gradient(135deg, #c93648, #e15465);
    box-shadow: 0 9px 20px rgba(207, 54, 72, .16);
}

.btn-sm {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 10px;
    font-size: .73rem;
}

.btn-icon {
    width: 40px;
    min-width: 40px;
    padding: 0;
}

.form-label {
    color: #3e4b61;
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: 0;
}

body:not(.auth-page) .form-control {
    min-height: 46px;
    padding: 10px 13px;
    border: 1.5px solid #dfe5ef;
    border-radius: 12px;
    background-color: #fbfcff;
    color: var(--ui-text);
    font-size: .86rem;
    box-shadow: none;
}

body:not(.auth-page) .form-control:focus {
    border-color: var(--ui-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(49, 87, 183, .10);
}

.card,
.table-container {
    overflow: hidden;
    border: 1px solid #e4eaf3;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 49, 90, .06);
}

.card:hover {
    box-shadow: 0 10px 28px rgba(31, 49, 90, .08);
    transform: none;
}

.card-header,
.table-header {
    min-height: 67px;
    padding: 17px 20px;
    border-bottom: 1px solid #edf1f6;
    background: #fff;
}

.card-title {
    color: var(--ui-text);
    font-size: 1rem;
    font-weight: 850;
}

.card-subtitle {
    color: #8995a8;
    font-size: .76rem;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid #edf1f6;
    background: #fafbfd;
}

.dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 22px;
}

.stat-card {
    min-width: 0;
    padding: 18px;
    gap: 14px;
    border: 1px solid #e4eaf3;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(31, 49, 90, .06);
}

.stat-card::before {
    display: none;
}

.stat-card:hover {
    box-shadow: 0 12px 28px rgba(31, 49, 90, .09);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    border-radius: 14px;
    font-size: 1.45rem;
}

.stat-card-content {
    min-width: 0;
}

.stat-card-content h3 {
    margin: 0 0 3px;
    overflow-wrap: anywhere;
    color: var(--ui-text);
    font-size: clamp(1.25rem, 3vw, 1.65rem);
    font-weight: 850;
    line-height: 1.15;
}

.stat-card-content p {
    color: #8793a6;
    font-size: .76rem;
    line-height: 1.4;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    min-width: 720px;
    font-size: .82rem;
}

.table th,
.table td {
    padding: 13px 16px;
    vertical-align: middle;
}

.table th {
    border-bottom: 1px solid #e4eaf3;
    background: #f7f9fc;
    color: #758197;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .055em;
}

.table tr {
    border-bottom: 1px solid #edf1f6;
}

.table tbody tr:hover {
    background: #f8faff;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    min-height: 25px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .66rem;
    font-weight: 850;
    letter-spacing: .01em;
}

.badge-success { border-color: #bfe8d4; background: #eefbf5; color: #14784c; }
.badge-warning { border-color: #f2d8a4; background: #fff8e9; color: #a76608; }
.badge-danger { border-color: #f1c7cd; background: #fff2f4; color: #b12e40; }
.badge-info,
.badge-primary { border-color: #cad8f4; background: #f0f4fd; color: #365da9; }

.modal-overlay {
    padding: 16px;
    background: rgba(15, 23, 42, .52);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.modal {
    width: min(560px, 100%);
    max-height: calc(100dvh - 32px);
    border: 1px solid #e1e7f1;
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .25);
}

.modal.modal-lg {
    max-width: 820px;
}

.modal-header {
    min-height: 66px;
    padding: 16px 19px;
    border-bottom: 1px solid #e9eef5;
    background: #fff;
}

.modal-title {
    color: var(--ui-text);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 850;
}

.modal-close {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: #f1f4f9;
    color: #7a879b;
}

.modal-close:hover {
    background: #ffecef;
    color: #bd2d40;
    transform: none;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 19px;
    border-top: 1px solid #e9eef5;
    background: #fafbfd;
}

.notification-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #fff;
    background: #e04456;
    font-size: .61rem;
    box-shadow: 0 5px 10px rgba(224, 68, 86, .24);
}

@media (max-width: 640px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        display: block;
        padding: 14px;
    }

    .stat-card-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 11px;
        font-size: 1.2rem;
    }

    .stat-card-content h3 {
        font-size: 1.2rem;
    }

    .card-header,
    .table-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px;
        gap: 11px;
    }

    .card-header > .btn,
    .table-header > .btn {
        width: 100%;
    }

    .card-body,
    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        padding: 13px 15px;
    }

    .modal-footer .btn {
        width: 100%;
    }
}


/* ========================================================================== 
   Android hotfix v3: SweetAlert2 atas-tengah dan sidebar sentuh yang benar
   ========================================================================== */

/* SweetAlert2 bawaan memberi translateX(-50%) pada toast posisi top. Ketika
   container sudah full-screen, transform tersebut menggeser toast setengah
   layar ke kiri. Aturan ini menormalkan viewport dan membuat toast stabil. */
body.swal2-toast-shown .swal2-container.rtrw-swal-toast-container,
.swal2-container.rtrw-swal-toast-container {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    padding: max(12px, env(safe-area-inset-top)) 10px 10px !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    grid-template-columns: none !important;
    overflow: visible !important;
    transform: none !important;
    background: transparent !important;
    pointer-events: none !important;
}

body.swal2-toast-shown .swal2-container.rtrw-swal-toast-container > .swal2-popup,
.rtrw-swal-toast-container > .swal2-popup.swal2-toast,
.rtrw-swal-toast-container > .rtrw-swal-toast {
    position: relative !important;
    inset: auto !important;
    flex: 0 1 440px !important;
    width: min(440px, calc(100vw - 20px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 20px) !important;
    margin: 0 auto !important;
    transform-origin: top center !important;
    pointer-events: auto !important;
}

.rtrw-swal-toast .swal2-title,
.swal2-popup.swal2-toast .swal2-title {
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
}

.rtrw-swal-toast .swal2-close,
.swal2-popup.swal2-toast .swal2-close {
    position: static !important;
    inset: auto !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: center !important;
    justify-self: end !important;
    width: 29px !important;
    height: 29px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 9px !important;
    font-size: 1rem !important;
    line-height: 1 !important;
}

.rtrw-swal-toast .swal2-timer-progress-bar-container,
.swal2-popup.swal2-toast .swal2-timer-progress-bar-container {
    right: 10px !important;
    bottom: 0 !important;
    left: 10px !important;
}

@media (max-width: 1024px) {
    body.sidebar-open {
        overflow: hidden !important;
    }

    /* Android lebih stabil saat elemen fixed itu sendiri menjadi scroll
       container dibandingkan flex-child scroll bersarang. */
    .sidebar {
        top: 0 !important;
        bottom: auto !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        scrollbar-gutter: stable;
    }

    .sidebar-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 4 !important;
        background: rgba(255, 255, 255, .97) !important;
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }

    .sidebar-menu {
        flex: 0 0 auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
    }

    .sidebar-user {
        flex: 0 0 auto !important;
        margin-top: 8px !important;
        margin-bottom: max(2px, env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 520px) {
    body.swal2-toast-shown .swal2-container.rtrw-swal-toast-container,
    .swal2-container.rtrw-swal-toast-container {
        padding-right: 8px !important;
        padding-left: 8px !important;
    }

    .rtrw-swal-toast-container > .swal2-popup.swal2-toast,
    .rtrw-swal-toast-container > .rtrw-swal-toast {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        min-height: 56px !important;
        padding: 10px 11px !important;
        column-gap: 9px !important;
        border-radius: 13px !important;
    }

    .rtrw-swal-toast .swal2-icon,
    .swal2-popup.swal2-toast .swal2-icon {
        width: 25px !important;
        height: 25px !important;
    }
}

/* ========================================================================== 
   AUDIT RESPONSIVE v5 — header seragam, tabel Android, kartu dan aksi halaman
   ========================================================================== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.topbar-left {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-heading,
.topbar-left > div {
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-right {
    flex: 0 0 auto;
}

.page-title {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

.topbar-action-button {
    min-height: 42px;
    white-space: nowrap;
}

.mobile-topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.mobile-topbar-actions .btn {
    flex: 1 1 170px;
    min-width: 0;
}

.content {
    min-width: 0;
    overflow-x: clip;
}

.content > * {
    min-width: 0;
}

.feature-card,
.stat-card,
.card,
.table-container,
.empty-state {
    min-width: 0;
}

.feature-card.compact {
    padding: 16px;
}

.feature-card.compact .feature-card-head {
    align-items: center;
}

.feature-card.compact .feature-icon {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
}

.empty-state {
    padding: 34px 18px;
    line-height: 1.55;
}

.table-responsive {
    border-radius: inherit;
}

@media (max-width: 900px) {
    .table-responsive .table {
        min-width: 660px;
    }
}

@media (max-width: 700px) {
    .topbar {
        min-height: 70px;
        padding: 10px 12px;
        gap: 9px;
    }

    .topbar-left {
        gap: 9px;
    }

    .topbar-right {
        gap: 6px;
    }

    .menu-toggle,
    .notification-btn,
    .topbar-logout {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 12px !important;
        justify-content: center;
    }

    .topbar-logout span {
        display: none !important;
    }

    .page-title {
        display: -webkit-box;
        max-width: none !important;
        font-size: clamp(.96rem, 4.4vw, 1.1rem) !important;
        line-height: 1.22 !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden !important;
    }

    .topbar .card-subtitle {
        display: none !important;
    }

    .content {
        padding: 15px 12px 30px;
    }

    .page-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }

    .page-actions > * {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 46px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 16px;
    }

    .stat-card {
        display: flex;
        align-items: center;
        padding: 14px;
        gap: 11px;
    }

    .stat-card-icon {
        width: 43px;
        height: 43px;
        flex: 0 0 43px;
        margin: 0;
        border-radius: 13px;
        font-size: 1.18rem;
    }

    .stat-card-content h3 {
        font-size: clamp(1.06rem, 5vw, 1.28rem);
    }

    .stat-card-content p {
        font-size: .72rem;
    }

    .card-header,
    .table-header {
        min-height: 0;
        padding: 15px;
        gap: 9px;
    }

    .card-body {
        padding: 15px;
    }

    .feature-grid {
        gap: 13px;
    }

    .feature-card {
        padding: 16px;
        gap: 10px;
        border-radius: 16px;
    }

    .feature-card h3 {
        font-size: 1rem;
    }

    .feature-card p {
        font-size: .84rem;
    }

    .content [style*="minmax(400px"],
    .content [style*="minmax(350px"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
    }

    .content [style*="padding: 60px 20px"] {
        padding: 34px 16px !important;
    }
}

@media (max-width: 640px) {
    .table-responsive {
        overflow: visible;
        border-radius: 0;
    }

    .table.mobile-card-table {
        display: block;
        width: 100%;
        min-width: 0 !important;
        border: 0;
        background: transparent;
    }

    .table.mobile-card-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .table.mobile-card-table tbody {
        display: grid;
        gap: 11px;
    }

    .table.mobile-card-table tbody tr {
        display: block;
        overflow: hidden;
        border: 1px solid #e3e9f2;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 5px 15px rgba(31, 49, 90, .05);
    }

    .table.mobile-card-table tbody td {
        display: grid;
        grid-template-columns: minmax(92px, 38%) minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        min-height: 42px;
        padding: 10px 12px;
        border: 0;
        border-bottom: 1px solid #edf1f6;
        white-space: normal !important;
        overflow-wrap: anywhere;
        text-align: left;
    }

    .table.mobile-card-table tbody td:last-child {
        border-bottom: 0;
    }

    .table.mobile-card-table tbody td::before {
        content: attr(data-label);
        color: #7a8799;
        font-size: .68rem;
        font-weight: 850;
        letter-spacing: .035em;
        text-transform: uppercase;
    }

    .table.mobile-card-table tbody td.mobile-table-empty {
        display: block;
        padding: 26px 14px;
        color: #7b8799;
        text-align: center;
    }

    .table.mobile-card-table tbody td.mobile-table-empty::before {
        display: none;
    }

    .table.mobile-card-table .table-actions {
        justify-content: flex-start;
    }

    .table.mobile-card-table .table-actions .btn {
        flex: 1 1 105px;
    }

    .modal-footer {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex-direction: initial !important;
        gap: 10px;
    }

    .modal-footer .btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 45px;
    }

    .modal-footer .btn:only-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    .dashboard-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-title {
        font-size: .95rem !important;
    }

    .modal-footer {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ========================================================================== 
   RESPONSIVE v6 — spacing konsisten dan halaman Kartu Keluarga
   ========================================================================== */
.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content > .dashboard-stats,
.content > .mobile-topbar-actions,
.content > .page-actions {
    margin-bottom: 0 !important;
}

.kk-layout {
    display: grid;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.kk-list-card,
.kk-detail-card {
    width: 100%;
    min-width: 0;
    align-self: start;
}

.kk-list-body {
    padding: 12px !important;
}

.kk-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.kk-list-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #fff;
    color: var(--slate-700);
    font-size: .9rem;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease;
}

.kk-list-link:hover {
    border-color: rgba(37, 99, 235, .35);
    background: #f8fbff;
    color: var(--primary-color);
    transform: translateY(-1px);
}

.kk-list-link.active {
    border-color: transparent;
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .2);
}

.kk-list-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #eff6ff;
}

.kk-list-link.active .kk-list-icon {
    background: rgba(255,255,255,.18);
}

.kk-empty-list,
.kk-detail-empty {
    min-height: 150px;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--slate-500);
    text-align: center;
}

.kk-empty-icon,
.kk-detail-empty-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    background: #eff6ff;
    font-size: 1.6rem;
}

.kk-summary {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e4eaf2;
    border-radius: 16px;
    background: #f8fafc;
}

.kk-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.kk-summary-grid > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kk-members-table-wrap {
    width: 100%;
    min-width: 0;
}

.kk-members-table td > div {
    min-width: 0;
}

@media (max-width: 900px) {
    .kk-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .kk-list-card,
    .kk-detail-card {
        align-self: auto;
    }
}

@media (max-width: 700px) {
    .content {
        gap: 16px;
    }

    .content > .card,
    .content > .dashboard-stats,
    .content > .feature-grid,
    .content > .page-actions,
    .content > .mobile-topbar-actions,
    .content > .kk-layout {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .content [style*="grid-template-columns: 300px 1fr"],
    .content [style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
        align-items: start !important;
    }

    .modal [style*="grid-template-columns: 1fr 1fr"],
    .content [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    .kk-list-body {
        padding: 10px !important;
    }

    .kk-list {
        gap: 7px;
    }

    .kk-list-link {
        min-height: 48px;
        padding: 10px 12px;
    }

    .kk-empty-list,
    .kk-detail-empty {
        min-height: 130px;
        padding: 24px 14px;
    }

    .kk-summary {
        padding: 14px;
        margin-bottom: 14px;
    }

    .kk-summary-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .kk-summary-grid > div {
        padding-bottom: 11px;
        border-bottom: 1px solid #e7ecf3;
    }

    .kk-summary-grid > div:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .kk-members-table.mobile-card-table tbody td {
        grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    }
}

@media (max-width: 420px) {
    .content {
        gap: 14px;
    }

    .kk-layout {
        gap: 14px;
    }
}

@media (max-width: 700px) {
    html,
    body,
    .dashboard,
    .main-content,
    .content {
        max-width: 100%;
        min-width: 0;
    }

    html,
    body {
        overflow-x: hidden;
    }

    .content > *,
    .kk-layout > *,
    .dashboard-stats > * {
        max-width: 100%;
        min-width: 0;
    }
}

/* ========================================================================== 
   Patch 2026-06-29 — Bootstrap Icons, dashboard responsif, RT/RW & Fonnte
   ========================================================================== */
.ui-icon,
.button-icon,
.sidebar-menu-icon .bi,
.menu-toggle .bi,
.notification-btn .bi,
.topbar-logout .bi,
.sidebar-logout-button .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    font-size: 1.1rem;
    line-height: 1;
}

.sidebar-menu-icon .bi {
    font-size: 1.05rem;
}

.btn .bi,
.quick-action .bi,
.card-title .bi {
    flex: 0 0 auto;
    font-size: 1em;
    line-height: 1;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card-content strong {
    display: block;
    margin: 0 0 3px;
    overflow-wrap: anywhere;
    color: var(--ui-text, #172033);
    font-size: clamp(1.18rem, 3vw, 1.62rem);
    font-weight: 850;
    line-height: 1.15;
}

.stat-card-content small {
    display: block;
    color: #8793a6;
    font-size: .76rem;
    font-weight: 650;
    line-height: 1.4;
}

.stat-card-icon.purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.dashboard-home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(285px, .75fr);
    align-items: start;
    gap: 20px;
}

.dashboard-empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #8490a3;
    text-align: center;
}

.dashboard-empty-state .bi {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #eff4ff;
    color: var(--primary-color, #3157b7);
    font-size: 1.7rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-activity-link {
    display: flex;
    align-items: flex-start;
    padding: 13px;
    gap: 12px;
    border: 1px solid #e8edf5;
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.dashboard-activity-link:hover {
    border-color: rgba(49, 87, 183, .3);
    box-shadow: 0 8px 20px rgba(31, 49, 90, .07);
    transform: translateY(-1px);
}

.activity-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
}

.activity-icon.blue {
    background: #edf3ff;
    color: #3157b7;
}

.activity-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-content strong {
    color: #172033;
    font-size: .88rem;
    overflow-wrap: anywhere;
}

.activity-content span,
.activity-content small {
    color: #7d899c;
    font-size: .76rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
}

.quick-action {
    min-width: 0;
    min-height: 47px;
    display: flex;
    align-items: center;
    padding: 10px 13px;
    gap: 10px;
    border: 1px solid #e3e9f2;
    border-radius: 12px;
    background: #fff;
    color: #526177;
    font-size: .8rem;
    font-weight: 800;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.quick-action .bi {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #eff3fa;
    color: #526b9a;
}

.quick-action:hover {
    border-color: #cbd8ee;
    background: #f8faff;
    color: var(--primary-color, #3157b7);
    transform: translateY(-1px);
}

.quick-action.primary {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary-color, #3157b7), #4c7ce5);
    color: #fff;
}

.quick-action.success {
    border-color: transparent;
    background: linear-gradient(135deg, #079669, #13b981);
    color: #fff;
}

.quick-action.primary .bi,
.quick-action.success .bi {
    background: rgba(255,255,255,.17);
    color: #fff;
}

.dashboard-upcoming-card {
    margin-top: 20px;
}

.dashboard-upcoming-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.upcoming-activity {
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
    border: 1px solid #e5ebf4;
    border-radius: 14px;
    color: #27354a;
    text-decoration: none;
}

.upcoming-date {
    width: 48px;
    height: 52px;
    flex: 0 0 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eef4ff;
    color: var(--primary-color, #3157b7);
}

.upcoming-date strong { font-size: 1rem; line-height: 1; }
.upcoming-date small { margin-top: 3px; font-size: .58rem; font-weight: 850; }
.upcoming-activity > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.upcoming-activity > span:last-child strong { font-size: .84rem; overflow-wrap: anywhere; }
.upcoming-activity > span:last-child small { color: #8290a3; font-size: .7rem; overflow-wrap: anywhere; }

.organization-profile-switcher {
    margin-bottom: 20px;
}

.organization-profile-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.organization-profile-card {
    width: 100%;
    min-width: 0;
    min-height: 74px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    padding: 11px;
    gap: 10px;
    border: 1px solid #e3e9f2;
    border-radius: 14px;
    background: #fff;
    color: #26344a;
    text-align: left;
    cursor: pointer;
}

.organization-profile-card:hover,
.organization-profile-card.active {
    border-color: rgba(49, 87, 183, .42);
    background: #f7faff;
    box-shadow: 0 7px 18px rgba(49,87,183,.08);
}

.organization-profile-card.active {
    outline: 2px solid rgba(49,87,183,.12);
}

.organization-profile-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #edf3ff;
    color: var(--primary-color, #3157b7);
    font-size: 1.15rem;
}

.organization-profile-card > span:nth-child(2) {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.organization-profile-card strong,
.organization-profile-card small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.organization-profile-card strong { font-size: .82rem; }
.organization-profile-card small { color: #8490a2; font-size: .68rem; }

.whatsapp-settings-grid .card {
    height: 100%;
}

.password-input-row,
.color-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-input-row .form-control,
.color-input-row .form-control {
    min-width: 0;
    flex: 1 1 auto;
}

.btn-icon-only {
    width: 44px;
    min-width: 44px;
    padding: 0;
}

.compact-check {
    margin-top: 12px;
}

.provider-security-note {
    display: flex;
    align-items: flex-start;
    margin-top: 16px;
    padding: 13px;
    gap: 11px;
    border: 1px solid #cfe2f6;
    border-radius: 13px;
    background: #f3f8fe;
    color: #365777;
}

.provider-security-note > .bi {
    flex: 0 0 auto;
    font-size: 1.25rem;
}

.provider-security-note > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.provider-security-note strong { font-size: .82rem; }
.provider-security-note span { font-size: .72rem; line-height: 1.5; }
.table-subtext { display: block; margin-top: 3px; color: #8995a7; font-size: .68rem; }
.no-padding { padding: 0 !important; }
.text-center { text-align: center !important; }
.badge-secondary { border-color: #d9e0ea; background: #f3f5f8; color: #667386; }

/* Browser Android kadang melaporkan viewport layout lebar walau layar fisik sempit.
   Class mobile-shell ditentukan lewat screen/visualViewport oleh main.js. */
body.mobile-shell .dashboard {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body.mobile-shell .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: auto !important;
    width: min(286px, calc(100vw - 42px)) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    transform: translateX(-105%) !important;
    transition: transform .22s ease !important;
}

body.mobile-shell .sidebar.active {
    transform: translateX(0) !important;
}

body.mobile-shell .sidebar-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.mobile-shell .main-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
}

body.mobile-shell .menu-toggle {
    display: grid !important;
    flex: 0 0 42px;
}

body.mobile-shell .topbar {
    width: 100% !important;
    max-width: 100% !important;
}

body.mobile-shell .content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
}

body.mobile-shell .dashboard-home-grid,
body.mobile-shell .content-grid.two-columns,
body.mobile-shell .dashboard-upcoming-grid {
    grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 1024px) {
    .dashboard-home-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-upcoming-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        display: flex;
        align-items: center;
        padding: 12px;
        gap: 10px;
    }

    .stat-card-icon {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        margin: 0;
        font-size: 1.15rem;
    }

    .stat-card-content strong { font-size: 1.05rem; }
    .stat-card-content small { font-size: .67rem; }
    .dashboard-upcoming-grid { grid-template-columns: minmax(0, 1fr); }
    .organization-profile-list { grid-template-columns: minmax(0, 1fr); }
    .organization-profile-card { grid-template-columns: 40px minmax(0, 1fr); }
    .organization-profile-card > .badge { grid-column: 2; justify-self: start; }
    .password-input-row { align-items: stretch; }
    .topbar .card-subtitle { white-space: normal; line-height: 1.35; }
}

@media (max-width: 420px) {
    body.mobile-shell .content { padding: 12px !important; }
    .dashboard-stats { gap: 8px; }
    .stat-card { padding: 10px; }
    .stat-card-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
    .stat-card-content strong { font-size: .96rem; }
    .stat-card-content small { font-size: .62rem; }
    .card-header { padding: 14px; }
    .card-body { padding: 14px; }
}

.auth-brand-bi {
    display: grid;
    place-items: center;
    background: #eef4ff;
    color: var(--primary-color, #3157b7);
    font-size: 1.45rem;
}
.system-state-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin: 0 auto var(--space-4);
    border-radius: 22px;
    background: #eef4ff;
    color: var(--primary-color, #3157b7);
    font-size: 2.25rem;
}

/* ==========================================================
   Alur Surat Warga -> RT -> RW -> Penerbitan
   ========================================================== */
.letter-flow-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--slate-200);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .055);
}
.letter-flow-step {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    background: var(--slate-50);
}
.letter-flow-step > span {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 12px;
    background: #eaf1ff;
    color: var(--primary-color);
    font-size: 18px;
}
.letter-flow-step strong,
.letter-flow-step small { display: block; }
.letter-flow-step strong { color: var(--slate-800); font-size: 13px; line-height: 1.35; }
.letter-flow-step small { margin-top: 3px; color: var(--slate-500); font-size: 11px; line-height: 1.4; }
.letter-flow-arrow { align-self: center; color: var(--slate-300); }
.letter-stats .letter-stat-link { color: inherit; text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.letter-stats .letter-stat-link:hover { transform: translateY(-2px); }
.letter-stats .letter-stat-link.is-active { border-color: color-mix(in srgb, var(--primary-color) 36%, white); box-shadow: 0 10px 30px rgba(30, 64, 175, .11); }
.letter-main-card { overflow: visible; }
.letter-card-header { align-items: center; gap: 14px; }
.letter-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.letter-filter { width: 178px; min-width: 150px; }
.letter-list { display: grid; gap: 12px; }
.letter-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.letter-item:hover { border-color: #cbd8ee; box-shadow: 0 9px 26px rgba(15, 23, 42, .065); transform: translateY(-1px); }
.letter-item-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #edf3ff, #e6efff);
    color: var(--primary-color);
    font-size: 21px;
}
.letter-item-main { min-width: 0; }
.letter-item-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.letter-item-title-row h4 { margin: 0; color: var(--slate-900); font-size: 15px; line-height: 1.4; }
.letter-item-title-row p { margin: 3px 0 0; color: var(--slate-500); font-size: 11.5px; overflow-wrap: anywhere; }
.letter-item-title-row .badge { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; white-space: nowrap; }
.letter-item-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 10px; color: var(--slate-500); font-size: 11.5px; }
.letter-item-meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.letter-purpose { display: -webkit-box; margin: 10px 0 0; overflow: hidden; color: var(--slate-700); font-size: 12.5px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.letter-mini-progress { display: flex; align-items: center; gap: 4px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.letter-mini-progress::-webkit-scrollbar { display: none; }
.letter-mini-progress span { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: var(--slate-100); color: var(--slate-500); font-size: 10.5px; font-weight: 700; }
.letter-mini-progress span.done { background: #e9f8f0; color: #15784d; }
.letter-mini-progress span.rejected { background: #fff0f2; color: #b4233b; }
.letter-item-actions { display: flex; max-width: 250px; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.letter-item-actions .btn { white-space: nowrap; }
.letter-empty { display: flex; min-height: 235px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; }
.letter-empty > i { margin-bottom: 4px; color: var(--slate-300); font-size: 46px; }
.letter-empty strong { color: var(--slate-700); }
.letter-empty span { max-width: 430px; font-size: 12px; }
.letter-modal { width: min(720px, calc(100vw - 28px)); max-height: min(90vh, 820px); max-height: min(90dvh, 820px); }
.letter-detail-modal { width: min(880px, calc(100vw - 28px)); }
.letter-action-modal { width: min(560px, calc(100vw - 28px)); }
.letter-form-notice { display: flex; align-items: flex-start; gap: 9px; }
.letter-form-notice i { margin-top: 2px; }
.letter-upload-section { margin-top: 18px; padding: 15px; border: 1px solid var(--slate-200); border-radius: 14px; background: var(--slate-50); }
.letter-upload-section .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.letter-upload-section .section-heading strong,
.letter-upload-section .section-heading small { display: block; }
.letter-upload-section .section-heading strong { color: var(--slate-800); font-size: 13px; }
.letter-upload-section .section-heading small { margin-top: 3px; color: var(--slate-500); font-size: 11px; line-height: 1.45; }
.letter-upload-section .section-heading > i { color: var(--primary-color); font-size: 22px; }
.required-mark { color: var(--danger-color); }
.form-help { display: block; margin-top: 5px; color: var(--slate-500); font-size: 11px; }
.letter-loading { display: flex; min-height: 180px; align-items: center; justify-content: center; gap: 8px; color: var(--slate-500); }
.letter-loading i { animation: spin .9s linear infinite; }
.letter-detail-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 15px; border-bottom: 1px solid var(--slate-200); }
.letter-detail-summary .badge { display: inline-flex; align-items: center; gap: 5px; }
.letter-detail-summary h4 { margin: 9px 0 2px; color: var(--slate-900); font-size: 17px; }
.letter-detail-summary p { margin: 0; color: var(--slate-500); font-size: 12px; overflow-wrap: anywhere; }
.letter-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0; }
.letter-timeline-step { position: relative; display: flex; min-width: 0; align-items: flex-start; gap: 8px; padding-right: 12px; }
.timeline-marker { position: relative; z-index: 2; display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border: 2px solid var(--slate-200); border-radius: 50%; background: #fff; color: var(--slate-400); font-size: 12px; }
.letter-timeline-step.done .timeline-marker { border-color: #86d5ae; background: #eaf9f1; color: #13764a; }
.letter-timeline-step.rejected .timeline-marker { border-color: #f1a7b3; background: #fff0f2; color: #b4233b; }
.letter-timeline-step strong,
.letter-timeline-step small { display: block; }
.letter-timeline-step strong { color: var(--slate-700); font-size: 11.5px; line-height: 1.4; }
.letter-timeline-step small { margin-top: 2px; color: var(--slate-500); font-size: 9.5px; line-height: 1.4; }
.timeline-line { position: absolute; z-index: 1; top: 14px; left: 30px; right: -1px; height: 2px; background: var(--slate-200); }
.letter-timeline-step.done .timeline-line { background: #b8e5cf; }
.letter-detail-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(260px, .92fr); gap: 18px; }
.letter-detail-grid section { min-width: 0; }
.letter-detail-grid h5 { margin: 0 0 10px; color: var(--slate-800); font-size: 13px; }
.letter-detail-grid .detail-list { border: 1px solid var(--slate-200); border-radius: 13px; overflow: hidden; }
.letter-detail-grid .detail-row { display: grid; grid-template-columns: minmax(120px, .42fr) minmax(0, .58fr); gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--slate-100); font-size: 12px; }
.letter-detail-grid .detail-row:last-child { border-bottom: 0; }
.letter-detail-grid .detail-row strong { color: var(--slate-600); }
.letter-detail-grid .detail-row span { color: var(--slate-800); overflow-wrap: anywhere; text-align: right; }
.letter-detail-grid .detail-rejection { background: #fff5f6; }
.letter-documents { display: grid; gap: 8px; }
.letter-document { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; transition: border-color .18s ease, background .18s ease; }
.letter-document:hover { border-color: #b9cae7; background: #f9fbff; }
.letter-document > i:first-child { color: var(--primary-color); font-size: 22px; }
.letter-document > i:last-child { color: var(--slate-400); font-size: 12px; }
.letter-document strong,
.letter-document small { display: block; }
.letter-document strong { color: var(--slate-700); font-size: 11.5px; }
.letter-document small { margin-top: 2px; color: var(--slate-500); font-size: 10px; overflow-wrap: anywhere; }

@media (max-width: 1180px) {
    .letter-flow-card { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .letter-flow-arrow { display: none; }
    .letter-flow-step { align-items: flex-start; }
    .letter-item { grid-template-columns: 44px minmax(0, 1fr); }
    .letter-item-actions { grid-column: 2; max-width: none; justify-content: flex-start; }
}
@media (max-width: 820px) {
    .letter-flow-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .letter-card-header { align-items: stretch; flex-direction: column; }
    .letter-header-actions { width: 100%; justify-content: stretch; }
    .letter-header-actions .btn,
    .letter-filter { flex: 1 1 180px; width: auto; }
    .letter-detail-grid { grid-template-columns: 1fr; }
    .letter-timeline { grid-template-columns: 1fr; gap: 0; }
    .letter-timeline-step { min-height: 58px; padding: 0 0 12px; }
    .timeline-line { top: 29px; bottom: -1px; left: 14px; right: auto; width: 2px; height: auto; }
}
@media (max-width: 620px) {
    .letter-flow-card { grid-template-columns: 1fr; padding: 10px; }
    .letter-flow-step { padding: 10px; }
    .letter-item { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 12px; }
    .letter-item-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 17px; }
    .letter-item-title-row { align-items: flex-start; flex-direction: column; gap: 7px; }
    .letter-item-title-row .badge { white-space: normal; }
    .letter-item-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 9px; }
    .letter-item-actions { grid-column: 1 / -1; }
    .letter-item-actions .btn { flex: 1 1 calc(50% - 5px); min-width: 0; justify-content: center; }
    .letter-header-actions { display: grid; grid-template-columns: 1fr; }
    .letter-header-actions .btn,
    .letter-filter { width: 100%; }
    .letter-detail-summary { align-items: stretch; flex-direction: column; }
    .letter-detail-summary .btn { width: 100%; }
    .letter-detail-grid .detail-row { grid-template-columns: 1fr; gap: 4px; }
    .letter-detail-grid .detail-row span { text-align: left; }
    .letter-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
}
@media (max-width: 390px) {
    .letter-item-meta { grid-template-columns: 1fr; }
    .letter-item-actions .btn { flex-basis: 100%; }
    .letter-mini-progress span { padding: 4px 7px; font-size: 9.5px; }
}
.stat-card-icon.warning{background:#fff6df;color:#b66a00}.stat-card-icon.primary{background:#eaf1ff;color:var(--primary-color)}.stat-card-icon.success{background:#e9f8f0;color:#15784d}.stat-card-icon.danger{background:#fff0f2;color:#b4233b}
