/* ======================================================
   JEMPOL HAM - ENTERPRISE CSS v2.0
   Professional Government & Corporate Design System
   Palette: Navy Blue → Cyan → Deep Indigo
   ====================================================== */

:root {
    /* Core Brand */
    --primary: #1e3a8a;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --primary-50: #eff6ff;
    --accent: #06b6d4;
    --accent-dark: #0891b2;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Surfaces */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
    --bg-topbar: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.25);

    /* Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Typography */
    --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

/* Reset Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* ==========================================
   LOGIN PAGE
   ========================================== */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(59,130,246,0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6,182,212,0.22) 0%, transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 40%, #0369a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content:'';
    position:absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14,165,233,0.18) 0%, transparent 70%);
    top: -200px; left: -150px;
    animation: floatBg 15s ease-in-out infinite alternate;
}
.login-page::after {
    content:'';
    position:absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, transparent 70%);
    bottom: -150px; right: -150px;
    animation: floatBg 20s ease-in-out infinite alternate-reverse;
}
@keyframes floatBg {
    from { transform: translate(0,0) scale(1); }
    to { transform: translate(40px, 30px) scale(1.1); }
}
.login-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: 45px 40px;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-logo { text-align: center; margin-bottom: 35px; }
.login-logo .logo-icon {
    width: 80px; height: 80px;
    margin: 0 auto 18px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    box-shadow: 0 12px 30px rgba(30,58,138,0.35);
}
.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}
.login-logo p {
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-family: var(--font-sans);
    line-height: 1.3;
    width: 100%;
    user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-sm); width: auto; }
.btn-lg { padding: 14px 30px; font-size: 15px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: 0 6px 20px rgba(30,58,138,0.4);
    color: white;
}
.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); color: var(--gray-900); }
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}
.btn-success:hover { color: white; }
.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239,68,68,0.3);
}
.btn-danger:hover { color: white; }
.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.btn-warning:hover { color: white; }
.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(14,165,233,0.3);
}
.btn-info:hover { color: white; }

/* ==========================================
   FORMS
   ========================================== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 7px;
    font-size: 13px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--gray-800);
    transition: all 0.2s;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
}
.form-control::placeholder { color: var(--gray-400); }
select.form-control { cursor: pointer; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius);
    border-left: 4px solid;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
}
.alert-success {
    background: #ecfdf5;
    border-color: var(--success);
    color: #065f46;
}
.alert-danger {
    background: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}
.alert-warning {
    background: #fffbeb;
    border-color: var(--warning);
    color: #92400e;
}
.alert-info {
    background: #eff6ff;
    border-color: var(--info);
    color: #1e40af;
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.6;
}
.badge.bg-primary { background: #dbeafe; color: var(--primary-dark); }
.badge.bg-success { background: #d1fae5; color: #065f46; }
.badge.bg-warning { background: #fef3c7; color: #92400e; }
.badge.bg-danger  { background: #fee2e2; color: #991b1b; }
.badge.bg-info    { background: #cffafe; color: #0e7490; }
.badge.bg-secondary { background: var(--gray-200); color: var(--gray-700); }

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

/* Sidebar */
.sidebar {
    width: 275px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(15,23,42,0.15);
    z-index: 50;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.sidebar-brand {
    padding: 26px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .logo-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 6px 16px rgba(59,130,246,0.4);
    flex-shrink: 0;
}
.sidebar-brand h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
    letter-spacing: -0.3px;
}
.sidebar-brand span {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 18px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.78);
    font-weight: 500;
    font-size: 13.5px;
    transition: all 0.2s;
    position: relative;
}
.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}
.sidebar-nav li a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
    transform: translateX(3px);
}
.sidebar-nav li a.active {
    background: linear-gradient(90deg, var(--primary-light), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(59,130,246,0.35);
    font-weight: 600;
}
.sidebar-nav li a.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
}

