/* =============================================
   Design Tokens — Stack2 Brand
   ============================================= */
:root {
    /* Brand palette */
    --brand-dark:   #1a1a1e;   /* Big Shark */
    --brand-green:  #6cf127;   /* Guarana */
    --brand-bg:     #f5f5f5;   /* BG White */

    /* Surfaces */
    --app-bg:             #f5f5f5;
    --app-surface:        #ffffff;
    --app-surface-raised: #f0f0f0;
    --app-border:         rgba(0, 0, 0, 0.08);
    --app-border-subtle:  rgba(0, 0, 0, 0.05);
    --app-shadow:         0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --app-shadow-md:      0 4px 14px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.05);
    --app-radius:         0.6rem;
    --app-radius-sm:      0.4rem;
    --app-radius-lg:      0.75rem;

    /* Typography */
    --app-text:           #1a1a1e;   /* Big Shark — primary text */
    --app-text-secondary: #5a5a64;
    --app-text-muted:     #9a9aa8;
    --app-font-body:      'Petita', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --app-font-heading:   'Scuper', 'Petita', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

    /* Accent — Guarana green */
    --app-accent:         #6cf127;           /* vivid brand green — decorative/bg */
    --app-accent-hover:   #56d41a;           /* slightly deeper for hover */
    --app-accent-text:    #1e7200;           /* dark green — readable on white (4.8:1) */
    --app-accent-subtle:  rgba(108, 241, 39, 0.1);
    --app-accent-border:  rgba(108, 241, 39, 0.3);

    /* Status palette */
    --app-status-task-on-hold: #6f42c1;
}

/* =============================================
   Fonts
   ============================================= */
/* @font-face {
    font-family: 'Petita';
    src: url('/fonts/Petita.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Scuper';
    src: url('/fonts/Scuper.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
} */

/* =============================================
   Base
   ============================================= */
html, body {
    font-family: var(--app-font-body);
    font-size: 0.9375rem;
    color: var(--app-text);
    background-color: var(--app-bg);
    -webkit-font-smoothing: antialiased;
}

main {
    background-color: var(--app-bg) !important;
}

.content {
    padding-top: 1.25rem;
}

/* Ticket tones (TicketRules.Tone), shared by the tickets list and the ticket page. --tone and --tone-soft suit white
   backgrounds; --tone-bright suits the dark headers. */
