/* ==========================================================================
   CrownCity Client - design layer
   --------------------------------------------------------------------------
   Loaded after vendor.css (Bootstrap 5.3) and huraga.css.

   Design language: near-monochrome surfaces, hairline borders, tight radii,
   dense precise type, minimal elevation. Blue is retained as the single accent
   (links, active state, focus) while primary actions are near-black, which is
   what makes the UI read as a product rather than a Bootstrap demo.

   No build step: hand-authored CSS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
    /* Accent: the instance's existing blue, used sparingly. */
    --cc-accent: #0d6efd;
    --cc-accent-rgb: 13, 110, 253;
    --cc-accent-quiet: #eef4ff;

    /* Surfaces - light */
    --cc-bg: #fafafa;
    --cc-surface: #ffffff;
    --cc-surface-2: #fafafa;
    --cc-surface-3: #f2f2f2;
    --cc-border: #eaeaea;
    --cc-border-strong: #d6d6d6;

    /* Text - light */
    --cc-text: #0a0a0a;
    --cc-text-muted: #666666;
    --cc-text-subtle: #8f8f8f;

    /* Primary action = near-black in light mode */
    --cc-action-bg: #0a0a0a;
    --cc-action-bg-hover: #000000;
    --cc-action-fg: #ffffff;
    --cc-action-border: #0a0a0a;

    /* Radii - tight, not bubbly */
    --cc-r-xs: 4px;
    --cc-r-sm: 5px;
    --cc-r: 6px;
    --cc-r-md: 8px;
    --cc-r-lg: 10px;

    /* Elevation: borders do the work; shadows only for floating layers */
    --cc-shadow-pop: 0 1px 1px rgba(0, 0, 0, 0.02), 0 8px 16px -4px rgba(0, 0, 0, 0.08);
    --cc-shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.18);

    --cc-ring: 0 0 0 3px rgba(var(--cc-accent-rgb), 0.24);
    --cc-topbar-h: 56px;
    --cc-sidebar-w: 232px;

    --cc-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --cc-ease: cubic-bezier(0.2, 0, 0, 1);
    --cc-dur: 140ms;
}

[data-bs-theme="dark"] {
    --cc-accent: #4d94ff;
    --cc-accent-rgb: 77, 148, 255;
    --cc-accent-quiet: #0d1a2b;

    --cc-bg: #000000;
    --cc-surface: #0a0a0a;
    --cc-surface-2: #0f0f0f;
    --cc-surface-3: #1a1a1a;
    --cc-border: #1f1f1f;
    --cc-border-strong: #333333;

    --cc-text: #ededed;
    --cc-text-muted: #a1a1a1;
    --cc-text-subtle: #737373;

    --cc-action-bg: #ededed;
    --cc-action-bg-hover: #ffffff;
    --cc-action-fg: #0a0a0a;
    --cc-action-border: #ededed;

    --cc-shadow-pop: 0 1px 1px rgba(0, 0, 0, 0.4), 0 8px 16px -4px rgba(0, 0, 0, 0.6);
    --cc-shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.8);
}

/* --------------------------------------------------------------------------
   2. Base and typography
   -------------------------------------------------------------------------- */

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--cc-bg);
    color: var(--cc-text);
    /* Product-density type: 14px body with a 1.5 rhythm. */
    font-size: 0.875rem;
    line-height: 1.5;
    letter-spacing: -0.006em;
}

h1, h2, h3, h4, h5, h6,
.cc-page-title,
.cc-error-title,
.cc-error-code,
.cc-stat-value {
    color: var(--cc-text);
    font-weight: 600;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

p,
.cc-note-body,
.cc-alert-body,
.cc-footer-signature {
    text-wrap: pretty;
}

a {
    color: var(--cc-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

small,
.small {
    font-size: 0.8125rem;
}

/* Numbers that change in place must not reflow their column. */
.table td,
.table th,
.page-link,
.badge,
.cc-stat-value,
.cc-balance-value,
.cc-pricing-value,
.currency,
.amount,
dd,
td.text-end,
td.text-center {
    font-variant-numeric: tabular-nums;
}

/* Micro-labels: uppercase, wide tracking, mono for machine-ish data. */
.cc-eyebrow,
.cc-nav-label,
.cc-stat-label,
.cc-balance-label,
.table > thead > tr > th {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cc-text-subtle);
}

.cc-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: 0.625rem 1rem;
    background: var(--cc-text);
    color: var(--cc-bg);
    border-radius: 0 0 var(--cc-r) 0;
    font-weight: 500;
}

.cc-skip-link:focus {
    left: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.page-link:focus-visible,
.form-check-input:focus-visible,
.dropdown-item:focus-visible,
.accordion-button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--cc-accent);
    outline-offset: 1px;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   3. Topbar
   -------------------------------------------------------------------------- */

.cc-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: var(--cc-surface);
    border-bottom: 1px solid var(--cc-border);
}

.cc-topbar-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--cc-topbar-h);
}

.cc-topbar .navbar-brand {
    margin-right: auto;
    min-height: auto;
}

.cc-topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    margin-left: auto;
}

