/* ═══════════════════════════════════════════
   Reporting PBJ — Layout Styles
   Clean, modern, minimalist design
   ═══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --color-bg: #f8fafc;
    --color-white: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #334155;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-heading: #0f172a;
    --color-accent: #2563eb;
    --color-accent-light: #eff6ff;
    --color-accent-hover: #1d4ed8;
    --color-red: #ef4444;
    --color-red-light: #fef2f2;
    --color-green: #22c55e;
    --sidebar-w: 260px;
    --sidebar-mini: 64px;
    --topbar-h: 56px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
    --transition: 0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Instrument Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }

/* ── App Shell ── */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-mini);
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.25s ease, min-width 0.25s ease;
    z-index: 40;
}

.sidebar.collapsed {
    width: var(--sidebar-mini);
    min-width: var(--sidebar-mini);
}

/* Sidebar brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: #fff;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.sidebar-brand-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar-brand-text {
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.3;
}

.sidebar-brand-text h5 {
    font-weight: 700;
    font-size: 0.85rem;
    margin: 0;
    color: var(--color-heading);
}

.sidebar-brand-text small {
    font-size: 0.6rem;
    color: var(--color-text-light);
    display: block;
}

.sidebar-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--color-bg);
    color: var(--color-heading);
}

/* Sidebar menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px;
}

.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.sidebar-section {
    padding: 16px 10px 6px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-light);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link {
    color: var(--color-text-muted);
    padding: 8px 10px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 7px;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    margin-bottom: 1px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link i {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link .sidebar-link-label {
    overflow: hidden;
}

.sidebar-link:hover {
    background: var(--color-bg);
    color: var(--color-heading);
}

.sidebar-link.active {
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 600;
}

.sidebar-link.active i { color: var(--color-accent); }

/* Sidebar nav-toggle */
.sidebar-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle-item .sidebar-arrow {
    transition: transform 0.2s;
    font-size: 0.5rem;
    color: var(--color-text-light);
    flex-shrink: 0;
}

.sidebar-toggle-item .sidebar-arrow.open {
    transform: rotate(90deg);
}

/* Sidebar submenu */
.sidebar-submenu {
    padding-left: 12px;
}

.sidebar-submenu .sidebar-link {
    padding-left: 24px;
    font-size: 0.75rem;
}

.sidebar-submenu .sidebar-submenu .sidebar-link {
    padding-left: 40px;
    font-size: 0.72rem;
}

.sidebar-submenu .sidebar-toggle-item {
    padding-left: 24px;
    font-size: 0.75rem;
}

/* Submenu visibility controlled by Alpine x-show */