.tone-reply   { --tone: #1f7fd1; --tone-soft: rgba(42, 120, 214, 0.1);  --tone-bright: #6bb8ff; }
.tone-new     { --tone: #1f7fd1; --tone-soft: rgba(42, 120, 214, 0.1);  --tone-bright: #6bb8ff; }
.tone-open    { --tone: #0d8a9c; --tone-soft: rgba(13, 138, 156, 0.1);  --tone-bright: #5fd3e0; }
.tone-todo    { --tone: #d6383d; --tone-soft: rgba(229, 72, 77, 0.1);   --tone-bright: #ff7a7e; }
.tone-waiting { --tone: #b86e00; --tone-soft: rgba(245, 166, 35, 0.14); --tone-bright: #ffc24d; }
.tone-hold    { --tone: #6c6c76; --tone-soft: rgba(0, 0, 0, 0.06);      --tone-bright: #c9c6be; }
.tone-done    { --tone: #2f9e44; --tone-soft: rgba(47, 158, 68, 0.11);  --tone-bright: #7ee2a0; }
.tone-closed  { --tone: #4a4a52; --tone-soft: rgba(0, 0, 0, 0.06);      --tone-bright: #c9c6be; }

/* Ticket page: on large screens the conversation scrolls on its own, and fitToWindow (ticket-view.js) sets its
   height to reach the bottom of the window. */
@media (min-width: 992px) {
    .ticket-conversation {
        overflow-y: auto;
        padding-right: .5rem;
    }
}

/* Hidden until openAtBottom (ticket-view.js) has scrolled it into place, so the jump isn't seen. Shown after a
   second anyway, in case the script never runs. */
.ticket-conversation[data-opening] {
    visibility: hidden;
    animation: ticket-conversation-show 0s 1s forwards;
}

@keyframes ticket-conversation-show {
    to {
        visibility: visible;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--app-font-heading);
    color: var(--app-text);
    font-weight: 700;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--app-accent-text);
    text-decoration: none;
}

a:hover, .btn-link:hover {
    color: var(--app-accent-text);
    text-decoration: underline;
}

/* =============================================
   Cards
   ============================================= */

/* Works alongside border-0 shadow-sm pattern used throughout */
.card.border-0 {
    border: 1px solid var(--app-border) !important;
    border-radius: var(--app-radius-lg) !important;
}

.card.shadow-sm {
    box-shadow: var(--app-shadow) !important;
}

.card .card-header {
    background-color: var(--app-surface) !important;
    padding-top: 1rem;
    padding-bottom: 0.75rem;
}

.card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
}

.card .card-header p.text-muted,
.card .card-header small {
    font-size: 0.78rem;
    color: var(--app-text-secondary) !important;
}

/* =============================================
   Buttons
   ============================================= */
.btn {
    border-radius: var(--app-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-dark {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #f5f5f5;
}

.btn-dark:hover {
    background-color: #2e2e35;
    border-color: #2e2e35;
    color: #f5f5f5;
}

.btn-primary {
    /* Brand green bg with dark text — white on #6cf127 fails WCAG */
    background-color: var(--app-accent);
    border-color: var(--app-accent);
    color: var(--brand-dark);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary.show,
.btn-primary:first-child:active,
:not(.btn-check) + .btn-primary:active {
    background-color: var(--app-accent-hover);
    border-color: var(--app-accent-hover);
    color: var(--brand-dark);
}

.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--app-accent);
    border-color: var(--app-accent);
    color: var(--brand-dark);
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-dark:disabled,
.btn-dark.disabled {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #f5f5f5;
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-outline-secondary {
    border-color: var(--app-border);
    color: var(--app-text-secondary);
}

.btn-outline-secondary:hover {
    background-color: var(--app-surface-raised);
    border-color: rgba(0,0,0,0.12);
    color: var(--app-text);
}

.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(108, 241, 39, 0.22);
    outline: none;
}

/* =============================================
   Badges
   ============================================= */
.badge {
    border-radius: 0.35rem;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.01em;
}

.badge.rounded-pill {
    border-radius: 100px;
}

.bg-task-on-hold {
    background-color: var(--app-status-task-on-hold) !important;
    color: #fff !important;
}

/* =============================================
   Forms
   ============================================= */
.form-control,
.form-select {
    border-radius: var(--app-radius-sm);
    border-color: rgba(0,0,0,0.12);
    font-size: 0.875rem;
    color: var(--app-text);
    background-color: var(--app-surface);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px rgba(108, 241, 39, 0.18);
}

.form-control::placeholder {
    color: var(--app-text-muted);
}

.form-label {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--app-text);
    margin-bottom: 0.35rem;
}

.form-text {
    color: var(--app-text-muted);
    font-size: 0.78rem;
}

.input-group .btn {
    border-color: rgba(0,0,0,0.12);
}

.form-check-input:checked {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
}

/* =============================================
   Dropdown menus
   ============================================= */
.dropdown-menu {
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-md);
    padding: 0.3rem;
    font-size: 0.875rem;
    background-color: var(--app-surface);
}

.dropdown-item {
    border-radius: var(--app-radius-sm);
    padding: 0.45rem 0.75rem;
    color: var(--app-text);
    font-size: 0.875rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--app-surface-raised);
    color: var(--app-text);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--app-accent-subtle);
    color: var(--app-accent-text);
}

.dropdown-divider {
    border-color: var(--app-border-subtle);
    margin: 0.3rem 0;
}

/* =============================================
   Tables
   ============================================= */
.table {
    font-size: 0.875rem;
    color: var(--app-text);
}

.table > :not(caption) > * > * {
    border-color: var(--app-border-subtle);
    padding: 0.65rem 0.75rem;
}

.table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-text-muted);
    border-bottom-color: var(--app-border);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--app-surface-raised);
}

/* =============================================
   Breadcrumbs
   ============================================= */
.breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--app-text-secondary);
    text-decoration: none;
}

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

.breadcrumb-item.active {
    color: var(--app-text);
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--app-text-muted);
}

/* =============================================
   Nav tabs
   ============================================= */
.nav-tabs {
    border-bottom: 1px solid var(--app-border);
    gap: 0.1rem;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0;
    color: var(--app-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    transition: color 0.15s, background-color 0.15s;
}

.nav-tabs .nav-link:hover {
    color: var(--app-text);
    background-color: var(--app-surface-raised);
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--app-accent-text);
    background-color: transparent;
    border-bottom: 2px solid var(--app-accent);
    font-weight: 600;
}

.dmarc-label {
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: .25rem;
}

.dmarc-record {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: .5rem .625rem;
    font-family: var(--bs-font-monospace);
    font-size: .8125rem;
    word-break: break-all;
}

.dmarc-tag-added {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
    border-radius: .2rem;
    padding: 0 .15rem;
}

.dmarc-tag-removed {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger-text-emphasis);
    text-decoration: line-through;
}

.dmarc-source-detail > td {
    background: var(--bs-tertiary-bg);
}

.dmarc-auth-table {
    font-size: .8125rem;
    --bs-table-bg: transparent;
}

.dmarc-fix-note {
    white-space: pre-line;
}

.dmarc-fix-date {
    min-width: 5.5rem;
}

/* DMARC source table: give the hint room on a phone instead of a leftover sliver. */
@media (max-width: 575.98px) {
    .dmarc-source-table .dmarc-cause {
        min-width: 18rem;
    }

    /* Keep the expanded SPF/DKIM detail on screen while the wide row scrolls. */
    .dmarc-auth-detail {
        position: sticky;
        left: 0;
        width: calc(100vw - 6rem);
    }

    .dmarc-auth-table > :not(caption) > * > * {
        padding: .25rem .2rem;
    }
}

/* =============================================
   Nav pills
   ============================================= */