.cc-topbar-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.375rem 0.625rem;
    border-radius: var(--cc-r);
    color: var(--cc-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition-property: color, background-color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.cc-topbar-link:hover {
    color: var(--cc-text);
    background-color: var(--cc-surface-3);
    text-decoration: none;
}

.cc-topbar-link.active {
    color: var(--cc-text);
    background-color: var(--cc-surface-3);
}

.cc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 40x40 minimum hit area. */
    min-width: 40px;
    min-height: 40px;
    padding: 0.375rem;
    border: 0;
    border-radius: var(--cc-r);
    background: transparent;
    color: var(--cc-text-muted);
    cursor: pointer;
    transition-property: color, background-color, transform;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.cc-icon-btn:hover {
    color: var(--cc-text);
    background-color: var(--cc-surface-3);
}

.cc-icon-btn:active {
    transform: scale(0.96);
}

.cc-icon-btn .icon {
    width: 18px;
    height: 18px;
}

.cc-account-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    padding: 0.25rem 0.625rem;
    border: 0;
    border-radius: var(--cc-r);
    background: transparent;
    color: var(--cc-text);
    font-size: 0.8125rem;
    font-weight: 500;
    transition-property: background-color, transform;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.cc-account-toggle:hover,
.cc-account-toggle[aria-expanded="true"] {
    background-color: var(--cc-surface-3);
}

.cc-account-toggle:active {
    transform: scale(0.96);
}

.cc-account-name {
    max-width: 22ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-account .dropdown-menu {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    box-shadow: var(--cc-shadow-pop);
    padding: 0.25rem;
    min-width: 11rem;
    font-size: 0.8125rem;
}

.cc-account .dropdown-item {
    border-radius: var(--cc-r-xs);
    padding: 0.4375rem 0.625rem;
}

.cc-account .dropdown-item:hover {
    background-color: var(--cc-surface-3);
}

.cc-brand img,
.cc-logo {
    height: 28px;
    width: auto;
}

/* The CrownCity Host logo is stacked (mark over wordmark), so it needs more height than a
   one-line wordmark to stay legible. */
.cc-brand img.cc-logo-crowncity,
.cc-logo.cc-logo-crowncity {
    height: 48px;
}

.cc-logo.cc-logo-login.cc-logo-crowncity {
    height: 112px;
}

.cc-logo-text {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--cc-text);
}

/* --------------------------------------------------------------------------
   4. Shell: sidebar and mobile drawer
   -------------------------------------------------------------------------- */

.cc-body {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
}

/* Flat nav rather than a card: a hairline column reads as an app shell.
   The rule lives on the grid column, not on the sticky nav element - the column
   stretches to the row height, so the hairline runs the full page instead of
   stopping where the nav items end. */
.cc-col-nav {
    border-right: 1px solid var(--cc-border);
}

.cc-sidebar {
    position: sticky;
    top: calc(var(--cc-topbar-h) + 1.5rem);
    padding-right: 1rem;
}

.cc-nav {
    gap: 1px;
}

.cc-nav-label {
    padding: 1.125rem 0.5rem 0.375rem;
}

.cc-nav-label:first-child {
    padding-top: 0;
}

.cc-nav-item {
    display: block;
}

.cc-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 34px;
    padding: 0.3125rem 0.5rem;
    border-radius: var(--cc-r);
    color: var(--cc-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition-property: color, background-color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.cc-nav-link:hover {
    color: var(--cc-text) !important;
    background-color: var(--cc-surface-3);
    text-decoration: none;
}

.cc-nav-link.active {
    color: var(--cc-text) !important;
    background-color: var(--cc-surface-3);
    font-weight: 500;
}

.cc-nav-link .icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.cc-balance,
.cc-note {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--cc-border);
}

.cc-balance-label,
.cc-note-title {
    display: block;
    margin-bottom: 0.125rem;
}

.cc-balance-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--cc-text);
}

.cc-note-body {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--cc-text-muted);
}

.cc-drawer {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    height: 100%;
    width: min(86vw, var(--cc-sidebar-w) + 40px);
    display: flex;
    flex-direction: column;
    background-color: var(--cc-surface);
    border-right: 1px solid var(--cc-border);
    box-shadow: var(--cc-shadow-pop);
    transform: translateX(-102%);
    visibility: hidden;
    transition-property: transform, visibility;
    transition-duration: 200ms;
    transition-timing-function: var(--cc-ease);
}

.cc-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.cc-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: var(--cc-topbar-h);
    padding: 0 0.5rem 0 1rem;
    border-bottom: 1px solid var(--cc-border);
}

.cc-drawer-title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cc-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem 1rem 2rem;
    -webkit-overflow-scrolling: touch;
}

.cc-drawer-body .cc-sidebar {
    position: static;
    padding-right: 0;
    border-right: 0;
}

.cc-drawer-actions {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--cc-border);
}

.cc-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1045;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition-property: opacity;
    transition-duration: 180ms;
    transition-timing-function: var(--cc-ease);
}

.cc-drawer-backdrop.is-open {
    opacity: 1;
}

body.cc-drawer-lock {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   5. Page header and breadcrumbs
   -------------------------------------------------------------------------- */

.cc-page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.cc-page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    gap: 0;
}

.breadcrumb-item {
    color: var(--cc-text-subtle);
}

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

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

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

.breadcrumb .dropdown-divider {
    display: none;
}

.breadcrumb > li:not(.breadcrumb-item) + li:not(.breadcrumb-item)::before {
    content: "/";
    margin: 0 0.5rem;
    color: var(--cc-border-strong);
}

/* --------------------------------------------------------------------------
   6. Surfaces
   -------------------------------------------------------------------------- */

.card {
    background-color: var(--cc-surface);
    border: 1px solid var(--cc-border);
    /* Outer radius = inner radius + padding, so nested controls stay concentric. */
    border-radius: var(--cc-r-md);
    box-shadow: none;
    overflow: clip;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--cc-border);
    padding: 0.875rem 1rem;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.dashboard .card-header h6,
.mod_client .card-header h6 {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--cc-text);
}

.card-body {
    padding: 1rem;
}

.card-body.p-1 {
    padding: 0.25rem !important;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--cc-border);
    padding: 0.875rem 1rem;
    font-size: 0.8125rem;
}

.list-group-item {
    border-color: var(--cc-border);
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
}

.list-group-item + .list-group-item {
    border-top: 1px solid var(--cc-border);
}