/* Sidebar footer */
.sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding: 4px 10px;
    flex-shrink: 0;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--color-red);
    font-size: 0.78rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.sidebar-logout i {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

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

.sidebar-copyright {
    padding: 8px 10px 2px;
    font-size: 0.65rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

/* Collapsed sidebar */
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-link-label,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .sidebar-arrow,
.sidebar.collapsed .sidebar-logout-text {
    display: none;
}

.sidebar.collapsed .sidebar-link,
.sidebar.collapsed .sidebar-toggle-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar.collapsed .sidebar-submenu { display: none !important; }
.sidebar.collapsed .sidebar-brand { padding: 0; justify-content: center; }
.sidebar.collapsed .sidebar-toggle { margin: 0 auto; }
.sidebar.collapsed .sidebar-menu { padding: 8px 5px; }
.sidebar.collapsed .sidebar-footer .sidebar-logout { justify-content: center; }
.sidebar.collapsed .sidebar-copyright { display: none; }

.sidebar-toggle-icon { transition: transform 0.25s ease; }
.sidebar.collapsed .sidebar-toggle-icon { transform: rotate(180deg); }

/* ── Main Area ── */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Topbar ── */
.topbar {
    height: var(--topbar-h);
    min-height: var(--topbar-h);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .topbar { padding: 0 24px; }
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition);
}

.mobile-menu-btn:hover { background: var(--color-bg); color: var(--color-heading); }

@media (min-width: 768px) {
    .mobile-menu-btn { display: none; }
}

/* Breadcrumb */
.breadcrumb {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

@media (min-width: 640px) {
    .breadcrumb { display: flex; }
}

.breadcrumb a {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color var(--transition);
}

.breadcrumb a:hover { color: var(--color-accent); }

.breadcrumb .separator { color: #cbd5e1; }

.breadcrumb .current {
    color: var(--color-heading);
    font-weight: 500;
}

/* User avatar */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.user-name {
    display: none;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

@media (min-width: 640px) {
    .user-name { display: block; }
}

/* User dropdown trigger */
.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid transparent;
    outline: none;
    box-shadow: none;
    transition: background var(--transition);
    user-select: none;
    text-decoration: none;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.user-dropdown-trigger::after {
    display: none !important;
}

.user-dropdown-trigger:hover {
    background: var(--color-bg);
}

.user-chevron {
    font-size: 0.7rem;
    color: var(--color-text-light);
    transition: transform 0.2s ease;
}

.show > .user-dropdown-trigger .user-chevron {
    transform: rotate(180deg);
}

/* ── Notifikasi tarik data (lonceng topbar) ── */
.notif-dropdown {
    display: flex;
    align-items: center;
}

.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.notif-bell:hover {
    background: var(--color-bg);
    color: var(--color-heading);
}

.notif-bell::after { display: none !important; }

.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--color-white);
}

.notif-menu {
    width: 340px;
    max-width: calc(100vw - 24px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.notif-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-heading);
    background: var(--color-bg);
}

.notif-menu-link {
    font-size: 0.72rem;
    color: var(--color-accent);
    text-decoration: none;
}

.notif-menu-body { max-height: 320px; overflow-y: auto; }

.notif-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
}

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

.notif-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.notif-icon-sukses { background: #ecfdf5; color: #059669; }
.notif-icon-gagal { background: var(--color-red-light); color: #dc2626; }

.notif-text { min-width: 0; }

.notif-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-heading);
}

.notif-year {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-left: 4px;
}

.notif-desc {
    font-size: 0.74rem;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

.notif-time {
    font-size: 0.68rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 14px;
    color: var(--color-text-light);
    font-size: 0.78rem;
}

.notif-empty i { font-size: 1.4rem; }

.notif-menu-footer {
    padding: 8px 14px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    background: var(--color-bg);
}

.notif-menu-footer a {
    font-size: 0.74rem;
    color: var(--color-accent);
    text-decoration: none;
}

/* ── Ikon pembaruan sistem (perisai di topbar) ── */
.notif-bell-alert { color: #dc2626; }

.notif-bell-alert:hover {
    background: #fef2f2;
    color: #b91c1c;
}

.notif-bell-warn { color: #b45309; }

.notif-bell-warn:hover {
    background: #fffbeb;
    color: #92400e;
}

.notif-icon-info { background: #eff6ff; color: #2563eb; }

.notif-menu-footer-aksi {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.notif-mark-read {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    text-decoration: underline;
}

.notif-mark-read:hover { color: var(--color-accent); }

/* ── Content Area ── */
.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
}

@media (min-width: 768px) {
    .content-area { padding: 24px; }
}

.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Dashboard Cards ── */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .dash-grid { grid-template-columns: repeat(4, 1fr); }
}

.dash-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 20px;
    text-decoration: none;
    transition: all var(--transition);
    display: block;
    color: inherit;
}

.dash-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #bfdbfe;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.dash-card-icon.blue   { background: #eff6ff; color: #2563eb; }
.dash-card-icon.green  { background: #ecfdf5; color: #059669; }
.dash-card-icon.amber  { background: #fffbeb; color: #d97706; }
.dash-card-icon.violet { background: #f5f3ff; color: #7c3aed; }
.dash-card-icon.cyan   { background: #ecfeff; color: #0891b2; }
.dash-card-icon.rose   { background: #fff1f2; color: #e11d48; }
.dash-card-icon.indigo { background: #eef2ff; color: #4f46e5; }
.dash-card-icon.teal   { background: #f0fdfa; color: #0d9488; }

.dash-card-arrow {
    font-size: 0.7rem;
    color: var(--color-text-light);
    transition: color var(--transition);
}

.dash-card:hover .dash-card-arrow { color: var(--color-accent); }

.dash-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 4px;
    line-height: 1.2;
}

.dash-card-label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

/* ── Quick Link Cards ── */
.quick-links {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .quick-links { grid-template-columns: repeat(3, 1fr); }
}

.quick-link-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 20px;
}

.quick-link-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-link-card h3 i { font-size: 0.95rem; }

.quick-link-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quick-link-list a {
    display: block;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all var(--transition);
}

.quick-link-list a:hover {
    background: var(--color-bg);
    color: var(--color-accent);
}

/* ── Page Header ── */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0 0 4px;
}

.page-header p {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0;
}

/* ── Sidebar Alpine Transitions ── */
.sidebar-enter {
    transition: all 0.2s ease-out;
    overflow: hidden;
}

.sidebar-enter-start {
    opacity: 0;
    max-height: 0;
}

.sidebar-enter-end {
    opacity: 1;
    max-height: 800px;
}

/* ── Sidebar Active Border ── */
.sidebar-link.active {
    position: relative;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--color-accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-link.sidebar-link-sub {
    padding-left: 24px;
    font-size: 0.75rem;
}

.sidebar-submenu .sidebar-submenu .sidebar-link-sub {
    padding-left: 40px;
    font-size: 0.72rem;
}

/* ── Sidebar Chevron ── */
.sidebar-chevron {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
    color: var(--color-text-light);
    flex-shrink: 0;
}

.sidebar-chevron.open {
    transform: rotate(90deg);
}

/* ── Sidebar Link Inner ── */
.sidebar-link-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

/* ── Mobile Sidebar Overlay ── */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 50;
        width: var(--sidebar-w);
    }

    .sidebar.collapsed {
        width: 0;
        min-width: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.4);
        z-index: 45;
        backdrop-filter: blur(2px);
    }

    .sidebar:not(.collapsed) + .sidebar-overlay,
    .sidebar-overlay.active {
        display: block;
    }
}

/* ═══════════════════════════════════════════
   Tender Page — Redesigned UI Components
   Clean, modern, minimalist
   ═══════════════════════════════════════════ */

/* ── Filter Bar ── */
.filter-bar {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .filter-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .filter-row { grid-template-columns: 1fr; }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select {
    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='%2394a3b8' 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 10px center;
    padding-right: 32px;
    cursor: pointer;
}

.filter-reset-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: all var(--transition);
}

.filter-reset-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-muted);
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.filter-actions .btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    line-height: 1.5;
}

.filter-actions .btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.filter-actions .btn-primary:hover {
    background: var(--color-accent-hover);
}

.filter-actions .btn-outline-secondary {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.filter-actions .btn-outline-secondary:hover {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-text-light);
}

/* ── Stats Cards ── */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .stats-cards { grid-template-columns: 1fr; }
}

.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.stat-card-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.stat-card-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-card-icon.green  { background: #ecfdf5; color: #059669; }
.stat-card-icon.amber  { background: #fffbeb; color: #d97706; }
.stat-card-icon.violet { background: #f5f3ff; color: #7c3aed; }
.stat-card-icon.cyan   { background: #ecfeff; color: #0891b2; }

.stat-card-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.stat-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.stat-row strong {
    font-weight: 600;
    color: var(--color-heading);
}

.stat-row.stat-success strong { color: var(--color-green); }
.stat-row.stat-warning strong { color: #d97706; }
.stat-row.stat-danger strong  { color: var(--color-red); }

/* ── Action Bar ── */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

.btn-soft:hover {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-text-light);
}

.btn-soft-primary {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-light);
}

.btn-soft-primary:hover {
    background: var(--color-accent);
    color: #fff;
}

.btn-soft-info {
    border-color: #0891b2;
    color: #0891b2;
    background: #ecfeff;
}

.btn-soft-info:hover {
    background: #0891b2;
    color: #fff;
}

.last-update-text {
    font-size: 0.7rem;
    color: var(--color-text-light);
}

/* ── Table Toolbar ── */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.table-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.table-toolbar-left select {
    padding: 4px 28px 4px 10px;
    font-size: 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    color: var(--color-text);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' 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 8px center;
}

.table-toolbar-left select:focus {
    border-color: var(--color-accent);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 10px;
    color: var(--color-text-light);
    font-size: 0.8rem;
    pointer-events: none;
}

.search-wrapper input {
    padding: 6px 12px 6px 32px;
    font-size: 0.78rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    color: var(--color-text);
    outline: none;
    width: 220px;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}

.search-wrapper input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.search-wrapper input::placeholder {
    color: var(--color-text-light);
}

/* ── Data Table ── */
.data-table-wrapper {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow-x: auto;
    margin-bottom: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: auto;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table thead th {
    background: var(--color-bg);
    padding: 10px 12px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table thead th.text-end {
    text-align: right;
}

.data-table thead th.text-center {
    text-align: center;
}

.data-table thead th .sort-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

.data-table thead th .sort-link:hover {
    color: var(--color-primary);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}

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

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    color: var(--color-text);
}

.data-table tbody td.text-end {
    text-align: right;
}

.data-table tbody td.text-center {
    text-align: center;
}

.data-table tbody td.text-danger {
    color: var(--color-red);
}

.data-table tbody td .fw-bold {
    font-weight: 600;
}

/* ── Table Footer / Pagination Info ── */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.table-footer .text-muted {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ── Pagination Override ── */
.pagination {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-item {
    display: inline-flex;
}

.page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1;
}

.page-item .page-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-text-light);
}

.page-item.active .page-link {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
    background: var(--color-bg);
}

/* ── Status Badge ── */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.status-selesai {
    background: #ecfdf5;
    color: #059669;
}

.status-berlangsung,
.status-badge.status-berlangsung {
    background: #fffbeb;
    color: #d97706;
}

.status-danger {
    background: #fef2f2;
    color: #dc2626;
}

.status-warning {
    background: #fffbeb;
    color: #d97706;
}

.status-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ── Page Subtitle ── */
.page-header p.subtitle {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 2px 0 0;
}

/* ── Responsive tweaks ── */
@media (max-width: 768px) {
    .search-wrapper input { width: 160px; }
    .data-table-wrapper { border-radius: var(--radius); overflow-x: auto; }
    .action-bar { flex-direction: column; align-items: stretch; }
    .action-bar-right { justify-content: flex-end; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-toolbar-right { align-self: flex-end; }
}

@media (max-width: 640px) {
    .stat-card { padding: 12px 14px; }
    .data-table { font-size: 0.72rem; }
    .data-table thead th,
    .data-table tbody td { padding: 8px; }
}

/* ── Dashboard Tabs ── */
.dash-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.dash-tab {
    padding: 8px 18px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    font-family: inherit;
}

.dash-tab:hover {
    color: var(--color-text);
}

.dash-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.dash-tab-content {
    min-height: 100px;
}

.dash-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.dash-filter-bar {
    margin-bottom: 20px;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

.dash-stat-card .stat-row strong {
    font-size: 1.15rem;
}

.card-chart {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
    height: 100%;
}

.card-chart:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.card-chart-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.card-opd {
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.card-opd-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #dc2626;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}


[x-cloak] { display: none !important; }

.ppk-searchable {
    position: relative;
    width: 100%;
}

.ppk-searchable-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    cursor: pointer;
    text-align: left;
}

.ppk-searchable-trigger:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ppk-searchable-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ppk-searchable-value.is-placeholder {
    color: var(--color-text-muted);
}

.ppk-searchable-chevron {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    font-size: 0.75rem;
    transition: transform var(--transition);
    flex-shrink: 0;
}

.ppk-searchable-chevron.is-open {
    transform: rotate(180deg);
}

.ppk-searchable-clear {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 4px;
    font-size: 1rem;
}

.ppk-searchable-clear:hover {
    color: var(--color-text);
    background: var(--color-bg);
}

.ppk-searchable-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.ppk-searchable-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.ppk-searchable-search i {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.ppk-searchable-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8rem;
    color: var(--color-text);
    font-family: inherit;
    padding: 0;
}

.ppk-searchable-options {
    max-height: 260px;
    overflow-y: auto;
}

.ppk-searchable-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.8rem;
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}

.ppk-searchable-option:hover,
.ppk-searchable-option.is-active {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

.ppk-searchable-option-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ppk-searchable-option-check {
    color: var(--color-accent);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ppk-searchable-empty {
    padding: 12px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Multi-pilih satuan kerja (menu Export ITKP) */
.ppk-multi-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-white);
}

.ppk-multi-actions button {
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.72rem;
    color: var(--color-accent);
    cursor: pointer;
    text-decoration: underline;
}

.ppk-multi-actions button:hover {
    color: var(--color-text);
}

.ppk-multi-option {
    justify-content: flex-start;
    gap: 10px;
}

.ppk-multi-option input[type="checkbox"] {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--color-accent);
}

.ppk-multi-option .ppk-searchable-option-text {
    flex: 1 1 auto;
}

.ppk-searchable-option.is-checked {
    background: var(--color-accent-light);
    color: var(--color-accent);
}


/* ---- Ikon rumus perhitungan (popover) ---- */
.rumus-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    padding: 0;
    margin-left: 4px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-light);
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
}

.rumus-info:hover,
.rumus-info:focus-visible {
    color: var(--color-accent);
    background: var(--color-accent-light);
    outline: none;
}

.rumus-info i { line-height: 1; }

.popover.rumus-popover {
    max-width: 320px;
    font-size: 0.78rem;
    border-color: var(--color-border);
    box-shadow: var(--shadow-md);
}

.popover.rumus-popover .popover-header {
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-heading);
    background: var(--color-accent-light);
    border-bottom-color: var(--color-border);
}

.popover.rumus-popover .popover-body {
    padding: 8px 10px;
    line-height: 1.5;
    color: var(--color-text);
}

.popover.rumus-popover .popover-body b,
.popover.rumus-popover .popover-body strong { color: var(--color-heading); }