.sidebar-footer {
    padding: 18px 18px 22px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius);
    margin-bottom: 14px;
}
.avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.sidebar-user .info h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
}
.sidebar-user .info span {
    font-size: 11px;
    opacity: 0.75;
    line-height: 1.2;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
}
.topbar {
    background: var(--bg-topbar);
    padding: 18px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--gray-100);
}
.topbar h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}
.topbar h3 i {
    color: var(--primary-light);
    font-size: 18px;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 22px;
}
.notif {
    position: relative;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: all 0.2s;
}
.notif:hover {
    background: var(--primary-50);
    color: var(--primary);
}
.notif .count {
    position: absolute;
    top: 3px; right: 3px;
    min-width: 18px; height: 18px;
    border-radius: 10px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.content-wrapper {
    flex: 1;
    padding: 28px 34px;
    max-width: 100%;
}
@media (max-width: 1024px) {
    .content-wrapper { padding: 22px 20px; }
    .topbar { padding: 16px 20px; }
}

/* ==========================================
   CARD COMPONENTS
   ========================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    margin-bottom: 22px;
    overflow: hidden;
    transition: box-shadow 0.25s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(to right, rgba(239,246,255,0.6), transparent);
}
.card-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}
.card-title i { color: var(--primary-light); font-size: 16px; }
.card-body { padding: 24px; }

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}
.stat-card {
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
}
.stat-card.stat-primary::before    { background: linear-gradient(180deg, var(--primary), var(--primary-light)); }
.stat-card.stat-success::before    { background: linear-gradient(180deg, var(--success), #34d399); }
.stat-card.stat-warning::before    { background: linear-gradient(180deg, var(--warning), #fbbf24); }
.stat-card.stat-danger::before     { background: linear-gradient(180deg, var(--danger), #f87171); }
.stat-card.stat-info::before       { background: linear-gradient(180deg, var(--info), #38bdf8); }
.stat-card.stat-accent::before     { background: linear-gradient(180deg, var(--accent), #22d3ee); }

.stat-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.stat-primary .stat-icon { background: #dbeafe; color: var(--primary-dark); }
.stat-success .stat-icon { background: #d1fae5; color: #059669; }
.stat-warning .stat-icon { background: #fef3c7; color: #d97706; }
.stat-danger  .stat-icon { background: #fee2e2; color: #dc2626; }
.stat-info    .stat-icon { background: #cffafe; color: #0e7490; }
.stat-accent  .stat-icon { background: #e0e7ff; color: #4f46e5; }

.stat-content { flex: 1; min-width: 0; }
.stat-label {
    font-size: 12.5px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.2px;
}
.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.1;
    letter-spacing: -0.5px;
}
.stat-trend {
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--success);
    font-weight: 700;
}
.stat-trend.down { color: var(--danger); }

/* Charts Row */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-bottom: 26px;
}
@media (max-width: 1100px) {
    .charts-grid { grid-template-columns: 1fr; }
}
.chart-box {
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
}
.chart-box h4 {
    font-size: 14px;
    color: var(--gray-700);
    margin-bottom: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-box h4 i { color: var(--accent-dark); }

/* ==========================================
   TABLE
   ========================================== */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table thead {
    background: linear-gradient(to right, var(--primary-50), #ecfeff);
}
.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--gray-700);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}
.table tbody tr {
    transition: background 0.15s;
}
.table tbody tr:hover {
    background: var(--gray-50);
}
.table tbody tr:last-child td { border-bottom: none; }
.table .btn + .btn { margin-left: 6px; }

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 180px; }
.filter-bar .form-control { padding: 10px 14px; }
.filter-bar .btn { width: auto; }