a.list-group-item {
    color: var(--cc-text);
    text-decoration: none;
    transition-property: background-color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

a.list-group-item:hover {
    background-color: var(--cc-surface-2);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   7. Tables - hairline rows, no grid
   -------------------------------------------------------------------------- */

.table {
    --bs-table-border-color: var(--cc-border);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    margin-bottom: 0;
    font-size: 0.8125rem;
}

/* Neutralise the theme's .table-bordered / .table-striped grid. */
.table-bordered,
.table-bordered > :not(caption) > * > * {
    border-width: 0 0 1px 0;
    border-color: var(--cc-border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: transparent;
    background-color: transparent;
    color: inherit;
}

.table > :not(caption) > * > * {
    border-bottom-width: 1px;
    border-color: var(--cc-border);
    box-shadow: none;
}

.table > thead > tr > th {
    background-color: transparent;
    border-bottom: 1px solid var(--cc-border);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    font-weight: 500;
}

.table > tbody > tr > td,
.table > tbody > tr > th {
    padding: 0.75rem;
    vertical-align: middle;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: transparent;
    background-color: var(--cc-surface-2);
}

.table-sm > :not(caption) > * > * {
    padding: 0.4375rem 0.625rem;
}

.table-responsive {
    border-radius: var(--cc-r-md);
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--cc-text);
    margin-bottom: 0.3125rem;
}

.form-control,
.form-select {
    min-height: 36px;
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    border-radius: var(--cc-r);
    border-color: var(--cc-border-strong);
    background-color: var(--cc-surface);
    color: var(--cc-text);
    transition-property: border-color, box-shadow, background-color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.form-control-sm,
.form-select-sm {
    min-height: 30px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: var(--cc-r-sm);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--cc-text);
    box-shadow: var(--cc-ring);
    background-color: var(--cc-surface);
}

.form-control::placeholder {
    color: var(--cc-text-subtle);
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.1875rem;
    border-color: var(--cc-border-strong);
}

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

.form-check-label {
    font-size: 0.8125rem;
}

.form-text,
.form-control ~ .text-muted,
.text-muted {
    color: var(--cc-text-subtle) !important;
    font-size: 0.8125rem;
}

.text-secondary {
    color: var(--cc-text-muted) !important;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group > label,
.controls > label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.3125rem;
}

/* --------------------------------------------------------------------------
   9. Buttons
   -------------------------------------------------------------------------- */

.btn {
    --bs-btn-border-radius: var(--cc-r);
    border-radius: var(--cc-r);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.006em;
    min-height: 34px;
    padding: 0.375rem 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    transition-property: transform, background-color, border-color, color, box-shadow;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.btn-sm {
    min-height: 30px;
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--cc-r-sm);
}

.btn-lg,
.btn-big {
    min-height: 40px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--cc-r);
}

.btn:active:not(:disabled),
.btn:not(:disabled):active {
    transform: scale(0.96);
}

/* Primary action: near-black (light) / near-white (dark). */
.btn-primary {
    --bs-btn-bg: var(--cc-action-bg);
    --bs-btn-border-color: var(--cc-action-border);
    --bs-btn-color: var(--cc-action-fg);
    --bs-btn-hover-bg: var(--cc-action-bg-hover);
    --bs-btn-hover-border-color: var(--cc-action-bg-hover);
    --bs-btn-hover-color: var(--cc-action-fg);
    --bs-btn-active-bg: var(--cc-action-bg);
    --bs-btn-active-border-color: var(--cc-action-border);
    --bs-btn-active-color: var(--cc-action-fg);
    --bs-btn-focus-shadow-rgb: 0, 0, 0;
}

.btn-dark {
    --bs-btn-bg: var(--cc-action-bg);
    --bs-btn-border-color: var(--cc-action-border);
    --bs-btn-color: var(--cc-action-fg);
    --bs-btn-hover-bg: var(--cc-action-bg-hover);
    --bs-btn-hover-border-color: var(--cc-action-bg-hover);
    --bs-btn-hover-color: var(--cc-action-fg);
}

.btn-outline-primary {
    --bs-btn-color: var(--cc-accent);
    --bs-btn-border-color: var(--cc-border-strong);
    --bs-btn-hover-bg: var(--cc-surface-3);
    --bs-btn-hover-color: var(--cc-text);
    --bs-btn-hover-border-color: var(--cc-border-strong);
    --bs-btn-active-bg: var(--cc-surface-3);
    --bs-btn-active-color: var(--cc-text);
}

.btn-outline-secondary,
.btn-outline-info {
    --bs-btn-color: var(--cc-text-muted);
    --bs-btn-border-color: var(--cc-border-strong);
    --bs-btn-hover-bg: var(--cc-surface-3);
    --bs-btn-hover-color: var(--cc-text);
    --bs-btn-hover-border-color: var(--cc-border-strong);
    --bs-btn-active-bg: var(--cc-surface-3);
    --bs-btn-active-color: var(--cc-text);
}

.btn-success {
    --bs-btn-bg: var(--cc-action-bg);
    --bs-btn-border-color: var(--cc-action-border);
    --bs-btn-color: var(--cc-action-fg);
    --bs-btn-hover-bg: var(--cc-action-bg-hover);
    --bs-btn-hover-border-color: var(--cc-action-bg-hover);
    --bs-btn-hover-color: var(--cc-action-fg);
}

.btn-check:checked + .btn,
.btn-check:active + .btn {
    box-shadow: var(--cc-ring);
}

/* --------------------------------------------------------------------------
   10. Alerts, badges, toasts
   -------------------------------------------------------------------------- */

.alert,
.cc-alert {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--cc-r-md);
    border: 1px solid var(--cc-border);
    background-color: var(--cc-surface);
    color: var(--cc-text);
    font-size: 0.8125rem;
    box-shadow: none;
}

