/* PHPGuru app frame (shared by the products; copied in by _micro_base/theme/apply_shell.php). Loaded after style.css.
   Navy menu, white work area, one blue for actions. No gradients, no web fonts (the desktop editions are offline). */
:root { --nav: #0b1f4a; --nav-2: #142d63; --nav-ink: #c7d3ec; --blue: #2563eb; --blue-ink: #1d4ed8; --surface: #f5f7fb; }
body.app { background: var(--surface); }
.skip-link { position: absolute; left: 8px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* ---- side menu */
.app-side { background: var(--nav); color: #fff; width: 232px; flex: none; }
/* Bootstrap makes this panel see-through on wide screens (it is only a drawer on small ones), so the colour is set firmly. */
@media (min-width: 992px) { .app-side.offcanvas-lg { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background-color: var(--nav) !important; } }
.app-side.offcanvas-lg { --bs-offcanvas-bg: var(--nav); --bs-offcanvas-width: 264px; }
.app-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 18px; }
.brand-mark { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--blue); font-size: 1.2rem; }
.brand-name { font-weight: 700; font-size: .98rem; line-height: 1.25; letter-spacing: -.01em; }
.app-nav { list-style: none; margin: 0; padding: 6px 12px; display: grid; gap: 4px; }
.app-nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; border-radius: 10px; color: var(--nav-ink); font-weight: 500; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.app-nav a .bi { font-size: 1.1rem; }
.app-nav a:hover { background: var(--nav-2); color: #fff; }
.app-nav a.active { background: var(--blue); color: #fff; font-weight: 600; }
.app-nav a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: none; }

/* ---- top bar */
.app-top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--pg-line); position: sticky; top: 0; z-index: 1020; }
.app-search { position: relative; flex: 1 1 auto; max-width: 460px; margin: 0; }
.app-search .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--pg-muted); pointer-events: none; }
.app-search .form-control { padding-left: 40px; background: var(--surface); border-color: transparent; }
.app-search .form-control:focus { background: #fff; border-color: var(--blue); }
.app-top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.btn-icon { width: 42px; min-height: 42px; padding: 0; border-radius: 10px; color: var(--pg-ink-2); font-size: 1.2rem; }
.btn-icon:hover { background: var(--surface); color: var(--pg-ink); }
.bell-count { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; }
.bell-menu { width: min(340px, 92vw); } .bell-menu .dropdown-item { white-space: normal; padding: 8px 16px; }
.user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: 10px; color: var(--pg-ink); font-weight: 600; }
.user-btn:hover { background: var(--surface); }
.avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #dbe6ff; color: var(--blue-ink); font-size: .82rem; font-weight: 700; }
.dropdown-menu { border: 1px solid var(--pg-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .12); padding: 6px; }
.dropdown-item { border-radius: 8px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; } .bell-menu .dropdown-item { display: block; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface); }
.dropdown-item.text-danger:hover { background: #fef2f2; }
.table .dropdown-item, .dropdown-item { font-weight: 500; text-decoration: none !important; color: var(--pg-ink); } .dropdown-item .bi { color: var(--pg-muted); }

/* ---- page */
.app-page { padding: 24px; max-width: 1280px; width: 100%; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.6rem; margin: 0; } .page-head p { margin: 2px 0 0; color: var(--pg-muted); }
.card { box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.card-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 18px; }
.card-title-row h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: 10px; } .card-title-row h2 .bi { color: var(--blue); }

/* ---- the four figures */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--pg-line); border-radius: 14px; padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.kpi-icon { grid-row: span 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; font-size: 1.25rem; }
.kpi-label { font-size: .82rem; font-weight: 600; color: var(--pg-muted); }
.kpi-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-note { grid-column: 1 / -1; margin-top: 6px; font-size: .82rem; color: var(--pg-muted); }
.kpi-note .up { color: var(--pg-good); font-weight: 600; } .kpi-note .down { color: var(--pg-bad); font-weight: 600; }
.kpi.blue .kpi-icon { background: #dbe6ff; color: var(--blue-ink); } .kpi.amber .kpi-icon { background: #fef3c7; color: #b45309; }
.kpi.red .kpi-icon { background: #fee2e2; color: #b91c1c; } .kpi.green .kpi-icon { background: #dcfce7; color: #15803d; }

/* ---- chart */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--pg-line); }
.seg a { padding: 6px 14px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--pg-ink-2); text-decoration: none; min-height: 34px; display: inline-flex; align-items: center; }
.seg a.active { background: var(--blue); color: #fff; } .seg a:hover:not(.active) { background: #e8edf7; }
.chart-wrap { padding: 4px 18px 16px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e5eaf2; stroke-width: 1; } .chart .axis { fill: var(--pg-muted); font-size: 11px; }
.chart .bar.paid { fill: var(--blue); } .chart .bar.due { fill: #a9c2f7; } .chart .bar:hover { opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .84rem; color: var(--pg-ink-2); margin: 0 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; } .legend .paid i { background: var(--blue); } .legend .due i { background: #a9c2f7; }

/* ---- tables, filters, small parts */
/* Hidden labels inside a wide table are positioned by the scrolling box, so they cannot push the page sideways on a phone. */
.card-body.p-0, .table-responsive { position: relative; }
.table .num { text-align: right; } .table td.actions, .table th.actions { width: 1%; text-align: right; white-space: nowrap; }
.table th a { color: inherit; text-decoration: none; } .table th a:hover { color: var(--pg-ink); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--pg-line); }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; flex: 1 1 150px; max-width: 260px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--pg-line); }
.empty-state { padding: 36px 18px; text-align: center; color: var(--pg-muted); } .empty-state .bi { font-size: 2rem; color: #a3b1c9; display: block; margin-bottom: 8px; } .empty-state p { margin: 0 0 12px; }
.badge.bg-danger { font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fact { background: var(--surface); border-radius: 10px; padding: 12px 14px; } .fact span { display: block; font-size: .78rem; font-weight: 600; color: var(--pg-muted); } .fact strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.share { height: 10px; border-radius: 999px; background: #a9c2f7; overflow: hidden; } .share > span { display: block; height: 100%; background: var(--blue); }

@media (max-width: 991.98px) { .app-search { min-width: 0; } .app-search .form-control { min-width: 0; } .app-top { padding: 10px 14px; } .app-page { padding: 16px 14px; } .user-name { display: none; } }
.page-head > .d-flex { flex-wrap: wrap; }
.card-body:has(> .table) { overflow-x: auto; position: relative; }
@media (max-width: 575.98px) { .filters .form-control, .filters .form-select { min-width: 0; flex: 1 1 120px; max-width: none; } .filters .form-label { flex: 0 0 100%; } .page-head h1 { font-size: 1.35rem; } .kpi-value { font-size: 1.35rem; } .table > :not(caption) > * > * { padding: .6rem .75rem; } }
@media print { .app-side, .app-top, .filters, .pager, .seg, .skip-link, .no-print { display: none !important; } .app-page { padding: 0; max-width: none; } body.app { background: #fff; } }
.app-top-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--pg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-page > h3:first-child, .app-page > .d-flex:first-child h3, .app-page h3.mb-4, .app-page h3.mb-3 { font-size: 1.5rem; }