/* ==========================================
   MODAL
   ========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    z-index: 100;
    padding: 30px 15px;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease-out;
}
.modal-overlay.show { display: flex; }
@keyframes fadeIn { from {opacity:0} to {opacity:1} }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 860px;
    box-shadow: var(--shadow-2xl);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    border: none;
}
/* legacy fallback: .modal-dialog */
.modal-dialog {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 860px;
    box-shadow: var(--shadow-2xl);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    border: none;
}
.modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.18);
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    background: rgba(255,255,255,0.32);
    transform: rotate(90deg);
}
.modal-body { padding: 26px 28px; max-height: 70vh; overflow-y: auto; }
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }
.modal-footer {
    padding: 16px 24px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.modal-footer .btn { width: auto; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 22px;
}
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-item { }
.detail-item label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.detail-item .val {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 600;
    word-break: break-word;
    line-height: 1.5;
}
.detail-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1.5px dashed var(--gray-200);
}
.detail-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.doc-card {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px;
    transition: all 0.2s;
    background: var(--gray-50);
}
.doc-card:hover {
    border-color: var(--primary-light);
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.doc-card .doc-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}
.doc-card .doc-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}
.doc-card .doc-link {
    font-size: 12.5px;
    display: block;
    word-break: break-all;
    color: var(--primary-dark);
}
.doc-card img {
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    max-height: 140px;
    object-fit: cover;
    width: 100%;
}

/* Vertical dividers (hide in mobile) */
.divider1 { display: block !important; }
@media (max-width: 700px) {
    .divider1 { display: none !important; }
}

/* ==========================================
   CHAT UI (pesan.php & chat.php)
   ========================================== */
.chat-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-md);
}
@media (max-width: 900px) { .chat-wrapper { grid-template-columns: 1fr; } }

