:root {
    --pm-bg: #e9eef5;
    --pm-surface: #ffffff;
    --pm-surface-soft: #f4f7fc;
    --pm-text: #0f172a;
    --pm-text-muted: #475569;
    --pm-border: #d7e0eb;
    --pm-border-strong: #c2cfde;
    --pm-primary: #2f4f7f;
    --pm-primary-strong: #223f6a;
    --pm-danger: #e53935;
    --pm-radius-sm: 8px;
    --pm-radius-md: 10px;
    --pm-radius-lg: 12px;
    --pm-shadow-sm: 0 3px 10px rgba(15, 23, 42, 0.06);
    --pm-shadow-md: 0 8px 22px rgba(15, 23, 42, 0.09);
    --pm-shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
}

body.ui-shell {
    background: var(--pm-bg);
    color: var(--pm-text);
    font-family: "Inter", "Segoe UI", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.45;
}

body.ui-shell .site-wrapper {
    max-width: 1720px;
    margin: 12px auto;
    padding: 0 12px 14px;
}

body.ui-shell .site-header {
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-lg);
    background: var(--pm-surface);
    box-shadow: var(--pm-shadow-sm);
    padding: 10px 16px 12px;
    margin-bottom: 12px;
}

body.ui-shell .site-body {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 0 !important;
}

body.ui-shell .site-sidebar {
    position: sticky;
    top: 10px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-lg);
    background: var(--pm-surface);
    box-shadow: var(--pm-shadow-sm);
    padding: 12px;
}

body.ui-shell .site-content {
    min-height: 72vh;
    border-radius: var(--pm-radius-lg);
}

body.ui-shell .header-tagline {
    display: none;
}

body.ui-shell .header-top,
body.ui-shell .topbar-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 0 !important;
}

body.ui-shell .header-logo,
body.ui-shell .topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

body.ui-shell .header-logo a,
body.ui-shell .topbar-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--pm-border);
    background: #fff;
}

body.ui-shell .header-logo img,
body.ui-shell .topbar-brand img {
    width: auto;
    max-width: 240px;
    height: 38px;
}

body.ui-shell .brand-logo-light {
    display: block !important;
}

body.ui-shell .brand-logo-dark {
    display: none !important;
}

body.ui-shell .server-time,
body.ui-shell .topbar-chip {
    font-size: 11px;
    color: #3d5a7d;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    border: 1px solid var(--pm-border);
    background: var(--pm-surface-soft);
    border-radius: 999px;
    padding: 6px 12px;
}

body.ui-shell .dev-mode-badge,
body.ui-shell .topbar-chip--danger {
    background: #fff4f4;
    border-color: #f4c9c9;
    color: #a11f1f;
}

body.ui-shell .header-ad,
body.ui-shell .topbar-adsurface {
    margin-left: auto;
}

body.ui-shell .topbar-nav-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--pm-border);
}

body.ui-shell .header-tagline {
    margin: 8px 0 !important;
    padding: 8px 0 !important;
}

body.ui-shell .header-cta {
    margin: 8px 0 0 !important;
}

body.ui-shell .header-stats {
    margin-top: 8px !important;
    padding: 8px 0 !important;
}

/* Public/member CTA strip hierarchy fix */
body.ui-shell.public-shell .header-cta,
body.ui-shell.member-shell .header-cta {
    margin: 6px 0 12px !important;
    padding: 8px 14px !important;
    border-radius: 10px !important;
    border: 1px solid #d4dfef !important;
    background: #f6f9fe !important;
    box-shadow: none !important;
}

body.ui-shell.public-shell .header-cta a,
body.ui-shell.member-shell .header-cta a {
    font-size: 14px !important;
    font-weight: 760 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.2 !important;
}

body.ui-shell.public-shell .header-cta a:first-child,
body.ui-shell.member-shell .header-cta a:first-child {
    color: #1f7a46 !important;
    font-size: 13px !important;
}

body.ui-shell.public-shell .header-cta .price-tag,
body.ui-shell.member-shell .header-cta .price-tag {
    font-size: 16px !important;
    color: #d83a36 !important;
    font-weight: 780 !important;
}

body.ui-shell .top-nav {
    width: 100%;
}

body.ui-shell .top-nav__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

body.ui-shell .top-nav__link,
body.ui-shell .top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 720;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #23486f !important;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.ui-shell .top-nav__link:hover,
body.ui-shell .top-nav a:hover {
    background: #edf3fb;
    border-color: #cad8e8;
}

body.ui-shell .top-nav__link.nav-current,
body.ui-shell .top-nav a.nav-current {
    background: #2f4f7f;
    color: #ffffff !important;
    border-color: #2f4f7f;
}

body.ui-shell .top-nav__link.nav-logout,
body.ui-shell .top-nav a.nav-logout {
    color: #a43a3a !important;
}

/* Public/member top nav contrast upgrade */
body.ui-shell.public-shell .top-nav,
body.ui-shell.member-shell .top-nav {
    margin-top: 12px;
    background: linear-gradient(180deg, #132c4b 0%, #0f2440 100%);
    border: 1px solid #23466e;
    border-radius: 11px;
    padding: 2px 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.ui-shell.public-shell .top-nav__list,
body.ui-shell.member-shell .top-nav__list {
    gap: 4px;
}

body.ui-shell.public-shell .top-nav__link,
body.ui-shell.public-shell .top-nav a,
body.ui-shell.member-shell .top-nav__link,
body.ui-shell.member-shell .top-nav a {
    min-height: 31px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0.08em;
    color: #d8e8ff !important;
}

body.ui-shell.public-shell .top-nav__link:hover,
body.ui-shell.public-shell .top-nav a:hover,
body.ui-shell.member-shell .top-nav__link:hover,
body.ui-shell.member-shell .top-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(189, 214, 246, 0.45);
    color: #ffffff !important;
}

body.ui-shell.public-shell .top-nav__link.nav-current,
body.ui-shell.public-shell .top-nav a.nav-current,
body.ui-shell.member-shell .top-nav__link.nav-current,
body.ui-shell.member-shell .top-nav a.nav-current {
    background: #3e6298;
    border-color: #4d76af;
    color: #ffffff !important;
}

body.ui-shell.public-shell .top-nav__link.nav-logout,
body.ui-shell.public-shell .top-nav a.nav-logout,
body.ui-shell.member-shell .top-nav__link.nav-logout,
body.ui-shell.member-shell .top-nav a.nav-logout {
    color: #ffb4b4 !important;
}

body.ui-shell.public-shell .top-nav__link.nav-logout:hover,
body.ui-shell.public-shell .top-nav a.nav-logout:hover,
body.ui-shell.member-shell .top-nav__link.nav-logout:hover,
body.ui-shell.member-shell .top-nav a.nav-logout:hover {
    background: rgba(229, 57, 53, 0.22);
    border-color: rgba(250, 160, 160, 0.42);
    color: #ffd4d4 !important;
}

body.ui-shell.public-shell .top-nav .theme-toggle,
body.ui-shell.member-shell .top-nav .theme-toggle {
    min-height: 30px;
    background: #edf3ff !important;
    border-color: #c3d3ea;
    color: #1f446d;
    box-shadow: none;
}

body.ui-shell.public-shell .top-nav .theme-toggle:hover,
body.ui-shell.member-shell .top-nav .theme-toggle:hover {
    background: #ffffff !important;
    border-color: #d2deee;
}

body.ui-shell.public-shell .top-nav .theme-toggle__label,
body.ui-shell.member-shell .top-nav .theme-toggle__label {
    color: #5e7898;
}

body.ui-shell.public-shell .top-nav .theme-toggle__value,
body.ui-shell.member-shell .top-nav .theme-toggle__value {
    color: #173a63;
}

body.ui-shell .mobile-nav-toggle,
body.ui-shell .theme-toggle,
body.ui-shell .mobile-sidebar-toggle {
    border: 1px solid var(--pm-border);
    background: #ffffff !important;
    color: #274d75;
    border-radius: 9px;
    min-height: 34px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: var(--pm-shadow-sm);
}

body.ui-shell .theme-toggle__label {
    color: #5f7998;
}

body.ui-shell .theme-toggle__value {
    color: #23486f;
}

body.ui-shell fieldset,
body.ui-shell .member-info-card,
body.ui-shell .admin-nav-shell {
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-md);
    background: #fff;
    box-shadow: none;
}

