*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #e8ecf1; color: #374151; line-height: 1.6; min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 25% 20%, rgba(59,130,246,.03) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 30%, rgba(139,92,246,.02) 0%, transparent 50%);
    background-attachment: fixed;
}
a { color: #3b82f6; text-decoration: none; transition: color .2s; }
a:hover { color: #2563eb; text-decoration: underline; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.35); }

/* Navbar */
.navbar {
    background: rgba(255,255,255,.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: #374151; padding: 0 1.5rem; position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,.03);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-left { display: flex; align-items: center; gap: .75rem; }
.nav-toggle {
    background: none; border: none; cursor: pointer; font-size: 1.1rem; color: #64748b;
    padding: .35rem .4rem; border-radius: 6px; transition: all .15s; line-height: 1;
}
.nav-toggle:hover { background: rgba(0,0,0,.03); color: #1e293b; }
.nav-page { font-weight: 600; font-size: .95rem; color: #1e293b; }
.nav-user { font-size: .85rem; display: flex; align-items: center; gap: 1rem; color: #6b7280; }
.btn-logout { background: rgba(239,68,68,.05); color: #dc2626; padding: 5px 14px; border-radius: 8px; font-size: .8rem; transition: all .2s; border: 1px solid rgba(239,68,68,.06); }
.btn-logout:hover { background: #ef4444; color: #fff; text-decoration: none; border-color: #ef4444; }

/* Layout */
.app-container { display: flex; max-width: 1400px; margin: 0 auto; min-height: 100vh; }
.sidebar {
    position: fixed; top: 0; left: max(0px, calc(50% - 700px)); width: 240px; height: 100vh; overflow-y: auto; z-index: 99;
    background: rgba(255,255,255,.3); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(0,0,0,.04);
    display: flex; flex-direction: column;
    transition: width .2s ease;
}
.sidebar-head { display: flex; align-items: center; border-bottom: 1px solid rgba(0,0,0,.03); flex-shrink: 0; }
.sidebar-brand {
    display: flex; align-items: center; padding: 1rem 1.25rem;
    font-weight: 800; font-size: 1.3rem; letter-spacing: .5px;
    text-decoration: none !important; flex: 1; min-width: 0;
}
.sidebar-brand .sb-first,
.sidebar-brand .sb-rest {
    color: #1e293b;
    background: linear-gradient(135deg,#1e293b,#3b82f6); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar-menu { list-style: none; padding: .5rem 0; flex: 1; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: .65rem; padding: .6rem 1.25rem; margin: 2px .5rem;
    color: #6b7280; font-size: .9rem; border-radius: 8px;
    transition: all .15s; text-decoration: none !important; white-space: nowrap;
}
.sidebar-menu li a:hover { background: rgba(59,130,246,.06); color: #1e293b; }
.sidebar-menu li a.active {
    background: rgba(59,130,246,.1); color: #2563eb; font-weight: 600;
    box-shadow: inset 3px 0 0 #3b82f6;
}
.sidebar-footer {
    padding: .65rem 1.25rem; border-top: 1px solid rgba(0,0,0,.03);
    font-size: .78rem; color: #94a3b8; flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
}
.sb-user { color: #6b7280; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-logout { color: #dc2626; font-weight: 500; text-decoration: none !important; }
.sb-logout:hover { text-decoration: underline !important; }

/* Collapsed sidebar */
.sidebar.collapsed { width: 48px; }
.sidebar.collapsed .sidebar-brand {
    display: flex; align-items: center; justify-content: center; padding: .9rem 0;
}
.sidebar.collapsed .sb-first {
    font-weight: 800; font-size: 1.1rem;
    background: linear-gradient(135deg,#1e293b,#3b82f6); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar.collapsed .sb-rest { display: none; }
.sidebar.collapsed .sidebar-head { border-bottom: none; }
.sidebar.collapsed .sb-user,
.sidebar.collapsed .sb-label { display: none; }
.sidebar.collapsed .sidebar-menu li a { justify-content: center; padding: .6rem 0; margin: 1px .25rem; font-size: 1rem; }
.sidebar.collapsed .sidebar-footer { padding: .4rem .65rem; }

.content-area { flex: 1; display: flex; flex-direction: column; min-width: 0; margin-left: 240px; transition: margin-left .2s ease; }
.sidebar.collapsed + .content-area { margin-left: 48px; }
.main-content { flex: 1; padding: 1.75rem 2rem; overflow-x: auto; }

/* Page Header */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.35rem; font-weight: 700; color: #1e293b; margin-bottom: .25rem; letter-spacing: -.3px; }
.page-header p { color: #6b7280; font-size: .85rem; }

/* Glass Card */
.card {
    background: rgba(255,255,255,.4); border-radius: 16px;
    border: 1px solid rgba(255,255,255,.55);
    padding: 1.5rem 1.75rem; margin-bottom: 1rem;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(0,0,0,.02), inset 0 1px 0 rgba(255,255,255,.6);
    transition: all .3s ease;
}
.card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.04);
    background: rgba(255,255,255,.48);
}
.card-header {
    font-weight: 600; font-size: .95rem; margin-bottom: .75rem; padding-bottom: .65rem;
    border-bottom: 1px solid rgba(0,0,0,.03); color: #1e293b;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
}

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: rgba(255,255,255,.38); border-radius: 16px;
    border: 1px solid rgba(255,255,255,.5); padding: 1.15rem; text-align: center;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(0,0,0,.02), inset 0 1px 0 rgba(255,255,255,.55);
    transition: all .3s ease; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, rgba(59,130,246,.5), rgba(139,92,246,.5));
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,.05);
    background: rgba(255,255,255,.45);
}
.stat-card .stat-value { font-size: 1.85rem; font-weight: 700; color: #1e293b; line-height: 1.2; }
.stat-card .stat-label { font-size: .78rem; color: #6b7280; margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(0,0,0,.03); border-radius: 12px;
    background: rgba(255,255,255,.15);
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
thead th {
    background: rgba(255,255,255,.3); border-bottom: 1px solid rgba(0,0,0,.04);
    padding: .7rem .85rem; text-align: left; font-weight: 600;
    color: #4b5563; white-space: nowrap;
    text-transform: uppercase; font-size: .72rem; letter-spacing: .5px;
    position: sticky; top: 0; z-index: 1;
}
thead th a { color: #3b82f6; text-decoration: none !important; font-weight: 600; }
thead th a:hover { color: #2563eb; text-decoration: none !important; }
tbody td { padding: .6rem .85rem; border-bottom: 1px solid rgba(0,0,0,.03); vertical-align: middle; }
tbody tr { transition: background .15s; }
tbody tr:nth-child(even) { background: rgba(255,255,255,.15); }
tbody tr:hover { background: rgba(59,130,246,.04); }
tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge-success { background: rgba(22,163,74,.07); color: #15803d; border: 1px solid rgba(22,163,74,.1); }
.badge-danger { background: rgba(239,68,68,.07); color: #dc2626; border: 1px solid rgba(239,68,68,.1); }
.badge-warning { background: rgba(245,158,11,.08); color: #b45309; border: 1px solid rgba(245,158,11,.12); }
.badge-info { background: rgba(59,130,246,.07); color: #1d4ed8; border: 1px solid rgba(59,130,246,.1); }
.badge-secondary { background: rgba(148,163,184,.1); color: #4b5563; border: 1px solid rgba(148,163,184,.14); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; color: #1e293b; margin-bottom: 6px; }
.form-control {
    width: 100%; padding: .55rem .85rem;
    background: rgba(255,255,255,.4); border: 1.5px solid rgba(0,0,0,.05);
    border-radius: 10px; font-size: .9rem; transition: all .2s;
    color: #374151;
}
.form-control:hover { border-color: rgba(0,0,0,.08); }
.form-control:focus { outline: none; border-color: rgba(59,130,246,.3); box-shadow: 0 0 0 3px rgba(59,130,246,.06); background: rgba(255,255,255,.55); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .5rem 1.1rem; border: none; border-radius: 10px; font-size: .85rem; font-weight: 500;
    cursor: pointer; transition: all .2s; text-decoration: none; line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; border: 1px solid rgba(59,130,246,.15); }
.btn-primary:hover { background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 4px 16px rgba(59,130,246,.18); }
.btn-success { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; border: 1px solid rgba(22,163,74,.15); }
.btn-success:hover { background: linear-gradient(135deg, #15803d, #166534); box-shadow: 0 4px 16px rgba(22,163,74,.18); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; border: 1px solid rgba(239,68,68,.15); }
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 4px 16px rgba(239,68,68,.18); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border: 1px solid rgba(245,158,11,.15); }
.btn-warning:hover { background: linear-gradient(135deg, #d97706, #b45309); }
.btn-sm { padding: .42rem .9rem; font-size: .85rem; border-radius: 8px; }
.jalur-btn { background: rgba(255,255,255,.3); border: 1px solid rgba(0,0,0,.04); color: #6b7280; }
.jalur-btn:hover { background: rgba(255,255,255,.5); color: #374151; }
.jalur-btn.active { background: rgba(59,130,246,.1); color: #2563eb; border-color: rgba(59,130,246,.15); font-weight: 600; }
.page-btn { background: rgba(255,255,255,.3); border: 1px solid rgba(0,0,0,.04); color: #6b7280; min-width: 32px; }
.page-btn:hover { background: rgba(255,255,255,.5); color: #374151; }
.page-btn.active { background: rgba(59,130,246,.1); color: #2563eb; border-color: rgba(59,130,246,.15); font-weight: 600; }
.modal-overlay { position:fixed; inset:0; z-index:999; background:rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; backdrop-filter:blur(2px); }
.modal-content { background:#f8fafc; border-radius:12px; box-shadow:0 20px 60px rgba(0,0,0,.12); max-height:80vh; width:90%; overflow:hidden; }
.modal-header { padding:1rem 1.25rem; border-bottom:1px solid rgba(0,0,0,.06); background:#fff; border-radius:12px 12px 0 0; }
.modal-header .btn { font-size:1.2rem; line-height:1; background:none; border:none; color:#6b7280; cursor:pointer; }
.modal-body { padding:1.25rem; }
.btn-outline { background: rgba(255,255,255,.35); border: 1.5px solid rgba(0,0,0,.05); color: #4b5563; }
.btn-outline:hover { background: rgba(255,255,255,.5); border-color: rgba(0,0,0,.08); box-shadow: none; transform: none; }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: 12px; font-size: .85rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: rgba(22,163,74,.05); color: #15803d; border-color: rgba(22,163,74,.08); }
.alert-danger { background: rgba(239,68,68,.05); color: #dc2626; border-color: rgba(239,68,68,.08); }
.alert-warning { background: rgba(245,158,11,.05); color: #b45309; border-color: rgba(245,158,11,.08); }
.alert-info { background: rgba(59,130,246,.05); color: #1d4ed8; border-color: rgba(59,130,246,.08); }

/* Modal */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.15); z-index: 999;
    align-items: center; justify-content: center;
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.modal-overlay.active { display: flex; }
.modal {
    background: rgba(255,255,255,.75); border-radius: 20px;
    width: 90%; max-width: 560px; max-height: 80vh;
    overflow-y: auto; padding: 1.75rem;
    border: 1px solid rgba(255,255,255,.8);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 20px 56px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.8);
    animation: modalIn .3s cubic-bezier(.21,1.02,.73,1);
}
.modal-header { font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem; color: #1e293b; }
.modal table td { padding: .4rem .5rem; border-bottom: 1px solid rgba(0,0,0,.03); color: #374151; }
.modal-close { float: right; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: #94a3b8; transition: color .15s; }
.modal-close:hover { color: #4b5563; }
@keyframes modalIn { from { opacity: 0; transform: scale(.92) translateY(-20px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* Pagination */
.pagination { display: flex; align-items: center; gap: .4rem; margin-top: 1rem; justify-content: center; }
.pagination a, .pagination span {
    padding: .45rem .8rem; border: 1px solid rgba(0,0,0,.05); border-radius: 8px; font-size: .85rem;
    transition: all .2s; min-width: 36px; text-align: center; color: #6b7280;
}
.pagination a:hover { background: rgba(255,255,255,.3); border-color: rgba(0,0,0,.08); text-decoration: none; color: #1e293b; }
.pagination .active { background: rgba(59,130,246,.08); color: #2563eb; border-color: rgba(59,130,246,.12); }

/* Flex utilities */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: .5rem; }
.gap-1 { gap: .5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.text-center { text-align: center; }
.text-muted { color: #6b7280; font-size: .85rem; }

/* Empty state */
.empty { text-align: center; padding: 3rem 1rem; color: #94a3b8; }
.empty p { font-size: .9rem; }

/* Loading Spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2.5px solid rgba(0,0,0,.04); border-top-color: #3b82f6; border-radius: 50%; animation: spin .6s linear infinite; }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay { display: none; position: absolute; inset: 0; background: rgba(255,255,255,.4); z-index: 50; align-items: center; justify-content: center; border-radius: 16px; backdrop-filter: blur(3px); }
.loading-overlay.active { display: flex; }
.table-wrap, .card { position: relative; }

/* Toast Notifications */
.toast-container { position: fixed; top: 68px; right: 1.25rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast {
    background: rgba(255,255,255,.8); border-radius: 14px; padding: .85rem 1.1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.06); font-size: .85rem;
    min-width: 320px; max-width: 440px; display: flex; align-items: center; gap: .6rem;
    border: 1px solid rgba(255,255,255,.8);
    border-left: 4px solid #3b82f6; animation: toastIn .35s cubic-bezier(.21,1.02,.73,1);
    font-weight: 500; color: #374151; backdrop-filter: blur(16px);
}
.toast-success { border-left-color: #16a34a; }
.toast-danger { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-confirm { border-left-color: #f59e0b; flex-direction: column; gap: .75rem; }
.toast-actions { display: flex; gap: .5rem; align-self: flex-end; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Notification Badge */
.notif-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; box-shadow: 0 0 10px rgba(239,68,68,.2); }

/* Progress Bar */
.progress-bar { height: 8px; background: rgba(0,0,0,.04); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); border-radius: 4px; transition: width .5s ease; }
.progress-bar-fill.success { background: linear-gradient(90deg, #16a34a, #22c55e); }

/* Empty icon */
.empty-icon { font-size: 2.5rem; color: rgba(148,163,184,.3); margin-bottom: .5rem; }

/* Stat tabs */
.stat-link { display: block; cursor: pointer; transition: all .3s ease; text-decoration: none !important; color: inherit; border-radius: 16px; }
.stat-link:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.04); text-decoration: none !important; }
.stat-link.active { border-color: #3b82f6; border-width: 2px; background: rgba(59,130,246,.03); }

/* Search & Sort */
.search-form { margin: 0; display: inline-flex; align-items: center; gap: .35rem; }
.search-input {
    padding: .42rem .8rem; border: 1.5px solid rgba(0,0,0,.05); border-radius: 10px; font-size: .85rem;
    width: 240px; transition: all .2s; background: rgba(255,255,255,.4); color: #374151;
}
.search-input:focus { outline: none; border-color: rgba(59,130,246,.3); box-shadow: 0 0 0 3px rgba(59,130,246,.06); background: rgba(255,255,255,.55); }
.search-input::placeholder { color: #94a3b8; }
.sort-link { color: inherit; text-decoration: none !important; display: inline-block; }
.sort-link:hover { color: #3b82f6; }
.editable { cursor: pointer; border-bottom: 1.5px dashed rgba(0,0,0,.06); transition: border-color .15s; }
input[type=checkbox] { cursor: pointer; width: 16px; height: 16px; accent-color: #3b82f6; }
.editable:hover { border-bottom-color: #3b82f6; }

/* Quick action buttons group */
.btn-group { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Re-entry indicator */
.badge-reentry {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: rgba(245,158,11,.08); color: #b45309; font-size: .82rem; font-weight: 700;
    cursor: help; margin-left: 4px; vertical-align: middle;
    border: 1.5px solid rgba(245,158,11,.12); transition: all .2s;
}
.badge-reentry:hover { background: rgba(245,158,11,.15); color: #92400e; transform: scale(1.2); }

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,.2); }
    50% { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
}
.badge-reentry { animation: pulse-warning 2s infinite; }

/* WA Blaster */
#qr-reader { border-radius: 12px; overflow: hidden; min-height: 200px; background: rgba(255,255,255,.2); border: 1.5px dashed rgba(0,0,0,.05); }
#qr-reader video { border-radius: 12px; }
#qr-reader__dashboard_section { padding: 0 !important; }
#qr-reader__dashboard_section_csr button { background: #3b82f6; color: #fff; border: none; padding: 6px 16px; border-radius: 8px; cursor: pointer; transition: background .15s; }
#qr-reader__dashboard_section_csr button:hover { background: #2563eb; }
#qr-reader__dashboard_section_csr span { font-size: .8rem; color: #6b7280; }
.editable-wa { cursor: pointer; border-bottom: 1.5px dashed rgba(0,0,0,.06); transition: border-color .15s; padding: 2px 4px; border-radius: 3px; }
.editable-wa:hover { border-bottom-color: #16a34a; background: rgba(22,163,74,.03); }
.btn-qr { font-size: .85rem; padding: 2px 6px; cursor: pointer; }
#wa-template { font-family: inherit; background: rgba(255,255,255,.3); color: #374151; border: 1.5px solid rgba(0,0,0,.05); border-radius: 10px; padding: .75rem; }

/* ─── Dashboard Grid ─── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.dashboard-chart .chart-wrap { position: relative; height: 240px; }
.dashboard-chart canvas { max-height: 240px; }

/* ─── Stat Card with Icon ─── */
.stat-card { --accent: #3b82f6; }
.stat-icon { font-size: 1.6rem; margin-bottom: 2px; line-height: 1; }

/* ─── Timeline ─── */
.timeline { padding: .25rem 0; }
.timeline-item {
    display: flex; gap: .75rem; padding: .6rem 0;
    border-bottom: 1px solid rgba(0,0,0,.03);
    animation: fadeIn .3s ease;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    margin-top: 5px; background: #94a3b8;
}
.dot-success { background: #16a34a; box-shadow: 0 0 6px rgba(22,163,74,.3); }
.dot-danger { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.3); }
.dot-info { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,.3); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-head { font-weight: 600; font-size: .85rem; color: #1e293b; }
.timeline-meta { font-size: .75rem; color: #94a3b8; margin-top: 2px; }
.timeline-empty { padding: 1.5rem; text-align: center; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Quick Actions ─── */
.quick-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.quick-action-btn {
    display: flex; flex-direction: column; align-items: center; gap: .35rem;
    padding: .85rem 1.1rem; border-radius: 14px; min-width: 88px;
    background: rgba(255,255,255,.35); border: 1px solid rgba(0,0,0,.04);
    transition: all .25s ease; cursor: pointer; text-decoration: none !important;
}
.quick-action-btn:hover {
    background: rgba(255,255,255,.55); border-color: rgba(59,130,246,.15);
    transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.qa-icon { font-size: 1.4rem; line-height: 1; }
.qa-label { font-size: .78rem; font-weight: 600; color: #475569; }

/* ─── Tab Bar ─── */
.tab-bar { display: flex; gap: .25rem; background: rgba(0,0,0,.03); border-radius: 10px; padding: 3px; }
.tab-item {
    padding: .4rem .85rem; border-radius: 8px; font-size: .82rem; font-weight: 600;
    color: #6b7280; transition: all .2s; text-decoration: none !important; white-space: nowrap;
    display: flex; align-items: center; gap: .4rem;
}
.tab-item:hover { color: #1e293b; background: rgba(255,255,255,.4); }
.tab-item.active { background: #fff; color: #1e293b; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; font-size: .68rem; font-weight: 700; }

/* ─── Row Status Colors ─── */
.row-diproses { border-left: 3px solid #f59e0b; }
.row-selesai { border-left: 3px solid #16a34a; }
.row-bermasalah { border-left: 3px solid #ef4444; }
.row-dibagikan { border-left: 3px solid #3b82f6; }

/* ─── Editable inline ─── */
.editable { display:inline-block; min-width:40px; cursor:pointer; padding:1px 2px; border-radius:3px; }
.editable:hover { background:rgba(59,130,246,.06); }

/* ─── Inline copy button (detail modal) ─── */
.btn-copy-inline { display:inline; border:none; background:rgba(59,130,246,.08); color:#3b82f6; font-size:.65rem; font-weight:600; padding:1px 6px; border-radius:4px; cursor:pointer; transition:all .15s; vertical-align:middle; line-height:1.6; }
.btn-copy-inline:hover { background:rgba(59,130,246,.16); }

/* ─── Row selection ─── */
tr.selected { background: rgba(59,130,246,.08) !important; outline: 2px solid rgba(59,130,246,.3); outline-offset: -2px; }

/* ─── Shortcut hint bar ─── */
.shortcut-hint { display:flex; gap:.75rem; flex-wrap:wrap; padding:.4rem .75rem; font-size:.7rem; color:#6b7280; background:rgba(0,0,0,.015); border-top:1px solid rgba(0,0,0,.03); }

/* ─── Full-width layout (no sidebar) ─── */
.layout-full .sidebar { display: none; }
.layout-full .content-area { margin-left: 0; max-width: 100%; }

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .mon-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ─── Dashboard Clean ─── */
body:has(#dash-app) .main-content {
    overflow: hidden; display: flex; flex-direction: column;
    height: calc(100vh - 56px); padding: .65rem 1.25rem .35rem;
}
#dash-app { flex: 1; display: flex; flex-direction: column; gap: .5rem; overflow: hidden; }

/* Summary bar */
.dash-summary { display: flex; gap: .5rem; }
.dash-stat {
    flex: 1; background: rgba(255,255,255,.35); border-radius: 10px;
    padding: .55rem .75rem; text-align: center;
    border-left: 3px solid var(--accent); backdrop-filter: blur(6px);
    transition: all .15s;
}
.dash-stat:hover { background: rgba(255,255,255,.55); }
.dash-stat.active { background: rgba(255,255,255,.7); box-shadow: 0 4px 12px rgba(0,0,0,.04); }
.ds-val { display: block; font-size: 1.3rem; font-weight: 700; color: #1e293b; line-height: 1.2; }
.ds-lbl { display: block; font-size: .75rem; color: #6b7280; margin-top: 1px; }

/* Main area: chart kiri, tabel+timeline kanan */
.dash-main { flex: 1; display: flex; gap: .5rem; overflow: hidden; }
.dash-col { flex: 1; display: flex; flex-direction: column; gap: .5rem; overflow: hidden; }

/* Footer links */
.dash-footer {
    display: flex; gap: .35rem; flex-wrap: wrap;
    background: rgba(255,255,255,.2); border-radius: 10px; padding: .35rem .5rem;
    backdrop-filter: blur(6px);
}
.dash-link {
    font-size: .72rem; color: #6b7280; padding: .25rem .55rem;
    border-radius: 6px; transition: all .15s; white-space: nowrap;
}
.dash-link:hover { background: rgba(255,255,255,.5); color: #1e293b; text-decoration: none; }

/* Compact tables */
.compact-table { width:100%; border-collapse:collapse; font-size:.82rem; }
.compact-table th { background:rgba(0,0,0,.015); padding:4px 6px; text-align:left; font-weight:600; color:#6b7280; border-bottom:1px solid rgba(0,0,0,.04); position:sticky; top:0; }
.compact-table td { padding:4px 6px; border-bottom:1px solid rgba(0,0,0,.02); white-space:nowrap; }
.compact-table tbody tr:hover { background:rgba(255,255,255,.25); }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(59,130,246,.04) !important; }

/* Mini timeline */
#timeline-container .timeline-item { padding:2px 0; }
#timeline-container .timeline-dot { width:5px;height:5px;margin-top:3px; }
#timeline-container .timeline-body { padding-left:10px; }
#timeline-container .timeline-head { font-size:.68rem; color:#374151; }
#timeline-container .timeline-meta { font-size:.6rem; }

@media (max-width: 768px) {
    .sidebar { width: 48px; overflow: hidden; position: fixed; top: 0; left: max(0px, calc(50% - 700px)); height: 100vh; z-index: 99; }
    .sidebar-head { border-bottom: none; }
    .sidebar-brand { display: flex; align-items: center; justify-content: center; padding: .9rem 0; }
    .sidebar-brand .sb-first { font-weight: 800; font-size: 1.1rem; background: linear-gradient(135deg,#1e293b,#3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
    .sidebar-brand .sb-rest { display: none; }
    .sidebar-menu li a { justify-content: center; padding: .6rem 0; font-size: 1rem; gap: 0; margin: 1px .25rem; }
    .sidebar-footer { padding: .4rem .65rem; justify-content: center; }
    .sidebar-footer .sb-user { display: none; }
    .sidebar-footer .sb-logout { font-size: .85rem; }
    .content-area { margin-left: 48px; }
    .sidebar.collapsed + .content-area { margin-left: 48px; }
    .mon-grid { grid-template-columns: 1fr !important; }
    .main-content { padding: .75rem; }
    .form-row { flex-direction: column; gap: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .toast-container { left: .5rem; right: .5rem; }
    .toast { min-width: auto; }
    .search-input { width: 160px; }
}
