:root {
    --primary: #0c2d48;
    --primary-dark: #081e33;
    --primary-light: #eef3f8;
    --primary-mid: #1a4a6e;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #e11d48;
    --danger-light: #ffe4e6;
    --info: #0284c7;
    --info-light: #e0f2fe;
    --gray-50: #f6f7f9;
    --gray-100: #eef0f3;
    --gray-200: #e2e5ea;
    --gray-300: #c9ced6;
    --gray-400: #94a0b0;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --sidebar-width: 268px;
    --topbar-height: 64px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 8px 24px rgba(15,23,42,.06);
    --shadow-lg: 0 16px 40px rgba(15,23,42,.1);
    --transition: .2s ease;
    --border: 1px solid var(--gray-200);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(26,74,110,.35), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 90%, rgba(12,45,72,.4), transparent 50%),
        #061525;
    padding: 1.25rem;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 2.25rem 2rem;
    border: 1px solid rgba(255,255,255,.12);
    animation: fadeUp .45s ease both;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -.02em;
}

.login-logo h1 {
    font-size: 1.4rem;
    color: var(--gray-900);
    font-weight: 800;
    letter-spacing: -.02em;
}

.login-logo p {
    color: var(--gray-500);
    font-size: .875rem;
    margin-top: .35rem;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--gray-400);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle:hover { color: var(--gray-700); background: var(--gray-100); }
.password-toggle svg { width: 18px; height: 18px; }
.btn-login { margin-top: .5rem; min-height: 48px; font-weight: 600; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* App Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.logo { display: flex; align-items: center; gap: .75rem; }

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .8rem;
    flex-shrink: 0;
    letter-spacing: -.02em;
}

.logo-title { font-weight: 600; font-size: .95rem; display: block; }
.logo-sub { font-size: .7rem; color: var(--gray-400); display: block; }

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: .25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem .75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-size: .875rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: .25rem;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    padding: 0 .25rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .875rem;
    flex-shrink: 0;
}

.user-name { font-size: .875rem; font-weight: 500; }
.user-role { font-size: .75rem; color: var(--gray-400); }

.btn-logout {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    font-size: .875rem;
    transition: all var(--transition);
    width: 100%;
}

.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover { background: rgba(239,68,68,.15); color: var(--danger); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--primary);
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    color: #fff;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: .5rem;
    color: #fff;
}

.menu-toggle svg { width: 24px; height: 24px; }
.page-title { font-size: 1.25rem; font-weight: 600; color: #fff; }

.content { padding: 1.5rem; }

/* Cards & Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow);
    border: var(--border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    text-decoration: none;
    color: inherit;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #9eb6cc;
}

.stat-card.is-alert {
    border-color: #fecdd3;
    background: linear-gradient(180deg, #fff 60%, #fff1f2 100%);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }

.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.stat-label { font-size: .8rem; color: var(--gray-500); margin-top: .125rem; }

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: var(--border);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
}

.card-title { font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 1.25rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: .375rem;
}

.form-control {
    width: 100%;
    padding: .625rem .875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12,45,72,.16);
}

.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-hint { font-size: .75rem; color: var(--gray-500); margin-top: .25rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Tables */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

thead { background: var(--gray-50); }

th {
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .025em;
    white-space: nowrap;
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}

tr:hover td { background: var(--gray-50); }

.product-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--gray-100);
}

.product-thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: .7rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Alerts */
.alert {
    padding: .875rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .875rem;
    font-weight: 500;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--info-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* Search bar */
.search-bar {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-bar .form-control { max-width: 300px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state svg { width: 48px; height: 48px; margin: 0 auto 1rem; color: var(--gray-300); }

/* FEFO Preview */
.fefo-preview {
    background: var(--primary-light);
    border: 1px solid #9eb6cc;
    border-radius: var(--radius);
    padding: 1.1rem 1.15rem;
    margin-top: 1rem;
}

.fefo-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.fefo-preview h4 {
    font-size: .95rem;
    color: var(--primary-dark);
    margin: 0;
    font-weight: 700;
}

.fefo-preview-badge {
    font-size: .7rem;
    font-weight: 600;
    color: var(--primary);
    background: #fff;
    border: 1px solid #9eb6cc;
    border-radius: 999px;
    padding: .2rem .65rem;
}

.fefo-timeline { display: flex; flex-direction: column; gap: 0; }

.fefo-timeline-item {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: .75rem;
    position: relative;
}

.fefo-timeline-item:not(:last-child) .fefo-timeline-rail::after {
    content: '';
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: -4px;
    width: 2px;
    background: #9eb6cc;
}

.fefo-timeline-rail {
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: .15rem;
}

.fefo-timeline-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.fefo-timeline-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: .75rem .9rem;
    margin-bottom: .75rem;
}

.fefo-timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}

.fefo-batch-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-500);
}

.fefo-timeline-meta strong { color: var(--primary-dark); font-size: .95rem; }
.fefo-timeline-exp { font-size: .82rem; color: var(--gray-600); margin-bottom: .55rem; }

.fefo-bar {
    height: 6px;
    background: var(--gray-100);
    border-radius: 99px;
    overflow: hidden;
}

.fefo-bar span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width .35s ease;
}

.fefo-preview-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: .65rem;
    border-top: 2px solid #9eb6cc;
    font-size: .9rem;
    color: var(--gray-700);
}

.fefo-preview-total strong { color: var(--primary-dark); font-size: 1rem; }

.fefo-item {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    border-bottom: 1px solid #9eb6cc;
    font-size: .85rem;
}

.fefo-item:last-child { border-bottom: none; }

/* Form pages */
.form-page { max-width: 700px; }

.btn-back-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-700);
    flex-shrink: 0;
    text-decoration: none;
}