.alert-success { border-color: #b7e0c4; background-color: #f2fbf5; }
.alert-danger  { border-color: #f0bdc0; background-color: #fef5f5; }
.alert-warning { border-color: #eddaa8; background-color: #fffbf0; }
.alert-info    { border-color: #c7d9f7; background-color: #f5f9ff; }

[data-bs-theme="dark"] .alert-success { border-color: #1c3d2a; background-color: #0b1a11; --bs-alert-color: #7fd0a2; }
[data-bs-theme="dark"] .alert-danger  { border-color: #4a1f22; background-color: #1a0d0e; --bs-alert-color: #f0a1a5; }
[data-bs-theme="dark"] .alert-warning { border-color: #4a3d18; background-color: #1a1508; --bs-alert-color: #e8c877; }
[data-bs-theme="dark"] .alert-info    { border-color: #1f3450; background-color: #0a1220; --bs-alert-color: #9fc4f5; }

[data-bs-theme="dark"] .alert {
    color: var(--bs-alert-color, var(--cc-text));
}

.cc-alert-icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 0.125rem;
    opacity: 0.7;
}

.cc-alert-body {
    flex: 1 1 auto;
    min-width: 0;
}

.cc-alert-body > p:last-child,
.cc-alert-body > ul:last-child,
.cc-alert-body > ol:last-child {
    margin-bottom: 0;
}

.cc-alert .btn-close {
    flex: 0 0 auto;
    padding: 0.25rem;
    margin: 0;
    font-size: 0.625rem;
}

/* Fallback for the unstyled Huraga flash wrapper. */
.h-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    background-color: var(--cc-surface-2);
}

.h-block h2 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: capitalize;
    margin: 0;
}

.h-block p {
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875em 0.5em;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    vertical-align: middle;
    color: var(--cc-text-muted);
    background-color: var(--cc-surface-3);
    border: 1px solid var(--cc-border);
}

/* Muted, consistent status pills rather than saturated fills. */
.badge.bg-success,
.badge.text-bg-success { color: #14532d; background-color: #e8f5ec; border-color: #c3e3cd; }
.badge.bg-danger,
.badge.text-bg-danger  { color: #7f1d1d; background-color: #fdeaea; border-color: #f3c9c9; }
.badge.bg-warning,
.badge.text-bg-warning { color: #713f12; background-color: #fdf6e3; border-color: #eddfb4; }
.badge.bg-info,
.badge.text-bg-info    { color: #1e3a8a; background-color: #eef4ff; border-color: #cfdefb; }
.badge.bg-primary,
.badge.text-bg-primary { color: #1e3a8a; background-color: #eef4ff; border-color: #cfdefb; }
.badge.bg-secondary,
.badge.text-bg-secondary { color: var(--cc-text-muted); background-color: var(--cc-surface-3); border-color: var(--cc-border); }

[data-bs-theme="dark"] .badge.bg-success,
[data-bs-theme="dark"] .badge.text-bg-success { color: #86d6a3; background-color: #0e1f14; border-color: #1e3d2a; }
[data-bs-theme="dark"] .badge.bg-danger,
[data-bs-theme="dark"] .badge.text-bg-danger  { color: #f0a1a5; background-color: #1c0f10; border-color: #45201f; }
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.text-bg-warning { color: #e8c877; background-color: #1a1508; border-color: #43391a; }
[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .badge.text-bg-info,
[data-bs-theme="dark"] .badge.bg-primary,
[data-bs-theme="dark"] .badge.text-bg-primary { color: #9fc4f5; background-color: #0a1220; border-color: #1e3450; }

.toast {
    border-radius: var(--cc-r-md);
    border: 1px solid var(--cc-border);
    background-color: var(--cc-surface);
    box-shadow: var(--cc-shadow-pop);
    font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   11. Tabs
   -------------------------------------------------------------------------- */

.nav-tabs {
    border-bottom: 1px solid var(--cc-border);
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    margin-bottom: -1px;
    padding: 0.5rem 0.125rem;
    margin-right: 1rem;
    color: var(--cc-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    background-color: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--cc-text) !important;
    border-bottom-color: var(--cc-border-strong);
    background-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--cc-text) !important;
    background-color: transparent;
    border-bottom: 1px solid var(--cc-text);
    font-weight: 500;
}

.tab-content {
    padding-top: 1rem;
}

/* --------------------------------------------------------------------------
   12. Order flow - horizontal stepper, single active panel
   --------------------------------------------------------------------------
   Replaces the inherited accordion. The module's accordion headers are hidden
   and the panel bodies become the step content; the stepper carries the labels
   and the progress state. `.cc-stepper` is on #orderManager.
   -------------------------------------------------------------------------- */

.cc-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    counter-reset: cc-step;
}

.cc-step {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Separator between steps, drawn as a chevron rather than a border so the
   wrapped rows stay readable. */
.cc-step + .cc-step::before {
    content: "";
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0 0.25rem;
    background-color: var(--cc-border-strong);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.cc-step-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    min-height: 36px;
    padding: 0.3125rem 0.625rem;
    border: 1px solid transparent;
    border-radius: var(--cc-r);
    background-color: transparent;
    color: var(--cc-text-subtle);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    transition-property: color, background-color, border-color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.cc-step-btn .icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    opacity: 0.7;
}

.cc-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid var(--cc-border-strong);
    color: var(--cc-text-subtle);
    font-size: 0.6875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.cc-step-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.3125rem;
    border-radius: 999px;
    background-color: var(--cc-surface-3);
    color: var(--cc-text-muted);
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}

/* Completed steps are actionable - clicking one goes back. Future steps are
   disabled: opening "Payment" before the cart has anything would show an empty
   panel, which is the misleading affordance the accordion had. */
.cc-step.is-done .cc-step-btn {
    color: var(--cc-text-muted);
    border-color: var(--cc-border);
    cursor: pointer;
}

.cc-step.is-done .cc-step-btn:hover {
    color: var(--cc-text);
    background-color: var(--cc-surface-2);
}

.cc-step.is-done .cc-step-num {
    border-color: var(--cc-border-strong);
    color: var(--cc-text-muted);
}

.cc-step.is-done .cc-step-check {
    display: inline-flex;
    color: var(--cc-text-muted);
}

.cc-step.is-current .cc-step-btn {
    color: var(--cc-text);
    background-color: var(--cc-surface-2);
    border-color: var(--cc-border);
    font-weight: 600;
}

.cc-step.is-current .cc-step-num {
    background-color: var(--cc-text);
    border-color: var(--cc-text);
    color: var(--cc-bg);
}

.cc-step.is-current .cc-step-count {
    background-color: var(--cc-surface);
    border: 1px solid var(--cc-border);
}

.cc-step:not(.is-done):not(.is-current) .cc-step-btn {
    cursor: default;
}

/* A step whose panel the module has not rendered yet (an empty cart, so no
   #checkout). Shown so the path ahead is legible, dimmed so it does not invite
   a click it cannot honour. */
.cc-step.is-unavailable .cc-step-btn {
    opacity: 0.5;
}

.cc-step.is-unavailable .cc-step-num {
    border-style: dashed;
}

/* The domain order form's Register/Transfer switch is the only saturated blue
   left in the interface. Keep the selected state, drop the hue. */
.nav-pills .nav-link {
    color: var(--cc-text-muted);
}

.nav-pills .nav-link:hover {
    color: var(--cc-text);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--cc-text);
    color: var(--cc-bg);
}

.cc-step-check {
    display: none;
    flex: 0 0 auto;
}

.cc-step-check .icon {
    width: 14px;
    height: 14px;
    opacity: 1;
}

/* The module's own accordion headers are replaced by the stepper. */
.cc-stepper .accordion-header {
    display: none;
}

.cc-stepper .accordion-item {
    border: 0;
    border-radius: 0;
    background-color: transparent;
    counter-increment: none;
}

#orderManager .accordion-body {
    padding: 0 0 0.5rem;
}

#orderManager .accordion-body .accordion-inner > :last-child {
    margin-bottom: 0;
}

.cc-order-card {
    border: 0 !important;
    background-color: transparent !important;
}

/* --------------------------------------------------------------------------
   13. Pagination
   -------------------------------------------------------------------------- */

.cc-pagination-nav {
    margin-top: 1rem;
}

.pagination {
    gap: 0.25rem;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 0.25rem 0.4375rem;
    border-radius: var(--cc-r) !important;
    border: 1px solid var(--cc-border);
    background-color: var(--cc-surface);
    color: var(--cc-text-muted);
    font-size: 0.8125rem;
    transition-property: transform, background-color, border-color, color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.page-link:hover {
    background-color: var(--cc-surface-3);
    border-color: var(--cc-border-strong);
    color: var(--cc-text);
}

.page-link:active {
    transform: scale(0.96);
}

.page-item.active .page-link {
    background-color: var(--cc-text);
    border-color: var(--cc-text);
    color: var(--cc-bg);
    font-weight: 500;
}

.page-item.disabled .page-link {
    background-color: transparent;
    border-color: var(--cc-border);
    color: var(--cc-text-subtle);
    opacity: 0.5;
}

.page-link .icon {
    width: 14px;
    height: 14px;
}

/* --------------------------------------------------------------------------
   14. Dashboard stat tiles
   -------------------------------------------------------------------------- */

.cc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background-color: var(--cc-border);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    overflow: clip;
}

.cc-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.875rem 1rem;
    background-color: var(--cc-surface);
    min-width: 0;
}

.cc-stat-value {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--cc-text);
}

.cc-stat-meta {
    font-size: 0.75rem;
    color: var(--cc-text-subtle);
}

.cc-section {
    margin-bottom: 1.5rem;
}

.cc-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.625rem;
}

.cc-section-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cc-section-link {
    font-size: 0.8125rem;
    color: var(--cc-text-muted);
}

.cc-section-link:hover {
    color: var(--cc-text);
}

.cc-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    border: 1px dashed var(--cc-border-strong);
    border-radius: var(--cc-r-md);
    color: var(--cc-text-subtle);
    font-size: 0.8125rem;
    text-align: center;
}

.cc-rows {
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    background-color: var(--cc-surface);
    overflow: clip;
}

.cc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--cc-border);
    color: var(--cc-text);
    text-decoration: none;
    transition-property: background-color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.cc-row:first-child {
    border-top: 0;
}

a.cc-row:hover {
    background-color: var(--cc-surface-2);
    text-decoration: none;
}

.cc-row-main {
    min-width: 0;
}

.cc-row-title {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: -0.006em;
}

.cc-row-id {
    font-family: var(--cc-mono);
    font-size: 0.75rem;
    color: var(--cc-text-subtle);
}

.cc-row-sub {
    font-size: 0.75rem;
    color: var(--cc-text-subtle);
}

.cc-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Notice strip used for the showcase and on-hold ticket prompts. */
.cc-notice {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--cc-border);
    border-left: 2px solid var(--cc-accent);
    border-radius: var(--cc-r-md);
    background-color: var(--cc-surface);
    font-size: 0.8125rem;
}

.cc-notice-body > :last-child {
    margin-bottom: 0;
}

.cc-notice-body h1,
.cc-notice-body h2,
.cc-notice-body h3 {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.cc-notice-action {
    flex: 0 0 auto;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   15. Order pricing block
   -------------------------------------------------------------------------- */

.cc-pricing {
    margin-top: 1.25rem;
}

.cc-pricing .pricing {
    padding: 1rem;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-r-md);
    background-color: var(--cc-surface-2);
}

.cc-pricing-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.625rem;
    font-size: 0.8125rem;
}

.cc-pricing-row:last-child {
    margin-bottom: 0;
}

.cc-pricing-label {
    color: var(--cc-text-muted);
}

.cc-pricing-value {
    font-weight: 500;
    color: var(--cc-text);
}

.cc-pricing-breakdown {
    padding: 0.625rem 0;
    border-top: 1px solid var(--cc-border);
    border-bottom: 1px solid var(--cc-border);
    margin-bottom: 0.625rem;
}

.cc-pricing-total {
    padding-top: 0.75rem;
    border-top: 1px solid var(--cc-border-strong);
    align-items: center;
}

.cc-pricing-total .cc-pricing-label {
    color: var(--cc-text);
    font-weight: 500;
}

.cc-pricing-total .cc-pricing-value {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.cc-pricing-submit {
    width: 100%;
    margin-top: 1rem;
}

.cc-quantity {
    max-width: 6rem;
}

/* --------------------------------------------------------------------------
   16. Public / authenticated pages
   -------------------------------------------------------------------------- */

.cc-public {
    background-color: var(--cc-bg);
}

.cc-public-main {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-login .card,
.page-signup .card,
.page-password-reset .card,
.mod_client_set_new_password .card {
    border-radius: var(--cc-r-lg);
    border-color: var(--cc-border);
    box-shadow: none;
}

.page-login .card-body,
.page-signup .card-body,
.page-password-reset .card-body {
    padding: 1.75rem;
}

.page-login .card h1,
.page-signup .card h1,
.page-password-reset .card h1 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-login .card h5,
.page-signup .card h5 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   17. Footer
   -------------------------------------------------------------------------- */

.cc-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding: 1.25rem 0 1rem;
    border-top: 1px solid var(--cc-border);
    font-size: 0.75rem;
    color: var(--cc-text-subtle);
}

.cc-footer-signature {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.cc-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.cc-footer-links a {
    color: var(--cc-text-subtle);
}

.cc-footer-links a:hover {
    color: var(--cc-text);
}

.cc-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1035;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--cc-r);
    border: 1px solid var(--cc-border);
    background-color: var(--cc-surface);
    color: var(--cc-text-muted);
    box-shadow: var(--cc-shadow-pop);
    transition-property: transform, background-color, color;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.cc-to-top:hover {
    background-color: var(--cc-surface-3);
    color: var(--cc-text);
}

.cc-to-top:active {
    transform: scale(0.96);
}

.cc-to-top .icon {
    width: 14px;
    height: 14px;
}

/* --------------------------------------------------------------------------
   18. Error page
   -------------------------------------------------------------------------- */

.cc-error {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 4rem 0;
}

.cc-error-code {
    font-family: var(--cc-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--cc-text-subtle);
}

.cc-error-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    max-width: 32ch;
}

.cc-error-detail {
    color: var(--cc-text-muted);
    max-width: 52ch;
    margin: 0 0 0.5rem;
}

/* --------------------------------------------------------------------------
   19. Content media
   -------------------------------------------------------------------------- */

.content-block img:not(.cc-logo):not(.db-avatar):not(.rounded-circle) {
    outline: 1px solid rgba(0, 0, 0, 0.08);
    outline-offset: -1px;
    border-radius: var(--cc-r-sm);
}

[data-bs-theme="dark"] .content-block img:not(.cc-logo):not(.db-avatar):not(.rounded-circle) {
    outline-color: rgba(255, 255, 255, 0.1);
}

.db-avatar {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .db-avatar {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------------------------
   20. Overlays and misc
   -------------------------------------------------------------------------- */

.wait,
.loading {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background-color: rgba(0, 0, 0, 0.4);
}

.wait .spinner-border {
    color: #fff !important;
}

.modal-content {
    border-radius: var(--cc-r-lg);
    border: 1px solid var(--cc-border);
    background-color: var(--cc-surface);
    box-shadow: var(--cc-shadow-modal);
}

.modal-header {
    border-bottom: 1px solid var(--cc-border);
    padding: 0.875rem 1rem;
}

.modal-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    border-top: 1px solid var(--cc-border);
    padding: 0.75rem 1rem;
}

.accordion-item {
    border-color: var(--cc-border);
    background-color: var(--cc-surface);
}

.accordion-button {
    font-size: 0.8125rem;
    font-weight: 500;
    background-color: transparent;
}

.accordion-button:not(.collapsed) {
    background-color: var(--cc-surface-2);
    color: var(--cc-text);
}

.email-list {
    border-radius: var(--cc-r-md);
}

.email-list .list-group-item {
    border-left: 2px solid transparent;
}

.email-list .list-group-item.active {
    border-left-color: var(--cc-text);
    background: var(--cc-surface-3);
    color: var(--cc-text);
}

.invoice-gateway {
    border-radius: var(--cc-r-md);
    border-color: var(--cc-border);
    transition-property: border-color, box-shadow;
    transition-duration: var(--cc-dur);
    transition-timing-function: var(--cc-ease);
}

.invoice-gateway:hover,
.invoice-gateway:has(.btn-check:checked) {
    border-color: var(--cc-text);
    box-shadow: none;
}

/* The sprite ship-set is stroke-based; keep weights consistent. */
.icon {
    width: 18px;
    height: 18px;
    stroke-width: 1.75;
}

h1 .icon,
h2 .icon {
    width: 20px;
    height: 20px;
}

/* --------------------------------------------------------------------------
   21. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .cc-body {
        padding-top: 1rem;
    }

    .cc-page-title {
        font-size: 1.3125rem;
    }

    .cc-page-header {
        margin-bottom: 1rem;
    }

    .cc-error {
        padding: 2.5rem 0;
    }
}

@media (max-width: 575.98px) {
    .card-body {
        padding: 0.875rem;
    }

    .card-header {
        padding: 0.75rem 0.875rem;
    }

    .cc-pricing-total .cc-pricing-value {
        font-size: 1.0625rem;
    }

    .cc-stat-value {
        font-size: 1.25rem;
    }
}

/* --------------------------------------------------------------------------
   22. Status pills, forced
   --------------------------------------------------------------------------
   Bootstrap's .bg-* / .text-bg-* utilities set background-color with
   !important, and Huraga forces .badge[class*="bg-"]{color:#fff!important}.
   Both outrank the plain selectors in section 10, so the muted pill treatment
   is restated here at the same weight.
   -------------------------------------------------------------------------- */

.badge.bg-success,
.badge.text-bg-success { color: #14532d !important; background-color: #e8f5ec !important; border-color: #c3e3cd !important; }
.badge.bg-danger,
.badge.text-bg-danger { color: #7f1d1d !important; background-color: #fdeaea !important; border-color: #f3c9c9 !important; }
.badge.bg-warning,
.badge.text-bg-warning { color: #713f12 !important; background-color: #fdf6e3 !important; border-color: #eddfb4 !important; }
.badge.bg-info,
.badge.text-bg-info,
.badge.bg-primary,
.badge.text-bg-primary { color: #1e3a8a !important; background-color: #eef4ff !important; border-color: #cfdefb !important; }
.badge.bg-secondary,
.badge.text-bg-secondary,
.badge.bg-dark,
.badge.text-bg-dark { color: var(--cc-text-muted) !important; background-color: var(--cc-surface-3) !important; border-color: var(--cc-border) !important; }
.badge.bg-light,
.badge.text-bg-light { color: var(--cc-text-muted) !important; background-color: var(--cc-surface-3) !important; border-color: var(--cc-border) !important; }

[data-bs-theme="dark"] .badge.bg-success,
[data-bs-theme="dark"] .badge.text-bg-success { color: #86d6a3 !important; background-color: #0e1f14 !important; border-color: #1e3d2a !important; }
[data-bs-theme="dark"] .badge.bg-danger,
[data-bs-theme="dark"] .badge.text-bg-danger { color: #f0a1a5 !important; background-color: #1c0f10 !important; border-color: #45201f !important; }
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.text-bg-warning { color: #e8c877 !important; background-color: #1a1508 !important; border-color: #43391a !important; }
[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .badge.text-bg-info,
[data-bs-theme="dark"] .badge.bg-primary,
[data-bs-theme="dark"] .badge.text-bg-primary { color: #9fc4f5 !important; background-color: #0a1220 !important; border-color: #1e3450 !important; }
[data-bs-theme="dark"] .badge.bg-secondary,
[data-bs-theme="dark"] .badge.text-bg-secondary,
[data-bs-theme="dark"] .badge.bg-dark,
[data-bs-theme="dark"] .badge.text-bg-dark,
[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.text-bg-light { color: var(--cc-text-muted) !important; background-color: var(--cc-surface-3) !important; border-color: var(--cc-border) !important; }

/* --------------------------------------------------------------------------
   23. Module page normalisation
   --------------------------------------------------------------------------
   Fixes that cannot be expressed per-component, applied across every module
   template the theme does not override:
     a) duplicate page heading  - modules print their own <h1> in the card header
        while the layout already prints the page heading
     b) card-in-card nesting    - the wrapper card around a page's real content
     c) heading inversion       - in-content headings outranking the page title
     d) prose measure           - body copy running the full container width
   -------------------------------------------------------------------------- */

/* a) Suppress the duplicated heading, keep the module's subtitle as a
   description line under the layout's page heading.

   Scoped to body:not(.cc-public): the duplication only exists on pages using
   layout_default, which renders the page heading. Pages on layout_public
   (signup, password reset, maintenance) render no page heading at all, so their
   card-header <h1> is the only heading on the page and must stay.

   Safe on layout_default: every template that renders a card-header <h1> also
   defines meta_title, which the layout falls back to for the page <h1>. */
body:not(.cc-public) .card-header h1 {
    display: none;
}

.card-header .small,
.card-header .text-muted,
.card-header .text-secondary {
    display: block;
    margin-top: 0;
}

/* With the h1 suppressed, a header holding only the subtitle is a description
   line - not a title bar. Drop its rule so it does not read as an orphaned
   caption. Headers that also carry a control (the wallet's "Add Funds" form)
   keep their separator. */
body:not(.cc-public) .card-header:has(h1):not(:has(.btn, button, form, input, select)) {
    border-bottom: 0;
    padding-bottom: 0;
}

/* b) A card whose body contains further cards is a page wrapper, not a surface.
   Flatten it so the inner cards read as the real content cards. */
.card:has(> .card-body .card) {
    border: 0;
    background-color: transparent;
    border-radius: 0;
}

.card:has(> .card-body .card) > .card-header {
    border-bottom: 0;
    padding: 0 0 0.75rem;
    background-color: transparent;
}

.card:has(> .card-body .card) > .card-body {
    padding: 0;
}

/* c) In-content headings must stay below the page title (1.5rem). Article
   titles in the news template render as <h3>, which Bootstrap scales to
   ~1.9rem - larger than the page heading. */
.card-body h1,
.card-body h2 {
    font-size: 1.125rem;
    letter-spacing: -0.015em;
}

.card-body h3 {
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.card-body h4,
.card-body h5,
.card-body h6 {
    font-size: 0.875rem;
}

/* Headings that are links keep the text colour; blue stays for links in text. */
.card h1 a,
.card h2 a,
.card h3 a,
.card h4 a,
.card-header a,
.link-body-emphasis {
    color: var(--cc-text);
}

.card h1 a:hover,
.card h2 a:hover,
.card h3 a:hover,
.card h4 a:hover,
.card-header a:hover {
    color: var(--cc-text);
    text-decoration: underline;
}

/* d) Body copy capped at a readable measure. Tables and grids stay full width. */
.content-block p,
.content-block li,
.content-block blockquote,
.cc-notice-body p,
.cc-notice-body li {
    max-width: 72ch;
}

.content-block .card-body > .row p,
.content-block .card-body > .row li {
    max-width: none;
}

/* Empty states: shorter, single-bordered. Inside a card the card border is
   enough, so the dashed rule is dropped to avoid two competing outlines. */
.cc-empty {
    padding: 1.25rem 1rem;
}

.card-body .cc-empty,
.card-body > .cc-empty {
    border: 0;
    border-radius: var(--cc-r);
    background-color: var(--cc-surface-2);
}

[data-bs-theme="dark"] .card-body .cc-empty,
[data-bs-theme="dark"] .card-body > .cc-empty {
    background-color: var(--cc-surface-2);
}

/* The order flow's step affordance now lives in the stepper (section 12). The
   accordion headers those rules styled are hidden, so the earlier chevron
   treatment for them was removed. */

/* The order card repeats the branding module's footer attribution. Keep one.
   Needs !important: Bootstrap ships .d-flex{display:flex!important}. */
#orderbutton .card-body > .d-flex.justify-content-center.small.text-muted {
    display: none !important;
}

/* Auth pages the theme does not override (signup, password reset, set-new-
   password) centre their card title and render secondary actions as full-width
   outlined buttons. Match the login treatment: left-aligned title, secondary
   actions as text links on a hairline row.

   The modules ship `<h5 class="text-center m-4">`, and Bootstrap utility classes
   carry !important - so text-align and margin need it too. */
.page-signup .card h1,
.page-signup .card h5,
.page-password-reset .card h1,
.page-password-reset .card h5,
.mod_client_set_new_password .card h1,
.mod_client_set_new_password .card h5 {
    text-align: left !important;
    margin: 0 0 1.25rem !important;
    font-size: 1.125rem;
    font-weight: 600;
}

.page-signup .card-body > .row,
.page-password-reset .card-body > .row,
.mod_client_set_new_password .card-body > .row {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--cc-border);
}

.page-signup .card-body > .row .btn,
.page-password-reset .card-body > .row .btn,
.mod_client_set_new_password .card-body > .row .btn {
    justify-content: flex-start;
    min-height: 0;
    padding: 0;
    border: 0;
    background-color: transparent;
    color: var(--cc-accent);
    font-weight: 400;
    box-shadow: none;
}

.page-signup .card-body > .row .btn:hover,
.page-password-reset .card-body > .row .btn:hover,
.mod_client_set_new_password .card-body > .row .btn:hover {
    background-color: transparent;
    color: var(--cc-accent);
    text-decoration: underline;
    transform: none;
}

.page-signup .card-body > .row .btn:active,
.page-password-reset .card-body > .row .btn:active {
    transform: none;
}

/* The locale selector was the heaviest element in the header. */
.cc-topbar .ts-wrapper.js-locale-selector,
.cc-topbar .form-select.js-locale-selector {
    max-width: 160px;
}

.cc-topbar .ts-wrapper .ts-control {
    min-height: 32px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.8125rem;
}

/* --------------------------------------------------------------------------
   24. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .btn,
    .cc-icon-btn,
    .cc-account-toggle,
    .cc-nav-link,
    .cc-topbar-link,
    .page-link,
    .cc-to-top,
    .cc-drawer,
    .cc-drawer-backdrop,
    .form-control,
    .form-select,
    .invoice-gateway,
    .cc-row {
        transition-duration: 1ms !important;
    }

    .btn:active:not(:disabled),
    .cc-icon-btn:active,
    .cc-account-toggle:active,
    .page-link:active,
    .cc-to-top:active {
        transform: none;
    }
}

/* ==========================================================================
   14. CrownCity Host brand layer
   --------------------------------------------------------------------------
   Matches crowncityhost.com and the order pages: Public Sans body, Bricolage
   Grotesque headings, navy + gold on ink text, lavender page background,
   rounder corners. Re-points the tokens above (later rules win) and restyles
   the few components the tokens don't reach. Fonts are loaded in
   layout_default.html.twig.
   ========================================================================== */

:root {
    --cc-navy: #00067C;
    --cc-navy-700: #0B1496;
    --cc-navy-500: #5A63C0;
    --cc-gold: #ffc400;
    --cc-gold-400: #FFD633;
    --cc-gold-soft: #FFF6D6;
    --cc-gold-ink: #8A6500;
    --cc-font: "Public Sans", ui-sans-serif, system-ui, sans-serif;
    --cc-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;

    --cc-accent: #0B1496;
    --cc-accent-rgb: 11, 20, 150;
    --cc-accent-quiet: #EEF0FB;
    --cc-bg: #F4F5FC;
    --cc-surface: #ffffff;
    --cc-surface-2: #F8F9FD;
    --cc-surface-3: #EEF0FB;
    --cc-border: #E1E5EF;
    --cc-border-strong: #CDD3E3;
    --cc-text: #0F1B3D;
    --cc-text-muted: #525C78;
    --cc-text-subtle: #7A839C;
    --cc-action-bg: #00067C;
    --cc-action-bg-hover: #0B1496;
    --cc-action-fg: #ffffff;
    --cc-action-border: #00067C;
    --cc-r-xs: 6px;
    --cc-r-sm: 8px;
    --cc-r: 10px;
    --cc-r-md: 16px;
    --cc-r-lg: 20px;
    --cc-ring: 0 0 0 3px rgba(255, 196, 0, 0.5);
    --cc-topbar-h: 72px;

    --bs-body-font-family: var(--cc-font);
    --bs-primary: #00067C;
    --bs-primary-rgb: 0, 6, 124;
    --bs-link-color: #0B1496;
    --bs-link-color-rgb: 11, 20, 150;
    --bs-link-hover-color: #00067C;
    --bs-link-hover-color-rgb: 0, 6, 124;
}

[data-bs-theme="dark"] {
    --cc-accent: #A9AEF0;
    --cc-accent-rgb: 169, 174, 240;
    --cc-accent-quiet: #141A4D;
    --cc-bg: #060A2E;
    --cc-surface: #0C1240;
    --cc-surface-2: #0F1650;
    --cc-surface-3: #161E63;
    --cc-border: #222A72;
    --cc-border-strong: #323C8C;
    --cc-text: #EEF0FB;
    --cc-text-muted: #AEB4D6;
    --cc-text-subtle: #7E86B4;
    --cc-action-bg: #ffc400;
    --cc-action-bg-hover: #FFD633;
    --cc-action-fg: #0F1B3D;
    --cc-action-border: #ffc400;
    --cc-gold-ink: #FFD633;
    --bs-link-color: #A9AEF0;
    --bs-link-color-rgb: 169, 174, 240;
    --bs-link-hover-color: #ffffff;
    --bs-link-hover-color-rgb: 255, 255, 255;
}

body {
    font-family: var(--cc-font);
    font-size: 0.9375rem;
    letter-spacing: 0;
}

h1, h2, h3, h4, h5, h6,
.cc-page-title,
.cc-error-title,
.cc-stat-value,
.card-title {
    font-family: var(--cc-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cc-page-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
}

/* Top bar: white, like the marketing header */
.cc-topbar {
    background-color: var(--cc-surface);
    border-bottom: 1px solid var(--cc-border);
}

/* Sidebar */
.cc-nav-link {
    font-size: 0.9375rem;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
}
.cc-nav-link:hover {
    color: var(--cc-text);
    background-color: var(--cc-surface-3);
}
.cc-nav-link.active {
    color: var(--cc-navy) !important;
    background-color: var(--cc-accent-quiet);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--cc-gold);
}
[data-bs-theme="dark"] .cc-nav-link.active {
    color: var(--cc-text) !important;
}

/* Section labels (ACCOUNT, BILLING ...) in the marketing site's gold eyebrow style */
.cc-eyebrow,
.cc-nav-label,
.cc-stat-label,
.cc-balance-label {
    color: var(--cc-gold-ink);
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* Cards, tables, forms */
.card {
    border-radius: var(--cc-r-md);
}
.form-control,
.form-select {
    min-height: 46px;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border-radius: 12px;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--cc-navy-500);
    box-shadow: var(--cc-ring);
}

/* Buttons: navy primary, gold for the warning/CTA variant, as on the marketing site */
.btn {
    border-radius: 12px;
    font-weight: 600;
}
.btn-primary {
    --bs-btn-focus-shadow-rgb: 255, 196, 0;
}
.btn-warning {
    --bs-btn-bg: var(--cc-gold);
    --bs-btn-border-color: var(--cc-gold);
    --bs-btn-color: #0F1B3D;
    --bs-btn-hover-bg: var(--cc-gold-400);
    --bs-btn-hover-border-color: var(--cc-gold-400);
    --bs-btn-hover-color: #0F1B3D;
}
.btn-outline-primary {
    --bs-btn-color: var(--cc-navy);
    --bs-btn-border-color: rgba(15, 27, 61, 0.25);
    --bs-btn-hover-bg: var(--cc-accent-quiet);
    --bs-btn-hover-color: var(--cc-navy);
    --bs-btn-hover-border-color: var(--cc-navy-500);
}
.badge {
    border-radius: 999px;
}

/* Full-width marketing footer below the page grid (see layout_default) */
.cc-site-footer {
    margin-top: 3rem;
}
