/*
 * Monitoring Jaringan — tambahan di atas tema Conca (public/vendor/conca, disalin dari Asset/ERP/NewSSO, yang
 * sudah berwarna biru DKM). Bagian "shell" disalin apa adanya dari asset/public/css/asset.css (yang juga sama
 * dengan ERP) — samakan bila tampilan DKM berubah.
 */

/* Inter, self-hosted (no Google Fonts request). */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
}

/* ---- shell ------------------------------------------------------------ */
.app-sidebar-logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 700; font-size: 1.2rem; color: inherit; }
.brand-mark { height: 38px; width: auto; border-radius: 6px; }

/* CountSista logo (components/brand-logo): mark + "Count" bold / "Sista" regular + tagline. */
.brand-logo { display: inline-flex; align-items: center; gap: .7rem; color: #1C2333; }
.brand-logo-mark { flex-shrink: 0; }
.brand-logo-ink { fill: currentColor; }
.brand-logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-logo-name { font-size: 1.4rem; font-weight: 500; letter-spacing: -.01em; color: inherit; }
.brand-logo-name b { font-weight: 800; }
.brand-logo-tagline { margin-top: 3px; font-size: .62rem; font-weight: 400; letter-spacing: .03em; color: #6B7280; white-space: nowrap; }
[data-bs-theme="dark"] .brand-logo { color: #E5E7EB; }
[data-bs-theme="dark"] .brand-logo-tagline { color: #9CA3AF; }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; flex-shrink: 0; background: rgba(var(--bs-primary-rgb), .14); color: var(--bs-primary); }
.avatar-initials.sm { width: 30px; height: 30px; font-size: .68rem; }
.avatar-initials.md { width: 38px; height: 38px; font-size: .8rem; }
.ci { flex-shrink: 0; vertical-align: -3px; }

/* Sidebar: each module is a group that folds open (accordion, see erp.js). Conca's headings are small light
   grey; ours are the clickable group label — bold DKM blue caps with a chevron, a thin divider between groups.
   Folding animates grid rows 0fr → 1fr so the height needs no measuring. */
.app-sidebar-menu .dkm-menu-group { border-top: 1px solid rgba(0, 0, 0, .07); }
.app-sidebar-menu .dkm-menu-group:first-child { border-top: 0; }
.app-sidebar-menu .app-sidebar-menu-item + .dkm-menu-group { margin-top: 8px; }
.app-sidebar-menu .dkm-menu-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 13px 16px; margin: 0; border: 0; border-radius: 8px; background: none; text-align: start; cursor: pointer;
}
.app-sidebar-menu .dkm-menu-toggle:hover { background: rgba(var(--bs-primary-rgb), .06); }
.app-sidebar-menu .dkm-menu-toggle:focus-visible { outline: 2px solid var(--dkm-blue); outline-offset: -2px; }
.app-sidebar-menu ul .dkm-menu-toggle > span { padding: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dkm-blue); }
.app-sidebar-menu .dkm-menu-heading { display: inline-flex; align-items: center; gap: .7rem; }
.app-sidebar-menu .dkm-menu-icon { flex-shrink: 0; vertical-align: 0; padding: 4px; width: 26px; height: 26px; border-radius: 7px; background: rgba(var(--bs-primary-rgb), .1); color: var(--dkm-blue); }
.app-sidebar-menu .dkm-menu-group.open .dkm-menu-icon { background: var(--dkm-blue); color: #fff; }
[data-bs-theme="dark"] .app-sidebar-menu .dkm-menu-icon { background: rgba(147, 197, 253, .15); color: #93c5fd; }
.app-sidebar-menu .dkm-menu-chevron { color: var(--dkm-blue); transition: transform .2s ease; transform: rotate(-90deg); }
.app-sidebar-menu .dkm-menu-group.open .dkm-menu-chevron { transform: rotate(0deg); }
.app-sidebar-menu .dkm-menu-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.app-sidebar-menu .dkm-menu-items > ul { overflow: hidden; min-height: 0; }
.app-sidebar-menu .dkm-menu-group.open .dkm-menu-items { grid-template-rows: 1fr; }
.app-sidebar-menu .dkm-menu-group.open .dkm-menu-items > ul { padding-bottom: 8px; }
@media (prefers-reduced-motion: reduce) {
    .app-sidebar-menu .dkm-menu-items, .app-sidebar-menu .dkm-menu-chevron { transition: none; }
}
[data-bs-theme="dark"] .app-sidebar-menu ul .dkm-menu-toggle > span,
[data-bs-theme="dark"] .app-sidebar-menu .dkm-menu-chevron { color: #93c5fd; }
[data-bs-theme="dark"] .app-sidebar-menu .dkm-menu-group { border-top-color: rgba(255, 255, 255, .08); }
[data-bs-theme="dark"] .app-sidebar-menu .dkm-menu-toggle:hover { background: rgba(255, 255, 255, .05); }

/* DKM brand blue: top bar is blue in every DKM app. */
:root { --dkm-blue: #1d4ed8; --dkm-blue-dark: #1e3a8a; }
.app-header,
.app-header.bg-card { background-color: var(--dkm-blue) !important; border-bottom: 0; box-shadow: 0 1px 4px rgba(0, 40, 90, .25); }
.app-header,
.app-header .text-custom-body,
.app-header .header-nav-link,
.app-header .header-nav-link .ci { color: #fff !important; }
.app-header .app-header-bar-btn span { background-color: #fff !important; }
.app-header .header-nav-link:hover { background-color: rgba(255, 255, 255, .15); }
.app-header .avatar-initials { background: #fff; color: var(--dkm-blue); }

/* ---- data tables ------------------------------------------------------ */
.dkm-table > :not(caption) > * > * { padding: .6rem .6rem; }
.dkm-table th { white-space: nowrap; }
.dkm-table thead th {
    background-color: rgba(var(--bs-primary-rgb), .08);
    color: var(--dkm-blue-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--dkm-blue);
}
.dkm-table tbody tr:hover > * { background-color: rgba(var(--bs-primary-rgb), .04); }
[data-bs-theme="dark"] .dkm-table thead th { color: #93c5fd; }
.dkm-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* heading rows of a grouped list (chart of accounts) */
.dkm-table tr.dkm-group-row > * { background-color: rgba(var(--bs-primary-rgb), .05); font-weight: 600; }
.dkm-table tr.dkm-group-top > * { background-color: rgba(var(--bs-primary-rgb), .12); font-weight: 700; color: var(--dkm-blue-dark); }
[data-bs-theme="dark"] .dkm-table tr.dkm-group-top > * { color: #93c5fd; }

/* ---- reports ---------------------------------------------------------- */
.report-table td, .report-table th { padding: .35rem .6rem; }
.report-table .group-row td { font-weight: 700; background: rgba(var(--bs-primary-rgb), .05); }
.report-table .total-row td { font-weight: 700; border-top: 2px solid var(--bs-body-color); }
.report-table .indent { padding-left: 1.6rem; }
.report-table .neg { color: var(--bs-danger); }

@media print {
    .app-sidebar, .app-header, .app-footer, .app-backdrop, .page-header, .no-print, .alert { display: none !important; }
    .app-wrapper, .app-content-wrapper { margin: 0 !important; padding: 0 !important; }
    .card { border: 0 !important; box-shadow: none !important; }
    body { background: #fff !important; font-size: 11px; }
    .dkm-table thead th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit !important; text-decoration: none !important; }
    .report-header { margin-top: 0 !important; }
}
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ---- cards & panels --------------------------------------------------- */
/* Every card gets a thin frame (the theme draws them borderless on the grey page, which made pages look loose). */
:root { --dkm-frame: #dbe2ec; --dkm-panel: #f1f5fa; --dkm-head: #f7f9fc; }
[data-bs-theme="dark"] { --dkm-frame: rgba(255, 255, 255, .12); --dkm-panel: rgba(255, 255, 255, .04); --dkm-head: rgba(255, 255, 255, .03); }
.card { border: 1px solid var(--dkm-frame) !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); border-radius: .6rem; }
.card > .card-header { background: var(--dkm-head); border-bottom: 1px solid var(--dkm-frame); padding: .75rem 1.25rem; }
.card > .card-header .card-title, .card-title { font-size: 1rem; font-weight: 600; color: var(--dkm-blue-dark); margin-bottom: 0; }
[data-bs-theme="dark"] .card-title { color: #bfdbfe; }

/* Summary panel at the top of a document / record (label above value: Tanggal, Periode, Status …): framed and
   tinted so it stands apart from the lines and data below it. Matches cards whose body columns start with the
   small muted label. */
.card:has(> .card-body > [class*="col"] > .text-muted.small:first-child),
.card:has(> .card-body > .row > [class*="col"] > .text-muted.small:first-child) {
    background: var(--dkm-panel); border-color: #cdd7e5 !important; border-left: 4px solid var(--dkm-blue) !important;
}
.card > .card-body > [class*="col"] > .text-muted.small:first-child,
.card > .card-body > .row > [class*="col"] > .text-muted.small:first-child {
    font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: .2rem;
}

/* ---- dashboard -------------------------------------------------------- */
.stat-card { height: 100%; }
.stat-label { font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--bs-secondary-color); }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.25; color: var(--dkm-blue-dark); font-variant-numeric: tabular-nums; margin-top: .25rem; }
.stat-sub { font-size: .8rem; color: var(--bs-secondary-color); margin-top: .2rem; }
[data-bs-theme="dark"] .stat-value { color: #93c5fd; }
a.stat-card:hover { border-color: var(--dkm-blue) !important; }
.dkm-section { display: flex; align-items: center; gap: .75rem; margin: 2rem 0 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--dkm-blue); }
.dkm-section h2 { font-size: 1.1rem; font-weight: 700; color: var(--dkm-blue-dark); margin: 0; }
[data-bs-theme="dark"] .dkm-section h2 { color: #bfdbfe; }
.dkm-bu-row { font-size: .85rem; }

/* ID | EN switcher from dkm/sso-client (<x-sso::locale-switcher />): the package ships markup only. */
.sso-locale-switcher { border: 1px solid rgba(var(--bs-primary-rgb), .35); border-radius: .5rem; padding: 2px; }
.sso-locale-btn { border: 0; background: transparent; font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: .2rem .55rem; border-radius: .35rem; color: var(--dkm-blue); cursor: pointer; }
.sso-locale-btn:hover { background: rgba(var(--bs-primary-rgb), .12); }
.sso-locale-btn.is-active { background: var(--dkm-blue); color: #fff; }
.app-header .sso-locale-switcher { border-color: rgba(255, 255, 255, .5); }
.app-header .sso-locale-btn { color: #fff; }
.app-header .sso-locale-btn:hover { background: rgba(255, 255, 255, .15); }
.app-header .sso-locale-btn.is-active { background: #fff; color: var(--dkm-blue); }

@media print {
    .card { border: 0 !important; box-shadow: none !important; background: #fff !important; }
}

/* ======================================================================== */
/* Dari Manajemen Aset (umum)                                                */
/* ======================================================================== */
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.brand-logo-name { font-size: 1.15rem; }
/* Badge status: selalu teks + warna lembut. */
.dkm-badge { font-weight: 600; font-size: .72rem; letter-spacing: .01em; padding: .35em .6em; border-radius: .4rem; }
/* Keadaan kosong. */
.dkm-empty { text-align: center; color: var(--bs-secondary-color); padding: 2.5rem 1rem; }
.dkm-empty .ci { opacity: .45; margin-bottom: .5rem; }

/* Teks kecil abu untuk keterangan di bawah nilai. */
.dkm-sub { display: block; font-size: .78rem; color: var(--bs-secondary-color); }
/* Nada badge (Bootstrap di Conca belum punya kelas *-emphasis). Teks gelap di latar lembut, kontras ≥ 4.5:1. */
.dkm-badge.tone-success   { background: #dcfce7; color: #166534; }
.dkm-badge.tone-warning   { background: #fef3c7; color: #92400e; }
.dkm-badge.tone-danger    { background: #fee2e2; color: #991b1b; }
.dkm-badge.tone-info      { background: #e0f2fe; color: #075985; }
.dkm-badge.tone-primary   { background: #dbeafe; color: #1e40af; }
.dkm-badge.tone-secondary { background: #eef0f3; color: #4b5563; }
.dkm-badge.tone-dark      { background: #1f2937; color: #fff; }
.dkm-count { display: inline-block; min-width: 2rem; padding: .2rem .55rem; border-radius: .45rem; background: #dbeafe; color: #1e40af; font-weight: 700; text-align: center; }
.dkm-table a { text-decoration: none; }
.dkm-table a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* ---- halaman publik (layouts/public): header biru seperti aplikasi HP ---- */
.m-body { background: #f1f4f9; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.m-header {
    position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .5rem;
    min-height: 56px; padding: .4rem .75rem; padding-top: calc(.4rem + env(safe-area-inset-top));
    background: var(--dkm-blue); color: #fff; box-shadow: 0 1px 4px rgba(0, 40, 90, .25);
}
.m-header-title { font-weight: 600; font-size: 1.05rem; }
.m-header-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: #fff; }
.m-header-btn:hover, .m-header-btn:focus-visible { background: rgba(255, 255, 255, .15); color: #fff; }
.m-header-brand { text-decoration: none; }
.m-header-brand .brand-logo { color: #fff; }
.m-header-brand .brand-logo-name { font-size: 1.05rem; }
.m-header-brand .brand-logo-mark rect { fill: #fff; }
.m-header-brand .brand-logo-mark g { stroke: var(--dkm-blue); }
.m-header-brand .brand-logo-mark .brand-logo-dot { fill: var(--dkm-blue); }
.m-content { padding: 1rem .9rem; max-width: 640px; margin: 0 auto; }
.m-card { background: #fff; border: 1px solid var(--dkm-frame); border-radius: .85rem; padding: 1rem; margin-bottom: .85rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
a.m-card { display: block; color: inherit; text-decoration: none; }
a.m-card:active { background: #f8fafc; }
.m-title { font-size: .95rem; font-weight: 700; color: var(--dkm-blue-dark); margin: 1.1rem 0 .6rem; }
.m-stat { text-align: center; padding: .9rem .5rem; }
.m-stat .v { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--dkm-blue-dark); }
.m-stat .l { font-size: .72rem; color: var(--bs-secondary-color); }
.m-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid #eef1f6; font-size: .88rem; }
.m-row:last-child { border-bottom: 0; }
.m-row > span:first-child { color: var(--bs-secondary-color); }
.m-row > span:last-child { font-weight: 600; text-align: end; }
.m-btn { width: 100%; padding: .8rem 1rem; font-weight: 700; border-radius: .7rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.m-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255, 255, 255, .94); }
.m-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #e5e7eb; border-top-color: var(--dkm-blue); animation: m-spin .8s linear infinite; margin-bottom: 1rem; }
@keyframes m-spin { to { transform: rotate(360deg); } }

/* ======================================================================== */
/* Monitoring Jaringan                                                       */
/* ======================================================================== */
.m-body { padding-bottom: 0; }
.m-content { max-width: 720px; }
.m-header a.m-header-link { white-space: nowrap; color: #fff; text-decoration: none; font-size: .8rem; font-weight: 600; opacity: .9; }
.m-header a.m-header-link:hover { opacity: 1; text-decoration: underline; }

/* Status: always icon + label next to the colour (never colour alone). Fixed status palette. */
:root { --st-ok: #0ca30c; --st-warn: #fab219; --st-down: #d03b3b; --st-none: #c3c2b7; }
.st { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.st-dot { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--st-none); }
.st-dot.ok { background: var(--st-ok); } .st-dot.warn { background: var(--st-warn); } .st-dot.down { background: var(--st-down); }

/* Verdict card on the check page / status cards on the dashboard: coloured left edge by level. */
.lvl { border-left: 5px solid var(--st-none) !important; }
.lvl.ok { border-left-color: var(--st-ok) !important; }
.lvl.warn { border-left-color: var(--st-warn) !important; }
.lvl.down { border-left-color: var(--st-down) !important; }
.verdict-title { display: flex; gap: .7rem; align-items: center; }
.verdict-title .ic { font-size: 1.8rem; line-height: 1; }
.verdict-title h2 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--dkm-blue-dark); }
.finding { margin-top: .9rem; }
.finding h3 { margin: 0 0 .3rem; font-size: .95rem; font-weight: 700; }
.finding ul { margin: 0; padding-left: 1.2rem; }
.finding li { margin: .2rem 0; }

/* Check steps */
.steps { list-style: none; padding: 0; margin: 1rem 0 0; }
.steps li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid #eef1f6; font-size: .9rem; }
.steps li:last-child { border-bottom: 0; }
.steps li .val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: end; }
.steps li.run .val::after { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #e5e7eb; border-top-color: var(--dkm-blue); animation: m-spin .8s linear infinite; vertical-align: -2px; }
.steps li .val.bad { color: #b91c1c; }
.loc-pill { display: inline-flex; gap: .4rem; align-items: center; background: #eff6ff; color: var(--dkm-blue-dark); border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; font-weight: 600; }

/* 24h status strips */
.strip-row { display: grid; grid-template-columns: 9rem 1fr; gap: .75rem; align-items: center; margin: .45rem 0; font-size: .85rem; }
.strip { display: flex; gap: 2px; height: 1.4rem; }
.strip span { flex: 1; border-radius: 3px; background: #e5e7eb; min-width: 2px; }
.strip span.ok { background: var(--st-ok); } .strip span.warn { background: var(--st-warn); } .strip span.down { background: var(--st-down); }
.strip span:hover { outline: 2px solid #191822; outline-offset: 1px; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .6rem; }

/* Single-series line charts (public/js/dashboard.js) */
.chart-box { position: relative; }
.chart-box svg { width: 100%; height: 170px; display: block; overflow: visible; }
.chart-box .tick { fill: #898781; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-box .gridline { stroke: #e1e0d9; } .chart-box .baseline { stroke: #c3c2b7; }
.chart-box .threshold { stroke: #898781; stroke-dasharray: 4 4; }
.chart-box .series { fill: none; stroke: #2a78d6; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .pt { fill: #2a78d6; stroke: #fff; stroke-width: 2; }
.chart-box .crosshair { stroke: #898781; }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--dkm-frame); border-radius: .5rem; padding: .35rem .6rem; font-size: .78rem; box-shadow: 0 4px 14px rgba(0,0,0,.12); white-space: nowrap; display: none; z-index: 5; }
.chart-empty { color: #898781; padding: 3rem 0; text-align: center; font-size: .85rem; }
@media (max-width: 575.98px) { .m-header-brand .brand-logo-name { font-size: .95rem; } .m-header-brand .brand-logo-mark { width: 32px; height: 32px; } }
.check-wrap { max-width: 720px; }
.loc-pill { flex-wrap: wrap; word-break: break-all; }