.nav-pills .nav-link {
    border-radius: var(--app-radius-sm);
    color: var(--app-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    transition: color 0.15s, background-color 0.15s;
}

.nav-pills .nav-link:hover {
    color: var(--app-text);
    background-color: var(--app-surface-raised);
}

.nav-pills .nav-link.active {
    background-color: var(--app-accent);
    color: var(--brand-dark);
    font-weight: 600;
}

/* =============================================
   Alerts
   ============================================= */
.alert {
    border-radius: var(--app-radius);
    font-size: 0.875rem;
}

/* =============================================
   Modals
   ============================================= */
.modal-content {
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow-md);
}

.modal-header {
    border-bottom-color: var(--app-border-subtle);
    padding: 1.1rem 1.25rem;
}

.modal-footer {
    border-top-color: var(--app-border-subtle);
    padding: 0.85rem 1.25rem;
}

/* =============================================
   Definition lists (detail page data rows)
   ============================================= */
dt {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--app-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

dd {
    font-size: 0.875rem;
    color: var(--app-text);
}

/* =============================================
   Utilities & overrides
   ============================================= */
.text-muted {
    color: var(--app-text-secondary) !important;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #16a34a;
}

.invalid {
    outline: 1px solid #dc2626;
}

.validation-message {
    color: #dc2626;
    font-size: 0.8rem;
}

.darker-border-checkbox.form-check-input {
    border-color: rgba(0,0,0,0.25);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--app-text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.dropdown-toggle-no-caret::after {
    display: none !important;
}

.table-fixed-100 {
    table-layout: fixed;
    width: 100%;
    word-wrap: anywhere;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* =============================================
   Mobile — prevent iOS auto-zoom on input focus
   iOS Safari zooms in when the focused input's computed font-size is
   below 16px. This app sets html/body font-size to 0.9375rem (15px),
   so 1rem = 15px here — still below the 16px threshold. We must use
   the absolute value 16px (with !important to beat Bootstrap and any
   component-scoped overrides) to guarantee the computed size is ≥ 16px
   on all mobile devices without disabling user pinch-to-zoom.
   ============================================= */
@media (max-width: 767.98px) {
    .form-control,
    .form-control-sm,
    .form-select,
    .form-select-sm,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    input:not([type]),
    textarea,
    select,
    div.milkdown .ProseMirror {
        font-size: 16px !important;
    }
}

/* =============================================
   Mobile — prevent double-tap zoom on interactive elements
   iOS Safari zooms on a double-tap unless touch-action: manipulation
   is set, which also removes the 300ms click delay. Scoped to mobile
   to avoid interfering with desktop pinch-zoom on touch trackpads.
   Set on html too, so double-tapping text (a long email, say) doesn't
   zoom either. Pinch-zoom still works.
   ============================================= */
@media (max-width: 767.98px) {
    html,
    a,
    button,
    [role="button"],
    .btn,
    label,
    input,
    select,
    textarea {
        touch-action: manipulation;
    }
}

/* =============================================
   Dashboard activity feed — shared between the
   Home dashboard and the /activity "View All" page.
   ============================================= */
.dash-icon-blue   { background: rgba(42, 120, 214, 0.12); color: #2a78d6; }
.dash-icon-green  { background: rgba(12, 163, 12, 0.12);  color: #0ca30c; }
.dash-icon-amber  { background: rgba(250, 178, 25, 0.16); color: #a86a00; }
.dash-icon-violet { background: rgba(74, 58, 167, 0.12);  color: #4a3aa7; }
.dash-icon-orange { background: rgba(235, 104, 52, 0.12); color: #eb6834; }
.dash-icon-pink   { background: rgba(232, 123, 164, 0.16); color: #c14c7c; }
.dash-icon-red    { background: rgba(208, 59, 59, 0.12);  color: #d03b3b; }

.dash-activity-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.055);
}

.dash-activity-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-activity-icon {
    width: 1.9rem;
    height: 1.9rem;
    min-width: 1.9rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.dash-activity-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1e;
    display: block;
}

/* Used across the app on flex children (text-truncate, long hostnames) but not a Bootstrap utility;
   without it a flex child can't shrink below its content and overflows its card. */
.min-w-0 {
    min-width: 0 !important;
}

.dash-activity-time {
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

/* =============================================
   Stat-tile cards and backup lists — shared between
   the Home dashboard and the Website Details overview tab.
   ============================================= */
.dash-stat-card {
    transition: box-shadow 0.15s, transform 0.1s;
}

.dash-stat-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08) !important;
    transform: translateY(-1px);
}

.dash-stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.dash-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1e;
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 0.78rem;
    color: #7a7a86;
    white-space: nowrap;
}

.dash-stat-sub {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.15rem;
}

.dash-backup-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.055);
}

.dash-backup-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-backup-host {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1e;
    display: block;
}

.dash-backup-list li .badge {
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
}

.dash-chart-fill {
    position: relative;
    flex: 1 1 auto;
    min-height: 180px;
}

.dash-chart-fill canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.dash-uptime-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
}

.dash-chart-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    background: #1a1a1e;
    color: #fff;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 10px));
    transition: opacity 0.1s ease;
    z-index: 1060;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    opacity: 0;
}

.dash-chart-tooltip-title {
    font-weight: 600;
}

/* =============================================
   Milkdown editor/viewer — blend into the surrounding card
   The nord theme paints its own off-white panel background and its own
   fonts (Inter body / Rubik headings) via custom properties (reset.css).
   Overriding them here — reusing the same tokens as the rest of the app
   rather than hardcoding — lets the editor/viewer pick up whatever
   background the embedding card actually has and keeps heading/body text
   looking like the same document instead of a visibly different font.
   ============================================= */
div.milkdown {
    --crepe-color-background: transparent;
    --crepe-font-default: var(--app-font-body);
    --crepe-font-title: var(--app-font-heading);
}

/* The top bar toolbar paints its own background from --crepe-color-surface
   (a separate variable, shared with floating popovers/code blocks that need
   to stand out from content — so it's overridden narrowly here rather than
   globally) instead of --crepe-color-background. Match it to the same
   transparent treatment so there's no visible seam above the content. */
div.milkdown div.milkdown-top-bar {
    background: transparent;
}

/* The nord theme pads the content area for a spacious full-page "document"
   feel (60px/120px) — way too much inside a card or a comment box, where it
   just wastes the available width. Shrink it to roughly match the app's own
   card padding (--bs-card-spacer, 1rem).

   Also scope horizontal overflow here: wide content (a table, an unwrapped
   code line, a long unbroken URL) has an intrinsic min-content width that
   can exceed this box. In normal flow that just paints past the edge rather
   than growing the box — which drags the whole page into horizontal scroll
   instead of staying contained. Scoping the scroll container to just the
   content area (not the whole editor) keeps the top bar in place and lets
   only the overflowing content scroll — applies to the read-only viewer too,
   since it shares this same structure. */
div.milkdown .ProseMirror {
    padding: 20px 16px;
    max-width: 100%;
    overflow-x: auto;
}

/* The editor (not the read-only viewer — it has BlockEdit disabled and no
   handle at all) needs its left side wider: the per-line drag-handle/"+"
   buttons float via floating-ui with placement "left" and a 16px offset from
   the block, and flip badly — off the edge of the card, not just to the
   other side — when there isn't room to render there. 66px handle width +
   16px offset + a little breathing room = 84px. */
.milkdown-host-editable div.milkdown .ProseMirror {
    padding-left: 84px;
}

/* Phones have no handles (see milkdown-editor.js), so no gutter for them. */
.milkdown-host-editable.milkdown-no-block-edit div.milkdown .ProseMirror {
    padding-left: 16px;
}

/* The nord theme has no border of its own (it's meant to blend into a page),
   which — combined with the transparent background above — leaves the
   editor with no visible boundary at all. It reads as plain text that blends
   into whatever sits below it (e.g. a Save/Cancel row). Give it a real
   field-like border, matching the app's .form-control convention. */
.milkdown-host-editable {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--app-radius-sm);
}

/* Milkdown highlight mark (==highlighted==) — editor and read-only viewer. */
div.milkdown mark,
div.milkdown mark.milkdown-highlight {
    background-color: #fff59d;
    color: inherit;
    padding: 0.05em 0.2em;
    border-radius: 0.15em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.dash-chart-tooltip-body {
    color: rgba(255, 255, 255, 0.85);
}

/* ---- Trial signup wizard (/signup, /signup/verify) ---- */
.signup-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
}

.signup-card {
    width: 100%;
    max-width: 460px;
    background-color: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-md);
    padding: 2.25rem 2rem;
}