.btn-back-mobile svg { width: 22px; height: 22px; }
.btn-back-mobile:active { background: var(--gray-200); }

.fefo-info-example {
    display: block;
    margin-top: .35rem;
    font-size: .9em;
    opacity: .95;
}

/* Tabs */
.tabs {
    display: flex;
    gap: .25rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.tab {
    padding: .75rem 1.25rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.filter-bar .form-group { margin-bottom: 0; }

/* Action buttons in table */
.action-btns { display: flex; gap: .375rem; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0;
    line-height: 1;
}

.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: .5rem; }

/* Print */
@media print {
    .sidebar, .topbar, .btn, .search-bar, .filter-bar, .no-print,
    .bottom-nav, .fab, .bottom-sheet, .bottom-sheet-overlay, .quick-actions,
    .report-toolbar, .report-mobile-view { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .content { padding: 0 !important; }
}

/* Responsive - desktop sidebar */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
}

/* ============================================
   MOBILE APP STYLE (Android-like)
   ============================================ */

:root {
    --bottom-nav-height: 68px;
    --appbar-height: 72px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* overflow-x: hidden pada elemen selain html membuatnya jadi scroll container
   (overflow-y ikut jadi auto). Di mobile gestur scroll bisa berhenti di situ dan
   tidak diteruskan ke viewport. Pakai clip: memotong tanpa bikin scroll container. */
html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    overflow-x: clip;
    max-width: 100%;
}

.app-body {
    width: 100%;
    overflow-x: clip;
    -webkit-tap-highlight-color: transparent;
}

.app-wrapper,
.main-content,
.content {
    max-width: 100%;
    min-width: 0;
}

.mobile-only { display: none !important; }
.desktop-only { display: block; }

/* FAB */
.fab {
    position: fixed;
    right: 1.25rem;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(12,45,72,.4);
    z-index: 90;
    transition: transform .2s, box-shadow .2s;
}

.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(.92); }

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,.06);
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    z-index: 300;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
    box-sizing: border-box;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    padding: .5rem .25rem .35rem;
    color: var(--gray-400);
    font-size: .65rem;
    font-weight: 500;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    min-height: 56px;
    transition: color .2s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active svg { stroke-width: 2.5; }

.bottom-nav-fab { position: relative; top: -14px; }
.bottom-nav-fab-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(12,45,72,.35);
    transition: transform .2s;
}

.bottom-nav-fab:active .bottom-nav-fab-btn { transform: scale(.9); }
.bottom-nav-fab.active .bottom-nav-fab-btn { box-shadow: 0 6px 24px rgba(12,45,72,.5); }
.bottom-nav-fab svg { width: 24px; height: 24px; }

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}

.bottom-sheet-overlay.active { opacity: 1; visibility: visible; }

.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 160;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.32,.72,0,1);
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: calc(var(--safe-bottom) + 1rem);
}

.bottom-sheet.active { transform: translateY(0); }

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 99px;
    margin: .75rem auto;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem .75rem;
    border-bottom: 1px solid var(--gray-100);
}

.bottom-sheet-header h3 { font-size: 1rem; font-weight: 600; }

.bottom-sheet-close {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-sheet-body { padding: .75rem 1rem; }

.sheet-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .875rem 1rem;
    border-radius: 14px;
    color: var(--gray-800);
    text-decoration: none;
    margin-bottom: .35rem;
    transition: background .15s;
}

.sheet-menu-item:active { background: var(--gray-100); }
.sheet-menu-item strong { display: block; font-size: .9rem; }
.sheet-menu-item small { color: var(--gray-500); font-size: .75rem; }

.sheet-menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sheet-menu-icon svg { width: 22px; height: 22px; }
.sheet-menu-danger strong { color: var(--danger); }

/* Mobile App Bar */
.mobile-appbar {
    background: var(--primary);
    border-bottom: none;
    height: auto;
    min-height: var(--topbar-height);
    padding: 0 1.5rem;
    color: #fff;
    box-shadow: 0 4px 20px rgba(12,45,72,.22);
}

@media (max-width: 768px) {
    .mobile-appbar {
        min-height: var(--appbar-height);
        padding: calc(.75rem + var(--safe-top)) 1rem .875rem;
        box-shadow: 0 4px 20px rgba(12,45,72,.28);
    }
}

.appbar-left { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; }
.appbar-right { flex-shrink: 0; }

.appbar-brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }

.appbar-logo {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,.2);
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.appbar-store { font-size: .7rem; opacity: .85; line-height: 1.2; }

.mobile-appbar .page-title {
    color: #fff;
    font-size: 1.15rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-appbar .menu-toggle {
    color: #fff;
    background: rgba(255,255,255,.15);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.appbar-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.25);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .85rem;
}

@media (max-width: 768px) {
    .mobile-appbar .page-title { font-size: 1.05rem; }
}

