/* ─────────────────────────────────────────────────────────────
   PowerMaps app theme.

   Loaded after AdminKit (app.css) and custom.css on every signed-in
   page, so it restyles the whole app shell without touching views.
   Same visual language as the sign-in pages and powermaps.app:
   ink sidebar, Plus Jakarta Sans, flat colour, hairline borders.

   The second half defines small dashboard components (pm-*) that the
   dashboards use; any view can opt into them.
   ───────────────────────────────────────────────────────────── */
:root {
    --pm-blue: #0d6efd;
    --pm-blue-dark: #0b5ed7;
    --pm-blue-soft: #e8f1ff;
    --pm-blue-bright: #4d94ff;
    --pm-ink: #07111f;
    --pm-ink-2: #0c1a2e;
    --pm-ink-line: rgba(255, 255, 255, .08);
    --pm-ink-muted: #9fb0c3;
    --pm-text: #0b1524;
    --pm-text-2: #1c2b3a;
    --pm-muted: #5b6b7c;
    --pm-subtle: #8494a7;
    --pm-line: #e3e9f0;
    --pm-line-2: #eef2f6;
    --pm-surface: #ffffff;
    --pm-canvas: #f4f7fb;
    --pm-field: #f8fafc;
    --pm-green: #0f9d58;
    --pm-green-soft: #e7f6ee;
    --pm-amber: #c2760a;
    --pm-amber-soft: #fff4e0;
    --pm-red: #d92d20;
    --pm-red-soft: #fdecea;
    --pm-violet: #6d4fd8;
    --pm-violet-soft: #f0ecfd;
    --pm-teal: #0e8a9a;
    --pm-teal-soft: #e3f5f7;
    --pm-radius: 14px;
    --pm-radius-sm: 10px;
    --pm-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
    --pm-shadow-lg: 0 12px 32px rgba(7, 17, 31, .10);
    --pm-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --pm-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --bs-body-font-family: var(--pm-font);
    --bs-primary: var(--pm-blue);
    --bs-primary-rgb: 13, 110, 253;
}

body {
    font-family: var(--pm-font);
    color: var(--pm-text);
    background: var(--pm-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body:not(.auth-page) { font-size: .9rem; }

.main, .wrapper { background: var(--pm-canvas); }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--pm-text);
    font-weight: 700;
    letter-spacing: -.015em;
}
a { color: var(--pm-blue); }
a:hover { color: var(--pm-blue-dark); }
.text-muted { color: var(--pm-muted) !important; }
.text-primary { color: var(--pm-blue) !important; }
.bg-primary { background-color: var(--pm-blue) !important; }

:focus-visible { outline: 2px solid var(--pm-blue); outline-offset: 2px; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar,
.sidebar-content { background: var(--pm-ink); }
.sidebar { border-right: 1px solid var(--pm-ink-line); }

.sidebar-brand,
.sidebar-brand:hover {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 22px 18px;
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
}
.sidebar-brand .brand-tile {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    background: var(--pm-blue);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(13, 110, 253, .35);
}
.sidebar-brand .brand-tile img { width: 22px; height: 22px; filter: brightness(0) invert(1); }

.sidebar-nav { padding: 4px 0 24px; }

.sidebar-header {
    padding: 22px 24px 8px;
    font-family: var(--pm-mono);
    font-size: .66rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #5f7389;
}

.sidebar-link,
a.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1px 12px;
    padding: 9px 12px;
    border-left: 0;
    border-radius: var(--pm-radius-sm);
    color: var(--pm-ink-muted);
    background: transparent;
    font-weight: 500;
    font-size: .875rem;
    transition: background-color .15s ease, color .15s ease;
}
.sidebar-link i,
.sidebar-link svg { color: #6f8399; width: 18px; height: 18px; flex-shrink: 0; margin: 0; transition: color .15s ease; }
.sidebar-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-link:hover i,
.sidebar-link:hover svg { color: #c9d6e4; }

.sidebar-item.active > .sidebar-link,
.sidebar-item.active .sidebar-link:hover {
    background: rgba(13, 110, 253, .18);
    border-left: 0;
    color: #fff;
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--pm-blue-bright);
}
.sidebar-item.active > .sidebar-link i,
.sidebar-item.active > .sidebar-link svg { color: var(--pm-blue-bright); }

/* ── Top bar ─────────────────────────────────────────────── */
.navbar {
    min-height: 64px;
    padding: 10px 24px;
    box-shadow: none;
    border-bottom: 1px solid var(--pm-line);
}
.navbar-bg { background: rgba(255, 255, 255, .92); }
@supports (backdrop-filter: blur(8px)) {
    .navbar-bg { backdrop-filter: saturate(160%) blur(8px); }
}
.navbar { position: sticky; top: 0; z-index: 1020; }

.sidebar-toggle {
    width: 38px; height: 38px; margin-right: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--pm-radius-sm);
    transition: background-color .15s ease;
}
.sidebar-toggle:hover { background: var(--pm-line-2); }
.hamburger, .hamburger:after, .hamburger:before { background: var(--pm-text-2); }