.signup-title {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
}

.signup-sub {
    color: var(--app-text-secondary);
    margin-bottom: 1.5rem;
}

.signup-alt {
    margin-top: 1.25rem;
    margin-bottom: 0;
    text-align: center;
    color: var(--app-text-secondary);
}

.signup-code {
    letter-spacing: 0.5rem;
    font-size: 1.4rem;
    text-align: center;
    font-weight: 600;
}

.signup-resend {
    margin-top: 1rem;
    text-align: center;
}

/* ---- Trial countdown banner ---- */
.trial-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    background-color: var(--app-accent-subtle);
    border-bottom: 1px solid var(--app-accent-border);
    color: var(--app-text);
    font-size: 0.9rem;
}

.trial-banner--expired {
    background-color: rgba(220, 53, 69, 0.1);
    border-bottom-color: rgba(220, 53, 69, 0.3);
}

.trial-banner .trial-banner-icon {
    font-size: 1rem;
    color: var(--app-accent-text);
}

.trial-banner--expired .trial-banner-icon {
    color: #b02a37;
}

.trial-banner .trial-banner-text {
    flex: 1 1 auto;
}

.trial-banner strong {
    font-weight: 600;
}

/* =============================================
   Sidebar mobile nav toggle
   ---------------------------------------------
   The hamburger is a plain checkbox (#sidebar-nav-toggler) rendered by
   MainLayout, while the collapsible nav (.nav-scrollable) is rendered by
   NavMenu — a different CSS-isolation scope. This global rule bridges the two:
   when the checkbox is checked, reveal the nav. On desktop (>=641px) the nav is
   always shown via NavMenu.razor.css, so this only matters on small screens.
   ============================================= */
.sidebar:has(.navbar-toggler:checked) .nav-scrollable {
    display: block;
}

/* The phone tab bar's height (MainLayout.razor.css), for anything that has to sit clear of it. */
:root { --app-tabbar-height: 3.6rem; }