/* Toast alerts */
.toast-alert {
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    animation: slideDown .35s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quick actions dashboard */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: .875rem .5rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: var(--border);
    text-decoration: none;
    color: var(--gray-700);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.quick-action:hover { border-color: #9eb6cc; box-shadow: var(--shadow-md); }
.quick-action:active { transform: scale(.95); }

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon svg { width: 22px; height: 22px; }
.quick-action span { font-size: .7rem; font-weight: 600; text-align: center; line-height: 1.2; }
.qa-in { background: #d1fae5; color: #059669; }
.qa-out { background: #fef3c7; color: #d97706; }
.qa-exp { background: #ffe4e6; color: #e11d48; }
.qa-report { background: #e0f2fe; color: #0284c7; }
.qa-product { background: #eef3f8; color: #0c2d48; }
.qa-import { background: #e8eef5; color: #1a4a6e; }
.mobile-quick { display: none; }

/* Demo banner */
.demo-banner {
    background: #fff;
    border: var(--border);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.demo-banner > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.15rem;
    font-size: .85rem;
    color: var(--gray-600);
    background: var(--primary-light);
}

.demo-banner > summary::-webkit-details-marker { display: none; }
.demo-banner strong { color: var(--primary-dark); }
.demo-banner-toggle {
    font-size: .75rem;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.demo-banner-body {
    padding: 1rem 1.15rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    border-top: 1px solid var(--gray-100);
}

.demo-banner-body p { font-size: .85rem; color: var(--gray-600); margin: 0; }
.demo-banner-note { font-size: .8rem !important; color: var(--gray-500) !important; }
.demo-banner[open] .demo-banner-toggle::before { content: none; }

/* Alert priority strip */
.alert-priority {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.alert-priority.is-ok { grid-template-columns: 1fr; }

@media (max-width: 768px) {
    .alert-priority {
        grid-template-columns: 1fr;
    }
}

.alert-priority-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform .15s, box-shadow .15s;
    background: #fff;
}

.alert-priority-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.alert-priority-card strong { display: block; font-size: .95rem; color: var(--gray-900); }
.alert-priority-card span { font-size: .78rem; color: var(--gray-500); }

.alert-priority-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-priority-icon svg { width: 20px; height: 20px; }
.alert-priority-card.is-danger { background: #fff1f2; border-color: #fecdd3; }
.alert-priority-card.is-danger .alert-priority-icon { background: #ffe4e6; color: #e11d48; }
.alert-priority-card.is-warning { background: #fffbeb; border-color: #fde68a; }
.alert-priority-card.is-warning .alert-priority-icon { background: #fef3c7; color: #d97706; }
.alert-priority-card.is-stock { background: #fff7ed; border-color: #fed7aa; }
.alert-priority-card.is-stock .alert-priority-icon { background: #ffedd5; color: #ea580c; }
.alert-priority-card.is-success { background: #e8eef5; border-color: #a7f3d0; }
.alert-priority-card.is-success .alert-priority-icon { background: #d1fae5; color: #059669; }

.dashboard-section-head {
    margin: .25rem 0 1rem;
}

.dashboard-section-head h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -.02em;
}

.dashboard-section-head p {
    font-size: .82rem;
    color: var(--gray-500);
    margin-top: .15rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.td-empty-msg {
    text-align: center;
    color: var(--gray-500);
}

/* Mobile card tables */
table.mobile-card-table thead { display: none; }

table.mobile-card-table tbody tr {
    display: block;
    background: #fff;
    border-radius: 14px;
    padding: .875rem 1rem;
    margin-bottom: .625rem;
    border: 1px solid var(--gray-200);
}

table.mobile-card-table tbody tr:hover td { background: transparent; }

table.mobile-card-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .4rem 0;
    border: none;
    font-size: .85rem;
}

table.mobile-card-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-500);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    flex-shrink: 0;
}

table.mobile-card-table td.td-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: .75rem;
    margin-top: .5rem;
    border-top: 1px solid var(--gray-100);
}

table.mobile-card-table td.td-actions::before { display: none; }
table.mobile-card-table td.td-empty::before { display: none; }
table.mobile-card-table td.td-empty { justify-content: center; color: var(--gray-500); }

table.mobile-card-table .action-btns { width: 100%; justify-content: flex-end; }
table.mobile-card-table .action-btns .btn { flex: 1; justify-content: center; min-height: 40px; }

table.mobile-card-table td.td-hide-mobile { display: none; }

table.mobile-card-table td.td-photo {
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    padding-bottom: .75rem;
    margin-bottom: .35rem;
    border-bottom: 1px solid var(--gray-100);
}

table.mobile-card-table td.td-photo::before { display: none; }

table.mobile-card-table .product-thumb,
table.mobile-card-table .product-thumb-placeholder {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    font-size: .85rem;
}

/* Mobile stat cards */
.stat-card-mobile {
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-card-mobile::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    border-radius: 0 0 0 60px;
    opacity: .1;
}

.stat-card-mobile.primary::after { background: var(--primary); }
.stat-card-mobile.success::after { background: var(--success); }
.stat-card-mobile.warning::after { background: var(--warning); }
.stat-card-mobile.danger::after { background: var(--danger); }

/* Login mobile app style */
.login-page {
    padding: 1.5rem;
    padding-top: calc(2rem + var(--safe-top));
    padding-bottom: calc(2rem + var(--safe-bottom));
}

.login-card {
    border-radius: 24px;
    padding: 2rem 1.5rem;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 1.75rem;
    box-shadow: 0 8px 24px rgba(12,45,72,.28);
}

.login-page .form-control {
    min-height: 48px;
    border-radius: 12px;
    font-size: 1rem;
    border: 1.5px solid var(--gray-200);
}

.login-page .btn-primary {
    min-height: 50px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(12,45,72,.32);
}

/* MOBILE BREAKPOINT */
@media (max-width: 768px) {
    .mobile-only { display: flex !important; }
    .mobile-only.inline { display: inline-flex !important; }
    .desktop-only { display: none !important; }

    .quick-actions { display: grid; }
    .desktop-quick { display: none; }
    .mobile-quick { display: flex; }

    .sidebar {
        display: flex !important;
        flex-direction: column;
        transform: translateX(-100%);
        width: min(280px, 88vw);
        z-index: 200;
    }

    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay.active { display: block; z-index: 199; }

    .menu-toggle {
        position: relative;
        z-index: 10;
        flex-shrink: 0;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
    }

    .content {
        padding: .75rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .65rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        flex-direction: column;
        padding: 1rem;
        border-radius: 16px;
        gap: .5rem;
    }

    .stat-icon { width: 40px; height: 40px; }
    .stat-icon svg { width: 20px; height: 20px; }
    .stat-value { font-size: 1.35rem; }
    .stat-label { font-size: .72rem; }

    .card {
        border-radius: 16px;
        margin-bottom: 1rem;
        border: 1px solid var(--gray-100);
    }

    .card-header {
        padding: .875rem 1rem;
        flex-direction: row;
        align-items: center;
    }

    .card-header .btn { display: none; }
    .card-header .btn.desktop-only { display: none; }
    .btn-back-mobile { display: flex !important; }

    .card-body { padding: 0 1rem 1rem; }

    .form-page .card-header {
        gap: .65rem;
        align-items: center;
    }

    .form-page .card-title {
        font-size: .95rem;
        line-height: 1.35;
        flex: 1;
        min-width: 0;
    }

    .form-page {
        max-width: none;
        overflow: hidden;
    }

    .form-page .card-body { padding: 0 1rem 1.25rem; }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-page .alert-info,
    .form-page .alert-error {
        font-size: .85rem;
        line-height: 1.5;
        border-radius: 12px;
    }

    .fefo-info-example {
        font-size: .82rem;
        margin-top: .5rem;
    }

    .form-page .btn-submit-mobile,
    .form-page .btn-primary[type="submit"],
    .form-page form > .btn-primary {
        width: 100%;
        min-height: 50px;
        margin-top: 1rem;
        font-size: 1rem;
        border-radius: 14px;
    }

    .fefo-preview {
        border-radius: 14px;
        padding: .875rem;
        margin-top: .75rem;
    }

    .fefo-preview h4 {
        font-size: .8rem;
        line-height: 1.4;
    }

    .fefo-item {
        flex-wrap: wrap;
        gap: .25rem .5rem;
        align-items: flex-start;
    }

    .fefo-item span {
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }

    .fefo-item strong {
        margin-left: auto;
        white-space: nowrap;
    }

    select.form-control {
        text-overflow: ellipsis;
    }

    textarea.form-control {
        min-height: 96px;
    }

    .card-body > .search-bar,
    .card-body > .alert,
    .card-body > form { padding-top: 0; }

    /* Kartu baris tabel sudah punya padding sendiri. Padding horizontal card-body
       dilepas (bukan dilawan dengan margin negatif, karena beberapa halaman
       memakai style="padding:0" inline) lalu dikembalikan ke elemen non-tabel. */
    .card-body:has(> .table-responsive) {
        padding-left: 0;
        padding-right: 0;
    }

    .card-body:has(> .table-responsive) > *:not(.table-responsive) {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body > .table-responsive { margin: 0; padding: 0; }

    .form-control, .btn, select.form-control {
        min-height: 48px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .btn-sm { min-height: 40px; font-size: .85rem; }

    .search-bar {
        flex-direction: column;
        gap: .5rem;
    }

    .search-bar .form-control { max-width: 100%; }

    .search-bar .btn { width: 100%; }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        border-radius: 14px;
    }

    .filter-bar .btn { width: 100%; }

    .tabs {
        gap: 0;
        padding: 0 .25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar { display: none; }

    .tab { padding: .75rem 1rem; font-size: .8rem; }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        max-width: 100%;
    }

    .table-responsive table.mobile-card-table {
        min-width: 0 !important;
        width: 100%;
    }

    /* Paksa layout kartu di HP agar tidak melebarkan viewport (yang membuat bottom-nav hilang) */
    .table-responsive table:not(.report-table) {
        min-width: 0 !important;
        width: 100%;
    }

    .table-responsive table:not(.report-table) thead {
        display: none;
    }

    .table-responsive table:not(.report-table) tbody tr {
        display: block;
        background: #fff;
        border-radius: 14px;
        padding: .875rem 1rem;
        margin-bottom: .625rem;
        border: 1px solid var(--gray-200);
    }

    .table-responsive table:not(.report-table) td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: .4rem 0;
        border: none;
        font-size: .85rem;
        word-break: break-word;
    }

    .table-responsive table:not(.report-table) td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-500);
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        flex-shrink: 0;
        max-width: 42%;
    }

    .table-responsive table:not(.report-table) td.td-actions,
    .table-responsive table:not(.report-table) td:has(.action-btns) {
        display: flex;
        justify-content: flex-end;
        padding-top: .75rem;
        margin-top: .5rem;
        border-top: 1px solid var(--gray-100);
    }

    .table-responsive table:not(.report-table) td.td-actions::before,
    .table-responsive table:not(.report-table) td:has(.action-btns)::before,
    .table-responsive table:not(.report-table) td.td-empty::before,
    .table-responsive table:not(.report-table) td[colspan]::before {
        display: none;
    }

    /* Kolom nomor urut tidak berguna di tampilan kartu, dan foto tampil tanpa label.
       Selector disamakan dengan aturan fallback di atas agar tidak kalah spesifisitas. */
    .table-responsive table:not(.report-table) td.td-hide-mobile {
        display: none;
    }

    .table-responsive table:not(.report-table) td.td-photo {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
        padding-bottom: .75rem;
        margin-bottom: .35rem;
        border-bottom: 1px solid var(--gray-100);
    }

    .table-responsive table:not(.report-table) td.td-photo::before {
        display: none;
    }

    .bottom-nav.mobile-only {
        display: flex !important;
    }

    .fab.mobile-only {
        display: flex !important;
    }

    .fefo-preview { border-radius: 14px; }

    .demo-banner { border-radius: 14px; }
    .demo-banner .btn { width: 100%; }
    .demo-banner-body { align-items: stretch; }

    .content {
        overflow-x: clip;
        max-width: 100%;
    }

    .card-title {
        font-size: .95rem;
        line-height: 1.35;
        word-break: break-word;
    }

    .monitoring-info-alert {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .monitoring-info-alert .btn {
        width: 100%;
    }

    .stats-grid.monitoring-stats {
        grid-template-columns: 1fr;
    }

    .fefo-guide-page {
        max-width: 100%;
        overflow-x: clip;
    }

    .fefo-nav-tabs {
        margin: 0 -.25rem;
        padding-left: .25rem;
        padding-right: .25rem;
    }

    .fefo-module-grid {
        grid-template-columns: 1fr !important;
    }

    .fefo-code {
        font-size: .72rem;
        padding: .85rem 1rem;
    }

    .fefo-section .card-body,
    .fefo-section.card .card-body {
        overflow-x: auto;
        max-width: 100%;
    }
}

@media (max-width: 380px) {
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   LAPORAN PAGE - Professional Report
   ============================================ */

.report-page { max-width: 1100px; margin: 0 auto; }

/* Toolbar */
.report-toolbar {
    margin-bottom: 1.25rem;
    border: 1px solid var(--gray-200);
}

.report-toolbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.report-toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.report-toolbar-sub {
    font-size: .82rem;
    color: var(--gray-500);
    margin-top: .15rem;
}

.report-type-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.report-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem .75rem;
    border-radius: 12px;
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    text-decoration: none;
    color: var(--gray-600);
    transition: all .2s;
}

.report-type-card:hover {
    border-color: var(--primary);
    background: #fff;
    color: var(--primary);
}

.report-type-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(12,45,72,.12);
}

.report-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.report-type-icon svg { width: 20px; height: 20px; }
.report-type-icon-masuk { background: #d1fae5; color: #059669; }
.report-type-icon-keluar { background: #fef3c7; color: #d97706; }
.report-type-icon-persediaan { background: #dbeafe; color: #2563eb; }
.report-type-icon-expired { background: #fee2e2; color: #dc2626; }

.report-type-label {
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.report-filter-form { padding: 1rem 1.5rem 1.25rem; }

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    align-items: end;
}

.report-filter-action .btn { min-height: 42px; }

/* Report Document */
.report-document {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.report-letterhead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem 2rem 1.25rem;
    border-bottom: 3px double var(--gray-800);
}

.report-letterhead-brand {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.report-letterhead-logo {
    width: 56px;
    height: 56px;
    background: var(--gray-900);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.report-company {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -.02em;
    line-height: 1.2;
}

.report-company-sub {
    font-size: .85rem;
    color: var(--gray-600);
    margin-top: .25rem;
    font-weight: 500;
}

.report-company-meta {
    font-size: .78rem;
    color: var(--gray-500);
    margin-top: .15rem;
}

.report-letterhead-meta {
    text-align: right;
    font-size: .78rem;
    color: var(--gray-600);
    line-height: 1.6;
    flex-shrink: 0;
}

.report-doc-id {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--gray-800);
    background: var(--gray-50);
    padding: .35rem .6rem;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    margin-bottom: .35rem;
}

.report-title-block {
    text-align: center;
    padding: 1.5rem 2rem 1rem;
    background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
    border-bottom: 1px solid var(--gray-200);
}

.report-main-title {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-900);
}

.report-subtitle {
    font-size: .85rem;
    color: var(--gray-600);
    margin-top: .5rem;
}

.report-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
}

.report-kpi {
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--gray-200);
    text-align: center;
}

.report-kpi:last-child { border-right: none; }

.report-kpi-label {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: .35rem;
}

.report-kpi-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.report-kpi-highlight {
    background: var(--primary-light);
}

.report-kpi-highlight .report-kpi-value {
    color: var(--primary-dark);
    font-size: 1.05rem;
}

/* Report Table */
.report-table-wrap {
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.report-table thead {
    background: var(--gray-800);
    color: #fff;
}

.report-table thead th {
    padding: .7rem .85rem;
    text-align: left;
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    border: none;
}

.report-table tbody td {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    vertical-align: middle;
}

.report-table tbody tr:nth-child(even):not(.report-total-row) {
    background: var(--gray-50);
}

.report-table tbody tr:hover:not(.report-total-row) td {
    background: #f0f4ff;
}

.report-table .col-no { width: 40px; text-align: center; color: var(--gray-500); }
.report-table .col-num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.report-table .col-money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-table .col-product strong { display: block; color: var(--gray-900); }
.report-table .col-product small { display: block; font-size: .72rem; color: var(--gray-500); margin-top: .1rem; }
.report-table .col-note { max-width: 180px; color: var(--gray-500); font-size: .78rem; }

.report-code {
    display: inline-block;
    font-family: 'Courier New', Consolas, monospace;
    font-size: .75rem;
    background: var(--gray-100);
    padding: .15rem .4rem;
    border-radius: 3px;
    color: var(--gray-800);
    border: 1px solid var(--gray-200);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.report-empty {
    text-align: center !important;
    padding: 2.5rem 1rem !important;
    color: var(--gray-500) !important;
    font-style: italic;
}

.report-total-row td {
    background: var(--gray-100) !important;
    border-top: 2px solid var(--gray-800);
    border-bottom: 2px solid var(--gray-800);
    font-weight: 700;
    padding: .75rem .85rem !important;
}

.report-total-label {
    text-align: right !important;
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .04em;
    color: var(--gray-800) !important;
}

.report-total-value {
    color: var(--gray-900) !important;
    font-size: .9rem !important;
}

.report-status {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 3px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.report-status-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Report Footer */
.report-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid var(--gray-200);
    margin-top: .5rem;
}

.report-footer-note {
    font-size: .75rem;
    color: var(--gray-500);
    line-height: 1.7;
}

.report-signature {
    text-align: center;
    font-size: .82rem;
    color: var(--gray-700);
    min-width: 200px;
}

.report-signature-space {
    height: 64px;
    border-bottom: 1px solid var(--gray-800);
    margin: .5rem 0;
}

.report-signature-name {
    font-weight: 700;
    text-decoration: underline;
    color: var(--gray-900);
}

.report-print-fab {
    background: var(--primary);
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 1rem);
}

/* Mobile report preview (screen only) */
.report-mobile-view {
    display: none;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.report-mobile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .65rem;
}

.report-mobile-stat {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: .875rem 1rem;
}

.report-mobile-stat span {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gray-500);
    margin-bottom: .25rem;
}

.report-mobile-stat strong {
    font-size: .95rem;
    color: var(--gray-900);
}

.report-mobile-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.report-mobile-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: .875rem 1rem;
}

.report-mobile-card-top {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}

.report-mobile-no {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.report-mobile-card-main {
    flex: 1;
    min-width: 0;
}

.report-mobile-card-main strong {
    display: block;
    font-size: .9rem;
    color: var(--gray-900);
    margin-bottom: .2rem;
}

.report-mobile-card-main small {
    display: block;
    font-size: .78rem;
    color: var(--gray-500);
    margin-top: .25rem;
    line-height: 1.4;
}

.report-mobile-card-main .report-code {
    font-size: .72rem;
}

.report-mobile-note {
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px solid var(--gray-100);
    font-size: .78rem;
    color: var(--gray-600);
}

.report-mobile-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-500);
    background: #fff;
    border: 1px dashed var(--gray-300);
    border-radius: 14px;
}

.report-print-hint {
    font-size: .78rem;
    color: var(--gray-500);
    text-align: center;
    line-height: 1.5;
    padding: 0 .5rem;
}

/* Mobile */
@media (max-width: 768px) {
    .report-toolbar-head { padding: 1rem; }
    .report-toolbar-head .report-print-btn { display: none; }

    .report-type-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: .5rem;
        padding: .875rem 1rem;
    }

    .report-type-card { padding: .65rem .35rem; }
    .report-type-icon { width: 34px; height: 34px; }
    .report-type-icon svg { width: 17px; height: 17px; }
    .report-type-label { font-size: .65rem; }

    .report-filter-form { padding: .875rem 1rem 1rem; }
    .report-filter-grid { grid-template-columns: 1fr; }

    .report-mobile-view { display: flex; }

    .report-print-layout {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .report-print-fab { display: none !important; }
}

/* Print - Laporan Formal A4 Portrait (1 halaman) */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 10mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        width: 210mm;
        height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        font-size: 9pt;
        color: #111 !important;
        overflow: hidden;
    }

    .sidebar, .topbar, .btn, .search-bar, .filter-bar, .no-print,
    .bottom-nav, .fab, .bottom-sheet, .bottom-sheet-overlay, .quick-actions,
    .report-toolbar, .report-mobile-view, .toast-alert {
        display: none !important;
    }

    .app-wrapper, .main-content, .content, .report-page {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    .main-content { margin-left: 0 !important; }

    .report-print-layout {
        display: block !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        overflow: hidden !important;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    .report-letterhead {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        padding: 0 0 6px !important;
        margin-bottom: 0 !important;
        border-bottom: 2px double #1f2937 !important;
        page-break-inside: avoid;
        page-break-after: avoid;
    }

    .report-letterhead-logo {
        width: 38px !important;
        height: 38px !important;
        font-size: 8.5pt !important;
        border-radius: 6px !important;
    }

    .report-company {
        font-size: 11pt !important;
        line-height: 1.15 !important;
    }

    .report-company-sub {
        font-size: 7.5pt !important;
        margin-top: 1px !important;
    }

    .report-company-meta {
        font-size: 7pt !important;
        margin-top: 0 !important;
    }

    .report-letterhead-meta {
        text-align: right !important;
        width: auto !important;
        font-size: 7pt !important;
        line-height: 1.45 !important;
    }

    .report-doc-id {
        font-size: 7pt !important;
        padding: 2px 5px !important;
        margin-bottom: 2px !important;
    }

    .report-doc-id,
    .report-code,
    code {
        text-decoration: none !important;
        -webkit-text-decoration: none !important;
    }

    .report-title-block {
        text-align: center;
        padding: 7px 0 5px !important;
        background: #f9fafb !important;
        border-bottom: 1px solid #e5e7eb !important;
        page-break-inside: avoid;
        page-break-after: avoid;
    }

    .report-main-title {
        font-size: 10.5pt !important;
        letter-spacing: .05em;
        line-height: 1.2 !important;
    }

    .report-subtitle {
        font-size: 7.5pt !important;
        margin-top: 2px !important;
        line-height: 1.3 !important;
    }

    .report-kpi-row {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        border-bottom: 1px solid #e5e7eb !important;
        page-break-inside: avoid;
        page-break-after: avoid;
    }

    .report-kpi {
        border-right: 1px solid #e5e7eb !important;
        border-bottom: none !important;
        padding: 5px 6px !important;
        text-align: center !important;
    }

    .report-kpi:last-child { border-right: none !important; }

    .report-kpi-label {
        font-size: 6pt !important;
        margin-bottom: 1px !important;
    }

    .report-kpi-value {
        font-size: 8.5pt !important;
        line-height: 1.2 !important;
    }

    .report-table-wrap {
        padding: 0 !important;
        overflow: hidden !important;
        page-break-inside: auto;
    }

    .report-table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        font-size: 6.8pt !important;
    }

    .report-table thead {
        display: table-header-group !important;
        background: #333 !important;
    }

    .report-table thead th {
        color: #fff !important;
        background: #333 !important;
        padding: 3px 4px !important;
        border: 1px solid #333 !important;
        font-size: 6pt !important;
        line-height: 1.25 !important;
        word-wrap: break-word;
        overflow: hidden;
    }

    .report-table tbody {
        display: table-row-group !important;
    }

    .report-table tr {
        display: table-row !important;
        page-break-inside: auto;
    }

    .report-table th,
    .report-table td {
        display: table-cell !important;
        padding: 2.5px 4px !important;
        border: 1px solid #d1d5db !important;
        text-align: left !important;
        vertical-align: middle !important;
        line-height: 1.25 !important;
        word-wrap: break-word;
        overflow: hidden;
    }

    .report-table tbody td::before {
        display: none !important;
        content: none !important;
    }

    .report-table tbody tr:nth-child(even):not(.report-total-row) {
        background: #f5f5f5 !important;
    }

    .report-table .col-no {
        width: 4% !important;
        text-align: center !important;
    }

    .report-table .col-num,
    .report-table .col-money {
        width: 7% !important;
        text-align: right !important;
    }

    .report-table .col-product {
        width: 16% !important;
    }

    .report-table .col-product strong {
        display: block;
        font-weight: 600;
        font-size: 6.8pt !important;
        line-height: 1.2 !important;
    }

    .report-table .col-product small {
        display: none !important;
    }

    .report-table .col-note {
        max-width: none !important;
        font-size: 6.5pt !important;
    }

    .report-code {
        background: #f3f4f6 !important;
        border: 1px solid #d1d5db !important;
        padding: 0 3px !important;
        font-size: 6.5pt !important;
        border-radius: 2px;
        text-decoration: none !important;
        white-space: nowrap;
    }

    .report-total-row td {
        background: #f3f4f6 !important;
        border-top: 1.5px solid #1f2937 !important;
        border-bottom: 1.5px solid #1f2937 !important;
        font-weight: 700 !important;
        padding: 3px 4px !important;
    }

    .report-total-label {
        text-align: right !important;
        text-transform: uppercase;
        font-size: 6.5pt !important;
    }

    .report-kpi-highlight {
        background: #eef2ff !important;
    }

    .report-footer {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 1rem !important;
        padding: 6px 0 0 !important;
        margin-top: 6px !important;
        page-break-inside: avoid;
    }

    .report-footer-note {
        font-size: 6.5pt !important;
        color: #6b7280 !important;
        line-height: 1.35 !important;
    }

    .report-footer-note p {
        margin: 0 !important;
    }

    .report-footer-note p + p {
        margin-top: 2px !important;
    }

    .report-signature {
        min-width: 150px;
        text-align: center;
        font-size: 7.5pt !important;
        line-height: 1.35 !important;
    }

    .report-signature p {
        margin: 0 !important;
    }

    .report-signature-space {
        height: 28px;
    }

    .report-signature-name {
        font-weight: 600;
        text-decoration: underline;
        font-size: 7.5pt !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
    }
}

/* ============================================
   PENGATURAN PAGE
   ============================================ */

.settings-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: .5rem;
}

.settings-section:last-of-type { border-bottom: none; }

.settings-section-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.settings-section-head h4 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--gray-900);
}

.settings-section-head p {
    font-size: .82rem;
    color: var(--gray-500);
    margin-top: .15rem;
}

.settings-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-section-icon svg { width: 22px; height: 22px; }

.input-with-suffix {
    display: flex;
    align-items: stretch;
    max-width: 200px;
}

.input-with-suffix .form-control {
    border-radius: 12px 0 0 12px;
    border-right: none;
}

.input-suffix {
    display: flex;
    align-items: center;
    padding: 0 .875rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-left: none;
    border-radius: 0 12px 12px 0;
    font-size: .85rem;
    color: var(--gray-600);
    font-weight: 500;
}

.settings-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .65rem;
    margin-top: 1rem;
}

.settings-preview-item {
    padding: .75rem;
    border-radius: 12px;
    font-size: .78rem;
    text-align: center;
}

.settings-preview-item strong {
    display: block;
    font-size: .82rem;
    margin-bottom: .25rem;
}

.settings-preview-item span { color: var(--gray-600); }

.settings-preview-aman { background: #d1fae5; border: 1px solid #a7f3d0; }
.settings-preview-aman strong { color: #065f46; }
.settings-preview-warning { background: #fef3c7; border: 1px solid #fde68a; }
.settings-preview-warning strong { color: #92400e; }
.settings-preview-danger { background: #fee2e2; border: 1px solid #fecaca; }
.settings-preview-danger strong { color: #991b1b; }

@media (max-width: 768px) {
    .settings-preview { grid-template-columns: 1fr; }
    .input-with-suffix { max-width: 100%; }
}

/* ============================================
   IMPORT PAGE
   ============================================ */

.import-page { max-width: 900px; margin: 0 auto; }

.import-steps {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.import-step {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: .82rem;
    font-weight: 500;
    text-decoration: none;
    border: 1.5px solid transparent;
}

.import-step.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
    font-weight: 600;
}

.import-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
}

.import-step.active .import-step-num {
    background: var(--primary);
    color: #fff;
}

.import-actions { margin-bottom: 1.25rem; }

.import-upload-form {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
    border: 1px dashed var(--gray-300);
}

.import-format-table { font-size: .85rem; }
.import-format-table code {
    background: var(--gray-100);
    padding: .15rem .4rem;
    border-radius: 4px;
    font-size: .78rem;
}

.import-tips {
    margin: 0;
    padding-left: 1.25rem;
    font-size: .85rem;
    color: var(--gray-600);
    line-height: 1.8;
}

.import-tips li { margin-bottom: .35rem; }

@media (max-width: 768px) {
    .import-steps { flex-direction: column; }
    .import-step { justify-content: flex-start; }
}

/* ============================================
   PANDUAN FEFO PAGE
   ============================================ */

.fefo-guide-page { max-width: 900px; margin: 0 auto; }

.fefo-hero {
    background: var(--primary);
    color: #fff;
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(12,45,72,.25);
}

.fefo-hero-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: rgba(255,255,255,.2);
    padding: .25rem .65rem;
    border-radius: 999px;
    margin-bottom: .75rem;
}

.fefo-hero h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.fefo-hero p { opacity: .9; font-size: .88rem; }
.fefo-hero-desc { margin-top: .75rem; opacity: .85; line-height: 1.6; font-size: .85rem; }

.fefo-nav-tabs {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    padding: .5rem 0 1rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.fefo-nav-tabs::-webkit-scrollbar { display: none; }

.fefo-tab {
    flex-shrink: 0;
    padding: .45rem .875rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: .78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
}

.fefo-tab.active, .fefo-tab:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.fefo-section { margin-bottom: 1rem; scroll-margin-top: 80px; }

.fefo-subtitle {
    font-size: .9rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 1.25rem 0 .65rem;
}

.fefo-formula {
    background: var(--gray-50);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 12px 12px 0;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-size: .88rem;
    line-height: 1.6;
}

.fefo-formula small { color: var(--gray-500); font-family: inherit; }

.fefo-table { font-size: .85rem; width: 100%; }
.fefo-table th { background: var(--gray-50); }
.fefo-highlight-row { background: var(--primary-light) !important; }

.fefo-list { padding-left: 1.25rem; line-height: 1.8; font-size: .88rem; color: var(--gray-700); }

.fefo-steps {
    padding-left: 1.25rem;
    line-height: 1.8;
    font-size: .88rem;
    color: var(--gray-700);
}

.fefo-steps ul { margin-top: .35rem; padding-left: 1.25rem; }

.fefo-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: .78rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
}

.fefo-diagram {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
}

.fefo-diagram-box {
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: .75rem 1rem;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
}

.fefo-diagram-box small { display: block; font-weight: 400; color: var(--gray-500); margin-top: .2rem; }
.fefo-diagram-main { border-color: var(--primary); background: var(--primary-light); }
.fefo-diagram-arrow { font-size: 1.25rem; color: var(--gray-400); }
.fefo-diagram-branches { display: flex; flex-direction: column; gap: .5rem; }

.fefo-info-box {
    background: var(--info-light);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: .875rem 1rem;
    font-size: .85rem;
    color: #1e40af;
    margin-top: 1rem;
}

.fefo-result-box {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: .88rem;
    color: #065f46;
    margin-top: 1rem;
}

.fefo-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .65rem;
    margin: 1rem 0;
}

.fefo-status-card {
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
}

.fefo-status-card strong { display: block; font-size: .88rem; margin-bottom: .25rem; }
.fefo-status-card span { display: block; font-size: .75rem; font-weight: 600; margin-bottom: .35rem; }
.fefo-status-card p { font-size: .72rem; opacity: .85; line-height: 1.4; margin: 0; }

.fefo-status-aman { background: #d1fae5; color: #065f46; }
.fefo-status-warning { background: #fef3c7; color: #92400e; }
.fefo-status-danger { background: #fee2e2; color: #991b1b; }

.fefo-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .65rem;
}

.fefo-module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .5rem;
    padding: 1rem .75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    text-decoration: none;
    color: var(--gray-800);
    transition: all .2s;
}

.fefo-module-card:hover {
    border-color: var(--primary);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.fefo-module-card small { font-size: .68rem; color: var(--gray-500); line-height: 1.3; }

.fefo-module-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.fefo-blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 0 0 1rem;
    background: var(--gray-50);
    border-radius: 0 12px 12px 0;
    font-size: .88rem;
    line-height: 1.8;
    color: var(--gray-700);
    font-style: italic;
}

@media print {
    .fefo-nav-tabs, .no-print { display: none !important; }
    .fefo-hero { background: #0c2d48 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .fefo-section { break-inside: avoid; }
}

@media (max-width: 768px) {
    .fefo-hero { padding: 1.25rem 1rem; }
    .fefo-hero h2 { font-size: 1.2rem; }
    .fefo-diagram { flex-direction: column; align-items: stretch; }
    .fefo-diagram-arrow { transform: rotate(90deg); text-align: center; }
    .fefo-module-grid { grid-template-columns: 1fr; }
    .fefo-section { scroll-margin-top: 100px; }
    .fefo-table { font-size: .8rem; }
    .fefo-list, .fefo-steps { padding-left: 1.1rem; font-size: .85rem; }
}

/* Product stock filter chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.1rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s ease;
}

.filter-chip em {
    font-style: normal;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 999px;
    padding: .05rem .45rem;
    font-size: .72rem;
    font-weight: 700;
}

.filter-chip:hover { border-color: #9eb6cc; color: var(--primary); }
.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.filter-chip.active em { background: rgba(255,255,255,.2); color: #fff; }
.filter-chip.is-warning.active { background: #d97706; border-color: #d97706; }
.filter-chip.is-danger.active { background: #e11d48; border-color: #e11d48; }

@media (max-width: 768px) {
    .filter-chips { gap: .4rem; }
    .filter-chip { flex: 1 1 calc(50% - .4rem); justify-content: center; min-height: 40px; }
}

.card-body-flush { padding: 0; }

@media (max-width: 768px) {
    .card-body-flush {
        padding: 0 1rem 1rem;
    }

    .card-body-flush .table-responsive {
        margin: 0;
    }

    /* Isi kartu murni berupa daftar: bingkai luar dihapus supaya tidak ada
       kartu di dalam kartu dan lebar layar tidak habis untuk padding */
    .card:has(> .card-body-flush) {
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    .card:has(> .card-body-flush) > .card-header {
        padding: 0 0 .625rem;
        border-bottom: none;
    }

    .card-body-flush .mobile-card-table tbody tr:last-child {
        margin-bottom: 0;
    }
}