body.ui-shell .member-info-card {
    padding: 10px;
    margin-bottom: 10px;
}

body.ui-shell .member-info-card .info-row {
    font-size: 12px;
    color: #4d627f;
    padding: 8px 2px;
    border-bottom: 1px solid #edf2f8;
}

body.ui-shell .member-info-card .info-row:last-child {
    border-bottom: none;
}

body.ui-shell .member-info-card .info-row--smtp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body.ui-shell .member-info-card .smtp-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

body.ui-shell .member-info-card .smtp-title {
    font-size: 12px;
    font-weight: 750;
    color: #2a466b;
    line-height: 1.1;
}

body.ui-shell .member-info-card .smtp-sub {
    font-size: 10.5px;
    font-weight: 600;
    color: #7084a1;
    line-height: 1.15;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

body.ui-shell .member-info-card .smtp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-width: 78px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
}

body.ui-shell .member-info-card .smtp-badge--secure {
    background: #eefaf1;
    border-color: #88d5a4;
    color: #1f8a45;
    box-shadow: inset 0 0 0 1px rgba(31, 138, 69, 0.12);
}

body.ui-shell .member-info-card .smtp-badge--plain {
    background: #fff4e8;
    border-color: #f7c997;
    color: #a14c04;
}

body.ui-shell .sidebar-credit-link,
body.ui-shell .member-name-link {
    color: #254970 !important;
    font-weight: 700;
}

body.ui-shell .sidebar-nav,
body.ui-shell .adm-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

body.ui-shell .sidebar-nav a,
body.ui-shell .adm-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 660;
    color: #223e63 !important;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

body.ui-shell .sidebar-nav a:hover,
body.ui-shell .adm-nav a:hover {
    background: #edf3fb;
    border-color: #d1dceb;
}

body.ui-shell .sidebar-nav .nav-active,
body.ui-shell .adm-nav .nav-active {
    background: #2f4f7f;
    color: #fff !important;
    border-color: #2f4f7f;
}

body.ui-shell .sidebar-nav .nav-number {
    color: #6a809d;
    font-size: 10px;
}

body.ui-shell .sidebar-nav .nav-active .nav-number {
    color: #d5e6ff;
}

/* Member sidebar readability bump */
body.ui-shell.member-shell .sidebar-nav a {
    min-height: 38px;
    padding: 0 13px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

body.ui-shell.member-shell .sidebar-nav .nav-number {
    font-size: 11px;
    font-weight: 760;
}

body.ui-shell.member-shell .member-info-card .info-row {
    font-size: 13px;
}

body.ui-shell .adm-sec,
body.ui-shell .adm-subsec {
    margin: 12px 2px 5px;
    font-size: 10px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #5e7695;
    font-weight: 760;
}

body.ui-shell .adm-nav img {
    display: none;
}

body.ui-shell .admin-nav-intro,
body.ui-shell .sidebar-admin-entry {
    background: #f4f8ff;
    border: 1px solid #d9e5f5;
    border-radius: 10px;
    padding: 10px;
}

body.ui-shell .admin-nav-backlink {
    display: inline-flex;
    margin-bottom: 8px;
    color: #2a4f76;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

body.ui-shell .admin-nav-title {
    margin: 4px 0;
    font-size: 18px;
    color: #0f223d;
}

body.ui-shell .admin-nav-copy {
    color: #4d627f;
    font-size: 12px;
    line-height: 1.4;
}

body.ui-shell h1,
body.ui-shell h2,
body.ui-shell h3 {
    color: #0d1f38;
    letter-spacing: -0.015em;
}

body.ui-shell h1 {
    font-size: 30px;
    line-height: 1.1;
    margin: 0 0 8px;
}

body.ui-shell h2 {
    font-size: 21px;
    line-height: 1.15;
    margin: 0 0 8px;
}

body.ui-shell .card,
body.ui-shell .panel,
body.ui-shell .table-shell,
body.ui-shell .dashboard-card,
body.ui-shell .dashboard-kpi,
body.ui-shell .dashboard-hero,
body.ui-shell .dashboard-alert {
    background: var(--pm-surface) !important;
    border: 1px solid var(--pm-border) !important;
    border-radius: var(--pm-radius-lg) !important;
    box-shadow: var(--pm-shadow-md) !important;
}

body.ui-shell .card {
    padding: 16px 18px;
    margin-bottom: 12px;
}

body.ui-shell .card-title {
    margin: 0 0 12px;
    border-bottom: 1px solid #e4ecf5;
    padding-bottom: 8px;
    color: #1b3556;
    font-size: 15px;
    font-weight: 740;
}

body.ui-shell input[type="text"],
body.ui-shell input[type="password"],
body.ui-shell input[type="email"],
body.ui-shell input[type="number"],
body.ui-shell input[type="search"],
body.ui-shell input[type="url"],
body.ui-shell input[type="tel"],
body.ui-shell select,
body.ui-shell textarea {
    border: 1px solid #cdd8e6;
    border-radius: 8px;
    background: #fff;
    color: #102640;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
    min-height: 36px;
    padding: 7px 11px;
}

body.ui-shell textarea {
    min-height: 128px;
}

body.ui-shell input:focus,
body.ui-shell select:focus,
body.ui-shell textarea:focus {
    border-color: #2f4f7f !important;
    box-shadow: 0 0 0 3px rgba(47, 79, 127, 0.15) !important;
}

body.ui-shell label,
body.ui-shell .form-label {
    font-size: 12px;
    color: #334e6f;
    font-weight: 680;
    letter-spacing: 0.01em;
}

body.ui-shell .form-group {
    margin-bottom: 12px;
}

body.ui-shell .form-hint {
    color: #5a708d;
    font-size: 11px;
}

body.ui-shell .btn,
body.ui-shell .btn-primary,
body.ui-shell button,
body.ui-shell input[type="submit"],
body.ui-shell input[type="button"] {
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 760 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-height: 34px;
    border: 1px solid transparent !important;
}

body.ui-shell .btn-primary,
body.ui-shell input[type="submit"],
body.ui-shell input[type="button"] {
    background: #2f4f7f !important;
    color: #fff !important;
}

body.ui-shell .btn-primary:hover,
body.ui-shell input[type="submit"]:hover,
body.ui-shell input[type="button"]:hover {
    background: #223f6a !important;
}

body.ui-shell .btn-danger {
    background: #e53935 !important;
    color: #fff !important;
}

body.ui-shell table.data-table,
body.ui-shell .table-shell table,
body.ui-shell table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

/* TinyMCE toolbar fix: prevent global table width rule from stretching button groups */
body.ui-shell table.mceLayout {
    width: 100% !important;
}

body.ui-shell .mceEditor table,
body.ui-shell .mceToolbar table,
body.ui-shell .mceToolbar td,
body.ui-shell .mceListBox table,
body.ui-shell .mceListBox td,
body.ui-shell td.mceToolbar {
    width: auto !important;
}

body.ui-shell .mceToolbar td {
    padding: 0 !important;
    white-space: nowrap;
}

body.ui-shell .table-shell {
    padding: 0;
    overflow: hidden;
}

body.ui-shell .table-shell thead th,
body.ui-shell table.data-table th {
    background: #f1f6fd !important;
    color: #3a5475 !important;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid #d8e3f0;
    padding: 10px 12px;
}

body.ui-shell .table-shell td,
body.ui-shell table.data-table td {
    background: #fff;
    color: #102640;
    border-bottom: 1px solid #e8eff7;
    padding: 10px 12px;
    font-size: 13px;
}

body.ui-shell .table-shell tbody tr:hover td,
body.ui-shell table.data-table tbody tr:hover td {
    background: #f8fbff;
}

body.ui-shell .status-badge,
body.ui-shell .dashboard-badge {
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 760;
}

body.ui-shell .notice-box {
    margin-top: 12px;
    border: 1px solid #f0d9d7;
    background: #fff8f8;
    border-radius: 10px;
    padding: 12px 14px;
    color: #5f2f2f;
    font-size: 12px;
}

body.ui-shell .notice-title {
    color: #a72c2c;
}

body.ui-shell .site-footer {
    margin-top: 12px;
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius-lg);
    background: #fff;
    box-shadow: var(--pm-shadow-sm);
    padding: 12px 16px;
    text-align: left !important;
}

body.ui-shell .footer-nav {
    display: flex;
    justify-content: flex-start;
    margin: 0;
    flex-wrap: wrap;
    gap: 6px;
}

body.ui-shell .footer-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #d7e3f1;
    font-size: 11px;
    color: #2d4f77 !important;
    text-decoration: none;
    font-weight: 640;
}