.chat-sidebar {
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
@media (max-width: 900px) {
    .chat-sidebar { border-right: none; border-bottom: 1px solid var(--gray-200); max-height: 250px; }
}
.chat-sidebar-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}
.chat-sidebar-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-list {
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.chat-list::-webkit-scrollbar { width: 5px; }
.chat-list::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }
.chat-item {
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: all 0.15s;
}
.chat-item:hover { background: white; }
.chat-item.active {
    background: white;
    border-left: 3px solid var(--primary-light);
    padding-left: 13px;
    box-shadow: inset 4px 0 12px rgba(59,130,246,0.07);
}
.chat-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}
.chat-info h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.chat-info p {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: linear-gradient(180deg, var(--gray-50) 0%, #ffffff 100%);
}
.chat-header {
    padding: 16px 22px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
}
.chat-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.chat-header span {
    font-size: 12px;
    color: var(--gray-500);
}
.chat-messages {
    flex: 1;
    padding: 22px 26px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background:
        radial-gradient(circle at top right, rgba(59,130,246,0.03), transparent 50%),
        radial-gradient(circle at bottom left, rgba(6,182,212,0.03), transparent 50%);
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 10px; }
.msg {
    max-width: 72%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    position: relative;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
    animation: msgIn 0.3s ease-out;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.msg-sender {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    opacity: 0.75;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}
.msg-time {
    display: block;
    text-align: right;
    font-size: 10px;
    opacity: 0.6;
    margin-top: 6px;
    font-weight: 600;
}
.msg.masyarakat {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-800);
    border-top-left-radius: 4px;
    align-self: flex-start;
}
.msg.petugas {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-top-right-radius: 4px;
    align-self: flex-end;
    box-shadow: 0 6px 16px rgba(59,130,246,0.25);
}
.chat-input {
    padding: 14px 18px;
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
}
.chat-input .form-control {
    flex: 1;
    border-radius: 24px;
    padding: 12px 20px;
}
.chat-input .btn {
    width: auto;
    border-radius: 24px;
    padding: 12px 26px;
}

/* ==========================================
   FRONT PAGE (masyarakat)
   ========================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-100);
    padding: 0 40px;
    box-shadow: var(--shadow-sm);
}
.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
    gap: 20px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 19px;
    color: var(--primary-dark);
    letter-spacing: -0.3px;
}
.nav-logo .logo-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    box-shadow: 0 6px 14px rgba(30,58,138,0.3);
}
.nav-menu {
    display: flex;
    gap: 6px;
    align-items: center;
}
.nav-menu a {
    padding: 9px 18px;
    border-radius: 30px;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.nav-menu a:hover, .nav-menu a.active {
    background: var(--primary-50);
    color: var(--primary-dark);
}
.nav-menu .btn { width: auto; padding: 9px 22px; }
@media (max-width: 820px) {
    .navbar { padding: 0 18px; }
    .nav-menu .nav-lbl { display: none; }
    .nav-menu a { padding: 9px 12px; }
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0369a1 100%);
    padding: 90px 40px 100px;
    color: white;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../image/foto kantor.jpeg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    filter: saturate(0.85) brightness(0.55) contrast(1.02);
    opacity: 0.9;
    z-index: 0;
    pointer-events: none;
}
.hero::before {
    content:'';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(135deg, rgba(15, 23, 42, 0.78) 0%, rgba(30, 58, 138, 0.68) 40%, rgba(7, 89, 133, 0.70) 80%, rgba(15, 23, 42, 0.78) 100%),
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    pointer-events: none;
    z-index: 1;
}
.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 2;
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } .hero { padding: 60px 20px 70px; } }
.hero h1 {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 18px;
    letter-spacing: -0.8px;
}
.hero h1 span {
    background: linear-gradient(135deg, #22d3ee, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255,255,255,0.82);
    margin-bottom: 32px;
    max-width: 560px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-cta .btn { width: auto; padding: 14px 28px; }
.hero-cta .btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}
.hero-cta .btn-outline:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.5);
    color: white;
}
.hero-card {
    background: rgba(15, 23, 42, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 30px;
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
}
.hero-card .kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 20px;
}
.kpi-box {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.kpi-box .num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 5px;
}
.kpi-box .lbl { font-size: 11.5px; opacity: 0.75; font-weight: 600; letter-spacing: 0.4px; }

/* Section */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 40px;
}
@media (max-width: 768px) { .section { padding: 50px 20px; } }
.section-title {
    text-align: center;
    margin-bottom: 50px;
}
.section-title h2 {
    font-size: 30px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.section-title h2 span { color: var(--primary-light); }
.section-title p {
    font-size: 15px;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}
.feature-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}
.feature-icon {
    width: 62px; height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, #eff6ff, #cffafe);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.03);
}
.feature-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}
.feature-card p {
    color: var(--gray-500);
    line-height: 1.7;
    font-size: 13.5px;
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    position: relative;
}
@media (max-width: 900px) { .steps-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card {
    background: white;
    padding: 30px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    border-top: 4px solid;
}
.step-card:nth-child(1) { border-top-color: var(--primary); }
.step-card:nth-child(2) { border-top-color: var(--accent); }
.step-card:nth-child(3) { border-top-color: var(--success); }
.step-card:nth-child(4) { border-top-color: var(--warning); }
.step-num {
    display: inline-flex;
    width: 46px; height: 46px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 16px;
    color: white;
}
.step-card:nth-child(1) .step-num { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.step-card:nth-child(2) .step-num { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.step-card:nth-child(3) .step-num { background: linear-gradient(135deg, var(--success), #34d399); }
.step-card:nth-child(4) .step-num { background: linear-gradient(135deg, var(--warning), #fbbf24); }
.step-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}
.step-card p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.65;
}

/* CTA */
.cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-dark) 100%);
    border-radius: 28px;
    padding: 55px 50px;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}
.cta::before, .cta::after {
    content:'';
    position:absolute;
    border-radius:50%;
    background: rgba(255,255,255,0.07);
}
.cta::before { width: 260px; height: 260px; top: -100px; left: -80px; }
.cta::after  { width: 320px; height: 320px; bottom: -140px; right: -100px; }
.cta > * { position: relative; z-index: 2; }
.cta h2 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.4px;
}
.cta p {
    opacity: 0.85;
    margin-bottom: 28px;
    font-size: 15px;
    max-width: 600px;
    margin-left: auto; margin-right: auto;
}
.cta .btn {
    width: auto;
    padding: 14px 36px;
    background: white;
    color: var(--primary-dark);
    font-weight: 700;
}
.cta .btn:hover {
    background: var(--gray-50);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: rgba(255,255,255,0.72);
    padding: 60px 40px 0;
}
.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand h3 {
    color: white;
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.footer-brand h3 .logo-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 17px;
}
.footer-brand p {
    line-height: 1.7;
    font-size: 13.5px;
    margin-bottom: 16px;
}
.footer h4 {
    color: white;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 18px;
}
.footer ul { display: flex; flex-direction: column; gap: 10px; }
.footer ul a {
    color: rgba(255,255,255,0.68);
    font-size: 13.5px;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.footer ul a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 22px 0;
    text-align: center;
    font-size: 12.5px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Upload file widget */
.file-widget {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 22px 20px;
    background: var(--gray-50);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.file-widget:hover {
    border-color: var(--primary-light);
    background: var(--primary-50);
}
.file-widget i {
    color: var(--primary-light);
    font-size: 30px;
    margin-bottom: 8px;
}
.file-widget p { font-size: 13px; color: var(--gray-600); font-weight: 500; }
.file-widget small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--gray-400); }
.file-widget input[type=file] { display: none; }
.file-widget.has-file {
    border-color: var(--success);
    background: #ecfdf5;
}
.file-widget.has-file i { color: var(--success); }
.file-widget .fname {
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    color: var(--gray-700);
    font-weight: 600;
    word-break: break-all;
    box-shadow: var(--shadow-sm);
}

/* Success Page */
.success-box {
    text-align: center;
    padding: 50px 20px;
}
.success-icon {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #34d399);
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 54px;
    box-shadow: 0 12px 30px rgba(16,185,129,0.35);
    animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.success-box h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 10px;
}
.success-box p {
    color: var(--gray-500);
    margin-bottom: 26px;
    line-height: 1.7;
}
.kode-box {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1.5px;
    box-shadow: 0 8px 22px rgba(59,130,246,0.3);
    margin-bottom: 12px;
}
.success-box small {
    display: block;
    color: var(--gray-500);
    margin-bottom: 34px;
}

/* Responsive Admin */
@media (max-width: 1280px) {
    .sidebar { width: 240px; }
}
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-105%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar-open-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(15,23,42,0.5);
        z-index: 40;
    }
    .sidebar-open-overlay.show { display: block; }
}