.navbar .nav-icon {
    width: 40px; height: 40px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--pm-radius-sm);
    color: var(--pm-muted);
    transition: background-color .15s ease, color .15s ease;
}
.navbar .nav-icon:hover { background: var(--pm-line-2); color: var(--pm-text); }
.navbar .nav-icon svg { width: 20px; height: 20px; }
.navbar .indicator {
    top: -6px; right: -8px;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; border: 2px solid #fff;
    background: var(--pm-red);
    font-size: .65rem; font-weight: 700; line-height: 14px;
}
.navbar .nav-link.dropdown-toggle { display: inline-flex; align-items: center; gap: 4px; }
.navbar .nav-link.dropdown-toggle::after { display: none; }
#userAvatar { width: 36px !important; height: 36px !important; font-size: .8rem; letter-spacing: .02em; }
#userRole { font-weight: 600; }

.dropdown-menu {
    border: 1px solid var(--pm-line);
    border-radius: 12px;
    box-shadow: var(--pm-shadow-lg);
    padding: 6px;
    font-size: .875rem;
}
.dropdown-item {
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--pm-text-2);
    display: flex; align-items: center; gap: 8px;
}
.dropdown-item svg { width: 16px; height: 16px; color: var(--pm-muted); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--pm-field); color: var(--pm-text); }
.dropdown-divider { border-color: var(--pm-line-2); margin: 6px 0; }
.dropdown-menu-header {
    padding: 12px 14px; border-bottom: 1px solid var(--pm-line-2);
    font-weight: 700; color: var(--pm-text); text-align: left;
}
.dropdown-menu-footer { padding: 10px; border-top: 1px solid var(--pm-line-2); font-weight: 600; }
.dropdown-menu.py-0 { padding: 0; }
.dropdown-menu .list-group-item { border-color: var(--pm-line-2); }

.pm-app-banner-wrap { padding: 16px 16px 0; }
.pm-app-banner-wrap .pm-app-prompt { margin-bottom: 0; }
.pm-app-banner-wrap:not(:has(.is-visible)) { display: none; }

/* ── Content area ────────────────────────────────────────── */
.content { padding: 28px 32px 24px; }
@media (max-width: 991.98px) { .content { padding: 20px 16px 16px; } }

.content h1.h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.025em; }
.content h1.h3 strong { font-weight: 800; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow);
    background: var(--pm-surface);
    margin-bottom: 20px;
}
/* custom.css lifts every card on hover, which makes tables and forms jitter
   under the pointer. Only explicitly interactive cards move now. */
.card:hover { transform: none; box-shadow: var(--pm-shadow); }
.card.pm-card-link:hover { transform: translateY(-2px); box-shadow: var(--pm-shadow-lg); }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--pm-line-2);
    padding: 16px 20px;
    border-radius: var(--pm-radius) var(--pm-radius) 0 0 !important;
}
.card-title, .card-header .card-title {
    color: var(--pm-text);
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: -.01em;
}
.card-subtitle { color: var(--pm-muted); }
.card-body { padding: 20px; }
.card-footer { background: transparent; border-top: 1px solid var(--pm-line-2); padding: 14px 20px; }
@media (max-width: 991.98px) {
    .card-body { padding: 16px; }
    .card-header { padding: 14px 16px; }
}