body.ui-shell .footer-nav a:hover {
    background: #eef4fc;
}

body.ui-shell .footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 11px;
    color: #5f738d;
}

body.ui-shell .footer-copyright {
    margin-left: auto;
    text-align: right;
}

body.ui-shell .footer-crypto img {
    height: 18px !important;
    width: auto;
    opacity: 0.9;
}

body.ui-shell #bugReportBtn {
    position: fixed;
    right: 14px;
    bottom: 86px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #173a63 !important;
    background: linear-gradient(180deg, #132f53 0%, #0f2848 100%) !important;
    color: #d8e8ff !important;
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    box-shadow: 0 14px 30px rgba(9, 24, 46, 0.38) !important;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

body.ui-shell #bugReportBtn img {
    width: 14px;
    height: 14px;
    opacity: 0.95;
    filter: brightness(0) invert(1);
}

body.ui-shell #bugReportBtn:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #1a3d67 0%, #15365d 100%) !important;
    border-color: #2b578a !important;
    color: #ffffff !important;
    box-shadow: 0 18px 34px rgba(10, 29, 55, 0.44) !important;
}

@media (max-width: 900px) {
    body.ui-shell #bugReportBtn {
        right: 10px;
        bottom: 98px;
        min-height: 36px;
        padding: 0 12px;
        font-size: 10px;
    }
}

body.ui-shell #bugPopupOverlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

body.ui-shell #bugPopupContainer {
    position: relative;
    width: min(94vw, 740px);
    height: min(86vh, 720px);
    border-radius: 12px;
    border: 1px solid #cad8e8;
    overflow: hidden;
    box-shadow: var(--pm-shadow-lg);
    background: #fff;
}

body.ui-shell #bugPopupClose {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 28px;
    height: 28px;
    border: 1px solid #d2deed;
    border-radius: 999px;
    background: #fff;
    color: #223e63;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

body.ui-shell #bugPopupFrame {
    width: 100%;
    height: 100%;
    border: none;
}

body.ui-shell .page-shell {
    max-width: none;
    margin: 0;
    padding: 4px 0;
}

body.ui-shell .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 18px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffffff 0%, #f7fafe 100%);
    border: 1px solid #d6e1ef;
    box-shadow: var(--pm-shadow-md);
}

body.ui-shell .page-header h1 {
    margin: 0;
}

body.ui-shell .page-kicker {
    margin: 0 0 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #4d698a;
    font-weight: 780;
}

body.ui-shell .stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.ui-shell .stat-card {
    border: 1px solid #d6e1ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--pm-shadow-sm);
    padding: 11px;
}

body.ui-shell .stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5d7694;
    font-weight: 740;
}

body.ui-shell .stat-value {
    margin-top: 5px;
    font-size: 25px;
    line-height: 1;
    color: #102640;
    font-weight: 820;
}

body.ui-shell .stat-value a {
    color: #102640;
    text-decoration: none;
}

body.ui-shell .stat-value a:hover {
    color: #2f4f7f;
}

body.ui-shell .panel-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
}

body.ui-shell .col-3 { grid-column: span 3; }
body.ui-shell .col-4 { grid-column: span 4; }
body.ui-shell .col-5 { grid-column: span 5; }
body.ui-shell .col-6 { grid-column: span 6; }
body.ui-shell .col-7 { grid-column: span 7; }
body.ui-shell .col-8 { grid-column: span 8; }
body.ui-shell .col-12 { grid-column: span 12; }

body.ui-shell .stack-10 {
    display: grid;
    gap: 10px;
}

body.ui-shell .stack-12 {
    display: grid;
    gap: 12px;
}

body.ui-shell .stack-14 {
    display: grid;
    gap: 14px;
}

body.ui-shell .top-nav__spacer {
    margin-left: auto;
}

body.ui-shell .muted {
    color: #5a708d !important;
}

body.ui-shell .member-home {
    display: grid;
    gap: 12px;
}