/* Utility */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }
.mt-3 { margin-top: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.d-none { display: none !important; }

/* ==============================================
   Wallpaper Dashboard Petugas (Foto Kantor + Transparan Biru)
   ============================================== */
.main-content.page-wallpaper {
    position: relative;
    background:
        linear-gradient(135deg,
            rgba(15, 23, 42, 0.65) 0%,
            rgba(30, 58, 138, 0.55) 35%,
            rgba(7, 89, 133, 0.50) 70%,
            rgba(15, 23, 42, 0.60) 100%),
        url('../image/foto kantor.jpeg') center center / cover no-repeat fixed;
    z-index: 0;
}
.main-content.page-wallpaper > .content-wrapper {
    position: relative;
    z-index: 2;
}
.main-content.page-wallpaper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('../image/foto kantor.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: saturate(0.9) brightness(0.75) contrast(1.05);
    z-index: -1;
}
.main-content.page-wallpaper .topbar {
    background: rgba(15, 23, 42, 0.45) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.main-content.page-wallpaper .topbar h3,
.main-content.page-wallpaper .topbar h3 i,
.main-content.page-wallpaper .topbar .dropdown strong {
    color: #fff !important;
}
.main-content.page-wallpaper .topbar .dropdown small,
.main-content.page-wallpaper .topbar .dropdown span {
    color: #cbd5e1 !important;
}
.main-content.page-wallpaper .card {
    background: rgba(255, 255, 255, 0.86) !important;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.18);
}
.main-content.page-wallpaper .stat-card {
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    position: relative;
    overflow: hidden;
}
.main-content.page-wallpaper .stat-primary { background: linear-gradient(135deg, rgba(37,99,235,0.92), rgba(59,130,246,0.85)) !important; }
.main-content.page-wallpaper .stat-warning { background: linear-gradient(135deg, rgba(217,119,6,0.92), rgba(245,158,11,0.85)) !important; }
.main-content.page-wallpaper .stat-info    { background: linear-gradient(135deg, rgba(14,116,144,0.92), rgba(6,182,212,0.85)) !important; }
.main-content.page-wallpaper .stat-success { background: linear-gradient(135deg, rgba(16,185,129,0.92), rgba(52,211,153,0.85)) !important; }
.main-content.page-wallpaper .stat-accent  { background: linear-gradient(135deg, rgba(124,58,237,0.92), rgba(168,85,247,0.85)) !important; }
.main-content.page-wallpaper .stat-danger  { background: linear-gradient(135deg, rgba(220,38,38,0.92), rgba(248,113,113,0.85)) !important; }
.main-content.page-wallpaper .stat-card *   { color: #fff !important; }
.main-content.page-wallpaper .stat-icon     { background: rgba(255,255,255,0.22) !important; }

@media print {
    .main-content.page-wallpaper { background: #fff !important; }
    .main-content.page-wallpaper .card,
    .main-content.page-wallpaper .stat-card { backdrop-filter: none; background: #fff !important; }
}

/* Print friendly */
@media print {
    .sidebar, .topbar, .btn, .chat-input, .filter-bar { display: none !important; }
    .main-content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ================================================================
   MOBILE RESPONSIVE OPTIMIZED (≤ 780px) — UTAMA untuk HP
   ================================================================ */
@media (max-width: 780px) {
    html { -webkit-text-size-adjust: 100%; }
    body { font-size: 15px; -webkit-tap-highlight-color: transparent; }

    /* Touch Target minimum 44px (WCAG AA) */
    a, button, .btn, .form-control, input, select, textarea,
    .file-widget, .gol-card, .chat-item, .step-card, .feature-card {
        min-height: 44px;
    }
    .form-control, input, select, textarea {
        font-size: 16px !important;  /* Prevent iOS auto zoom */
        padding: 13px 14px !important;
    }
    .form-label { font-size: 13.5px; margin-bottom: 6px; }
    .form-group { margin-bottom: 16px; }
    .form-row { grid-template-columns: 1fr !important; gap: 0; }

    /* Navbar mobile — always show hamburger */
    .nav-container { padding: 0 18px; height: 68px !important; }
    .navbar { padding: 0; box-shadow: var(--shadow); }
    .nav-logo h1 { font-size: 17px !important; }
    .nav-logo .logo-icon { width: 38px !important; height: 38px !important; font-size: 17px !important; }

    /* Buttons full-width on mobile */
    .btn, .btn-lg, .btn-sm:not(.nav-menu .btn-sm) {
        width: 100% !important;
        justify-content: center;
        padding: 14px 22px !important;
        border-radius: 12px !important;
    }
    .btn-sm { padding: 11px 16px !important; font-size: 14px !important; }
    .chat-input .btn { width: auto !important; padding: 12px 20px !important; border-radius: 24px !important; }

    /* Cards padding mobile */
    .card-body, .card-header { padding: 18px !important; }
    .card-header { gap: 10px; flex-wrap: wrap; }
    .card-title { font-size: 15px !important; }

    /* Stats grid — 2 kolom on mobile (max touchable) */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin-bottom: 20px;
    }
    .stat-card { padding: 16px 14px; gap: 12px; }
    .stat-icon { width: 48px; height: 48px; font-size: 22px; border-radius: 13px; }
    .stat-value { font-size: 22px !important; }
    .stat-label { font-size: 11.5px; }

    /* Charts — stack, not side by side */
    .charts-grid { grid-template-columns: 1fr !important; gap: 16px; margin-bottom: 20px; }
    .chart-box { padding: 18px !important; }
    .chart-box h4 { font-size: 13px !important; margin-bottom: 12px; }

    /* Filter & Search */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }
    .filter-bar .form-group { flex: 1 1 100%; width: 100%; }
    .filter-bar .btn { width: 100% !important; justify-content: center; }

    /* Tables — scroll friendly, small border-radius, touch rows */
    .table th, .table td { padding: 11px 10px; font-size: 13px; }
    .table .btn { width: auto !important; padding: 7px 10px !important; font-size: 12px !important; }
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr {
        margin-bottom: 14px;
        background: white;
        border: 1.5px solid var(--gray-200);
        border-radius: 12px;
        padding: 8px 10px;
        box-shadow: var(--shadow-sm);
    }
    .table tr:hover { background: white; }
    .table td {
        border: none;
        padding: 5px 4px;
        text-align: right;
        position: relative;
        padding-left: 45%;
    }
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 4px; top: 50%; transform: translateY(-50%);
        width: 42%;
        text-align: left;
        font-weight: 700;
        color: var(--gray-500);
        font-size: 11.5px;
        letter-spacing: 0.3px;
        white-space: nowrap;
    }
    .table td:last-child { border-bottom: none; }

    /* Modal mobile */
    .modal { max-width: calc(100vw - 20px); border-radius: 16px; }
    .modal-header, .modal-body, .modal-footer { padding: 16px !important; }
    .modal-footer { flex-direction: column-reverse; gap: 8px; }
    .modal-footer .btn { width: 100% !important; }
    .detail-grid { grid-template-columns: 1fr !important; gap: 12px; }
    .doc-grid { grid-template-columns: 1fr !important; }

    /* Hero masyarakat — mobile */
    .hero { padding: 40px 18px 55px !important; }
    .hero h1 { font-size: 28px !important; line-height: 1.18 !important; letter-spacing: -0.3px; }
    .hero p { font-size: 14.5px !important; line-height: 1.75; margin-bottom: 26px; }
    .hero-buttons { flex-direction: column; gap: 10px; }
    .hero-cta > .btn, .hero-inner .btn.btn-lg {
        width: 100% !important;
        justify-content: center;
        text-align: center;
        padding: 15px 22px !important;
        border-radius: 14px !important;
    }
    .hero .hero-card { display: none; } /* illustration hide mobile — fokus ke CTA */
    .stat4 { grid-template-columns: repeat(2,1fr) !important; gap: 14px !important; }

    /* Features, Steps — 1 kolom mobile */
    .features-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
    .features-grid .feature-card { padding: 22px; }
    .steps-grid { grid-template-columns: 1fr !important; gap: 14px; }
    .step-card { text-align: left; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; }
    .step-num { flex-shrink: 0; margin-bottom: 0; }
    .step-card p { text-align: left; font-size: 13.5px; }

    /* CTA section */
    .cta { padding: 40px 22px !important; border-radius: 20px !important; }
    .cta h2 { font-size: 20px !important; }
    .cta p { font-size: 13.5px; line-height: 1.65; }

    /* Footer masyarakat */
    .footer { padding: 36px 18px 0 !important; }
    .footcols, .footer-inner { grid-template-columns: 1fr !important; gap: 26px !important; }
    .footer h4 { margin-bottom: 12px; }

    /* Chat Masyarakat mobile */
    .chat-wrapper { grid-template-columns: 1fr !important; min-height: 70vh !important; border-radius: 16px !important; }
    .chat-sidebar { display: none; }
    .chat-sidebar.show { display: flex; border-right: none; border-bottom: 1px solid var(--gray-200); max-height: 260px; }
    .chat-main { min-width: 0; }
    .chat-messages { padding: 18px 16px !important; }
    .msg { max-width: 86% !important; }
    .chat-input { padding: 12px !important; gap: 8px !important; }
    .chat-header { padding: 14px 16px !important; }

    /* Navbar mobile menu (drawer) */
    .nav-menu {
        position: absolute !important;
        top: 68px; left: 0; right: 0;
        background: white;
        padding: 0 18px;
        flex-direction: column !important;
        align-items: stretch !important;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
        z-index: 35;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.3s ease;
    }
    .nav-menu.show { max-height: 600px; padding: 14px 18px 18px; }
    .nav-menu li { width: 100%; }
    .nav-menu li a {
        padding: 13px 12px !important;
        border-radius: 10px;
        font-size: 14.5px;
    }

    /* Admin Layout — sidebar mobile overlay */
    .admin-layout { flex-direction: column; min-height: 100vh; }
    .sidebar {
        position: fixed !important;
        top: 0; left: 0; bottom: 0;
        z-index: 80;
        width: 84% !important;
        max-width: 320px;
        transform: translateX(-105%);
        transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 10px 0 40px rgba(15,23,42,0.35); }
    .main-content { width: 100% !important; min-width: 0; }
    .topbar {
        position: sticky;
        top: 0;
        padding: 14px 16px !important;
        z-index: 30;
    }
    .topbar h3 { font-size: 16px; }
    .content-wrapper { padding: 18px 16px 28px !important; }
    .sidebar-open-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(15,23,42,0.55);
        z-index: 75;
        backdrop-filter: blur(2px);
    }
    .sidebar-open-overlay.show { display: block; }

    .notif { width: 38px; height: 38px; }
    .topbar-user { gap: 12px; }

    /* Chat Admin — hide sidebar on mobile (toggle from header) */
    .admin-layout .chat-wrapper { grid-template-columns: 1fr !important; }
    .admin-layout .chat-wrapper .chat-sidebar { display: none; }
    .admin-layout .chat-wrapper .chat-sidebar.show { display: flex; max-height: 280px; }

    /* Steps progress (ajukan.php) — 1 kolom di HP */
    .progress-steps { grid-template-columns: 1fr !important; gap: 10px !important; }
    .progress-steps > div { padding: 10px 14px !important; }
    .progress-steps > div:nth-child(2),
    .progress-steps > div:nth-child(3) { opacity: 0.6; }

    .submit-wrap { padding-top: 18px !important; }
    .submit-wrap .btn {
        box-shadow: 0 14px 30px rgba(30,58,138,0.32) !important;
    }
    .gol-card { min-height: 150px; }

    /* Info strip chat.php */
    .info3 { grid-template-columns: 1fr !important; }
    .info3 > div:nth-child(2), .info3 > div:nth-child(3) { display: none; }

    .section, .features, #fitur, #cara { padding: 50px 18px !important; }
    .section-title { margin-bottom: 30px; }
    .section-title h2 { font-size: 22px !important; }

    .success-box { padding: 34px 18px !important; }
    .success-icon { width: 90px; height: 90px; font-size: 44px; }
    .success-box h2 { font-size: 20px !important; }
    .kode-box { font-size: 20px !important; padding: 14px 20px !important; letter-spacing: 1.5px !important; }
}

/* Small Phone (< 380px) - iPhone SE dll */
@media (max-width: 380px) {
    .stat-value { font-size: 20px !important; }
    .stat-icon { width: 44px; height: 44px; font-size: 20px; }
    .hero h1 { font-size: 25px !important; }
    .stat-grid { gap: 10px; }
    .stat-card { padding: 14px 12px; gap: 10px; }
    .gol-card { padding: 14px 12px !important; }
    .file-widget { padding: 16px 14px !important; }
    .doc-card .doc-icon { width: 42px; height: 42px; font-size: 18px; }
}

/* Tablet (781px - 1024px) */
@media (min-width: 781px) and (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .steps-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .stat-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .hero-card { display: none; }
    .hero .hero-inner { grid-template-columns: 1fr !important; }
    .stat4 { grid-template-columns: repeat(2,1fr) !important; }
}

/* Safe-area iPhone notch */
@supports (padding: max(0px)) {
    .navbar, .topbar, .submit-wrap, .cta, .footer-bottom {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    .submit-wrap { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
    .footer-bottom { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