/* ── Tables ──────────────────────────────────────────────── */
.table { color: var(--pm-text-2); margin-bottom: 0; --bs-table-hover-bg: #f7faff; --bs-table-striped-bg: #fafbfd; }
.table > :not(caption) > * > * { padding: 12px 16px; border-bottom-color: var(--pm-line-2); }
.table > thead > tr > th,
.table thead th {
    background: var(--pm-field);
    color: var(--pm-muted);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--pm-line);
}
.table > :not(:first-child) { border-top: 0; }
.table td { vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: 9px 12px; }
/* A table that fills its card body runs edge to edge; one under a toolbar
   keeps the toolbar's spacing above it. */
.card-body > .table-responsive:only-child { margin: -20px; width: calc(100% + 40px); }
.card-body > .table-responsive:last-child:not(:only-child) { margin: 0 -20px -20px; width: calc(100% + 40px); border-top: 1px solid var(--pm-line-2); }
@media (max-width: 991.98px) {
    .card-body > .table-responsive:only-child { margin: -16px; width: calc(100% + 32px); }
    .card-body > .table-responsive:last-child:not(:only-child) { margin: 0 -16px -16px; width: calc(100% + 32px); }
}

/* ── Badges: soft tints read calmer than saturated pills ── */
.badge {
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .01em;
    padding: .38em .7em;
    border-radius: 999px;
}
.badge.bg-primary   { background: var(--pm-blue-soft) !important;   color: var(--pm-blue-dark) !important; }
.badge.bg-success   { background: var(--pm-green-soft) !important;  color: #0b7a43 !important; }
.badge.bg-warning   { background: var(--pm-amber-soft) !important;  color: #8a5300 !important; }
.badge.bg-danger    { background: var(--pm-red-soft) !important;    color: #b42318 !important; }
.badge.bg-info      { background: var(--pm-teal-soft) !important;   color: #0b6b78 !important; }
.badge.bg-secondary { background: #eef1f5 !important;               color: #475467 !important; }
.badge.bg-light     { background: var(--pm-field) !important;       color: var(--pm-text-2) !important; }
.badge.bg-dark      { background: var(--pm-ink) !important;         color: #fff !important; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    border-radius: var(--pm-radius-sm);
    font-weight: 600;
    font-size: .875rem;
    padding: .5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn svg.feather, .btn > svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm { padding: .32rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn-sm svg.feather, .btn-sm > svg { width: 14px; height: 14px; }
.btn-lg { padding: .75rem 1.25rem; font-size: .95rem; border-radius: 12px; }
.btn-link { display: inline; }
.btn-group > .btn { display: inline-flex; }

.btn-primary { background: var(--pm-blue); border-color: var(--pm-blue); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--pm-blue-dark); border-color: var(--pm-blue-dark); color: #fff; }
.btn-success { background: var(--pm-green); border-color: var(--pm-green); }
.btn-success:hover { background: #0b8148; border-color: #0b8148; }
.btn-info { background: var(--pm-teal); border-color: var(--pm-teal); color: #fff; }
.btn-info:hover { background: #0b7380; border-color: #0b7380; color: #fff; }
.btn-secondary { background: var(--pm-text-2); border-color: var(--pm-text-2); }
.btn-outline-primary { color: var(--pm-blue); border-color: #bcd6fe; background: #fff; }
.btn-outline-primary:hover { background: var(--pm-blue-soft); border-color: var(--pm-blue); color: var(--pm-blue-dark); }
.btn-outline-secondary { color: var(--pm-text-2); border-color: var(--pm-line); background: #fff; }
.btn-outline-secondary:hover { background: var(--pm-field); border-color: #cfd8e3; color: var(--pm-text); }
.btn-light { background: #fff; border-color: var(--pm-line); color: var(--pm-text-2); }
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(13, 110, 253, .25); outline: 0; }

/* ── Forms ───────────────────────────────────────────────── */
.form-control, .form-select {
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius-sm);
    background-color: #fff;
    color: var(--pm-text);
    font-size: .875rem;
    padding: .55rem .85rem;
    min-height: 40px;
}
.form-select { padding-right: 2.25rem; }
.form-control::placeholder { color: var(--pm-subtle); }
.form-control:focus, .form-select:focus {
    border-color: var(--pm-blue);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}
.form-label { font-weight: 600; font-size: .82rem; color: var(--pm-text-2); margin-bottom: 6px; }
.form-text { color: var(--pm-muted); }
.input-group-text { background: var(--pm-field); border-color: var(--pm-line); color: var(--pm-muted); }
.form-check-input:checked { background-color: var(--pm-blue); border-color: var(--pm-blue); }

/* ── Modals, alerts, misc ────────────────────────────────── */
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 24px 64px rgba(7, 17, 31, .22); }
.modal-header { border-bottom: 1px solid var(--pm-line-2); padding: 18px 22px; }
.modal-title { font-weight: 700; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--pm-line-2); padding: 14px 22px; gap: 8px; }
.modal-footer > * { margin: 0; }
.modal-backdrop.show { opacity: .45; }

.alert { border-radius: 12px; border-width: 1px; font-size: .875rem; }
.alert-info    { background: var(--pm-blue-soft);  border-color: #cfe1ff; color: #0a4fb8; }
.alert-success { background: var(--pm-green-soft); border-color: #c6ead6; color: #0b6b3a; }
.alert-warning { background: var(--pm-amber-soft); border-color: #fde3b0; color: #7a4b00; }
.alert-danger  { background: var(--pm-red-soft);   border-color: #f8cfcb; color: #9f1d13; }

.nav-tabs { border-bottom-color: var(--pm-line); gap: 4px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--pm-muted); font-weight: 600; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--pm-text); }
.nav-tabs .nav-link.active { color: var(--pm-blue); border-bottom-color: var(--pm-blue); background: transparent; }

.progress { background: var(--pm-line-2); border-radius: 999px; height: 8px; }
.progress-bar { background: var(--pm-blue); border-radius: 999px; }

.list-group-item { border-color: var(--pm-line-2); }
.pagination .page-link { border-radius: 8px; margin: 0 2px; border-color: var(--pm-line); color: var(--pm-text-2); }
.pagination .page-item.active .page-link { background: var(--pm-blue); border-color: var(--pm-blue); }

.stat-icon { border-radius: 12px; }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    background: transparent;
    border-top: 1px solid var(--pm-line);
    padding: 16px 32px;
    font-size: .8rem;
}
.footer .row { row-gap: 8px; }
.footer ul { margin: 0; }
.footer a.text-muted:hover { color: var(--pm-text) !important; }
@media (max-width: 767.98px) {
    .footer { padding: 16px; }
    .footer .col-6 { flex: 0 0 100%; max-width: 100%; text-align: left !important; }
}

/* ══ Dashboard components ═══════════════════════════════════ */

/* Page header: eyebrow, title, one-line context, actions on the right. */
.pm-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.pm-eyebrow {
    font-family: var(--pm-mono);
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--pm-blue);
    margin: 0 0 6px;
}
.pm-page-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; margin: 0; line-height: 1.2; }
.pm-page-subtitle { color: var(--pm-muted); margin: 6px 0 0; font-size: .9rem; }
.pm-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 575.98px) {
    .pm-page-title { font-size: 1.35rem; }
    .pm-page-actions { width: 100%; }
    .pm-page-actions .btn { flex: 1; }
}

/* Live indicator */
.pm-live {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    background: #fff; border: 1px solid var(--pm-line);
    font-size: .78rem; font-weight: 600; color: var(--pm-text-2);
    white-space: nowrap;
}
.pm-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pm-green); position: relative; }
.pm-live-dot::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    background: var(--pm-green); opacity: .3; animation: pmPulse 2s ease-out infinite;
}
.pm-live.is-degraded .pm-live-dot,
.pm-live.is-degraded .pm-live-dot::after { background: var(--pm-amber); }
.pm-live-time { color: var(--pm-muted); font-weight: 500; }
@keyframes pmPulse { 0% { transform: scale(.6); opacity: .45; } 100% { transform: scale(1.8); opacity: 0; } }

/* KPI tiles */
.pm-kpis { display: grid; gap: 16px; margin-bottom: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px)  { .pm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pm-kpis.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .pm-kpis.is-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.pm-kpi {
    background: var(--pm-surface);
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.pm-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pm-kpi-label { font-size: .8rem; font-weight: 600; color: var(--pm-muted); line-height: 1.3; }
.pm-kpi-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pm-blue-soft); color: var(--pm-blue);
}
.pm-kpi-icon svg { width: 18px; height: 18px; }
.pm-kpi-value {
    font-size: 1.85rem; font-weight: 800; letter-spacing: -.03em; line-height: 1;
    color: var(--pm-text); font-variant-numeric: tabular-nums;
}
.pm-kpi-foot { font-size: .76rem; color: var(--pm-subtle); margin-top: -6px; }
.pm-kpi.is-updated { border-color: #9ec5fe; box-shadow: 0 0 0 3px rgba(13, 110, 253, .12); }
@media (max-width: 575.98px) {
    .pm-kpi { padding: 14px; gap: 10px; }
    .pm-kpi-value { font-size: 1.5rem; }
    .pm-kpi-icon { width: 32px; height: 32px; }
}

.pm-tone-blue   { background: var(--pm-blue-soft);   color: var(--pm-blue); }
.pm-tone-green  { background: var(--pm-green-soft);  color: var(--pm-green); }
.pm-tone-amber  { background: var(--pm-amber-soft);  color: var(--pm-amber); }
.pm-tone-red    { background: var(--pm-red-soft);    color: var(--pm-red); }
.pm-tone-violet { background: var(--pm-violet-soft); color: var(--pm-violet); }
.pm-tone-teal   { background: var(--pm-teal-soft);   color: var(--pm-teal); }

/* Quick actions */
.pm-actions { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
@media (min-width: 992px) { .pm-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pm-actions.is-stack { grid-template-columns: minmax(0, 1fr); margin-bottom: 0; }

.pm-action {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--pm-surface);
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    box-shadow: var(--pm-shadow);
    color: var(--pm-text);
    text-decoration: none;
    min-width: 0;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pm-action:hover { color: var(--pm-text); border-color: #bcd6fe; box-shadow: 0 6px 18px rgba(13, 110, 253, .08); transform: translateY(-1px); }
.pm-action-icon {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.pm-action-icon svg { width: 20px; height: 20px; }
.pm-action-text { min-width: 0; display: flex; flex-direction: column; }
.pm-action-title { font-weight: 700; font-size: .875rem; line-height: 1.3; }
.pm-action-desc { font-size: .76rem; color: var(--pm-muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-action-arrow { margin-left: auto; color: var(--pm-subtle); width: 16px; height: 16px; flex-shrink: 0; transition: transform .15s ease, color .15s ease; }
.pm-action:hover .pm-action-arrow { transform: translateX(2px); color: var(--pm-blue); }
.pm-action.is-primary { background: var(--pm-blue); border-color: var(--pm-blue); color: #fff; }
.pm-action.is-primary .pm-action-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.pm-action.is-primary .pm-action-desc,
.pm-action.is-primary .pm-action-arrow { color: rgba(255, 255, 255, .75); }
.pm-action.is-primary:hover { background: var(--pm-blue-dark); color: #fff; }
@media (max-width: 575.98px) {
    .pm-action { padding: 12px; gap: 10px; }
    .pm-action-desc, .pm-action-arrow { display: none; }
    .pm-action-icon { width: 34px; height: 34px; }
}

/* Card header with title + aside */
.pm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pm-card-head .card-title { margin: 0; }
.pm-card-sub { font-size: .78rem; color: var(--pm-muted); margin: 2px 0 0; font-weight: 500; }
.pm-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 7px; margin-left: 6px;
    border-radius: 999px; background: var(--pm-line-2);
    font-size: .7rem; font-weight: 700; color: var(--pm-muted);
    vertical-align: 1px;
}

/* Toolbar (search + filters) */
.pm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.pm-search { position: relative; flex: 1 1 260px; }
.pm-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--pm-subtle); pointer-events: none; }
.pm-search .form-control { padding-left: 36px; }
.pm-toolbar .form-select { flex: 0 1 180px; width: auto; }
@media (max-width: 575.98px) { .pm-toolbar .form-select { flex: 1 1 140px; } }

/* Identity cell */
.pm-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pm-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .74rem; font-weight: 700; letter-spacing: .02em;
}
.pm-avatar.is-sm { width: 30px; height: 30px; font-size: .68rem; }
.pm-person-name { font-weight: 600; color: var(--pm-text); line-height: 1.3; display: block; }
.pm-person-meta { font-size: .78rem; color: var(--pm-muted); line-height: 1.3; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

.pm-link-strong { font-weight: 600; color: var(--pm-text); text-decoration: none; }
.pm-link-strong:hover { color: var(--pm-blue); }
.pm-num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Status pill with dot */
.pm-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 600; text-transform: capitalize; white-space: nowrap;
}
.pm-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Icon button cluster */
.pm-icon-btn {
    width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--pm-line); background: #fff;
    color: var(--pm-muted);
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pm-icon-btn svg { width: 15px; height: 15px; }
.pm-icon-btn:hover { background: var(--pm-field); color: var(--pm-text); border-color: #cfd8e3; }
.pm-icon-btn.is-warn:hover { background: var(--pm-amber-soft); color: var(--pm-amber); border-color: #fde3b0; }
.pm-icon-btn.is-ok:hover { background: var(--pm-green-soft); color: var(--pm-green); border-color: #c6ead6; }
.pm-icon-group { display: inline-flex; gap: 6px; }

/* Activity timeline */
.pm-timeline { list-style: none; margin: 0; padding: 0; }
.pm-timeline-item { position: relative; display: flex; gap: 12px; padding: 0 0 18px; }
.pm-timeline-item:last-child { padding-bottom: 0; }
.pm-timeline-item:not(:last-child)::before {
    content: ''; position: absolute; left: 15px; top: 34px; bottom: 4px;
    width: 1px; background: var(--pm-line);
}
.pm-timeline-icon {
    width: 31px; height: 31px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
}
.pm-timeline-icon svg { width: 15px; height: 15px; }
.pm-timeline-body { flex: 1; min-width: 0; padding-top: 5px; }
.pm-timeline-text { margin: 0; line-height: 1.45; color: var(--pm-text-2); overflow-wrap: anywhere; }
.pm-timeline-text strong { color: var(--pm-text); font-weight: 600; }
.pm-timeline-desc { margin: 2px 0 0; font-size: .8rem; color: var(--pm-muted); overflow-wrap: anywhere; }
.pm-timeline-time { font-size: .74rem; color: var(--pm-subtle); white-space: nowrap; padding-top: 6px; }

/* Empty + error states */
.pm-empty { text-align: center; padding: 36px 16px; color: var(--pm-muted); }
.pm-empty-icon {
    width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--pm-line-2); color: var(--pm-subtle);
}
.pm-empty-icon svg { width: 22px; height: 22px; }
.pm-empty-title { font-weight: 700; color: var(--pm-text); margin: 0 0 4px; }
.pm-empty-text { font-size: .85rem; margin: 0 auto; max-width: 320px; }
.pm-empty .btn { margin-top: 14px; }
.pm-empty.is-error .pm-empty-icon { background: var(--pm-red-soft); color: var(--pm-red); }
td.pm-empty-cell { padding: 0 !important; border-bottom: 0 !important; }

/* Loading skeletons */
.pm-skeleton {
    display: block; height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, #eef2f6 0%, #f6f8fb 50%, #eef2f6 100%);
    background-size: 200% 100%;
    animation: pmShimmer 1.3s ease-in-out infinite;
}
.pm-skeleton.is-value { height: 28px; width: 56px; border-radius: 8px; }
.pm-skeleton-row { display: flex; gap: 12px; align-items: center; padding: 6px 0 14px; }
.pm-skeleton-row .pm-skeleton.is-dot { width: 31px; height: 31px; border-radius: 50%; flex-shrink: 0; }
@keyframes pmShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Table pager */
.pm-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--pm-line-2); }
.pm-pager-info { font-size: .78rem; color: var(--pm-muted); }

@media (prefers-reduced-motion: reduce) {
    .pm-live-dot::after, .pm-skeleton { animation: none; }
    .pm-action, .pm-action:hover, .card.pm-card-link:hover { transform: none; }
}

@media print {
    .pm-page-actions, .pm-actions, .pm-app-banner-wrap { display: none !important; }
}

.min-w-0 { min-width: 0; }
@media (min-width: 1200px) { .pm-kpis.is-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