/* Phones with the tab bar: the menu opens as a sheet above it (More, or the menu button at the top), instead of
   pushing the page down. MainLayout.razor.css has the tab bar and the backdrop that closes it. */
@media (max-width: 640.98px) {
    .page:has(.app-tabbar) .sidebar:has(.navbar-toggler:checked) .nav-scrollable {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--app-tabbar-height) + env(safe-area-inset-bottom));
        z-index: 1029;
        max-height: 75vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0.75rem env(safe-area-inset-right) 0.5rem env(safe-area-inset-left);
        border-radius: 1rem 1rem 0 0;
        background: #0A121A;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
    }
}

/* =============================================
   Opened from the Home Screen
   The status bar is see-through there (apple-mobile-web-app-status-bar-style), so this strip in the brand colour
   sits behind it and the page never scrolls under the clock. iOS also tints the fade under the clock from the page's
   own background, so that's the brand colour here too (main keeps its light background, and the page is at least
   as tall as the screen, so it doesn't show anywhere else). No rubber-band bounce or pull-to-refresh: a reload
   would drop the connection to the server, and an installed app doesn't bounce.
   ============================================= */
@media (display-mode: standalone) {
    html, body {
        overscroll-behavior-y: none;
        background-color: #0A121A;
    }

    .page { min-height: 100dvh; }

    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        height: env(safe-area-inset-top);
        background: #0A121A;
        pointer-events: none;
    }
}

/* =============================================
   Segmented view switch (e.g. Plugins / Change history / Safe updates, Plugin / Host backups):
   a second-level switch inside a tab, so it doesn't read as another row of page tabs.
   ============================================= */
.view-switch {
    display: inline-flex;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 100px;
    background-color: rgba(0, 0, 0, 0.05);
    max-width: 100%;
    overflow-x: auto;
}