body.ui-shell .home-actions-mini {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.ui-shell .member-status--ok { color: #15803d; }
body.ui-shell .member-status--warn { color: #b45309; }
body.ui-shell .member-status--danger { color: #b91c1c; }

body.ui-shell .reply-alert-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

body.ui-shell .reply-alert-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

body.ui-shell .reply-alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e7effb;
    color: #23486f;
    font-size: 20px;
}

body.ui-shell .reply-alert-title {
    font-size: 16px;
    color: #0f2743;
    font-weight: 770;
}

body.ui-shell .reply-alert-sub {
    color: #5f7896;
    font-size: 12px;
}

body.ui-shell .reply-alert-arrow {
    margin-left: auto;
    font-size: 22px;
    color: #355b88;
}

body.ui-shell .membership-progress-track {
    height: 12px;
    border-radius: 999px;
    background: #ebf0f7;
    overflow: hidden;
    margin-bottom: 10px;
}

body.ui-shell .membership-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.25s ease;
}

body.ui-shell .progress-fill--good { background: #15803d; }
body.ui-shell .progress-fill--warn { background: #d97706; }
body.ui-shell .progress-fill--danger { background: #dc2626; }

body.ui-shell .announcement-card {
    position: relative;
}

body.ui-shell .announcement-card--critical { border-left: 4px solid #e53935 !important; }
body.ui-shell .announcement-card--important { border-left: 4px solid #d97706 !important; }
body.ui-shell .announcement-card--normal { border-left: 4px solid #2f4f7f !important; }
body.ui-shell .announcement-card--read { opacity: 0.72; }

body.ui-shell .announcement-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

body.ui-shell .announcement-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

body.ui-shell .announcement-title {
    color: #0f2743;
}

body.ui-shell .announcement-date {
    font-size: 11px;
    color: #607894;
    white-space: nowrap;
}

body.ui-shell .announcement-chip {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    font-size: 9px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 760;
}

body.ui-shell .announcement-chip--pin {
    background: #fff3c6;
    color: #7b4a08;
}

body.ui-shell .announcement-chip--new {
    background: #e53935;
    color: #fff;
}

body.ui-shell .announcement-body {
    color: #1b3658;
    font-size: 13px;
    line-height: 1.55;
}

body.ui-shell .announcement-foot {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5edf7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

body.ui-shell .announcement-foot a {
    color: #24496f;
    font-size: 12px;
    font-weight: 700;
}

body.ui-shell .empty-panel {
    text-align: center;
    color: #647b97;
}

body.ui-shell .member-compose,
body.ui-shell .member-settings {
    display: grid;
    gap: 12px;
}

body.ui-shell .warning-card {
    background: #fff8ec !important;
    border-color: #f4dfb0 !important;
    color: #7a4d0a;
}

body.ui-shell .warning-card a {
    color: #2f4f7f;
    font-weight: 700;
}

body.ui-shell .compose-readonly {
    background: #f5f8fc !important;
    color: #445b77 !important;
}

body.ui-shell .editor-demo {
    border: 1px solid #d4dfec;
    border-radius: 10px;
    overflow: hidden;
}

body.ui-shell .editor-demo-toolbar {
    background: #f3f7fd;
    border-bottom: 1px solid #dee7f4;
    padding: 7px 10px;
    color: #587192;
    font-size: 11px;
    font-weight: 680;
}

body.ui-shell .editor-demo-body {
    min-height: 200px;
    padding: 14px;
    color: #7b8fa8;
    font-size: 13px;
}

body.ui-shell .blocked-group {
    opacity: 0.62;
    pointer-events: none;
}

body.ui-shell .att-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

body.ui-shell .option-row {
    border: 1px solid #d9e4f2;
    border-radius: 10px;
    background: #f8fbff;
    padding: 10px 12px;
}

body.ui-shell .option-row--info {
    border-color: #cfe0f6;
    background: #f3f8ff;
}

body.ui-shell .option-row--success {
    border-color: #d5ebdd;
    background: #f3fbf5;
}

body.ui-shell .option-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

body.ui-shell .option-row label input {
    width: 16px;
    height: 16px;
}

body.ui-shell .compose-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.ui-shell .settings-answer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.ui-shell .settings-answer-row input {
    flex: 1 1 auto;
}

body.ui-shell .account-meta-grid {
    row-gap: 12px;
}

body.ui-shell .account-meta-grid > div {
    border: 1px solid #dce6f3;
    border-radius: 9px;
    background: #f8fbff;
    padding: 9px 10px;
}

body.ui-shell .account-meta-grid .meta-value {
    margin-top: 5px;
    color: #123252;
    font-size: 13px;
    font-weight: 730;
    word-break: break-word;
}

body.ui-shell .admin-dashboard-shell {
    max-width: none;
    width: 100%;
}

/* Admin dashboard contrast + spacing hotfix */
body.ui-shell.admin-shell .admin-dashboard-shell .admin-dashboard {
    gap: 14px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero {
    background: linear-gradient(145deg, #0b1525 0%, #132746 45%, #1f3d67 100%) !important;
    border-color: #24364f !important;
    box-shadow: 0 22px 54px rgba(8, 15, 28, 0.24) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__eyebrow {
    color: rgba(255, 255, 255, 0.78) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__title {
    color: #ffffff !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__meta {
    color: rgba(235, 243, 255, 0.86) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__action {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.07) 100%) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__panel-label {
    color: rgba(255, 255, 255, 0.76) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__signal {
    background: rgba(6, 12, 23, 0.24) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__signal-label {
    color: rgba(255, 255, 255, 0.74) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__signal-value {
    color: #ffffff !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-grid {
    gap: 14px !important;
    grid-auto-flow: row dense;
    align-items: start;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-card,
body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-alert {
    margin: 0 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell #dashboardCards > [data-card-key="unread_tickets"] {
    order: -40;
    margin-top: 0 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell #dashboardCards > [data-card-key="db_health"] {
    order: -30;
}

/* Admin shell compactness + readability */
body.ui-shell.admin-shell .site-body {
    grid-template-columns: minmax(230px, 262px) minmax(0, 1fr) !important;
    gap: 12px !important;
    padding-top: 8px !important;
}

body.ui-shell.admin-shell .site-sidebar {
    padding: 8px !important;
}

body.ui-shell.admin-shell .admin-nav-shell {
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 12px !important;
    background: #f7fafe !important;
    border: 1px solid #d4dfed !important;
    box-shadow: none !important;
}

body.ui-shell.admin-shell .admin-nav-backlink {
    justify-content: center !important;
    min-height: 30px;
    padding: 0 10px !important;
    border-radius: 8px !important;
    border: 1px solid #b9cdea !important;
    background: #e8f0fb !important;
    color: #14385f !important;
    box-shadow: none !important;
    text-decoration: none;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em !important;
}

body.ui-shell.admin-shell .admin-nav-backlink:hover {
    background: #dbe9fb !important;
    color: #0f3358 !important;
}

body.ui-shell.admin-shell .admin-nav-intro {
    padding: 10px !important;
    border-radius: 10px !important;
    border: 1px solid #dbe6f4 !important;
    background: #f2f7ff !important;
}

body.ui-shell.admin-shell .admin-nav-title {
    font-size: 18px !important;
    color: #10213b !important;
}

body.ui-shell.admin-shell .admin-nav-copy {
    color: #48607e !important;
    font-size: 12px !important;
}

body.ui-shell.admin-shell .admin-nav-shell > .adm-nav:first-of-type,
body.ui-shell.admin-shell .admin-nav-shell .adm-sec + .adm-nav,
body.ui-shell.admin-shell .admin-nav-shell .adm-subsec + .adm-nav {
    padding: 4px !important;
    border-radius: 10px !important;
    border: none !important;
    background: transparent !important;
}

body.ui-shell.admin-shell .adm-sec,
body.ui-shell.admin-shell .adm-subsec {
    margin: 8px 2px 3px !important;
    color: #3f5f84 !important;
    font-weight: 800 !important;
}

body.ui-shell.admin-shell .adm-subsec {
    display: block;
    padding: 0 4px;
    border: none;
    background: transparent;
    color: #4d6b8f !important;
    letter-spacing: 0.08em !important;
    margin: 10px 2px 4px !important;
}

body.ui-shell.admin-shell .adm-subsec::before {
    content: none;
}

body.ui-shell.admin-shell .adm-subsec + .adm-nav {
    padding-left: 0 !important;
}

body.ui-shell.admin-shell .adm-subsec + .adm-nav li a {
    padding-left: 9px !important;
}

body.ui-shell.admin-shell .adm-subsec + .adm-nav li a::before {
    content: none;
}

body.ui-shell.admin-shell .adm-subsec + .adm-nav li a.nav-active::before {
    content: none;
}

body.ui-shell.admin-shell .adm-nav li + li {
    margin-top: 2px !important;
}

body.ui-shell.admin-shell .adm-nav li a {
    min-height: 30px;
    padding: 0 9px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 670 !important;
    color: #203d62 !important;
    border: 1px solid transparent !important;
}

body.ui-shell.admin-shell .adm-nav li a:hover {
    transform: none !important;
    background: #eaf2fb !important;
    border-color: #d1deed !important;
}

body.ui-shell.admin-shell .adm-nav li a.nav-active {
    background: #2f4f7f !important;
    border-color: #2f4f7f !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.ui-shell.admin-shell .adm-nav li a img {
    display: none !important;
}

body.ui-shell.admin-shell .topbar-shell--admin {
    padding: 12px 14px !important;
    gap: 10px !important;
}

body.ui-shell.admin-shell .topbar-main {
    gap: 10px !important;
}

body.ui-shell.admin-shell .topbar-brand-title {
    font-size: 22px !important;
}

body.ui-shell.admin-shell .topbar-brand-subtitle {
    font-size: 12px !important;
    line-height: 1.45 !important;
    max-width: 52ch;
}

body.ui-shell.admin-shell .topbar-nav-row {
    margin-top: 14px !important;
    padding-top: 12px !important;
}

body.ui-shell.admin-shell .top-nav__list {
    gap: 14px !important;
}

body.ui-shell.admin-shell .top-nav__link {
    padding: 7px 0 !important;
    font-size: 11px !important;
    letter-spacing: 0.1em !important;
}

/* Final compact topbar overrides (non-sticky + tighter nav) */
body.ui-shell.admin-shell .site-header {
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    padding: 8px 12px 10px !important;
    border-radius: 12px !important;
}

body.ui-shell.admin-shell .topbar-shell--admin {
    padding: 8px 12px 4px !important;
    gap: 14px !important;
}

body.ui-shell.admin-shell .topbar-main {
    gap: 8px !important;
}

body.ui-shell.admin-shell .topbar-brand {
    gap: 10px !important;
}

body.ui-shell.admin-shell .topbar-logo-link {
    min-height: 42px !important;
    padding: 5px 8px !important;
    border-radius: 10px !important;
}

body.ui-shell.admin-shell .topbar-brand img {
    height: 30px !important;
    max-width: 192px !important;
}

body.ui-shell.admin-shell .topbar-brand-title {
    font-size: 18px !important;
    line-height: 1.08 !important;
}

body.ui-shell.admin-shell .topbar-brand-subtitle {
    font-size: 11px !important;
    line-height: 1.35 !important;
    max-width: 44ch !important;
}

body.ui-shell.admin-shell .topbar-chip {
    padding: 5px 10px !important;
    font-size: 10px !important;
}

body.ui-shell.admin-shell .theme-toggle,
body.ui-shell.admin-shell .mobile-nav-toggle {
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 10px !important;
}

body.ui-shell.admin-shell .topbar-nav-row {
    margin-top: 12px !important;
    padding-top: 10px !important;
    gap: 10px !important;
}

body.ui-shell.admin-shell .top-nav.top-nav--admin ul,
body.ui-shell.admin-shell .top-nav__list {
    gap: 10px !important;
    margin: 0 !important;
    padding: 3px 8px !important;
    background: #e8eff8 !important;
    border: 1px solid #cedbea !important;
    border-radius: 11px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75) !important;
}

body.ui-shell.admin-shell .top-nav.top-nav--admin a,
body.ui-shell.admin-shell .top-nav__link {
    min-height: 28px !important;
    padding: 0 9px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #1d3b61 !important;
    font-size: 10px !important;
    font-weight: 790 !important;
    letter-spacing: 0.11em !important;
}

body.ui-shell.admin-shell .top-nav.top-nav--admin a.nav-current,
body.ui-shell.admin-shell .top-nav__link.nav-current {
    background: #1f3f68 !important;
    border-color: #1f3f68 !important;
    color: #ffffff !important;
}

body.ui-shell.admin-shell .top-nav.top-nav--admin a.nav-logout,
body.ui-shell.admin-shell .top-nav__link.nav-logout {
    color: #9d3440 !important;
}

body.ui-shell.admin-shell .top-nav__link::after {
    display: none !important;
}

body.ui-shell.admin-shell .admin-nav-backlink {
    border-color: #142f53 !important;
    background: #142f53 !important;
    color: #ffffff !important;
}

body.ui-shell.admin-shell .admin-nav-backlink:hover {
    background: #1b3d68 !important;
    color: #ffffff !important;
}

/* Dashboard card distribution + support queue horizontal layout */
body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-grid {
    gap: 12px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell #dashboardCards > [data-card-key] {
    grid-column: auto !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell #dashboardCards > .dashboard-card--full,
body.ui-shell.admin-shell .admin-dashboard-shell #dashboardCards > .dashboard-alert.dashboard-card--full {
    grid-column: 1 / -1 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell #dashboardCards > [data-card-key="support_tickets"] {
    grid-column: 1 / -1 !important;
    order: -20;
}

body.ui-shell.admin-shell .admin-dashboard-shell #dashboardCards > [data-card-key="unread_tickets"] {
    grid-column: 1 / -1 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-card__title {
    color: #0f2743 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-card__summary {
    color: #3d5573 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
    scrollbar-width: auto;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 33%);
    gap: 10px;
    align-items: center;
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    border: 1px solid #d4deec !important;
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-item--unread {
    background: #fffaf2 !important;
    border-color: #f6d37a !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-id {
    color: #3f5fc0 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-name {
    color: #0f2743 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-email {
    color: #4a6380 !important;
    word-break: break-word;
}

body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-preview {
    color: #334d6b !important;
    margin-top: 0 !important;
    word-break: break-word;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-card__summary,
body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-mini-stat__label,
body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-progress-label,
body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-progress-count {
    color: #425c7b !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-card__title {
    color: #10213b !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-card,
body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-alert {
    border-color: #d4dfed !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

/* Dashboard compact tuning */
body.ui-shell.admin-shell .admin-dashboard-shell .admin-dashboard {
    gap: 10px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero {
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.86fr) !important;
    gap: 14px !important;
    padding: 20px 22px !important;
    border-radius: 18px !important;
    box-shadow: 0 14px 34px rgba(8, 15, 28, 0.2) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__title {
    max-width: 16ch !important;
    font-size: 40px !important;
    line-height: 1.03 !important;
    margin-bottom: 8px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__meta {
    margin-top: 8px !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    max-width: 64ch !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__actions {
    margin-top: 12px !important;
    gap: 8px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__action {
    min-height: 34px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    letter-spacing: 0.03em !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__panel {
    padding: 14px !important;
    border-radius: 16px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__panel-label {
    font-size: 10px !important;
    letter-spacing: 0.12em !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__signal-grid {
    gap: 8px !important;
    margin-top: 10px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__signal {
    padding: 10px 12px !important;
    border-radius: 14px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__signal-label {
    font-size: 10px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-hero__signal-value {
    margin-top: 4px !important;
    font-size: 30px !important;
    line-height: 1 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi-grid {
    gap: 12px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi {
    padding: 14px 16px !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 24px rgba(148, 163, 184, 0.16) !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi__top {
    margin-bottom: 10px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi__eyebrow {
    font-size: 10px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi__spark {
    width: 34px !important;
    height: 34px !important;
    border-radius: 11px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi__value {
    font-size: 42px !important;
    line-height: 0.95 !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi__label {
    margin-top: 8px !important;
    font-size: 15px !important;
}

body.ui-shell.admin-shell .admin-dashboard-shell .dashboard-kpi__meta {
    margin-top: 3px !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
}

@media (max-width: 1180px) {
    body.ui-shell .site-body {
        grid-template-columns: 1fr;
    }

    body.ui-shell .site-sidebar {
        position: static;
    }

    body.ui-shell .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-item {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 900px) {
    body.ui-shell .site-wrapper {
        margin: 6px auto;
        padding: 0 7px 10px;
    }

    body.ui-shell .site-header,
    body.ui-shell .site-sidebar,
    body.ui-shell .site-footer {
        border-radius: 10px;
    }

    body.ui-shell .site-footer {
        padding: 10px 12px;
    }

    body.ui-shell .footer-copyright {
        margin-left: 0;
        text-align: left;
    }

    body.ui-shell .top-nav__list {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-top: 8px;
    }

    body.ui-shell .top-nav__list.active {
        display: flex;
    }

    body.ui-shell .top-nav__link,
    body.ui-shell .top-nav a {
        width: 100%;
        justify-content: flex-start;
    }

    body.ui-shell .panel-grid > * {
        grid-column: span 12 !important;
    }

    body.ui-shell.admin-shell .site-body {
        grid-template-columns: 1fr !important;
    }

    body.ui-shell.admin-shell .topbar-shell--admin {
        padding: 10px !important;
    }

    body.ui-shell.admin-shell .topbar-brand-title {
        font-size: 18px !important;
    }

    body.ui-shell.admin-shell .admin-dashboard-shell [data-card-key="support_tickets"] .dashboard-ticket-item {
        grid-template-columns: 1fr !important;
        min-width: 0;
        max-width: none;
    }
}

[data-theme="dark"] body.ui-shell,
[data-theme="dark"] body.ui-shell .site-wrapper {
    background: #0b1220;
}

[data-theme="dark"] body.ui-shell {
    color: #dbe5f3;
}

[data-theme="dark"] body.ui-shell .site-header,
[data-theme="dark"] body.ui-shell .site-sidebar,
[data-theme="dark"] body.ui-shell .site-footer,
[data-theme="dark"] body.ui-shell .card,
[data-theme="dark"] body.ui-shell .table-shell,
[data-theme="dark"] body.ui-shell fieldset,
[data-theme="dark"] body.ui-shell .member-info-card,
[data-theme="dark"] body.ui-shell .dashboard-card,
[data-theme="dark"] body.ui-shell .dashboard-kpi,
[data-theme="dark"] body.ui-shell .dashboard-hero {
    background: #101a2c !important;
    border-color: #22324a !important;
    color: #dbe5f3;
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.4) !important;
}

[data-theme="dark"] body.ui-shell .page-header,
[data-theme="dark"] body.ui-shell .stat-card {
    background: #101a2c;
    border-color: #22324a;
}

[data-theme="dark"] body.ui-shell h1,
[data-theme="dark"] body.ui-shell h2,
[data-theme="dark"] body.ui-shell h3,
[data-theme="dark"] body.ui-shell .card-title {
    color: #e6edf9;
}

[data-theme="dark"] body.ui-shell .muted,
[data-theme="dark"] body.ui-shell .form-hint,
[data-theme="dark"] body.ui-shell .stat-label,
[data-theme="dark"] body.ui-shell .server-time,
[data-theme="dark"] body.ui-shell .topbar-chip {
    color: #9eb0c9 !important;
}

[data-theme="dark"] body.ui-shell .top-nav__link,
[data-theme="dark"] body.ui-shell .top-nav a,
[data-theme="dark"] body.ui-shell .sidebar-nav a,
[data-theme="dark"] body.ui-shell .adm-nav a {
    color: #b8c8df !important;
}

[data-theme="dark"] body.ui-shell .top-nav__link.nav-current,
[data-theme="dark"] body.ui-shell .top-nav a.nav-current,
[data-theme="dark"] body.ui-shell .sidebar-nav .nav-active,
[data-theme="dark"] body.ui-shell .adm-nav .nav-active {
    background: #355b8f;
    border-color: #355b8f;
    color: #f7fbff !important;
}

[data-theme="dark"] body.ui-shell input[type="text"],
[data-theme="dark"] body.ui-shell input[type="password"],
[data-theme="dark"] body.ui-shell input[type="email"],
[data-theme="dark"] body.ui-shell input[type="number"],
[data-theme="dark"] body.ui-shell input[type="search"],
[data-theme="dark"] body.ui-shell input[type="url"],
[data-theme="dark"] body.ui-shell input[type="tel"],
[data-theme="dark"] body.ui-shell select,
[data-theme="dark"] body.ui-shell textarea {
    background: #0f1726;
    border-color: #2b3b53;
    color: #e8effa;
}

[data-theme="dark"] body.ui-shell .table-shell thead th,
[data-theme="dark"] body.ui-shell table.data-table th {
    background: #172339 !important;
    border-color: #263651;
    color: #aec0d7 !important;
}

[data-theme="dark"] body.ui-shell .table-shell td,
[data-theme="dark"] body.ui-shell table.data-table td {
    background: #101a2c;
    border-color: #1d2b42;
    color: #dbe5f3;
}

/* -----------------------------------------------------------------------
   Dark mode readability hardening (site-wide)
   Keeps contrast strong even when page-level custom styles use light theme colors.
------------------------------------------------------------------------ */
[data-theme="dark"] body.ui-shell {
    --pm-dark-bg: #0b1423;
    --pm-dark-surface: #111f34;
    --pm-dark-surface-elev: #172942;
    --pm-dark-border: #2a3f5d;
    --pm-dark-text: #edf4ff;
    --pm-dark-text-soft: #ccdaec;
    --pm-dark-text-muted: #9cb0cc;
    --pm-dark-link: #9dc3ff;
}

[data-theme="dark"] body.ui-shell,
[data-theme="dark"] body.ui-shell .site-wrapper {
    background: var(--pm-dark-bg) !important;
    color: var(--pm-dark-text-soft) !important;
}

[data-theme="dark"] body.ui-shell .site-header,
[data-theme="dark"] body.ui-shell .site-sidebar,
[data-theme="dark"] body.ui-shell .site-footer,
[data-theme="dark"] body.ui-shell .card,
[data-theme="dark"] body.ui-shell .panel,
[data-theme="dark"] body.ui-shell .table-shell,
[data-theme="dark"] body.ui-shell fieldset,
[data-theme="dark"] body.ui-shell .member-info-card,
[data-theme="dark"] body.ui-shell .dashboard-card,
[data-theme="dark"] body.ui-shell .dashboard-kpi,
[data-theme="dark"] body.ui-shell .dashboard-alert,
[data-theme="dark"] body.ui-shell .stat-card,
[data-theme="dark"] body.ui-shell .page-header {
    background: var(--pm-dark-surface) !important;
    border-color: var(--pm-dark-border) !important;
    box-shadow: 0 14px 32px rgba(2, 8, 20, 0.48) !important;
}

[data-theme="dark"] body.ui-shell .site-content h1,
[data-theme="dark"] body.ui-shell .site-content h2,
[data-theme="dark"] body.ui-shell .site-content h3,
[data-theme="dark"] body.ui-shell .site-content h4,
[data-theme="dark"] body.ui-shell .site-content h5,
[data-theme="dark"] body.ui-shell .site-content h6,
[data-theme="dark"] body.ui-shell .site-content .card-title,
[data-theme="dark"] body.ui-shell .site-content .form-title,
[data-theme="dark"] body.ui-shell .site-content .section-title,
[data-theme="dark"] body.ui-shell .site-content .dashboard-card__title,
[data-theme="dark"] body.ui-shell .site-content .dashboard-kpi__label,
[data-theme="dark"] body.ui-shell .site-content .dashboard-kpi__value,
[data-theme="dark"] body.ui-shell .site-content .dashboard-mini-stat__value,
[data-theme="dark"] body.ui-shell .site-content .stat-value {
    color: var(--pm-dark-text) !important;
}

[data-theme="dark"] body.ui-shell .site-content p,
[data-theme="dark"] body.ui-shell .site-content li,
[data-theme="dark"] body.ui-shell .site-content td,
[data-theme="dark"] body.ui-shell .site-content th,
[data-theme="dark"] body.ui-shell .site-content small,
[data-theme="dark"] body.ui-shell .site-content label,
[data-theme="dark"] body.ui-shell .site-content legend,
[data-theme="dark"] body.ui-shell .site-content .muted,
[data-theme="dark"] body.ui-shell .site-content .form-hint,
[data-theme="dark"] body.ui-shell .site-content .dashboard-card__summary,
[data-theme="dark"] body.ui-shell .site-content .dashboard-ticket-email,
[data-theme="dark"] body.ui-shell .site-content .dashboard-ticket-preview,
[data-theme="dark"] body.ui-shell .site-content .dashboard-progress-label,
[data-theme="dark"] body.ui-shell .site-content .dashboard-progress-count,
[data-theme="dark"] body.ui-shell .site-content .table-help,
[data-theme="dark"] body.ui-shell .site-content .note,
[data-theme="dark"] body.ui-shell .site-content .helptext,
[data-theme="dark"] body.ui-shell .site-content .subtitle,
[data-theme="dark"] body.ui-shell .site-content [class$="-text"],
[data-theme="dark"] body.ui-shell .site-content [class$="-desc"],
[data-theme="dark"] body.ui-shell .site-content [class$="-copy"],
[data-theme="dark"] body.ui-shell .site-content [class$="-subtitle"],
[data-theme="dark"] body.ui-shell .site-content [class$="-summary"],
[data-theme="dark"] body.ui-shell .site-content [class$="-meta"],
[data-theme="dark"] body.ui-shell .site-content [class$="-hint"] {
    color: var(--pm-dark-text-soft) !important;
}

[data-theme="dark"] body.ui-shell .site-sidebar,
[data-theme="dark"] body.ui-shell .site-sidebar p,
[data-theme="dark"] body.ui-shell .site-sidebar label,
[data-theme="dark"] body.ui-shell .site-sidebar .form-label,
[data-theme="dark"] body.ui-shell .site-sidebar .member-info-card .info-row,
[data-theme="dark"] body.ui-shell .site-sidebar .admin-nav-copy,
[data-theme="dark"] body.ui-shell .site-sidebar .sidebar-credit,
[data-theme="dark"] body.ui-shell .site-sidebar .sidebar-credit-link {
    color: #cbd9eb !important;
}

[data-theme="dark"] body.ui-shell .site-sidebar .adm-sec,
[data-theme="dark"] body.ui-shell .site-sidebar .adm-subsec,
[data-theme="dark"] body.ui-shell .site-sidebar .sidebar-nav .nav-number {
    color: var(--pm-dark-text-muted) !important;
}

[data-theme="dark"] body.ui-shell .site-sidebar .member-info-card .smtp-title {
    color: #d5e5fb !important;
}

[data-theme="dark"] body.ui-shell .site-sidebar .member-info-card .smtp-sub {
    color: #97b2d4 !important;
}

[data-theme="dark"] body.ui-shell .site-sidebar .member-info-card .smtp-badge--secure {
    background: rgba(22, 163, 74, 0.26) !important;
    border-color: rgba(74, 222, 128, 0.62) !important;
    color: #8cffbc !important;
    box-shadow: inset 0 0 0 1px rgba(140, 255, 188, 0.2);
}

[data-theme="dark"] body.ui-shell .site-sidebar .member-info-card .smtp-badge--plain {
    background: rgba(217, 119, 6, 0.28) !important;
    border-color: rgba(251, 191, 36, 0.45) !important;
    color: #ffd48d !important;
}

[data-theme="dark"] body.ui-shell.admin-shell .adm-subsec {
    background: transparent !important;
    border-color: transparent !important;
    color: #9ab6d8 !important;
}

[data-theme="dark"] body.ui-shell.admin-shell .adm-subsec::before {
    content: none;
}

[data-theme="dark"] body.ui-shell.admin-shell .adm-subsec + .adm-nav li a::before {
    content: none;
}

[data-theme="dark"] body.ui-shell.admin-shell .adm-subsec + .adm-nav li a.nav-active::before {
    content: none;
}

[data-theme="dark"] body.ui-shell .site-content a,
[data-theme="dark"] body.ui-shell .site-footer a,
[data-theme="dark"] body.ui-shell .site-sidebar a:not(.nav-active):not(.admin-nav-backlink):not(.btn):not(.btn-primary) {
    color: var(--pm-dark-link) !important;
}

[data-theme="dark"] body.ui-shell .site-content a:hover,
[data-theme="dark"] body.ui-shell .site-footer a:hover,
[data-theme="dark"] body.ui-shell .site-sidebar a:hover {
    color: #c2dbff !important;
}

[data-theme="dark"] body.ui-shell .top-nav,
[data-theme="dark"] body.ui-shell .top-nav.top-nav--admin ul,
[data-theme="dark"] body.ui-shell .top-nav__list {
    background: linear-gradient(180deg, #112745 0%, #0d1f39 100%) !important;
    border-color: #2f4d75 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
}

[data-theme="dark"] body.ui-shell .top-nav__link,
[data-theme="dark"] body.ui-shell .top-nav a {
    color: #d9e8ff !important;
    opacity: 1 !important;
}

[data-theme="dark"] body.ui-shell .top-nav__link:hover,
[data-theme="dark"] body.ui-shell .top-nav a:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.13) !important;
    border-color: rgba(180, 207, 242, 0.44) !important;
}

[data-theme="dark"] body.ui-shell .top-nav__link.nav-current,
[data-theme="dark"] body.ui-shell .top-nav a.nav-current {
    background: #406aa3 !important;
    border-color: #4e7ab6 !important;
    color: #ffffff !important;
}

[data-theme="dark"] body.ui-shell .top-nav__link.nav-logout,
[data-theme="dark"] body.ui-shell .top-nav a.nav-logout {
    color: #ffb8b8 !important;
}

[data-theme="dark"] body.ui-shell .theme-toggle,
[data-theme="dark"] body.ui-shell .mobile-nav-toggle,
[data-theme="dark"] body.ui-shell .mobile-sidebar-toggle {
    background: #223754 !important;
    border-color: #3d5c84 !important;
    color: #e3efff !important;
    box-shadow: none !important;
}

[data-theme="dark"] body.ui-shell .theme-toggle__label {
    color: #b7cbed !important;
}

[data-theme="dark"] body.ui-shell .theme-toggle__value {
    color: #ffffff !important;
}

[data-theme="dark"] body.ui-shell input[type="text"],
[data-theme="dark"] body.ui-shell input[type="password"],
[data-theme="dark"] body.ui-shell input[type="email"],
[data-theme="dark"] body.ui-shell input[type="number"],
[data-theme="dark"] body.ui-shell input[type="search"],
[data-theme="dark"] body.ui-shell input[type="url"],
[data-theme="dark"] body.ui-shell input[type="tel"],
[data-theme="dark"] body.ui-shell select,
[data-theme="dark"] body.ui-shell textarea {
    background: #0f1b2f !important;
    border-color: #2f4666 !important;
    color: #e8f1ff !important;
}

[data-theme="dark"] body.ui-shell input::placeholder,
[data-theme="dark"] body.ui-shell textarea::placeholder {
    color: #96abc8 !important;
    opacity: 1 !important;
}

[data-theme="dark"] body.ui-shell .table-shell thead th,
[data-theme="dark"] body.ui-shell table.data-table th {
    background: #182b44 !important;
    border-color: #2e476a !important;
    color: #d4e4f8 !important;
}

[data-theme="dark"] body.ui-shell .table-shell td,
[data-theme="dark"] body.ui-shell table.data-table td {
    background: #121f34 !important;
    border-color: #23354f !important;
    color: #d3e1f3 !important;
}

[data-theme="dark"] body.ui-shell .table-shell tbody tr:nth-child(even) td,
[data-theme="dark"] body.ui-shell table.data-table tbody tr:nth-child(even) td {
    background: #15253d !important;
}

[data-theme="dark"] body.ui-shell .table-shell tbody tr:hover td,
[data-theme="dark"] body.ui-shell table.data-table tbody tr:hover td {
    background: #1a2d49 !important;
}

[data-theme="dark"] body.ui-shell .btn,
[data-theme="dark"] body.ui-shell button,
[data-theme="dark"] body.ui-shell input[type="submit"],
[data-theme="dark"] body.ui-shell input[type="button"] {
    color: #f3f8ff !important;
}

[data-theme="dark"] body.ui-shell .notice-box,
[data-theme="dark"] body.ui-shell .msg-box,
[data-theme="dark"] body.ui-shell .empty-state,
[data-theme="dark"] body.ui-shell .dashboard-note {
    background: var(--pm-dark-surface-elev) !important;
    border-color: #355174 !important;
    color: #d4e2f4 !important;
}

/* Page-specific readability fixes for rebuilt screens */
[data-theme="dark"] body.ui-shell .how-main-title,
[data-theme="dark"] body.ui-shell .how-section-title,
[data-theme="dark"] body.ui-shell .membership-title,
[data-theme="dark"] body.ui-shell .membership-section-title,
[data-theme="dark"] body.ui-shell .demo-title,
[data-theme="dark"] body.ui-shell .demo-side-title {
    color: #f0f6ff !important;
}

[data-theme="dark"] body.ui-shell .how-list li,
[data-theme="dark"] body.ui-shell .how-section-text,
[data-theme="dark"] body.ui-shell .membership-subtitle,
[data-theme="dark"] body.ui-shell .membership-item p,
[data-theme="dark"] body.ui-shell .membership-terms,
[data-theme="dark"] body.ui-shell .membership-term,
[data-theme="dark"] body.ui-shell .demo-desc,
[data-theme="dark"] body.ui-shell .demo-side-text,
[data-theme="dark"] body.ui-shell .free-send-shell .free-opt-note,
[data-theme="dark"] body.ui-shell .free-send-shell .smtp-slot,
[data-theme="dark"] body.ui-shell .captcha-subtitle,
[data-theme="dark"] body.ui-shell .captcha-status-item .label {
    color: #cbd9eb !important;
}

[data-theme="dark"] body.ui-shell .how-step,
[data-theme="dark"] body.ui-shell .membership-term--highlight {
    color: #ff9ea0 !important;
}

[data-theme="dark"] body.ui-shell .membership-item,
[data-theme="dark"] body.ui-shell .demo-credentials,
[data-theme="dark"] body.ui-shell .membership-alert,
[data-theme="dark"] body.ui-shell .membership-warning-box,
[data-theme="dark"] body.ui-shell .free-send-shell .free-sender-hint,
[data-theme="dark"] body.ui-shell .captcha-page .captcha-saved {
    background: #182940 !important;
    border-color: #355477 !important;
    color: #dbe8fa !important;
}

/* Dark theme hardening for member pages */
[data-theme="dark"] body.ui-shell .header-logo a,
[data-theme="dark"] body.ui-shell .topbar-logo-link {
    background: #15253d !important;
    border-color: #2d4567 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] body.ui-shell .brand-logo-light {
    display: none !important;
}

[data-theme="dark"] body.ui-shell .brand-logo-dark {
    display: block !important;
}

[data-theme="dark"] body.ui-shell .account-meta-grid > div {
    background: #172a44 !important;
    border-color: #2f4668 !important;
}

[data-theme="dark"] body.ui-shell .account-meta-grid .meta-value {
    color: #ecf4ff !important;
}

[data-theme="dark"] body.ui-shell .compose-readonly {
    background: #14233a !important;
    border-color: #2d4466 !important;
    color: #d6e5fa !important;
}

/* Admin Tools submenu hierarchy (indent + clearer subsection) */
body.ui-shell.admin-shell .adm-subsec {
    position: relative;
    margin: 11px 2px 5px !important;
    padding: 0 4px 0 12px !important;
    letter-spacing: 0.1em !important;
    color: #5b7698 !important;
}

body.ui-shell.admin-shell .adm-subsec::before {
    content: "" !important;
    position: absolute;
    left: 2px;
    top: 3px;
    bottom: 3px;
    width: 2px;
    border-radius: 2px;
    background: #9cb5d3;
}

body.ui-shell.admin-shell .adm-subsec + .adm-nav {
    padding-left: 12px !important;
    margin-left: 4px;
    border-left: 1px dashed #cfdded;
}

body.ui-shell.admin-shell .adm-subsec + .adm-nav li a {
    padding-left: 12px !important;
}

[data-theme="dark"] body.ui-shell.admin-shell .adm-subsec {
    color: #abc3e1 !important;
}

[data-theme="dark"] body.ui-shell.admin-shell .adm-subsec::before {
    content: "" !important;
    background: #4b678d;
}

[data-theme="dark"] body.ui-shell.admin-shell .adm-subsec + .adm-nav {
    border-left: 1px dashed #355476;
}

/* Membership status cards: force same vertical alignment */
body.ui-shell .membership-status-wrap {
    align-items: stretch !important;
}

body.ui-shell .membership-status-wrap .membership-status-card {
    min-height: 52px !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box;
}

body.ui-shell .membership-status-card--smtp {
    gap: 10px !important;
}

body.ui-shell .membership-status-card--smtp .smtp-label {
    font-weight: 720;
}

body.ui-shell .membership-status-card--smtp .smtp-id-badge {
    min-width: 50px;
    height: 32px;
    padding: 0 13px;
    margin: 0 4px 0 2px;
    border-radius: 10px;
    border: 1px solid #88d5a4;
    background: #eefaf1;
    color: #1f8a45;
    box-shadow: inset 0 0 0 1px rgba(31, 138, 69, 0.1);
    line-height: 1;
    justify-content: center;
}

body.ui-shell .membership-status-card--smtp .smtp-host {
    font-weight: 700;
    letter-spacing: 0.01em;
}

[data-theme="dark"] body.ui-shell .membership-status-card--smtp .smtp-id-badge {
    border-color: rgba(74, 222, 128, 0.62);
    background: rgba(22, 163, 74, 0.26);
    color: #8cffbc;
    box-shadow: inset 0 0 0 1px rgba(140, 255, 188, 0.18);
}