.view-switch-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.95rem;
    border: 0;
    border-radius: 100px;
    background: transparent;
    color: var(--app-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.view-switch-option:hover {
    color: var(--app-text);
}

.view-switch-option.active {
    background-color: #ffffff;
    color: var(--app-text);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

.view-switch-option:focus-visible {
    outline: 2px solid var(--app-accent);
    outline-offset: 1px;
}

@media (max-width: 767.98px) {
    .view-switch {
        display: flex;
    }

    .view-switch-option {
        flex: 1 1 0;
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ---------- List and details pages in the tickets pages' look (customers, services) ---------- */
.pg-hero {
    position: relative;
    /* Not hidden: a tab group's menu (website details) opens below the header. */
    border-radius: 1.1rem;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(42, 120, 214, 0.28) 0%, rgba(42, 120, 214, 0) 45%),
        radial-gradient(90% 120% at 0% 100%, rgba(108, 241, 39, 0.16) 0%, rgba(108, 241, 39, 0) 50%),
        var(--brand-dark, #1a1a1e);
    color: #f4f4f6;
    box-shadow: 0 10px 30px rgba(26, 26, 30, 0.18);
}

.pg-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 18px 18px;
    mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
    pointer-events: none;
}

.pg-hero-inner { position: relative; z-index: 1; padding: 1.4rem 2rem 1.5rem; }

.pg-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.55rem;
    margin-bottom: 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(244, 244, 246, 0.65);
}

.pg-kicker-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #6cf127; }
.pg-kicker-sep::before { content: '·'; margin-right: 0.55rem; color: rgba(244, 244, 246, 0.35); }
.pg-kicker a { color: rgba(244, 244, 246, 0.85); text-decoration: none; }
.pg-kicker a:hover { color: #ffffff; text-decoration: underline; }

.pg-headline {
    margin: 0 0 0.4rem;
    font-family: var(--app-font-heading);
    font-size: clamp(1.4rem, 1rem + 1.6vw, 2.1rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #ffffff;
    overflow-wrap: anywhere;
}

.pg-headline-accent { color: #6bb8ff; }
.pg-headline-muted { color: rgba(244, 244, 246, 0.5); }
.pg-sub { color: rgba(244, 244, 246, 0.7); }

/* Facts under a details page's headline, as one line of text: e.g. a service's status, price and next due date. */
.pg-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.55rem; margin-top: 0.1rem; font-size: 0.9rem; color: rgba(244, 244, 246, 0.7); }
.pg-hero-fact { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.pg-hero-fact + .pg-hero-fact::before { content: '·'; margin-right: 0.15rem; color: rgba(244, 244, 246, 0.35); }
.pg-hero-fact.is-status { color: var(--dot, #f4f4f6); font-weight: 600; }
.pg-hero-fact.is-late { color: #ff9a9d; font-weight: 600; }
.pg-hero-fact.is-soon { color: #ffc24d; font-weight: 600; }
.pg-hero-fact a { color: inherit; text-decoration: none; }
.pg-hero-fact a:hover { color: #ffffff; text-decoration: underline; }
.pg-hero-fact a + a { margin-left: 0.4rem; }

/* A details header with a picture on the right, e.g. a website's screenshot. */
.pg-hero-split { display: flex; align-items: flex-start; gap: 1.5rem; }
.pg-hero-main { flex: 1; min-width: 0; }
.pg-hero-tabs { margin-top: 1rem; }

.pg-hero-shot {
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 168px;
    height: 116px;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(244, 244, 246, 0.45);
    font-size: 1.5rem;
}

.pg-hero-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pg-hero-shot:hover { border-color: rgba(255, 255, 255, 0.35); }

.pg-hero .pg-hero-copy {
    --bs-btn-color: rgba(244, 244, 246, 0.6);
    --bs-btn-border-color: rgba(255, 255, 255, 0.18);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.12);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.3);
    --bs-btn-active-bg: rgba(255, 255, 255, 0.18);
    padding: 0.1rem 0.45rem;
    border-radius: 100px;
    font-size: 0.75rem;
    vertical-align: middle;
}

.pg-hero .pg-kicker-dot { background: var(--dot, #6cf127); }

/* The details page's sections, as the tickets list's queue chips. */
.pg-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

.pg-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem 0.3rem 0.6rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(244, 244, 246, 0.85);
    font-size: 0.82rem;
    transition: background 0.15s, transform 0.1s;
}

.pg-chip:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.pg-chip.is-active { background: #ffffff; border-color: #ffffff; color: var(--brand-dark, #1a1a1e); }
.pg-chip .bi { opacity: 0.75; }
.pg-chip-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-chip-count.is-alert { color: #6bb8ff; }
.pg-chip-count.is-zero { opacity: 0.5; }
.pg-chip.is-active .pg-chip-count.is-alert { color: #1f6fbf; }

/* The list */
.pg-list,
.pg-panel {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}

.pg-list { padding: 0.5rem; }

/* Panels can hold Bootstrap card parts (card-body, card-header, card-footer): give them the variables a .card would. */
.pg-panel {
    --bs-card-spacer-y: 0.85rem;
    --bs-card-spacer-x: 1.15rem;
    --bs-card-cap-padding-y: 0.75rem;
    --bs-card-cap-padding-x: 1.15rem;
    --bs-card-cap-bg: transparent;
    --bs-card-border-width: 1px;
    --bs-card-border-color: rgba(0, 0, 0, 0.06);
    --bs-card-inner-border-radius: 1rem;
}

/* Buttons in panels are pills. */
.pg-panel .btn:not(.btn-link),
.pg-form .btn:not(.btn-link) { border-radius: 100px; }

/* A button group reads as one pill: square inside, round at its two ends. Ends are counted among the buttons
   only, since a group can also hold its dropdown menu (split buttons) or radio inputs. */
.pg-panel .btn-group > .btn,
.pg-form .btn-group > .btn { border-radius: 0; }

.pg-panel .btn-group > .btn:nth-child(1 of .btn),
.pg-form .btn-group > .btn:nth-child(1 of .btn) { border-top-left-radius: 100px; border-bottom-left-radius: 100px; }

.pg-panel .btn-group > .btn:nth-last-child(1 of .btn),
.pg-form .btn-group > .btn:nth-last-child(1 of .btn) { border-top-right-radius: 100px; border-bottom-right-radius: 100px; }

/* A split button's arrow, with a faint divider from the main half. */
.pg-panel .btn-group > .dropdown-toggle-split,
.pg-form .btn-group > .dropdown-toggle-split { padding-left: 0.45rem; padding-right: 0.6rem; border-left-color: rgba(0, 0, 0, 0.14); }

/* Quiet buttons in panels share one look: blue and grey outlines read as the same dark outline. */
.pg-panel .btn-outline-primary,
.pg-panel .btn-outline-secondary:not(.btn-check + .btn) {
    --bs-btn-color: #3a3a42;
    --bs-btn-border-color: rgba(0, 0, 0, 0.16);
    --bs-btn-bg: #ffffff;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: var(--brand-dark, #1a1a1e);
    --bs-btn-hover-border-color: var(--brand-dark, #1a1a1e);
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: var(--brand-dark, #1a1a1e);
    --bs-btn-active-border-color: var(--brand-dark, #1a1a1e);
    --bs-btn-disabled-color: #8a8a94;
    --bs-btn-disabled-border-color: rgba(0, 0, 0, 0.1);
}

/* Radio choices (e.g. the plugin filters) as separate chips, the selected one dark. */
.pg-panel .btn-group:has(> .btn-check) { flex-wrap: wrap; gap: 0.35rem; }
.pg-panel .btn-group:has(> .btn-check) > .btn { margin-left: 0 !important; border-radius: 100px !important; }
.pg-panel .btn-check + .btn-outline-secondary { border-color: rgba(0, 0, 0, 0.12); background: #ffffff; color: #3a3a42; }
.pg-panel .btn-check + .btn-outline-secondary:hover { background: rgba(0, 0, 0, 0.04); color: #1a1a1e; }
.pg-panel .btn-check:checked + .btn-outline-secondary { border-color: var(--brand-dark, #1a1a1e); background: var(--brand-dark, #1a1a1e); color: #ffffff; }
.pg-panel .btn-check:disabled + .btn-outline-secondary { opacity: 0.45; }
.pg-panel .badge,
.pg-form .badge { border-radius: 100px; }


.pg-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
    padding: 0.75rem 0.85rem 0.6rem;
}

.pg-list-title { margin: 0; font-family: var(--app-font-heading); font-size: 1.15rem; font-weight: 700; }
.pg-list-count { font-size: 0.85rem; color: #6c6c76; }
.pg-list-footer { padding: 0.5rem; }

.pg-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.75rem;
    transition: background 0.15s;
}

.pg-row + .pg-row { margin-top: 2px; }
.pg-row:hover { background: rgba(0, 0, 0, 0.03); }

.pg-row-icon,
.pg-initials {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 0.7rem;
    background: #e7ecf3;
    color: #2d4a6b;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pg-row.is-waiting .pg-row-icon { background: rgba(42, 120, 214, 0.12); color: #1f6fbf; }

.pg-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }

.pg-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #1a1a1e;
    text-decoration: none;
}

.pg-row-name:hover { color: #1a1a1e; }

.pg-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.5rem; font-size: 0.8rem; color: #6c6c76; }
.pg-row-meta > span + span::before { content: '·'; margin-right: 0.5rem; color: #b5b5bd; }

.pg-row-side { flex-shrink: 0; display: flex; align-items: center; gap: 0.35rem; }

.pg-stat {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    min-width: 3.2rem;
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    color: #3a3a42;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pg-stat .bi { color: #8a8a94; font-size: 0.85rem; }
.pg-stat.is-zero { color: #b5b5bd; font-weight: 500; }
.pg-stat.is-zero .bi { color: #c9c9cf; }
.pg-stat.is-reply { background: rgba(42, 120, 214, 0.1); color: #1f6fbf; }
.pg-stat.is-reply .bi { color: #1f6fbf; }

/* Status colours for rows, pills and chip dots (services). */
.pg-tone-good  { --tone: #2f9e44; --tone-soft: rgba(47, 158, 68, 0.11);  --dot: #7ee2a0; }
.pg-tone-info  { --tone: #1f6fbf; --tone-soft: rgba(42, 120, 214, 0.1);  --dot: #6bb8ff; }
.pg-tone-warn  { --tone: #a85f00; --tone-soft: rgba(240, 140, 0, 0.13);  --dot: #ffc24d; }
.pg-tone-bad   { --tone: #c62a2f; --tone-soft: rgba(229, 72, 77, 0.12);  --dot: #ff7a7e; }
.pg-tone-muted { --tone: #6c6c76; --tone-soft: rgba(0, 0, 0, 0.06);      --dot: #a8a6a0; }

.pg-chip-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--dot, rgba(244, 244, 246, 0.6)); }
.pg-chip:disabled { opacity: 0.7; transform: none; }

.pg-row-icon.is-tone { background: var(--tone-soft); color: var(--tone); font-size: 1rem; }
/* A domain's favicon replaces the icon once it loads; a failed one is removed, leaving the icon. */
.pg-row-icon img { border-radius: 0.25rem; }
.pg-row-icon:has(img) .bi { display: none; }
.pg-row-icon:has(img) { background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.06); }
.pg-row-when.is-soon { color: #b86e00; font-weight: 600; }

/* A row's name with badges beside it, e.g. a website's staging and care plan badges. */
.pg-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.4rem; min-width: 0; }
.pg-row-title .badge { position: relative; z-index: 2; font-size: 0.68rem; border-radius: 100px; }
.pg-row-note { margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 100px; background: rgba(42, 120, 214, 0.1); color: #1f6fbf; font-size: 0.72rem; font-weight: 600; }

.pg-row.is-selected { background: rgba(42, 120, 214, 0.06); }

/* Above the row's link, so ticking doesn't open the row. */
.pg-row-check { position: relative; z-index: 2; flex-shrink: 0; margin: 0; }
.pg-list-header .pg-row-check { align-self: center; margin-right: 0.15rem; }

.pg-row-amount { display: inline-flex; flex-direction: column; align-items: flex-end; min-width: 5.5rem; font-size: 0.85rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pg-row-amount small { font-size: 0.72rem; font-weight: 400; color: #8a8a94; }
.pg-row-when { min-width: 6.5rem; text-align: right; font-size: 0.8rem; color: #6c6c76; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pg-row-when.is-late { color: #d6383d; font-weight: 600; }
.pg-muted-light { color: #a8a8b0; }

/* Above the row's link, so the menu still opens. */
.pg-row-menu { position: relative; z-index: 2; }

.pg-row-go {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #9a9aa4;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.pg-row:hover .pg-row-go { background: var(--brand-dark, #1a1a1e); color: #ffffff; transform: translateX(2px); }

.pg-skeleton { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1rem; }

.pg-skeleton-icon,
.pg-skeleton-lines span {
    background: linear-gradient(90deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.09) 50%, rgba(0,0,0,0.05) 100%);
    background-size: 200% 100%;
    animation: pg-shimmer 1.3s ease-in-out infinite;
}

.pg-skeleton-icon { width: 2.3rem; height: 2.3rem; border-radius: 0.7rem; flex-shrink: 0; }
.pg-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 0.45rem; }
.pg-skeleton-lines span { display: block; height: 0.7rem; border-radius: 4px; }
.pg-skeleton-lines span:first-child { width: 40%; }
.pg-skeleton-lines span:last-child { width: 20%; }

@keyframes pg-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.pg-empty { text-align: center; padding: 2.5rem 1rem; }

.pg-empty-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.6rem;
    border-radius: 50%;
    background: rgba(42, 120, 214, 0.1);
    color: #1f7fd1;
    font-size: 1.3rem;
}

.pg-empty-title { font-weight: 700; }
.pg-empty-sub { color: #6c6c76; font-size: 0.9rem; }

/* Details page panels */
.pg-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 1rem 1.15rem 0.25rem;
}

/* Some heads wrap their title and buttons in a row of their own: it spans the head. */
.pg-panel-head > .d-flex { flex: 1 1 auto; }
.pg-panel-head > p { flex-basis: 100%; }

.pg-panel-title {
    margin: 0 0 0.15rem;
    font-family: var(--app-font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1e;
}

.pg-panel-sub { margin: 0; font-size: 0.82rem; color: #6c6c76; }
.pg-panel-body { padding: 0.85rem 1.15rem 1.1rem; }
.pg-panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }

.pg-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: 0.05rem 0.5rem;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.06);
    color: #3a3a42;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* A form opened inside a panel, e.g. adding a contact. */
.pg-form { border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 0.85rem; background: #fafaf9; }

.pg-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 100px;
    background: #ffffff;
    color: #3a3a42;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pg-chip-btn:hover:not(:disabled) { background: var(--brand-dark, #1a1a1e); border-color: var(--brand-dark, #1a1a1e); color: #ffffff; }
.pg-chip-btn:disabled { opacity: 0.45; }

/* Tables inside panels: quiet headers, rounded hover. */
.pg-table { margin-bottom: 0; font-size: 0.9rem; }
.pg-table > thead > tr > th {
    padding-top: 0.35rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8a94;
    white-space: nowrap;
}
.pg-table > tbody > tr > td { border-bottom: 1px solid rgba(0, 0, 0, 0.04); }
.pg-table > tbody > tr:last-child > td { border-bottom: 0; }
.pg-table > tfoot > tr > td { border-top: 1px solid rgba(0, 0, 0, 0.08); border-bottom: 0; }
.pg-table a { color: #1a1a1e; font-weight: 500; text-decoration: none; }
.pg-table a:hover { text-decoration: underline; }
.pg-table .badge { border-radius: 100px; font-weight: 600; padding: 0.3em 0.65em; }

/* Key and value pairs, as the ticket page's details. */
.pg-props { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.45rem 0.75rem; margin: 0; font-size: 0.9rem; }
.pg-props dt { font-weight: 400; color: #6c6c76; }
.pg-props dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Ticket and contact rows in the details page */
.pg-ticket {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-radius: 0.7rem;
    color: inherit;
    text-decoration: none;
}

.pg-ticket + .pg-ticket { margin-top: 2px; }
.pg-ticket:hover { background: rgba(0, 0, 0, 0.03); color: inherit; }
.pg-ticket.is-closed { opacity: 0.6; }

.pg-ticket-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: var(--tone-soft);
    color: var(--tone);
    font-size: 0.9rem;
}

.pg-ticket-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pg-ticket-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: #1a1a1e; }
.pg-ticket-number { margin-right: 0.35rem; font-size: 0.8rem; color: #8a8a94; font-weight: 400; }
.pg-ticket-meta { font-size: 0.8rem; color: #6c6c76; }
.pg-ticket-side { flex-shrink: 0; display: flex; align-items: center; gap: 0.5rem; }

.pg-pill { padding: 0.15rem 0.55rem; border-radius: 100px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.pg-pill-status { background: var(--tone-soft); color: var(--tone); }

.pg-person { display: flex; align-items: center; gap: 0.6rem; }
.pg-person .pg-initials { width: 2rem; height: 2rem; border-radius: 50%; font-size: 0.72rem; }

@media (max-width: 767.98px) {
    .pg-hero-inner { padding: 1.2rem 1.25rem; }
    .pg-row { flex-wrap: wrap; gap: 0.5rem 0.75rem; }
    .pg-row-main { flex-basis: calc(100% - 3.2rem); }
    .pg-row-side { width: 100%; padding-left: 3.05rem; }
    .pg-row-amount { min-width: 0; flex-direction: row; align-items: baseline; gap: 0.3rem; }
    .pg-row-when { min-width: 0; }
    .pg-row-side .pg-pill-status { margin-left: auto; }
    .pg-row-menu { margin-left: auto; }
    .pg-row-go { display: none; }
    .pg-stat { min-width: 0; }
    .pg-ticket { flex-wrap: wrap; }
    .pg-ticket-side { width: 100%; padding-left: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pg-skeleton-icon, .pg-skeleton-lines span { animation: none; }
    .pg-row, .pg-chip, .pg-row-go, .pg-chip-btn { transition: none; }
}

/* The linked records control in a panel: its title matches the panel titles. */
.pg-panel .assignment-selector-slim-body > .fw-semibold:first-child {
    margin-bottom: 0.75rem !important;
    font-family: var(--app-font-heading);
    font-size: 1.05rem;
    font-weight: 700 !important;
}
