/* ============================================
   HORIZON - UNIVERSAL DARK THEME
   Consolidated Styling System
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */
:root {
    /* Primary Brand Colors */
    --hz-primary: #dc2639;
    --hz-primary-hover: #b01e2e;
    --hz-primary-light: rgba(220, 38, 57, 0.2);
    --hz-primary-glow: rgba(220, 38, 57, 0.3);

    /* Background Colors */
    --hz-bg-body: #000000;
    --hz-bg-surface: #0f0f0f;
    --hz-bg-elevated: #1a1a1a;
    --hz-bg-input: #1a1a1a;
    --hz-bg-hover: #252525;

    /* Text Colors */
    --hz-text-primary: #ffffff;
    --hz-text-secondary: #b3b3b3;
    --hz-text-muted: #888888;
    --hz-text-disabled: #555555;

    /* Border Colors */
    --hz-border: #333333;
    --hz-border-light: #444444;
    --hz-border-accent: rgba(255, 255, 255, 0.08);
    --hz-border-accent-hover: rgba(255, 255, 255, 0.15);

    /* Semantic Colors */
    --hz-success: #28a745;
    --hz-success-bg: #0a2e0a;
    --hz-warning: #ffc107;
    --hz-warning-bg: #2e2a0a;
    --hz-danger: #dc3545;
    --hz-danger-bg: #2e0a0a;
    --hz-info: #17a2b8;
    --hz-info-bg: #0a252e;

    /* UI Specific */
    --hz-sidebar-width: 280px;
    --hz-topbar-height: 4rem;
    --hz-border-radius: 0.375rem;
    --hz-border-radius-lg: 0.5rem;
    --hz-transition: 0.3s ease;
    --hz-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --hz-shadow-glow: 0 4px 15px var(--hz-primary-glow);

    /* Party Colors */
    --hz-party-dem: #3b82f6;
    --hz-party-rep: #ef4444;
    --hz-party-lib: #f59e0b;
    --hz-party-grn: #22c55e;
    --hz-party-una: #6b7280;
}

/* ============================================
   PARTY AFFILIATION BADGES
   ============================================ */
.party-dem { background-color: var(--hz-party-dem) !important; color: #fff; }
.party-rep { background-color: var(--hz-party-rep) !important; color: #fff; }
.party-lib { background-color: var(--hz-party-lib) !important; color: #000; }
.party-grn { background-color: var(--hz-party-grn) !important; color: #fff; }
.party-una { background-color: var(--hz-party-una) !important; color: #fff; }

/* ============================================
   GLOBAL RESET AND BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--hz-bg-body);
    color: var(--hz-text-primary);
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#app {
    flex: 1 0 auto;
    background-color: var(--hz-bg-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   PAGE LAYOUT
   ============================================ */
.page {
    position: relative;
    display: flex;
    flex-direction: row;
    background-color: var(--hz-bg-body);
    color: var(--hz-text-primary);
    min-height: 100vh;
    flex: 1;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--hz-bg-body);
    min-height: 100vh;
}

article,
article.content {
    flex: 1;
    padding: 2rem;
    background-color: var(--hz-bg-body);
}

.page-unauthenticated {
    flex-direction: column;
}

.page-unauthenticated main {
    min-height: 100vh;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
    background: linear-gradient(180deg, var(--hz-bg-body) 0%, #0d0d12 30%, #0a0a0a 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.5);
    width: var(--hz-sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-right: 1px solid var(--hz-border-accent);
    overflow-y: auto;
    transition: transform var(--hz-transition);
    transform: translateX(-100%);
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: block;
    cursor: pointer;
}

/* Navigation Menu */
.nav-menu {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-header {
    border-bottom: 1px solid var(--hz-border-accent);
    background: linear-gradient(135deg, var(--hz-bg-surface), var(--hz-bg-body));
}

.nav-main {
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0.55rem 1rem;
    color: var(--hz-text-secondary);
    text-decoration: none;
    border-radius: var(--hz-border-radius);
    margin: 0.1rem 0.25rem;
    transition: all var(--hz-transition);
    font-weight: 500;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(220, 38, 57, 0.08);
    color: var(--hz-text-primary);
    border-left-color: rgba(220, 38, 57, 0.4);
}

.nav-link.active {
    background: rgba(220, 38, 57, 0.12);
    color: var(--hz-text-primary);
    border-left-color: var(--hz-primary);
    font-weight: 600;
}

.nav-link span {
    margin-right: 0.75rem;
    font-size: 1.05rem;
    opacity: 0.8;
}

.nav-link.active span {
    opacity: 1;
}

/* Collapsible Nav Section */
.nav-collapse-toggle {
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--hz-text-secondary);
    font-weight: 500;
}

/* Section toggle (category headers) */
.nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-family: inherit;
    min-height: 40px;
    padding: 0.55rem 1rem;
    border-radius: var(--hz-border-radius);
    transition: all var(--hz-transition);
}

.nav-section-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
}

.nav-section-label-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hz-text-muted);
    user-select: none;
}

/* Static nav section header (non-collapsible) */
.nav-section-header {
    color: var(--hz-text-secondary);
    font-weight: 500;
    cursor: default;
    pointer-events: none;
}

.nav-collapse-icon {
    margin-left: auto;
    margin-right: 0 !important;
    font-size: 0.7rem;
    opacity: 0.5;
    color: var(--hz-text-muted);
}

/* workflow section divider */
.nav-section-divider {
    height: 1px;
    background: var(--hz-border-accent);
    margin: 0.6rem 1.25rem;
    opacity: 0.3;
}

/* muted section labels (static, non-collapsible) */
.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hz-text-muted);
    padding: 0.25rem 1rem 0.35rem;
    user-select: none;
}

.nav-submenu {
    margin-left: 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(220, 38, 57, 0.15);
}

.nav-sublink {
    font-size: 0.875rem;
    min-height: 38px;
    padding: 0.45rem 0.75rem;
    color: var(--hz-text-secondary);
    font-weight: 400;
    border-left: 2px solid transparent;
    margin-left: -0.5rem;
    padding-left: 1rem;
}

.nav-sublink:hover {
    color: var(--hz-text-primary);
    background: rgba(220, 38, 57, 0.06);
    border-left-color: rgba(220, 38, 57, 0.4);
}

.nav-sublink.active {
    color: var(--hz-text-primary);
    border-left-color: var(--hz-primary);
    background: rgba(220, 38, 57, 0.1);
    font-weight: 500;
}

.nav-sublink span {
    font-size: 0.9rem;
    opacity: 0.75;
}

.nav-sublink.active span,
.nav-sublink:hover span {
    opacity: 1;
}

/* Nav Footer */
.nav-footer {
    padding: 1rem;
    border-top: 1px solid var(--hz-border-accent);
    background: linear-gradient(135deg, var(--hz-bg-surface), var(--hz-bg-body));
    text-align: center;
}

.nav-footer-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--hz-text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    transition: color var(--hz-transition);
}

.nav-footer-email:hover {
    color: var(--hz-primary);
}

.nav-footer-copyright {
    color: var(--hz-text-muted);
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ============================================
   TOP BAR
   ============================================ */
.top-row {
    background: linear-gradient(90deg, var(--hz-bg-body) 0%, var(--hz-bg-elevated) 100%);
    border-bottom: 1px solid var(--hz-border-accent);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    justify-content: space-between;
    height: var(--hz-topbar-height);
    display: flex;
    align-items: center;
    padding-left: 1rem;
    padding-right: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
    transition: margin-left var(--hz-transition), width var(--hz-transition);
}

.navbar-brand {
    color: var(--hz-text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.navbar-toggler {
    background: linear-gradient(135deg, var(--hz-primary-light), rgba(220, 38, 57, 0.1));
    border: 1px solid var(--hz-border-accent);
    border-radius: 8px;
    transition: all var(--hz-transition);
    color: var(--hz-text-primary);
    display: block;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.navbar-toggler:hover {
    background: linear-gradient(135deg, var(--hz-primary-glow), var(--hz-primary-light));
    border-color: var(--hz-border-accent-hover);
    transform: scale(1.05);
    box-shadow: var(--hz-shadow-glow);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 1.5em;
    height: 1.5em;
    display: inline-block;
}

/* ============================================
   BUTTONS
   ============================================ */
button,
.btn,
input[type="button"],
input[type="submit"] {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--hz-border-radius);
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--hz-transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background: transparent;
}

/* Primary Button */
.btn-primary,
button.btn-primary,
input[type="submit"].btn-primary {
    color: var(--hz-primary);
    border-color: var(--hz-primary);
    background: transparent;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, var(--hz-primary), var(--hz-primary-hover));
    border-color: var(--hz-primary);
    color: var(--hz-text-primary);
    transform: translateY(-1px);
    box-shadow: var(--hz-shadow-glow);
}

/* Secondary Button */
.btn-secondary,
button.btn-secondary {
    color: var(--hz-text-primary);
    border-color: #6c757d;
    background: transparent;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    border-color: #6c757d;
    color: var(--hz-text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Success Button */
.btn-success,
button.btn-success {
    color: var(--hz-success);
    border-color: var(--hz-success);
    background: transparent;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background: linear-gradient(135deg, var(--hz-success), #20833a);
    border-color: var(--hz-success);
    color: var(--hz-text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Warning Button */
.btn-warning,
button.btn-warning {
    color: var(--hz-warning);
    border-color: var(--hz-warning);
    background: transparent;
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active {
    background: linear-gradient(135deg, var(--hz-warning), #e0a800);
    border-color: var(--hz-warning);
    color: var(--hz-bg-body);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* Danger Button */
.btn-danger,
button.btn-danger {
    color: var(--hz-danger);
    border-color: var(--hz-danger);
    background: transparent;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background: linear-gradient(135deg, var(--hz-danger), #c82333);
    border-color: var(--hz-danger);
    color: var(--hz-text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Info Button */
.btn-info,
button.btn-info {
    color: var(--hz-info);
    border-color: var(--hz-info);
    background: transparent;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    background: linear-gradient(135deg, var(--hz-info), #138496);
    border-color: var(--hz-info);
    color: var(--hz-text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Outline Buttons */
.btn-outline-primary {
    color: var(--hz-primary);
    border-color: var(--hz-primary);
    background: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background: linear-gradient(135deg, var(--hz-primary), var(--hz-primary-hover));
    border-color: var(--hz-primary);
    color: var(--hz-text-primary);
}

.btn-outline-secondary {
    color: var(--hz-text-secondary);
    border-color: #6c757d;
    background: transparent;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    border-color: #6c757d;
    color: var(--hz-text-primary);
}

.btn-outline-danger {
    color: var(--hz-danger);
    border-color: var(--hz-danger);
    background: transparent;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
    background: linear-gradient(135deg, var(--hz-danger), #c82333);
    border-color: var(--hz-danger);
    color: var(--hz-text-primary);
}

/* boundary action bar — floats over map after polygon draw */
.boundary-action-bar {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(20, 20, 25, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--hz-border, #333);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    z-index: 900;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.boundary-action-label {
    font-size: 0.8rem;
    color: var(--hz-text-secondary, #adb5bd);
    white-space: nowrap;
    margin-right: 0.25rem;
}

.hz-map-infobox {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: rgba(20, 20, 25, 0.88);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    z-index: 2;
    color: #d1d5db;
    font-size: 0.8rem;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* autogen side panel — docked right when preview is active */
.autogen-side-panel {
    position: fixed;
    top: 60px;
    right: 0;
    width: 320px;
    height: calc(100vh - 60px);
    background: var(--hz-bg-card, #1a1a2e);
    border-left: 1px solid var(--hz-border, #333);
    z-index: 1035;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px rgba(0,0,0,0.4);
}
.autogen-side-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--hz-border, #333);
    color: var(--hz-text-primary, #e4e4e7);
}
.autogen-side-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}
.autogen-side-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--hz-border, #333);
}

/* tier-gated: amber outline for locked features */
.btn-tier-gated {
    color: #b08a3e;
    border-color: #6b5a2a;
    background: transparent;
    opacity: 0.75;
    cursor: not-allowed;
    position: relative;
}
.btn-tier-gated .bi-lock-fill {
    color: #b08a3e;
}

/* Link Button */
.btn-link {
    color: var(--hz-text-secondary);
    border: none;
    background: transparent;
    text-decoration: none;
}

.btn-link:hover {
    color: var(--hz-primary);
    text-decoration: none;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--hz-border-radius-lg);
}

/* Button Group */
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
    border-radius: 0;
}

.btn-group > .btn:first-child {
    border-top-left-radius: var(--hz-border-radius);
    border-bottom-left-radius: var(--hz-border-radius);
}

.btn-group > .btn:last-child {
    border-top-right-radius: var(--hz-border-radius);
    border-bottom-right-radius: var(--hz-border-radius);
}

/* Disabled Buttons */
.btn:disabled,
.btn.disabled,
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Close Button */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background-color: var(--hz-bg-surface);
    border: 1px solid var(--hz-border-accent);
    box-shadow: var(--hz-shadow);
    transition: all var(--hz-transition);
    border-radius: var(--hz-border-radius);
    color: var(--hz-text-primary);
}

.card:hover {
    border-color: var(--hz-border-accent-hover);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

/* suppress hover transform on cards containing fixed-position modals */
.card:has(.modal-overlay-custom):hover {
    transform: none;
}

.card-header {
    background: linear-gradient(135deg, var(--hz-bg-surface), var(--hz-bg-body));
    border-bottom: 1px solid var(--hz-border-accent);
    color: var(--hz-text-primary);
    padding: 0.75rem 1rem;
    border-radius: calc(var(--hz-border-radius) - 1px) calc(var(--hz-border-radius) - 1px) 0 0;
}

.card-body {
    color: var(--hz-text-primary);
    background-color: var(--hz-bg-surface);
    padding: 1rem;
}

.card-footer {
    background: linear-gradient(135deg, var(--hz-bg-body), var(--hz-bg-surface));
    border-top: 1px solid var(--hz-border-accent);
    padding: 0.75rem 1rem;
    border-radius: 0 0 calc(var(--hz-border-radius) - 1px) calc(var(--hz-border-radius) - 1px);
}

.card-title {
    color: var(--hz-text-primary);
    margin-bottom: 0.5rem;
}

.card-text {
    color: var(--hz-text-secondary);
}

/* initiative details card — tighter label-value gap */
.initiative-details-card .table td:first-child {
    width: 140px;
    white-space: nowrap;
}

.initiative-details-card .table {
    max-width: 600px;
}

/* ============================================
   RESOURCE LINKS (Dashboard card)
   ============================================ */
.resource-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    padding: 0.6rem 0.85rem;
    border-radius: var(--hz-border-radius);
    background-color: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border-light);
    color: var(--hz-text-primary);
    transition: all var(--hz-transition);
}

.resource-link:hover {
    background-color: var(--hz-bg-hover);
    border-color: var(--hz-border-accent-hover);
    color: var(--hz-text-primary);
    transform: translateX(3px);
}

.resource-link .badge {
    font-size: 0.8rem;
    min-width: 1.6rem;
    padding: 0.35em 0.55em;
}

.resource-link.resource-danger {
    border-color: var(--hz-danger);
    background-color: var(--hz-danger-bg);
}

.resource-link.resource-danger:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

/* ============================================
   FORMS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
.form-control,
.form-select,
textarea {
    background-color: var(--hz-bg-input);
    color: var(--hz-text-primary);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    padding: 0.75rem;
    font-size: 1rem;
    transition: all var(--hz-transition);
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
.form-control:focus,
.form-select:focus,
textarea:focus {
    background-color: var(--hz-bg-input);
    border-color: var(--hz-primary);
    color: var(--hz-text-primary);
    box-shadow: 0 0 0 0.2rem var(--hz-primary-light);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--hz-text-muted);
}

input:disabled,
.form-control:disabled,
.form-select:disabled {
    background-color: var(--hz-bg-elevated);
    color: var(--hz-text-muted);
    border-color: var(--hz-border);
    opacity: 0.7;
    cursor: not-allowed;
}

.form-label {
    color: var(--hz-text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

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

.form-check-input {
    background-color: var(--hz-bg-input);
    border-color: var(--hz-border);
}

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

.form-check-label {
    color: var(--hz-text-primary);
}

/* Input Group */
.input-group-text {
    background-color: var(--hz-bg-elevated);
    border-color: var(--hz-border);
    color: var(--hz-text-secondary);
}

/* Validation States */
.is-invalid {
    border-color: var(--hz-danger) !important;
}

.invalid-feedback {
    color: var(--hz-danger);
}

.is-valid {
    border-color: var(--hz-success) !important;
}

.valid-feedback {
    color: var(--hz-success);
}

/* ============================================
   TABLES
   ============================================ */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--hz-text-primary);
    --bs-table-border-color: var(--hz-border);
    color: var(--hz-text-primary);
    border-color: var(--hz-border);
}

.table > thead {
    background-color: var(--hz-bg-elevated);
}

.table > thead > tr > th {
    color: var(--hz-text-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--hz-border-accent);
    padding: 0.75rem;
    background-color: var(--hz-bg-elevated);
}

.table > tbody > tr > td {
    color: var(--hz-text-primary);
    padding: 0.75rem;
    border-bottom: 1px solid var(--hz-border);
    background-color: transparent;
}

.table > tbody > tr:hover > td {
    background-color: var(--hz-bg-hover);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--hz-bg-surface);
}

.table-striped > tbody > tr:nth-of-type(odd):hover > td {
    background-color: var(--hz-bg-hover);
}

.table-dark {
    --bs-table-bg: var(--hz-bg-surface);
    --bs-table-color: var(--hz-text-primary);
    --bs-table-border-color: var(--hz-border);
}

.table-responsive {
    border-radius: var(--hz-border-radius);
    border: 1px solid var(--hz-border);
}

/* Sortable columns */
th[style*="cursor: pointer"],
.sortable-header {
    cursor: pointer;
    transition: color var(--hz-transition);
}

th[style*="cursor: pointer"]:hover,
.sortable-header:hover {
    color: var(--hz-primary);
}

/* ============================================
   MODALS
   ============================================ */
.modal-content {
    background-color: var(--hz-bg-surface);
    border: 1px solid var(--hz-border-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    border-radius: var(--hz-border-radius);
    color: var(--hz-text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--hz-border-accent);
    background: linear-gradient(135deg, var(--hz-bg-surface), var(--hz-bg-body));
    color: var(--hz-text-primary);
    padding: 1rem;
    border-radius: calc(var(--hz-border-radius) - 1px) calc(var(--hz-border-radius) - 1px) 0 0;
}

.modal-title {
    color: var(--hz-text-primary);
}

.modal-body {
    padding: 1.5rem;
    background-color: var(--hz-bg-surface);
    color: var(--hz-text-primary);
}

.modal-footer {
    border-top: 1px solid var(--hz-border-accent);
    background: linear-gradient(135deg, var(--hz-bg-body), var(--hz-bg-surface));
    padding: 1rem;
    border-radius: 0 0 calc(var(--hz-border-radius) - 1px) calc(var(--hz-border-radius) - 1px);
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

/* contact modal tab strip */
.contact-modal-tabs {
    border-bottom: 1px solid var(--hz-border);
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.contact-modal-tabs .nav-link {
    color: var(--hz-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: color var(--hz-transition), border-color var(--hz-transition);
}

.contact-modal-tabs .nav-link:hover {
    color: var(--hz-text-primary);
    border-bottom-color: var(--hz-border);
}

.contact-modal-tabs .nav-link.active {
    color: var(--hz-primary);
    border-bottom-color: var(--hz-primary);
    background: transparent;
}

/* ============================================
   OPT-IN STATUS CARDS
   ============================================ */
.opt-stat-card {
    padding: 1rem 0.5rem;
    border-radius: var(--hz-border-radius);
    border: 1px solid var(--hz-border);
    background: var(--hz-bg-surface);
    transition: var(--hz-transition);
}
.opt-stat-count {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}
.opt-stat-label {
    font-size: 0.85rem;
    color: var(--hz-text-secondary);
    margin-top: 0.25rem;
}
.opt-stat-hint {
    font-size: 0.7rem;
    color: var(--hz-text-muted);
    margin-top: 0.25rem;
}
.opt-stat-pending .opt-stat-count { color: #ffc107; }
.opt-stat-confirmed .opt-stat-count { color: #198754; }
.opt-stat-expired .opt-stat-count { color: #dc3545; }
.opt-stat-none .opt-stat-count { color: var(--hz-text-muted); }

/* ============================================
   SOURCE OPTION CARDS (create list wizard)
   ============================================ */
.source-option {
    transition: var(--hz-transition);
    border: 1px solid var(--hz-border);
}
.source-option:hover {
    border-color: var(--hz-primary);
    transform: translateY(-2px);
    box-shadow: var(--hz-shadow);
}
.source-option.border-primary {
    border-color: var(--hz-primary) !important;
    box-shadow: 0 0 0 1px var(--hz-primary);
}

/* ============================================
   ACCOUNT DROPDOWN (header)
   ============================================ */
.account-dropdown {
    position: relative;
}

.account-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    min-width: 180px;
    background-color: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    box-shadow: var(--hz-shadow);
    z-index: 1050;
    padding: 0.35rem 0;
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    padding: 0.5rem 1rem;
    color: var(--hz-text-primary);
    text-decoration: none;
    transition: background-color var(--hz-transition);
    font-size: 0.9rem;
}

.account-dropdown-tip {
    display: none;
    position: absolute;
    right: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
    width: max-content;
    max-width: 200px;
    padding: 0.4rem 0.65rem;
    border-radius: var(--hz-border-radius);
    background: var(--hz-bg-surface);
    border: 1px solid var(--hz-border);
    box-shadow: var(--hz-shadow);
    font-size: 0.75rem;
    color: var(--hz-text-secondary);
    line-height: 1.35;
    pointer-events: none;
    white-space: normal;
    z-index: 1060;
}

.account-dropdown-tip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--hz-border);
}

.account-dropdown-item:hover .account-dropdown-tip {
    display: block;
}

.account-dropdown-item:hover,
.account-dropdown-item:focus {
    background-color: var(--hz-bg-hover);
    color: var(--hz-text-primary);
    text-decoration: none;
}

.account-dropdown-divider {
    height: 1px;
    margin: 0.35rem 0;
    background-color: var(--hz-border);
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--hz-border-accent);
    transition: border-color var(--hz-transition);
}

.header-avatar:hover {
    border-color: var(--hz-primary);
}

/* ============================================
   IMPORT HEADER INDICATOR
   ============================================ */
.import-header-indicator {
    cursor: pointer;
    transition: opacity var(--hz-transition);
}

.import-header-indicator:hover {
    opacity: 0.8;
}

.import-header-progress {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.import-header-progress-bar {
    height: 100%;
    background: var(--hz-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.import-header-text {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--hz-text-secondary);
    white-space: nowrap;
}

.import-dismiss-btn {
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.5;
    transition: opacity var(--hz-transition);
}

.import-dismiss-btn:hover {
    opacity: 1;
}

/* ============================================
   Session Expiry Modal
   ============================================ */

.session-expiry-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.session-expiry-modal {
    background: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border-accent);
    border-radius: var(--hz-border-radius-lg);
    box-shadow: var(--hz-shadow);
    padding: 2rem;
    text-align: center;
    max-width: 380px;
    width: 90%;
    animation: sessionModalIn 0.2s ease-out;
}

@keyframes sessionModalIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.session-expiry-icon {
    font-size: 2.5rem;
    color: var(--hz-warning);
    margin-bottom: 0.75rem;
}

.session-expiry-title {
    color: var(--hz-text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.session-expiry-text {
    color: var(--hz-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.session-expiry-countdown {
    color: var(--hz-warning);
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.session-expiry-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.account-dropdown-trigger {
    padding: 2px !important;
    display: flex;
    align-items: center;
}

/* ============================================
   PAGE INFO POPOVER
   ============================================ */
.page-info-wrapper {
    position: relative;
}

.page-info-btn {
    color: var(--hz-text-muted);
    font-size: 1.1rem;
    transition: color var(--hz-transition);
}

.page-info-btn:hover {
    color: var(--hz-primary);
}

.page-info-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 1060;
    width: 360px;
    background-color: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    box-shadow: var(--hz-shadow);
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--hz-text-primary);
}

.page-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    color: var(--hz-text-primary);
}

.page-info-header .btn-link {
    color: var(--hz-text-muted);
    font-size: 0.8rem;
}

.page-info-list {
    margin: 0;
    padding-left: 1.1rem;
    list-style: disc;
}

.page-info-list li {
    margin-bottom: 0.4rem;
    color: var(--hz-text-secondary);
    line-height: 1.4;
}

.page-info-list li strong {
    color: var(--hz-text-primary);
}

/* ============================================
   DROPDOWNS
   ============================================ */
.dropdown-menu {
    background-color: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    box-shadow: var(--hz-shadow);
    border-radius: var(--hz-border-radius);
}

.dropdown-item {
    color: var(--hz-text-primary);
    padding: 0.5rem 1rem;
    transition: all var(--hz-transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--hz-bg-hover);
    color: var(--hz-text-primary);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--hz-primary);
    color: var(--hz-text-primary);
}

.dropdown-divider {
    border-color: var(--hz-border);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border-radius: var(--hz-border-radius);
    border: 1px solid;
    padding: 1rem;
}

.alert-success {
    background-color: var(--hz-success-bg);
    border-color: var(--hz-success);
    color: #a3d9a5;
}

.alert-danger {
    background-color: var(--hz-danger-bg);
    border-color: var(--hz-danger);
    color: #f5c6cb;
}

.alert-warning {
    background-color: var(--hz-warning-bg);
    border-color: var(--hz-warning);
    color: #fff3cd;
}

.alert-info {
    background-color: var(--hz-info-bg);
    border-color: var(--hz-info);
    color: #bee5eb;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 500;
    border-radius: var(--hz-border-radius);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.badge.bg-primary,
.bg-primary {
    background-color: var(--hz-primary) !important;
}

.badge.bg-success,
.bg-success {
    background-color: var(--hz-success) !important;
}

.badge.bg-danger,
.bg-danger {
    background-color: var(--hz-danger) !important;
}

.badge.bg-warning,
.bg-warning {
    background-color: var(--hz-warning) !important;
    color: var(--hz-bg-body) !important;
}

.badge.bg-info,
.bg-info {
    background-color: var(--hz-info) !important;
}

.badge.bg-secondary,
.bg-secondary {
    background-color: #6c757d !important;
}

.badge.bg-purple,
.bg-purple {
    background-color: #7c3aed !important;
    color: #fff !important;
}

.badge.bg-mock,
.bg-mock {
    background-color: #17a2b8 !important;
    color: #fff !important;
}

.border-mock {
    border-color: #17a2b8 !important;
    border-width: 2px !important;
}

/* ============================================
   COMMAND CENTER (Dashboard)
   ============================================ */
.cc-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cc-clickable { cursor: pointer; }

/* ── Alerts Strip ── */
.cc-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cc-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: var(--hz-border-radius);
    font-size: 0.875rem;
    font-weight: 500;
}
.cc-alert i { font-size: 1.1rem; flex-shrink: 0; }
.cc-alert span { flex: 1; }
.cc-alert--danger  { background: rgba(220,53,69,.15); color: #f87171; border-left: 3px solid var(--hz-danger); }
.cc-alert--warning { background: rgba(255,193,7,.12); color: #fbbf24; border-left: 3px solid var(--hz-warning); }
.cc-alert--info    { background: rgba(23,162,184,.12); color: #67d4e5; border-left: 3px solid var(--hz-info); }
.cc-alert-action {
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    color: inherit;
    opacity: .85;
    transition: opacity .15s;
}
.cc-alert-action:hover { opacity: 1; text-decoration: underline; }

/* ── Member Section ── */
.cc-member-section .card { background: var(--hz-bg-surface); border-color: var(--hz-border); }
.cc-member-section .card-header { background: var(--hz-bg-elevated); }
.cc-member-section .list-group-item { background: transparent; border-color: var(--hz-border); }

/* ── Header Row ── */
.cc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}
.cc-welcome { margin: 0; font-size: 1.35rem; font-weight: 700; color: #fff; }
.cc-date { margin: 0.15rem 0 0; font-size: 0.8rem; color: var(--hz-text-muted); }

.cc-quick-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--hz-border-radius);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.cc-action-btn:hover { transform: translateY(-1px); }
.cc-action-btn--primary {
    background: var(--hz-primary);
    color: #fff;
}
.cc-action-btn--primary:hover { background: #b71f30; color: #fff; }
.cc-action-btn--secondary {
    background: var(--hz-bg-elevated);
    color: var(--hz-text-secondary);
    border: 1px solid var(--hz-border);
}
.cc-action-btn--secondary:hover { border-color: var(--hz-primary); color: #fff; }

/* ── Two-Column Layout ── */
.cc-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 992px) {
    .cc-layout { grid-template-columns: 1fr; }
}

/* ── Panel ── */
.cc-panel {
    background: var(--hz-bg-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius-lg);
    overflow: hidden;
}
.cc-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem 0.5rem;
}
.cc-panel-title { margin: 0; font-size: 1rem; font-weight: 600; color: #fff; }
.cc-panel-link {
    font-size: 0.78rem;
    color: var(--hz-text-muted);
    text-decoration: none;
    transition: color .15s;
}
.cc-panel-link:hover { color: var(--hz-primary); }

/* ── Filter Tabs ── */
.cc-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--hz-border);
    padding: 0 1rem;
    overflow-x: auto;
}
.cc-tab {
    background: none;
    border: none;
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--hz-text-muted);
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
    cursor: pointer;
}
.cc-tab:hover { color: #fff; }
.cc-tab--active { color: var(--hz-primary); border-bottom-color: var(--hz-primary); }
.cc-tab-count {
    display: inline-block;
    font-size: 0.7rem;
    background: var(--hz-bg-elevated);
    padding: 0 0.4rem;
    border-radius: 9999px;
    margin-left: 0.3rem;
    min-width: 1.2rem;
    text-align: center;
}
.cc-tab-count--warn { background: rgba(220,53,69,.25); color: #f87171; }

/* ── Initiative List ── */
.cc-initiative-list { display: flex; flex-direction: column; }
.cc-init-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--hz-border);
    transition: background .12s;
}
.cc-init-row:last-child { border-bottom: none; }
.cc-init-row:hover { background: var(--hz-bg-elevated); }
.cc-init-row--warn { border-left: 3px solid var(--hz-warning); }

.cc-init-info { flex: 1; min-width: 0; }
.cc-init-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.cc-init-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}
.cc-init-status {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
}
.cc-init-status--running   { background: rgba(220,38,57,.2); color: #f87171; }
.cc-init-status--paused    { background: rgba(255,193,7,.18); color: #fbbf24; }
.cc-init-status--draft     { background: rgba(108,117,125,.2); color: #9ca3af; }
.cc-init-status--scheduled { background: rgba(23,162,184,.18); color: #67d4e5; }
.cc-init-status--completed { background: rgba(40,167,69,.18); color: #6ee7b7; }
.cc-init-status--partial   { background: rgba(255,193,7,.18); color: #fbbf24; }
.cc-init-status--failed    { background: rgba(220,53,69,.25); color: #f87171; }
.cc-init-status--cancelled { background: rgba(108,117,125,.15); color: #6b7280; }

.cc-init-type {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--hz-text-muted);
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--hz-border);
    border-radius: 3px;
}
.cc-init-type--p2p { border-color: var(--hz-info); color: var(--hz-info); }

/* progress bar row */
.cc-init-progress-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.35rem;
}
.cc-init-progress {
    flex: 1;
    height: 5px;
    background: var(--hz-bg-elevated);
    border-radius: 3px;
    display: flex;
    overflow: hidden;
    max-width: 200px;
}
.cc-init-bar { height: 100%; transition: width .3s; }
.cc-init-bar--success { background: var(--hz-success); }
.cc-init-bar--pending { background: var(--hz-warning); }
.cc-init-bar--fail    { background: var(--hz-danger); }

.cc-init-summary { font-size: 0.72rem; color: var(--hz-text-muted); white-space: nowrap; }
.cc-init-response { color: var(--hz-info); }

.cc-init-p2p-stats {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: var(--hz-text-muted);
}
.cc-init-meta { font-size: 0.72rem; color: var(--hz-text-muted); margin-top: 0.25rem; display: block; }
.cc-init-end { color: var(--hz-text-muted); font-size: 0.85rem; flex-shrink: 0; margin-left: 0.5rem; }

.cc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--hz-text-muted);
    font-size: 0.85rem;
}
.cc-empty i { font-size: 1.5rem; }
.cc-empty a { color: var(--hz-primary); }

/* ── Resources Row ── */
.cc-resources {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}
.cc-resource {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.85rem 0.5rem;
    background: var(--hz-bg-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    text-decoration: none;
    transition: border-color .15s, transform .1s;
}
.cc-resource:hover { border-color: var(--hz-primary); transform: translateY(-1px); }
.cc-resource i { font-size: 1.1rem; color: var(--hz-text-muted); }
.cc-resource-count { font-size: 1.1rem; font-weight: 700; color: #fff; }
.cc-resource-label { font-size: 0.7rem; color: var(--hz-text-muted); }
.cc-resource--alert { border-color: var(--hz-warning); }
.cc-resource--alert i { color: var(--hz-warning); }

/* ── Sidebar ── */
.cc-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.cc-sidebar-card {
    background: var(--hz-bg-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius-lg);
    padding: 1rem;
}
.cc-sidebar-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hz-text-muted);
    margin-bottom: 0.6rem;
}
.cc-sidebar-link {
    display: block;
    margin-top: 0.65rem;
    font-size: 0.78rem;
    color: var(--hz-text-muted);
    text-decoration: none;
}
.cc-sidebar-link:hover { color: var(--hz-primary); }
.cc-sidebar-empty { font-size: 0.82rem; color: var(--hz-text-muted); padding: 0.5rem 0; }

/* group badges and tag pills */
.cc-group-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(var(--hz-primary-rgb, 99, 102, 241), 0.15);
    color: var(--hz-primary);
    margin-left: 0.35rem;
    vertical-align: middle;
}
.cc-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
}
.cc-tag-pill {
    display: inline-block;
    font-size: 0.62rem;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: var(--hz-surface-hover, rgba(255,255,255,0.08));
    color: var(--hz-text-muted);
    border: 1px solid var(--hz-border, rgba(255,255,255,0.1));
}

/* member sidebar list */
.cc-member-group-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hz-text-muted);
    margin-top: 0.5rem;
    margin-bottom: 0.15rem;
    padding-bottom: 0.1rem;
    border-bottom: 1px solid var(--hz-border, rgba(255,255,255,0.08));
}
.cc-member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.2rem 0;
}
.cc-member-name { font-weight: 500; }
.cc-member-role {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    text-transform: capitalize;
}
.cc-member-role--owner { background: rgba(var(--hz-warning-rgb, 245, 158, 11), 0.15); color: var(--hz-warning); }
.cc-member-role--coordinator { background: rgba(var(--hz-primary-rgb, 99, 102, 241), 0.15); color: var(--hz-primary); }
.cc-member-role--member { background: rgba(var(--hz-success-rgb, 16, 185, 129), 0.12); color: var(--hz-success); }

/* wallet */
.cc-wallet-balance { font-size: 1.6rem; font-weight: 700; color: var(--hz-success); }
.cc-wallet--low { color: var(--hz-danger) !important; }
.cc-wallet-sub { font-size: 0.75rem; color: var(--hz-text-muted); margin-top: 0.1rem; }
.cc-wallet-period { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.25rem; }
.cc-wallet-row { display: flex; justify-content: space-between; font-size: 0.78rem; }

/* reputation */
.cc-reputation { text-align: center; padding: 0.4rem 0 0.6rem; }
.cc-rep-score { font-size: 2rem; font-weight: 800; line-height: 1; }
.cc-rep-label { font-size: 0.7rem; color: var(--hz-text-muted); margin-top: 0.2rem; }
.cc-rep-info { cursor: help; margin-left: 0.25rem; opacity: 0.6; position: relative; }
.cc-rep-info:hover { opacity: 1; }
.cc-rep-confidence { font-size: 0.65rem; color: var(--hz-warning); margin-top: 0.15rem; font-style: italic; }
.cc-rep--good { color: var(--hz-success); }
.cc-rep--warn { color: var(--hz-warning); }
.cc-rep--bad  { color: var(--hz-danger); }

/* health metrics */
.cc-health-metrics { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.cc-health-row { display: flex; justify-content: space-between; font-size: 0.78rem; }

/* compliance */
.cc-compliance-stats {
    display: flex;
    gap: 0.6rem;
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.cc-compliance-bar {
    height: 5px;
    background: var(--hz-bg-elevated);
    border-radius: 3px;
    display: flex;
    overflow: hidden;
}

/* ============================================
   INITIATIVE CARDS
   ============================================ */
.initiative-card {
    background: var(--hz-bg-surface);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    height: 100%;
}

.initiative-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hz-shadow);
}

/* accent left-border by status */
.initiative-card--running  { border-left: 3px solid var(--hz-primary); }
.initiative-card--paused   { border-left: 3px solid var(--hz-warning); }
.initiative-card--draft    { border-left: 3px solid var(--hz-border-light); }
.initiative-card--completed { border-left: 3px solid var(--hz-success); }
.initiative-card--failed   { border-left: 3px solid var(--hz-danger); }
.initiative-card--partial  { border-left: 3px solid var(--hz-warning); }
.initiative-card--cancelled { border-left: 3px solid var(--hz-text-muted); }

/* past initiatives are dimmed */
.initiative-card--past {
    opacity: 0.7;
}

.initiative-card--past:hover {
    opacity: 1;
}

/* ── header row ── */
.initiative-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.initiative-card-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.initiative-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.initiative-status--draft    { background: var(--hz-bg-elevated); color: var(--hz-text-muted); }
.initiative-status--scheduled { background: var(--hz-info-bg); color: var(--hz-info); }
.initiative-status--running  { background: rgba(220, 38, 57, 0.15); color: var(--hz-primary); }
.initiative-status--paused   { background: var(--hz-warning-bg); color: var(--hz-warning); }
.initiative-status--completed { background: var(--hz-success-bg); color: var(--hz-success); }
.initiative-status--cancelled { background: var(--hz-bg-elevated); color: var(--hz-text-muted); }
.initiative-status--partial  { background: var(--hz-warning-bg); color: var(--hz-warning); }
.initiative-status--failed   { background: var(--hz-danger-bg); color: var(--hz-danger); }

.initiative-badge-mock {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    letter-spacing: 0.05em;
}

.initiative-badge-warn {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--hz-danger-bg);
    color: var(--hz-danger);
}

/* countdown timer badge for scheduled initiatives */
.scheduled-countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: var(--hz-border-radius);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hz-info);
    background: var(--hz-info-bg);
    border: 1px solid rgba(13, 202, 240, 0.3);
    animation: countdown-pulse 2s ease-in-out infinite;
}

@keyframes countdown-pulse {
    0%, 100% { border-color: rgba(13, 202, 240, 0.3); }
    50%      { border-color: rgba(13, 202, 240, 0.6); }
}

/* wind-down phase (PartiallyCompleted) — receive-only */
.initiative-winddown-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    color: #b87a00;
    background: rgba(184, 122, 0, 0.15);
    border: 1px solid rgba(184, 122, 0, 0.4);
}

.initiative-winddown-banner {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--hz-border-radius);
    font-size: 0.85rem;
    color: #b87a00;
    background: rgba(184, 122, 0, 0.1);
    border: 1px solid rgba(184, 122, 0, 0.25);
}

/* ── kebab menu ── */
.initiative-card-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.initiative-kebab {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hz-border-radius);
    color: var(--hz-text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.initiative-kebab:hover {
    background: var(--hz-bg-elevated);
    color: var(--hz-text-primary);
}

.initiative-kebab-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.initiative-kebab-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    min-width: 170px;
    background: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    box-shadow: var(--hz-shadow);
    padding: 0.35rem 0;
    margin-top: 0.25rem;
}

.initiative-kebab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.85rem;
    border: none;
    background: none;
    color: var(--hz-text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
}

.initiative-kebab-item:hover {
    background: var(--hz-bg-hover);
    color: var(--hz-text-primary);
}

.initiative-kebab-item--danger:hover {
    background: var(--hz-danger-bg);
    color: var(--hz-danger);
}

.initiative-kebab-divider {
    height: 1px;
    background: var(--hz-border);
    margin: 0.25rem 0;
}

.initiative-nav-arrow {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hz-border-radius);
    color: var(--hz-text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.initiative-nav-arrow:hover {
    background: var(--hz-primary-light);
    color: var(--hz-primary);
}

/* ── title + description ── */
.initiative-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hz-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.initiative-card-desc {
    font-size: 0.78rem;
    color: var(--hz-text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: -0.25rem;
}

/* ── hero stat ── */
.initiative-card-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
}

.initiative-hero-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.initiative-hero-unit {
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.7;
}

.initiative-hero-label {
    font-size: 0.75rem;
    color: var(--hz-text-muted);
    margin-top: 0.25rem;
}

.text-stat-success { color: var(--hz-success); }
.text-stat-warn    { color: var(--hz-warning); }
.text-stat-danger  { color: var(--hz-danger); }
.text-stat-muted   { color: var(--hz-text-muted); }

/* ── progress bar ── */
.initiative-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.initiative-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--hz-bg-elevated);
    display: flex;
    overflow: hidden;
}

.initiative-progress-segment {
    height: 100%;
    transition: width 0.4s ease;
}

.initiative-progress--success { background: var(--hz-success); }
.initiative-progress--pending { background: var(--hz-warning); }
.initiative-progress--fail    { background: var(--hz-danger); }

.initiative-progress-legend {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.initiative-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--hz-text-muted);
}

.initiative-legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.initiative-legend-dot--success { background: var(--hz-success); }
.initiative-legend-dot--pending { background: var(--hz-warning); }
.initiative-legend-dot--fail    { background: var(--hz-danger); }

/* ── draft stats ── */
.initiative-draft-stats {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    font-size: 0.8rem;
    color: var(--hz-text-secondary);
}

/* ── footer ── */
.initiative-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--hz-border);
}

.initiative-recency {
    font-size: 0.72rem;
    color: var(--hz-text-muted);
}

.initiative-primary-action {
    flex-shrink: 0;
}

/* primary action buttons */
.btn-initiative {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    border: none;
    border-radius: var(--hz-border-radius);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-initiative:active {
    transform: scale(0.97);
}

.btn-initiative:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-initiative--activate {
    background: var(--hz-success);
    color: #fff;
}

.btn-initiative--activate:hover:not(:disabled) {
    background: #22923c;
}

.btn-initiative--pause {
    background: var(--hz-warning);
    color: #000;
}

.btn-initiative--pause:hover {
    background: #e0a800;
}

.btn-initiative--resume {
    background: var(--hz-success);
    color: #fff;
}

.btn-initiative--resume:hover {
    background: #22923c;
}

/* ============================================
   INITIATIVE SECTIONS (Active / Past grouping)
   ============================================ */
.initiatives-section {
    margin-bottom: 2rem;
}

.initiatives-section--past {
    margin-top: 1rem;
}

.initiatives-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
}

.initiatives-section-heading {
    display: flex;
    align-items: center;
    color: var(--hz-text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.initiatives-section-header .initiatives-section-heading {
    margin-bottom: 0;
}

.initiatives-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--hz-bg-elevated);
    color: var(--hz-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.initiatives-section-toggle {
    color: var(--hz-text-muted);
    transition: transform 0.2s ease;
}

.badge.bg-dark,
.bg-dark {
    background-color: var(--hz-bg-elevated) !important;
}

/* ============================================
   PROGRESS BARS
   ============================================ */
.progress {
    background-color: var(--hz-bg-elevated);
    border-radius: var(--hz-border-radius);
    height: 0.5rem;
}

.progress-bar {
    transition: width var(--hz-transition);
}

.progress-bar.bg-success {
    background-color: var(--hz-success) !important;
}

.progress-bar.bg-danger {
    background-color: var(--hz-danger) !important;
}

.progress-bar.bg-warning {
    background-color: var(--hz-warning) !important;
}

.progress-bar.bg-info {
    background-color: var(--hz-info) !important;
}

/* ============================================
   SPINNERS
   ============================================ */
.spinner-border {
    color: var(--hz-primary);
}

.spinner-border.text-primary {
    color: var(--hz-primary) !important;
}

/* ============================================
   TOASTS
   ============================================ */
.toast {
    background-color: var(--hz-bg-elevated) !important;
    color: var(--hz-text-primary) !important;
    border: 1px solid var(--hz-border-accent) !important;
    box-shadow: var(--hz-shadow) !important;
    border-radius: var(--hz-border-radius-lg) !important;
    backdrop-filter: blur(10px) !important;
    min-width: 300px !important;
    max-width: 600px !important;
    animation: slideInFromTop 0.3s ease-out !important;
}

.toast .toast-body {
    background-color: var(--hz-bg-elevated) !important;
    color: var(--hz-text-primary) !important;
    padding: 0.75rem 1rem !important;
    border-radius: var(--hz-border-radius-lg) !important;
    font-size: 0.9rem !important;
}

/* Toast Variants */
.toast-success,
.toast.bg-success {
    background: linear-gradient(135deg, var(--hz-success-bg), #1a4d1a) !important;
    border-color: var(--hz-success) !important;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3) !important;
}

.toast-error,
.toast.bg-danger {
    background: linear-gradient(135deg, var(--hz-danger-bg), #4d1a1a) !important;
    border-color: var(--hz-danger) !important;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3) !important;
}

.toast-warning,
.toast.bg-warning {
    background: linear-gradient(135deg, var(--hz-warning-bg), #4d4a1a) !important;
    border-color: var(--hz-warning) !important;
    box-shadow: 0 4px 20px rgba(255, 193, 7, 0.3) !important;
}

.toast-info,
.toast.bg-info {
    background: linear-gradient(135deg, var(--hz-info-bg), #1a424d) !important;
    border-color: var(--hz-info) !important;
    box-shadow: 0 4px 20px rgba(23, 162, 184, 0.3) !important;
}

.toast-container {
    position: fixed !important;
    z-index: 1055 !important;
}

.toast.hiding {
    animation: slideOutToTop 0.3s ease-in forwards !important;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* ============================================
   LIST GROUPS
   ============================================ */
.list-group {
    border-radius: var(--hz-border-radius);
}

.list-group-item {
    background-color: var(--hz-bg-surface);
    border-color: var(--hz-border);
    color: var(--hz-text-primary);
    padding: 0.75rem 1rem;
}

.list-group-item:hover {
    background-color: var(--hz-bg-hover);
}

.list-group-item.active {
    background-color: var(--hz-primary);
    border-color: var(--hz-primary);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    gap: 0.25rem;
}

.page-link {
    background-color: var(--hz-bg-surface);
    border-color: var(--hz-border);
    color: var(--hz-text-primary);
    transition: all var(--hz-transition);
}

.page-link:hover {
    background-color: var(--hz-bg-hover);
    border-color: var(--hz-border-accent);
    color: var(--hz-primary);
}

.page-item.active .page-link {
    background-color: var(--hz-primary);
    border-color: var(--hz-primary);
    color: var(--hz-text-primary);
}

.page-item.disabled .page-link {
    background-color: var(--hz-bg-surface);
    border-color: var(--hz-border);
    color: var(--hz-text-disabled);
}

/* ============================================
   ACCORDION
   ============================================ */
.accordion {
    --bs-accordion-bg: var(--hz-bg-surface);
    --bs-accordion-border-color: var(--hz-border);
    --bs-accordion-btn-color: var(--hz-text-primary);
    --bs-accordion-btn-bg: var(--hz-bg-surface);
    --bs-accordion-active-color: var(--hz-primary);
    --bs-accordion-active-bg: var(--hz-bg-elevated);
}

.accordion-button {
    background-color: var(--hz-bg-surface);
    color: var(--hz-text-primary);
}

.accordion-button:not(.collapsed) {
    background-color: var(--hz-bg-elevated);
    color: var(--hz-primary);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem var(--hz-primary-light);
    border-color: var(--hz-primary);
}

.accordion-body {
    background-color: var(--hz-bg-surface);
    color: var(--hz-text-primary);
}

/* ============================================
   TABS
   ============================================ */
.nav-tabs {
    border-bottom-color: var(--hz-border);
}

.nav-tabs .nav-link {
    color: var(--hz-text-secondary);
    border-color: transparent;
    transition: all var(--hz-transition);
}

.nav-tabs .nav-link:hover {
    border-color: var(--hz-border) var(--hz-border) transparent;
    color: var(--hz-text-primary);
}

.nav-tabs .nav-link.active {
    background-color: var(--hz-bg-surface);
    border-color: var(--hz-primary) var(--hz-border) var(--hz-bg-surface);
    border-top-width: 2px;
    color: var(--hz-text-primary);
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

/* connect active tab to content area */
.nav-tabs {
    margin-bottom: 0 !important;
}

.nav-tabs + .tab-content {
    border-top: 1px solid var(--hz-border);
    padding-top: 1.5rem;
}

.nav-pills .nav-link {
    color: var(--hz-text-secondary);
    border-radius: var(--hz-border-radius);
    transition: all var(--hz-transition);
}

.nav-pills .nav-link:hover {
    background-color: var(--hz-bg-hover);
    color: var(--hz-text-primary);
}

.nav-pills .nav-link.active {
    background-color: var(--hz-primary);
    color: var(--hz-text-primary);
}

.nav-pills-sm .nav-link {
    font-size: 0.8rem;
}

/* ============================================
   STEP INDICATOR (Onboarding)
   ============================================ */
.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #6c757d;
    color: var(--hz-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    transition: all var(--hz-transition);
}

.step-indicator.active {
    background-color: var(--hz-primary);
}

.step-line {
    width: 50px;
    height: 2px;
    background-color: #6c757d;
    margin: 0 10px;
    transition: all var(--hz-transition);
}

.step-line.active {
    background-color: var(--hz-primary);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
/* Text Colors */
.text-muted {
    color: var(--hz-text-muted) !important;
}

.text-primary {
    color: var(--hz-primary) !important;
}

.text-success {
    color: var(--hz-success) !important;
}

.text-danger {
    color: var(--hz-danger) !important;
}

.text-warning {
    color: var(--hz-warning) !important;
}

.text-info {
    color: var(--hz-info) !important;
}

.text-light {
    color: var(--hz-text-primary) !important;
}

.text-white {
    color: var(--hz-text-primary) !important;
}

/* Background Colors */
.bg-body {
    background-color: var(--hz-bg-body) !important;
}

.bg-surface {
    background-color: var(--hz-bg-surface) !important;
}

/* Borders */
.border {
    border-color: var(--hz-border) !important;
}

.border-primary {
    border-color: var(--hz-primary) !important;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--hz-primary), var(--hz-primary-hover));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #e63946, var(--hz-primary));
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--hz-primary) rgba(0, 0, 0, 0.3);
}

/* ============================================
   FOCUS STYLES
   ============================================ */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--hz-primary);
    outline-offset: 2px;
}

/* ============================================
   SELECTION
   ============================================ */
::selection {
    background: var(--hz-primary-glow);
    color: var(--hz-text-primary);
}

/* ============================================
   RESPONSIVE STYLES - MOBILE FIRST
   ============================================ */

/* --- Extra Small Devices (phones, < 576px) --- */
@media (max-width: 575.98px) {
    :root {
        --hz-topbar-height: 3.5rem;
    }

    /* Typography scaling */
    html {
        font-size: 14px;
    }

    h1, .display-4 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    h4, .h4 { font-size: 1.1rem; }
    .display-6 { font-size: 1.5rem; }
    .lead { font-size: 1rem; }

    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
        font-size: 1rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
    }

    .btn-lg {
        min-height: 52px;
        padding: 0.75rem 1.25rem;
    }

    /* Touch-friendly form controls */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    .form-control,
    .form-select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 0.625rem 0.875rem;
    }

    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Content padding */
    article,
    article.content {
        padding: 1rem;
        padding-top: 4.5rem;
    }

    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Cards */
    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header,
    .card-footer {
        padding: 0.75rem 1rem;
    }

    /* Modals - full screen on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }

    .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .modal-body {
        max-height: calc(100vh - 10rem);
        overflow-y: auto;
    }

    .modal-xl,
    .modal-lg {
        max-width: calc(100% - 1rem);
    }

    /* Tables */
    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    /* Nav menu */
    .nav-link {
        padding: 0.875rem 1rem;
    }

    /* Badges */
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    /* Dropdowns */
    .dropdown-menu {
        min-width: 100%;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }

    /* Alerts */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Progress bars */
    .progress {
        height: 0.625rem;
    }

    /* Pagination */
    .page-link {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Scroll areas - adjust for mobile */
    .scroll-area-sm { max-height: 120px; }
    .scroll-area-md { max-height: 200px; }
    .scroll-area-lg { max-height: 300px; }

    /* Hide non-essential columns on mobile */
    .d-mobile-none {
        display: none !important;
    }

    /* Stack buttons vertically */
    .btn-group-mobile-stack {
        flex-direction: column;
        width: 100%;
    }

    .btn-group-mobile-stack > .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        border-radius: var(--hz-border-radius) !important;
    }

    /* Full width buttons on mobile */
    .btn-mobile-full {
        width: 100%;
    }
}

/* --- Small Devices (landscape phones, 576px - 767px) --- */
@media (min-width: 576px) and (max-width: 767.98px) {
    html {
        font-size: 15px;
    }

    .btn {
        min-height: 42px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    .form-control,
    .form-select {
        min-height: 42px;
        font-size: 16px;
    }

    article,
    article.content {
        padding: 1.25rem;
        padding-top: 5rem;
    }

    .modal-dialog {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* --- Medium Devices (tablets, < 768px combined) --- */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--hz-transition);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        width: var(--hz-sidebar-width);
        height: 100vh;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .page main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .top-row {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        margin-left: 0 !important;
    }
    
    article,
    article.content {
        margin-left: 0 !important;
    }
    
    .sidebar.show::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    /* Two-column grid becomes single column */
    .row > .col-md-6:only-child,
    .row > .col-lg-6:only-child {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Card grid adjustments */
    .row-cols-md-2 > * {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* --- Tablet and up (768px+) --- */
@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar.show ~ main {
        margin-left: 0;
        width: 100%;
    }

    .btn {
        min-height: 40px;
    }
}

/* --- Desktop (1025px+) --- */
@media (min-width: 1025px) {
    .navbar-toggler {
        display: block !important;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar.show ~ main {
        margin-left: var(--hz-sidebar-width);
        width: calc(100% - var(--hz-sidebar-width));
    }
    
    .page main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .sidebar.persistent {
        transform: translateX(0);
    }
    
    .sidebar.persistent ~ main {
        margin-left: var(--hz-sidebar-width);
        width: calc(100% - var(--hz-sidebar-width));
    }
}

/* --- iPhone Safe Areas (notch/home indicator) --- */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .top-row {
        padding-top: env(safe-area-inset-top);
    }

    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    @media (max-width: 767.98px) {
        article,
        article.content {
            padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        }

        .modal-content {
            padding-bottom: env(safe-area-inset-bottom);
        }
    }
}

/* --- Touch Device Optimizations --- */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn-close {
        width: 2rem;
        height: 2rem;
    }

    /* Remove hover effects that don't work on touch */
    .card:hover {
        transform: none;
    }

    .btn:hover {
        transform: none;
    }

    /* Better touch scrolling */
    .scroll-area-sm,
    .scroll-area-md,
    .scroll-area-lg,
    .scroll-area-xs,
    .modal-body,
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Sortable headers need bigger tap area */
    .sortable-header {
        padding: 0.75rem 0.5rem;
    }
}

/* --- High DPI / Retina Displays --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure thin borders render correctly */
    .border,
    .card,
    .modal-content,
    .form-control {
        border-width: 0.5px;
    }
}

/* --- Landscape Phone Orientation --- */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-dialog-centered {
        align-items: flex-start;
        padding-top: 1rem;
    }

    .modal-body {
        max-height: calc(100vh - 8rem);
    }

    article,
    article.content {
        padding-top: 4rem;
    }
}

/* ============================================
   LOADING / EMPTY STATES
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--hz-text-muted);
}

.empty-state i,
.empty-state .bi {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   AVATAR / PROFILE
   ============================================ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--hz-bg-elevated);
}

.avatar-lg {
    width: 150px;
    height: 150px;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hz-bg-elevated);
    color: var(--hz-text-muted);
}

/* ============================================
   CUSTOM CONTAINER OVERRIDES
   ============================================ */
.container,
.container-fluid {
    color: var(--hz-text-primary);
}

/* ============================================
   BLAZOR SPECIFIC
   ============================================ */
#blazor-error-ui {
    background: var(--hz-danger-bg);
    color: var(--hz-danger);
    border-top: 1px solid var(--hz-danger);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--hz-success);
}

.invalid {
    outline: 1px solid var(--hz-danger);
}

.validation-message {
    color: var(--hz-danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ============================================
   TOOLTIP STYLES (LEGAL PAGES)
   ============================================ */
.tooltip-custom {
    position: relative;
    border-bottom: 1px dotted var(--hz-text-primary);
    cursor: help;
}

.tooltip-custom .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--hz-bg-hover);
    color: var(--hz-text-primary);
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--hz-border-radius);
    border: 1px solid var(--hz-border-accent);
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity var(--hz-transition);
}

.tooltip-custom:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Details/Summary Styling */
details summary {
    outline: none;
    cursor: pointer;
}

details[open] summary {
    margin-bottom: 0.5rem;
}

/* ============================================
   LOADING CONTAINER
   ============================================ */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Modal Overlay - Semi-transparent backdrop for modals */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Scrollable containers with max-height constraints */
.scroll-area-sm {
    max-height: 150px;
    overflow-y: auto;
}

.scroll-area-md {
    max-height: 300px;
    overflow-y: auto;
}

.scroll-area-lg {
    max-height: 400px;
    overflow-y: auto;
}

/* Dark surface backgrounds */
.bg-surface-dark {
    background-color: #2a2a2a;
}

/* Stripe card element container */
.stripe-element-container {
    padding: 12px;
    height: auto;
    min-height: 44px;
}

/* Text utilities */
.text-pre-wrap {
    white-space: pre-wrap;
}

/* Center content container */
.min-vh-50 {
    min-height: 50vh;
}

/* Toast container z-index */
.z-toast {
    z-index: 1055;
}

/* Logo/Avatar container - fixed size with overflow */
.logo-avatar {
    width: 60px;
    height: 60px;
    overflow: hidden;
}

.logo-avatar img {
    width: 60px;
    height: 60px;
    object-fit: cover;
}

/* Gradient card background */
.card-gradient {
    background: linear-gradient(135deg, #252525, #1f1f1f);
}

/* Password toggle button positioning */
.password-toggle-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #e5e5e5;
    padding: 0;
}

.password-toggle-btn:hover {
    color: var(--hz-primary);
}

/* Extra small scroll area */
.scroll-area-xs {
    max-height: 200px;
    overflow-y: auto;
}

/* Progress bar thin variant */
.progress-thin {
    height: 4px;
}

/* Template preview card */
.template-preview-card {
    background-color: var(--bs-dark, #1a1a2e);
    border: 1px solid var(--bs-border-color, #444);
}

.template-preview-body {
    background-color: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
}

/* ── Subscription blocked overlay ── */
.subscription-blocked-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.subscription-blocked-card {
    max-width: 480px;
    padding: 3rem 2rem;
    border-radius: 1rem;
    background: var(--bs-body-bg, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* ── Donation dashboard ── */
.donation-dashboard .donation-stat-card {
    transition: transform var(--hz-transition), box-shadow var(--hz-transition);
}

.donation-dashboard .donation-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hz-shadow);
}

.donation-dashboard .badge {
    font-size: 0.75rem;
}

/* icon pill background for stat cards */
.donation-icon-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
}

/* dot-leader ledger rows */
.donation-ledger-row {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.donation-ledger-dots {
    flex: 1;
    border-bottom: 1px dotted var(--hz-border-light);
    margin-bottom: 4px;
}

/* pulsing live indicator */
.donation-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--hz-success);
    animation: donation-pulse 1.5s ease-in-out infinite;
}

@keyframes donation-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ── Consent timeline ── */
.consent-timeline-list {
    position: relative;
    padding-left: 28px;
}

.consent-timeline-list::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--hz-border, #dee2e6);
}

.consent-timeline-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
}

.consent-timeline-item:last-child {
    padding-bottom: 0;
}

.consent-timeline-marker {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fff;
    margin-left: -28px;
    z-index: 1;
}

.consent-timeline-marker.marker-success { background: var(--bs-success); }
.consent-timeline-marker.marker-danger { background: var(--bs-danger); }
.consent-timeline-marker.marker-warning { background: var(--bs-warning); color: #212529; }
.consent-timeline-marker.marker-secondary { background: var(--bs-secondary); }

.consent-timeline-content {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: var(--hz-card-bg, #f8f9fa);
    border-radius: 6px;
    border: 1px solid var(--hz-border, #dee2e6);
}

.consent-text-preview {
    padding: 8px 12px;
    background: var(--hz-bg, #fff);
    border: 1px solid var(--hz-border, #dee2e6);
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    max-height: 150px;
    overflow-y: auto;
}

.trustedform-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0d6e3f;
    background: #d1f7e5;
    border: 1px solid #a3e4c1;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.15s;
}
.trustedform-badge:hover {
    background: #b8f0d5;
    color: #0a5c34;
    text-decoration: none;
}

/* ── Custom Fields & Field Management ── */
.cursor-pointer {
    cursor: pointer;
}

.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    line-height: 1.3;
}

.card.border-primary {
    border-color: var(--hz-primary) !important;
    background: rgba(220, 38, 57, 0.05);
}

/* ============================================
   COLUMN MAPPING TABLE (Data Vault)
   ============================================ */
.column-mapping-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.column-mapping-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.column-mapping-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    transition: border-color 0.2s;
}

.column-mapping-search:focus-within {
    border-color: var(--hz-primary);
}

.column-mapping-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--hz-text-primary);
    width: 100%;
    font-size: 0.875rem;
}

.column-mapping-search input::placeholder {
    color: var(--hz-text-muted);
}

.column-mapping-search .btn-clear {
    background: none;
    border: none;
    color: var(--hz-text-muted);
    padding: 0;
    cursor: pointer;
    line-height: 1;
    font-size: 0.75rem;
}

.column-mapping-search .btn-clear:hover {
    color: var(--hz-text-primary);
}

.column-mapping-filters {
    display: flex;
    gap: 0.375rem;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: var(--hz-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--hz-text-primary);
}

.filter-chip.active {
    background: var(--hz-primary);
    border-color: var(--hz-primary);
    color: #fff;
}

/* sections */
.mapping-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.mapping-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    padding: 0.6rem 0.75rem;
    color: var(--hz-text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.mapping-section-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mapping-section-body {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mapping-section-collapsed-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.mapped-preview-chip {
    background: rgba(25, 135, 84, 0.12);
    color: #75b798;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.ignored-preview-chip {
    background: rgba(108, 117, 125, 0.15);
    color: var(--hz-text-muted);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.column-mapping-table thead th {
    position: sticky;
    top: 0;
    background: var(--hz-bg-card, #1a1a2e);
    z-index: 5;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--hz-text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.column-mapping-table tbody tr {
    transition: background 0.1s;
}

.column-mapping-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.mapping-row-duplicate {
    background: rgba(255, 193, 7, 0.06) !important;
}

/* compact list for bulk-auto sections */
.compact-column-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
    max-height: 320px;
    overflow-y: auto;
}

.compact-column-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

.compact-column-name {
    color: var(--hz-text-primary);
    font-weight: 500;
}

.compact-column-sample {
    color: var(--hz-text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* preview chips for collapsed sections */
.election-preview-chip {
    background: rgba(13, 202, 240, 0.1);
    color: #6edff6;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.customdata-preview-chip {
    background: rgba(13, 202, 240, 0.08);
    color: #6edff6;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* custom modal overlay — css-toggled to prevent blazor DOM flicker */
.modal-overlay-custom {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.modal-overlay-custom.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay-custom .modal-panel-custom {
    width: 340px;
    max-width: 90vw;
}

/* ============================================
   BILLING PAGE STYLES
   ============================================ */

/* billing-safe neutral/blue accent for financial numbers (avoids red-on-black anxiety) */
.billing-hero-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}
.billing-hero-value.billing-accent {
    color: #5ba4f5;
}
.billing-hero-label {
    font-size: 0.85rem;
    color: var(--hz-text-muted);
    margin-top: 0.25rem;
}
.billing-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
}
.billing-stat-label {
    font-size: 0.75rem;
    color: var(--hz-text-muted);
}

/* wallet progress bar */
.billing-progress-track {
    width: 100%;
    height: 8px;
    background: var(--hz-bg-elevated);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.75rem 0 0.25rem;
}
.billing-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #5ba4f5, #3d8bd4);
    transition: width 0.4s ease;
}
.billing-progress-fill.billing-progress--low {
    background: linear-gradient(90deg, var(--hz-warning), #e6a700);
}
.billing-progress-fill.billing-progress--critical {
    background: linear-gradient(90deg, var(--hz-danger), #c0392b);
}

/* credit card visual */
.billing-cc-visual {
    position: relative;
    background: linear-gradient(135deg, #1e2a3a 0%, #2c3e50 50%, #1a252f 100%);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
}
.billing-cc-visual::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}
.billing-cc-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.billing-cc-number {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e0e0e0;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}
.billing-cc-expiry {
    font-size: 0.75rem;
    color: var(--hz-text-muted);
}
.billing-cc-chip {
    width: 36px;
    height: 26px;
    background: linear-gradient(135deg, #d4af37, #c5a028);
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

/* pricing cards */
.billing-pricing-card {
    background: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius-lg);
    padding: 1.25rem;
    text-align: center;
    transition: border-color var(--hz-transition);
    height: 100%;
}
.billing-pricing-card:hover {
    border-color: var(--hz-border-light);
}
.billing-pricing-card .billing-pricing-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0.5rem 0;
}
.billing-pricing-card .billing-pricing-label {
    font-size: 0.8rem;
    color: var(--hz-text-muted);
}
.billing-pricing-card .billing-pricing-icon {
    font-size: 1.5rem;
    color: #5ba4f5;
    margin-bottom: 0.25rem;
}

/* transaction day grouping */
.billing-tx-day-header {
    background: var(--hz-bg-surface);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hz-text-secondary);
    border-bottom: 1px solid var(--hz-border);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.billing-tx-day-header:hover {
    background: var(--hz-bg-hover);
}
.billing-tx-day-header .billing-tx-day-summary {
    font-weight: 400;
    color: var(--hz-text-muted);
    font-size: 0.75rem;
}
.billing-tx-direction-in {
    color: var(--hz-success);
}
.billing-tx-direction-out {
    color: #5ba4f5;
}

/* billing accordion */
.billing-accordion-item {
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.billing-accordion-header {
    background: var(--hz-bg-elevated);
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hz-text-primary);
    user-select: none;
    transition: background var(--hz-transition);
}
.billing-accordion-header:hover {
    background: var(--hz-bg-hover);
}
.billing-accordion-body {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--hz-text-secondary);
    border-top: 1px solid var(--hz-border);
}

/* cost breakdown table */
.billing-breakdown-table {
    width: 100%;
    font-size: 0.85rem;
}
.billing-breakdown-table td {
    padding: 0.4rem 0;
    color: var(--hz-text-secondary);
}
.billing-breakdown-table td:last-child {
    text-align: right;
    color: #e0e0e0;
    font-weight: 500;
}
.billing-breakdown-table tr.billing-breakdown-total td {
    border-top: 1px solid var(--hz-border);
    padding-top: 0.6rem;
    font-weight: 600;
    color: #ffffff;
}

/* invoice section */
.billing-invoice-summary {
    background: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.billing-invoice-summary .billing-invoice-period {
    font-weight: 600;
    color: #ffffff;
}
.billing-invoice-summary .billing-invoice-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #5ba4f5;
}

/* in-kind contribution tracker */
.inkind-card {
    border-left: 3px solid #5ba4f5;
}
.inkind-cycle-label {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}
.inkind-breakdown-item {
    background: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    border-radius: var(--hz-border-radius);
    padding: 0.75rem;
    text-align: center;
}
.inkind-rates-table {
    font-size: 0.85rem;
}
.inkind-rates-table th {
    font-weight: 500;
    color: var(--hz-text-muted);
    border-bottom-color: var(--hz-border);
}
.inkind-rates-table td {
    border-bottom-color: var(--hz-border);
}

/* ============================================
   REUSABLE TOOLTIP (hz-tooltip)
   ============================================ */
.hz-tooltip-parent {
    position: relative;
    cursor: default;
}
.hz-tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--hz-bg-elevated, #1a1a1a);
    color: var(--hz-text-primary, #fff);
    border: 1px solid var(--hz-border, #333);
    border-radius: var(--hz-border-radius, 0.375rem);
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1080;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.hz-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--hz-border, #333);
}
.hz-tooltip-parent:hover .hz-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* wider tooltip variant for tab descriptions */
.btn-group .hz-tooltip-parent .hz-tooltip-text {
    white-space: normal;
    width: 220px;
    text-align: center;
}

/* wider tooltip for multi-line descriptions */
.hz-tooltip-wide {
    white-space: normal;
    width: 280px;
    text-align: center;
    line-height: 1.4;
}
.btn-group .hz-tooltip-parent {
    overflow: visible;
}

/* ============================================
   TURF MAP
   ============================================ */
.hz-map-container {
    position: relative;
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--hz-border, #333);
}

.hz-map-container.hz-map-fullheight {
    height: calc(100vh - 220px);
    min-height: 400px;
}

.hz-map-toolbar {
    position: absolute;
    top: 10px;
    right: 60px;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.hz-map-toolbar .btn {
    backdrop-filter: blur(8px);
    background: rgba(31, 41, 55, 0.85);
    border: 1px solid var(--hz-border, #333);
    font-size: 0.8rem;
}

.hz-map-toolbar .btn:hover {
    background: rgba(55, 65, 81, 0.9);
}

.hz-map-btn-wrap {
    position: relative;
}

.hz-map-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    white-space: nowrap;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    color: #e5e7eb;
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--hz-border, #333);
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
}

.hz-map-btn-wrap:hover .hz-map-tooltip {
    display: block;
}

.hz-map-sidebar {
    width: 340px;
    min-width: 280px;
    max-width: 400px;
    overflow-y: hidden;
    border-right: 1px solid var(--hz-border, #333);
    background: var(--hz-bg-primary, #0d1117);
}

/* turf list header */
.tl-header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--hz-border, #333);
}

/* filter chips */
.tl-filters { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tl-chip {
    padding: 1px 8px; border-radius: 10px; font-size: 0.68rem; font-weight: 600;
    background: rgba(255,255,255,0.05); color: #8b949e; border: 1px solid transparent;
    cursor: pointer; transition: all 0.15s;
}
.tl-chip:hover { background: rgba(255,255,255,0.1); }
.tl-chip.active { border-color: #6366f1; color: #a5b4fc; background: rgba(99,102,241,0.15); }
.tl-chip.unassigned.active { border-color: #6b7280; color: #9ca3af; }
.tl-chip.assigned.active { border-color: #3b82f6; color: #60a5fa; }
.tl-chip.inprogress.active { border-color: #f59e0b; color: #fbbf24; }
.tl-chip.completed.active { border-color: #10b981; color: #34d399; }

/* bulk bar */
.tl-bulk-bar {
    display: flex; align-items: center; gap: 6px; padding: 4px 0.75rem;
    border-bottom: 1px solid var(--hz-border, #333);
    background: rgba(255,255,255,0.02);
}

/* group headers */
.tl-group-header {
    display: flex; align-items: center; padding: 4px 0.75rem;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: #8b949e; cursor: pointer; user-select: none;
    background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tl-group-header:hover { background: rgba(255,255,255,0.04); }
.tl-group-count {
    margin-left: auto; background: rgba(255,255,255,0.08); border-radius: 8px;
    padding: 0 6px; font-size: 0.65rem;
}

/* compact rows */
.tl-row {
    display: flex; align-items: center; gap: 6px; padding: 5px 0.75rem 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer;
    transition: background 0.12s;
}
.tl-row:hover { background: rgba(99,102,241,0.06); }
.tl-row.active { background: rgba(99,102,241,0.12); }
.tl-row.selected { background: rgba(239,68,68,0.06); }
.tl-row.note-match { outline: 1px solid var(--hz-primary); outline-offset: -1px; }

/* left color bar */
.tl-status-bar { width: 3px; align-self: stretch; border-radius: 0 2px 2px 0; flex-shrink: 0; }
.tl-row.unassigned .tl-status-bar { background: #6b7280; }
.tl-row.assigned .tl-status-bar { background: #3b82f6; }
.tl-row.inprogress .tl-status-bar { background: #f59e0b; }
.tl-row.completed .tl-status-bar { background: #10b981; }

.tl-check { flex-shrink: 0; margin: 0; }

.tl-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tl-name {
    font-weight: 600; font-size: 0.82rem; color: var(--hz-text-primary, #e6edf3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-stats { font-size: 0.7rem; color: var(--hz-text-secondary, #8b949e); }

.tl-list { scrollbar-width: thin; scrollbar-color: #333 transparent; }

.tl-footer {
    padding: 4px 0.75rem; border-top: 1px solid var(--hz-border, #333); text-align: center;
}

/* status badges (unchanged) */
.hz-turf-status {
    display: inline-block; padding: 0.1rem 0.4rem; border-radius: 4px;
    font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.03em; flex-shrink: 0; white-space: nowrap;
}
.hz-turf-status.unassigned { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.hz-turf-status.assigned { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.hz-turf-status.inprogress { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.hz-turf-status.completed { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.hz-map-popup .mapboxgl-popup-content {
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid #374151;
}

.hz-map-popup .mapboxgl-popup-tip {
    border-top-color: #1f2937;
}

/* ── GPS marker styles ─────────────────────────────────────── */

/* member blue dot with pulse ring */
.canvass-user-gps-dot {
    width: 18px; height: 18px; border-radius: 50%;
    background: #3b82f6; border: 3px solid #fff;
    box-shadow: 0 0 10px rgba(59,130,246,0.7);
    position: relative;
}
.canvass-user-gps-dot::after {
    content: ''; position: absolute;
    top: -6px; left: -6px;
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid rgba(59,130,246,0.5);
    animation: gps-pulse 2s ease-out infinite;
    pointer-events: none;
}
@keyframes gps-pulse {
    0%   { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* coordinator volunteer dot with label */
.volunteer-gps-dot {
    display: flex; flex-direction: column; align-items: center;
    pointer-events: auto; cursor: pointer;
}
.volunteer-gps-dot-inner {
    width: 16px; height: 16px; border-radius: 50%;
    background: #10b981; border: 2.5px solid #fff;
    box-shadow: 0 0 10px rgba(16,185,129,0.7);
    position: relative;
}
.volunteer-gps-dot-inner::after {
    content: ''; position: absolute;
    top: -5px; left: -5px;
    width: 26px; height: 26px; border-radius: 50%;
    border: 2px solid rgba(16,185,129,0.4);
    animation: gps-pulse 2.5s ease-out infinite;
    pointer-events: none;
}
.volunteer-label {
    margin-top: 2px;
    font-size: 0.6rem; font-weight: 600;
    color: #e5e7eb; white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* overlay panel — floating control on turf map */
.hz-overlay-panel {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    border-radius: 8px;
    backdrop-filter: blur(12px);
    background: rgba(13, 17, 23, 0.92);
    border: 1px solid var(--hz-border, #333);
    min-width: 200px;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hz-overlay-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0.7rem;
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.hz-overlay-toggle:hover {
    color: #fff;
}

.hz-overlay-body {
    padding: 0.3rem 0.7rem 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hz-overlay-body .form-check-input {
    width: 1.8em;
    height: 0.9em;
}

.hz-overlay-body .form-check {
    min-height: 0;
    padding-left: 2.2em;
}

.hz-overlay-body .form-check-label {
    line-height: 1.4;
}

.heatmap-gradient-bar {
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(to right, #3b0764, #7c3aed, #a78bfa, #f59e0b, #ef4444, #fbbf24);
    margin-bottom: 2px;
}

/* ============================================
   TURF DETAIL TABS
   ============================================ */
.turf-tabs {
    border-bottom: 1px solid var(--hz-border, #333);
    gap: 0;
}
.turf-tabs .nav-link {
    color: #8b949e;
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    white-space: nowrap;
}
.turf-tabs .nav-link:hover { color: #e5e7eb; }
.turf-tabs .nav-link.active {
    color: #58a6ff;
    border-bottom-color: #58a6ff;
    background: transparent;
}

/* result distribution bar */
.turf-result-bar {
    display: flex;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}
.turf-result-segment { min-width: 2px; transition: width 0.3s ease; }
.turf-result-segment.result-strong-support { background: #22c55e; }
.turf-result-segment.result-lean-support { background: #86efac; }
.turf-result-segment.result-undecided { background: #fbbf24; }
.turf-result-segment.result-lean-oppose { background: #f87171; }
.turf-result-segment.result-strong-oppose { background: #ef4444; }
.turf-result-segment.result-not-home { background: #6b7280; }
.turf-result-segment.result-moved { background: #a78bfa; }
.turf-result-segment.result-refused { background: #f97316; }
.turf-result-segment.result-inaccessible { background: #64748b; }
.turf-result-segment.result-unknown { background: #374151; }
.turf-result-bar.mini { height: 4px; border-radius: 2px; }

/* result legend dot */
.turf-result-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; margin-right: 6px; flex-shrink: 0;
}
.turf-result-dot.result-strong-support { background: #22c55e; }
.turf-result-dot.result-lean-support { background: #86efac; }
.turf-result-dot.result-undecided { background: #fbbf24; }
.turf-result-dot.result-lean-oppose { background: #f87171; }
.turf-result-dot.result-strong-oppose { background: #ef4444; }
.turf-result-dot.result-not-home { background: #6b7280; }
.turf-result-dot.result-moved { background: #a78bfa; }
.turf-result-dot.result-refused { background: #f97316; }
.turf-result-dot.result-inaccessible { background: #64748b; }
.turf-result-dot.result-unknown { background: #374151; }

/* note cards */
.turf-notes-feed { display: flex; flex-direction: column; gap: 6px; }
.turf-note-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--hz-border, #333);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
}
.turf-note-text { line-height: 1.4; white-space: pre-wrap; word-break: break-word; }

/* note result badges */
.result-badge-support { background: rgba(34,197,94,0.2) !important; color: #4ade80 !important; }
.result-badge-undecided { background: rgba(251,191,36,0.2) !important; color: #fbbf24 !important; }
.result-badge-oppose { background: rgba(239,68,68,0.2) !important; color: #f87171 !important; }
.result-badge-neutral { background: rgba(107,114,128,0.2) !important; color: #9ca3af !important; }

/* turf contacts tab stat cards */
.turf-stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--hz-border, #333);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
}
/* active filter ring on badges */
.badge.ring {
    outline: 2px solid #58a6ff;
    outline-offset: 1px;
}

/* ============================================
   WALK LIST
   ============================================ */
.walk-list-entry {
    transition: background 0.1s ease;
}

.walk-list-entry:hover {
    background: rgba(99, 102, 241, 0.05);
}

.walk-list-box {
    font-size: 0.7rem;
    color: var(--hz-text-secondary, #8b949e);
    border: 1px solid var(--hz-border, #333);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
}

.walk-list-street .card-header {
    font-size: 0.9rem;
}

/* print styles for walk lists */
@media print {
    .no-print { display: none !important; }
    .print-only { display: flex !important; }
    body { background: #fff !important; color: #000 !important; }
    .card { border: 1px solid #ccc !important; break-inside: avoid; }
    .card-header { background: #f0f0f0 !important; color: #000 !important; }
    .walk-list-entry { border-bottom: 1px solid #ddd !important; }
    .text-light { color: #000 !important; }
    .text-secondary { color: #555 !important; }
    .badge { border: 1px solid #999; }
}

/* ═══════════════════════════════════════════════════════════
   canvass session — mobile-first walking ui
   ═══════════════════════════════════════════════════════════ */

.canvass-session {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: var(--hz-bg, #0f1117);
    overflow: hidden;
}

.canvass-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
}

.canvass-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1a1d27;
    border-bottom: 1px solid #2a2d3a;
    color: #fff;
    z-index: 20;
    flex-shrink: 0;
}

.canvass-progress {
    flex-shrink: 0;
}

.canvass-body {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.canvass-map-area {
    flex: 1;
    min-height: 200px;
}

.canvass-door-panel {
    background: #1a1d27;
    border-top: 1px solid #2a2d3a;
    color: #fff;
    flex: 1;
    overflow-y: auto;
}

.canvass-door-panel:not(.open) {
    flex: 0;
    overflow: hidden;
}

.map-hidden-mobile {
    display: none;
}

.canvass-door-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvass-door-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    margin-bottom: 2px;
}

.door-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 10px 12px 4px;
}

.door-voter-chips {
    display: flex;
    gap: 6px;
    padding: 0 12px 8px;
    flex-wrap: wrap;
}

.door-prev-result {
    background: #252836;
    padding: 6px 12px;
    margin: 0 12px 8px;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
}

.door-result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 0 12px 8px;
}

.door-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: transform 0.1s, opacity 0.15s;
}

.door-btn:active { transform: scale(0.95); }
.door-btn:disabled { opacity: 0.5; }

.door-btn i { font-size: 1.1rem; }

.door-btn-strong-support { background: #16a34a; }
.door-btn-lean-support { background: #4ade80; color: #064e3b; }
.door-btn-undecided { background: #d97706; }
.door-btn-lean-oppose { background: #ea580c; }
.door-btn-strong-oppose { background: #dc2626; }
.door-btn-not-home { background: #6b7280; }
.door-btn-moved { background: #475569; }
.door-btn-refused { background: #991b1b; }
.door-btn-inaccessible { background: #334155; }

.door-notes {
    padding: 0 12px 8px;
}

.door-notes textarea {
    background: #252836;
    border-color: #3a3d4a;
    color: #fff;
}

/* survey questions in canvass session */
.door-survey {
    margin: 0 12px 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.door-survey .survey-header {
    font-weight: 600;
    font-size: 0.82rem;
    color: #495057;
    margin-bottom: 6px;
}

.door-survey .survey-question {
    margin-bottom: 8px;
}

.door-survey .survey-question:last-child {
    margin-bottom: 0;
}

.door-survey .survey-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.door-survey .survey-yesno {
    display: flex;
    gap: 6px;
}

.door-survey .survey-yesno .btn {
    flex: 1;
    font-size: 0.78rem;
}

.door-survey .survey-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.door-consent {
    padding: 8px 12px;
    margin: 0 12px 8px;
    border-radius: 8px;
    background: #1e2030;
    border: 1px solid #3a3d4a;
    transition: border-color 0.2s, background 0.2s;
}

.door-consent.consent-active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

.door-consent .form-check-input:checked {
    background-color: #22c55e;
    border-color: #22c55e;
}

.consent-fields input {
    background: #252836;
    border-color: #3a3d4a;
    color: #fff;
}

.consent-signature-wrapper {
    position: relative;
}

.consent-signature-canvas {
    cursor: crosshair;
    display: block;
}

.consent-sig-clear {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 2px 6px;
    font-size: 0.7rem;
    opacity: 0.6;
}

.consent-sig-clear:hover {
    opacity: 1;
}

.note-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 0 4px;
}

.note-chips .chip {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 16px;
    border: 1px solid #3a3d4a;
    background: #1e2030;
    color: #b0b3c0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.note-chips .chip:hover {
    border-color: #6366f1;
    color: #e0e0e0;
}

.note-chips .chip.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #a5b4fc;
}

.resident-tabs {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    overflow-x: auto;
    border-bottom: 1px solid #2a2d3a;
}

.resident-tab {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 16px;
    border: 1px solid #3a3d4a;
    background: #1e2030;
    color: #b0b3c0;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.resident-tab:hover {
    border-color: #6366f1;
    color: #e0e0e0;
}

.resident-tab.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #a5b4fc;
    font-weight: 600;
}

.resident-tab.done {
    border-color: #22c55e;
}

.resident-tab.done.active {
    border-color: #6366f1;
}

.resident-tab .bi-check-circle-fill {
    color: #22c55e;
    font-size: 0.65rem;
}

.door-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid #2a2d3a;
}

.canvass-list-toggle {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    border: none;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 30;
    cursor: pointer;
}

.canvass-door-list {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    background: #1a1d27;
    border-top: 1px solid #2a2d3a;
    z-index: 25;
    display: flex;
    flex-direction: column;
}

.door-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: #fff;
    border-bottom: 1px solid #2a2d3a;
}

.door-list-items {
    overflow-y: auto;
    flex: 1;
}

.door-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #252836;
    color: #fff;
    text-align: left;
    cursor: pointer;
}

.door-list-item:hover, .door-list-item.active { background: #252836; }
.door-list-item.knocked { opacity: 0.6; }

.door-list-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* directions panel */
.canvass-directions-panel {
    position: fixed;
    top: 90px;
    right: 0;
    width: 320px;
    max-height: calc(100vh - 120px);
    background: #1a1d27;
    border-left: 1px solid #2a2d3a;
    z-index: 25;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px rgba(0,0,0,0.4);
}
@media (max-width: 768px) {
    .canvass-directions-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 55vh;
        border-left: none;
        border-top: 1px solid #2a2d3a;
        border-radius: 12px 12px 0 0;
    }
}
.directions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: #fff;
    border-bottom: 1px solid #2a2d3a;
}
.directions-summary {
    display: flex;
    gap: 16px;
    padding: 8px 12px;
    color: #94a3b8;
    font-size: 0.85rem;
    border-bottom: 1px solid #252836;
}
.directions-steps {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}
.direction-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    color: #e2e8f0;
    border-bottom: 1px solid #1e2130;
}
.direction-step .step-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.direction-step .step-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.canvass-summary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 16px;
}

.canvass-summary-card {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 12px;
    padding: 24px;
    color: #fff;
    width: 100%;
    max-width: 400px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.summary-stat {
    text-align: center;
    background: #252836;
    border-radius: 8px;
    padding: 12px 8px;
}

.summary-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
}

.summary-breakdown {
    border-top: 1px solid #2a2d3a;
    padding-top: 8px;
}

/* responsive — ensure map gets space on larger screens */
@media (min-width: 768px) {
    .canvass-body {
        flex-direction: row;
    }
    .canvass-map-area {
        flex: 2;
    }
    .map-hidden-mobile {
        display: block;
    }
    .canvass-door-panel {
        flex: none;
        width: 380px;
        border-top: none;
        border-left: 1px solid #2a2d3a;
        overflow-y: auto;
    }
    .canvass-door-panel:not(.open) {
        width: 380px;
    }
    .door-result-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* edit result highlight */
.door-btn.active-result {
    outline: 3px solid #fbbf24;
    outline-offset: -3px;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.3);
}

/* walk path compute button */
.btn-outline-cyan {
    color: #22d3ee;
    border-color: #22d3ee;
}
.btn-outline-cyan:hover {
    background: #22d3ee;
    color: #0f172a;
}

/* ── mms media upload ── */
.mms-upload-zone {
    border: 2px dashed var(--hz-border, #333);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    transition: border-color 0.2s;
}
.mms-upload-zone:hover {
    border-color: var(--hz-info, #17a2b8);
}
.mms-preview {
    position: relative;
    display: inline-block;
    max-width: 200px;
}
.mms-preview img,
.mms-preview video {
    max-width: 100%;
    max-height: 160px;
    border-radius: 6px;
    border: 1px solid var(--hz-border, #333);
    object-fit: cover;
}
.mms-preview .mms-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.mms-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    background: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
    font-size: 0.7rem;
    font-weight: 600;
}
.mms-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--hz-border, #333);
    vertical-align: middle;
}

/* mock-send golden button */
.btn-mock-send {
    background: linear-gradient(135deg, #c8a415, #e6c22e);
    color: #1a1a1a;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 1rem;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.btn-mock-send:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 0 8px rgba(230, 194, 46, 0.5);
    color: #1a1a1a;
}
.btn-mock-send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    color: #1a1a1a;
}

/* ── Tier Badge ─────────────────────────────────────────────── */
.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.02em;
}
.tier-badge:hover {
    transform: translateY(-1px);
}
.tier-badge-basic {
    background: linear-gradient(135deg, #2a2a3e, #3a3a50);
    color: #b3b3cc;
    border: 1px solid #444466;
}
.tier-badge-basic:hover {
    box-shadow: 0 0 8px rgba(100, 100, 150, 0.3);
}
.tier-badge-pro {
    background: linear-gradient(135deg, #1a3a5c, #2a5a8c);
    color: #7ab8f5;
    border: 1px solid #3a6a9c;
}
.tier-badge-pro:hover {
    box-shadow: 0 0 10px rgba(90, 160, 240, 0.3);
}
.tier-badge-enterprise {
    background: linear-gradient(135deg, #3a2a1a, #5c4a2a);
    color: #f5c842;
    border: 1px solid #6c5a3a;
}
.tier-badge-enterprise:hover {
    box-shadow: 0 0 10px rgba(245, 200, 66, 0.3);
}
.tier-badge-atcost {
    background: linear-gradient(135deg, #1a3a2a, #2a5c3a);
    color: #66cc88;
    border: 1px solid #3a6c4a;
}
.tier-badge-atcost:hover {
    box-shadow: 0 0 10px rgba(102, 204, 136, 0.3);
}

/* ── Plan Cards (PlansModal) ────────────────────────────────── */
.plan-card {
    background: var(--hz-bg-elevated);
    border: 1px solid var(--hz-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.plan-card:hover {
    border-color: var(--hz-border-light);
}
.plan-card-current {
    border-color: var(--hz-primary) !important;
    box-shadow: 0 0 12px rgba(220, 38, 57, 0.15);
}
.plan-card-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hz-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.75rem;
    border-radius: 10px;
    letter-spacing: 0.02em;
}
.plan-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--hz-text-primary);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.plan-card-price {
    margin-bottom: 0.75rem;
}
.plan-card-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--hz-text-primary);
}
.plan-card-period {
    font-size: 0.85rem;
    color: var(--hz-text-muted);
}
.plan-card-rates {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    color: var(--hz-text-secondary);
    text-align: left;
}
.plan-card-rates li {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--hz-border);
}
.plan-card-rates li:last-child {
    border-bottom: none;
}
.plan-card-features {
    margin-bottom: 0.25rem;
}

/* tier-specific plan card accents */
.plan-card-pro {
    border-color: #2a5a8c;
}
.plan-card-pro .plan-card-name {
    color: #7ab8f5;
}
.plan-card-enterprise {
    border-color: #5c4a2a;
}
.plan-card-enterprise .plan-card-name {
    color: #f5c842;
}

/* ── Feature Gate (locked content) ──────────────────────────── */
.feature-gate-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--hz-bg-elevated);
    border: 1px dashed var(--hz-border);
    border-radius: 12px;
    text-align: center;
}
.feature-gate-icon {
    font-size: 2rem;
    color: var(--hz-text-muted);
    margin-bottom: 0.75rem;
}
.feature-gate-message {
    color: var(--hz-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    max-width: 300px;
}

/* ── Tier Reference Cards (Admin) ───────────────────────────── */
.tier-ref-card {
    border: 1px solid var(--hz-border);
    transition: border-color 0.2s ease;
}
.tier-ref-basic {
    border-left: 3px solid #666;
}
.tier-ref-pro {
    border-left: 3px solid #7ab8f5;
}
.tier-ref-enterprise {
    border-left: 3px solid #f5c842;
}
.tier-ref-atcost {
    border-left: 3px solid #66cc88;
}

/* ── MyTurfs Mobile ─────────────────────────────────────────── */
.myturfs-container {
    max-width: 800px;
    margin: 0 auto;
}

.myturf-card {
    border-radius: 10px;
    overflow: hidden;
}

.myturf-name {
    font-size: 1.05rem;
    font-weight: 600;
}

.myturf-stats {
    font-size: 0.85rem;
    line-height: 1.6;
}

.myturf-actions {
    flex-wrap: wrap;
}

.myturf-btn {
    min-height: 44px;
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 575.98px) {
    .myturfs-container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    .myturf-name {
        font-size: 1.1rem;
    }
    .myturf-stats {
        font-size: 0.9rem;
        text-align: left !important;
        margin-top: 0.25rem;
    }
    .myturf-btn {
        min-height: 48px;
        font-size: 1.05rem;
    }
}

/* ── WalkList Mobile ────────────────────────────────────────── */
.walklist-title {
    font-size: 1.1rem;
    word-break: break-word;
}

.walklist-toolbar {
    align-items: center;
}

.walklist-badge {
    font-size: 0.75rem;
    white-space: nowrap;
}

.walklist-side-col {
    min-width: 0;
}

@media (min-width: 768px) {
    .walklist-side-col:first-child {
        border-right: 1px solid var(--hz-border, #2a2d3a);
    }
}

@media (max-width: 767.98px) {
    .walklist-side-col + .walklist-side-col {
        border-top: 1px solid var(--hz-border, #2a2d3a);
        padding-top: 0.75rem;
        margin-top: 0.5rem;
    }
    .walklist-title {
        font-size: 1rem;
    }
    .walklist-badge {
        font-size: 0.7rem;
    }
}

/* ── CanvassSession Topbar Mobile ───────────────────────────── */
.canvass-topbar-info {
    min-width: 0;
    overflow: hidden;
}

.canvass-topbar-info strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40vw;
}

.canvass-topbar-btn {
    min-width: 36px;
    min-height: 36px;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .canvass-topbar {
        padding: 6px 8px;
        gap: 4px;
    }
    .canvass-topbar-info strong {
        font-size: 0.85rem;
        max-width: 35vw;
    }
    .canvass-topbar-info small {
        font-size: 0.7rem;
    }
    .canvass-topbar-btn {
        min-width: 32px;
        min-height: 32px;
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* ── Analytics Tab Condensed Layout ── */
.analytics-tab .card { border-width: 1px; }
.analytics-tab .card-body { padding: 0.75rem; }
.analytics-tab .card-header { padding: 0.4rem 0.75rem; }
.analytics-tab .card-header h6 { font-size: 1rem; margin: 0; }
.analytics-tab .table { font-size: 0.9rem; margin-bottom: 0; }
.analytics-tab details > summary { cursor: pointer; user-select: none; font-size: 0.9rem; }
.analytics-tab .stat-mini {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 0.4rem 0.6rem;
    min-width: 70px;
}
.analytics-tab .stat-mini .stat-val { font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.analytics-tab .stat-mini .stat-lbl { font-size: 0.72rem; color: var(--bs-secondary-color); line-height: 1.1; text-transform: uppercase; letter-spacing: 0.02em; }
.analytics-tab .kpi-strip { font-size: 0.9rem; }
.analytics-tab .kpi-strip .kpi-val { font-weight: 700; }
.analytics-tab .progress { height: 8px; }

/* analytics-tab mobile responsiveness */
@media (max-width: 768px) {
    .analytics-tab .card-body { padding: 0.6rem; }
    .analytics-tab .card-header { padding: 0.5rem 0.75rem; }
    .analytics-tab .card-header h6 { font-size: 0.95rem; }
    .analytics-tab .stat-mini { min-width: 60px; padding: 0.35rem 0.4rem; }
    .analytics-tab .stat-mini .stat-val { font-size: 1.05rem; }
    .analytics-tab .stat-mini .stat-lbl { font-size: 0.68rem; }
    .analytics-tab .table { font-size: 0.85rem; }
    .analytics-tab .kpi-strip { font-size: 0.85rem; }
    .analytics-tab .progress { height: 10px; }
    .analytics-tab .badge { font-size: 0.75rem; }
    .analytics-tab .table th,
    .analytics-tab .table td { padding: 0.4rem 0.3rem; }
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE RULES
   ============================================ */

/* ── Top Bar / Wallet ─────────────────────────────────────── */
.topbar-wallet {
    font-family: monospace;
}

@media (max-width: 767.98px) {
    .topbar-wallet {
        display: none !important;
    }
    .top-row {
        padding-left: 0.5rem;
        padding-right: 0.75rem;
    }
    .top-row .navbar-brand {
        font-size: 0.95rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .topbar-wallet {
        font-size: 0.72rem !important;
        gap: 0.4rem !important;
    }
    .topbar-wallet span {
        white-space: nowrap;
    }
}

/* ── Tables — always scroll horizontally on mobile ────────── */
@media (max-width: 767.98px) {
    table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Dashboard Command Center ─────────────────────────────── */
@media (max-width: 575.98px) {
    .cc-wrap {
        padding: 0.75rem;
        gap: 1rem;
    }
    .cc-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .cc-welcome { font-size: 1.15rem; }
    .cc-quick-actions {
        width: 100%;
    }
    .cc-quick-actions .cc-action-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.78rem;
        padding: 0.45rem 0.6rem;
    }
    .cc-resources {
        flex-wrap: wrap;
    }
    .cc-resource {
        min-width: calc(33% - 0.5rem);
        padding: 0.6rem 0.35rem;
    }
    .cc-resource-count { font-size: 0.95rem; }
    .cc-resource-label { font-size: 0.65rem; }
    .cc-init-name { max-width: 180px; font-size: 0.82rem; }
    .cc-init-row { padding: 0.6rem 0.75rem; }
    .cc-sidebar-card { padding: 0.75rem; }
}

/* ── Turf Management — split panel stacking ───────────────── */
@media (max-width: 767.98px) {
    .turf-mgmt-layout {
        flex-direction: column !important;
    }
    .hz-map-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        max-height: 35vh;
        border-right: none !important;
        border-bottom: 1px solid var(--hz-border, #333);
    }
    .hz-map-container.hz-map-fullheight {
        height: 50vh;
        min-height: 250px;
    }
    .hz-map-toolbar {
        top: 6px;
        right: 6px;
        gap: 0.3rem;
    }
    .hz-map-toolbar .btn {
        font-size: 0.72rem;
        padding: 0.3rem 0.5rem;
    }
    .hz-overlay-panel {
        max-width: 240px;
        min-width: 160px;
    }
    .turf-mgmt-toolbar {
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
    }
    .turf-mgmt-toolbar .btn {
        font-size: 0.72rem;
        padding: 0.3rem 0.5rem;
    }
}

/* ── Volunteer Conversations — panel stacking ─────────────── */
@media (max-width: 767.98px) {
    .convo-panel-list {
        max-height: 40vh;
        margin-bottom: 0.5rem;
    }
    .convo-panel-list .card-body {
        max-height: 35vh !important;
    }
    .convo-panel-detail .card-body {
        max-height: 50vh !important;
    }
}

/* ── Initiative Cards Grid ────────────────────────────────── */
@media (max-width: 575.98px) {
    .initiative-card {
        padding: 1rem;
        gap: 0.5rem;
    }
    .initiative-card-title { font-size: 0.92rem; }
    .initiative-hero-value { font-size: 1.8rem; }
    .initiative-hero-unit { font-size: 1.2rem; }
    .initiative-card-footer { flex-wrap: wrap; gap: 0.5rem; }
    .initiative-kebab-menu { min-width: 150px; }
}

/* ── Billing — credit card & pricing ──────────────────────── */
@media (max-width: 575.98px) {
    .billing-cc-visual {
        padding: 1rem;
        min-height: 120px;
    }
    .billing-cc-number {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }
    .billing-hero-value { font-size: 1.8rem; }
    .billing-pricing-card {
        padding: 1rem;
    }
    .billing-pricing-card .billing-pricing-amount { font-size: 1.4rem; }
    .billing-invoice-summary {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ── Plan Cards (PlansModal) responsive ───────────────────── */
@media (max-width: 767.98px) {
    .plan-card {
        padding: 1rem;
    }
    .plan-card-amount { font-size: 1.5rem; }
}

/* ── Autogen Side Panel — mobile full-width ───────────────── */
@media (max-width: 767.98px) {
    .autogen-side-panel {
        width: 100%;
        top: auto;
        bottom: 0;
        height: 60vh;
        border-left: none;
        border-top: 1px solid var(--hz-border, #333);
        border-radius: 12px 12px 0 0;
    }
}

/* ── Column Mapping (Data Vault) ──────────────────────────── */
@media (max-width: 575.98px) {
    .column-mapping-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    .column-mapping-search {
        max-width: 100%;
        min-width: 0;
    }
    .column-mapping-filters {
        flex-wrap: wrap;
    }
    .filter-chip {
        font-size: 0.72rem;
        padding: 0.2rem 0.5rem;
    }
}

/* ── Donation Dashboard ───────────────────────────────────── */
@media (max-width: 575.98px) {
    .donation-icon-pill {
        width: 40px;
        height: 40px;
    }
}

/* ── Feature Gate ─────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .feature-gate-locked {
        padding: 1.5rem 0.75rem;
    }
    .feature-gate-icon { font-size: 1.5rem; }
}

/* ── Conversations Page Header ────────────────────────────── */
@media (max-width: 575.98px) {
    .page-header-wrap {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    .page-header-wrap h1 {
        font-size: 1.25rem;
    }
    .page-header-actions {
        width: 100%;
    }
    .page-header-actions select {
        width: 100% !important;
    }
}

/* ── General Responsive Utility Overrides ─────────────────── */
@media (max-width: 575.98px) {
    /* multi-column rows that should stack */
    .row > [class*="col-md-"],
    .row > [class*="col-lg-"] {
        margin-bottom: 0.75rem;
    }

    /* tighter card spacing */
    .card { margin-bottom: 0.75rem; }

    /* full-width selects in headers */
    .form-select.form-select-sm {
        max-width: 100%;
    }

    /* step indicator */
    .step-line { width: 30px; margin: 0 5px; }

    /* smaller avatars on mobile */
    .avatar-lg { width: 100px; height: 100px; }

    /* consent timeline */
    .consent-timeline-list { padding-left: 20px; }
}

@media (max-width: 767.98px) {
    /* ensure all standard tables can scroll */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* button groups wrap */
    .d-flex.gap-2 { flex-wrap: wrap; }

    /* walkable-list left/right stacking border fix */
    .walklist-side-col + .walklist-side-col {
        border-top: 1px solid var(--hz-border, #2a2d3a);
        padding-top: 0.75rem;
        margin-top: 0.5rem;
    }
}

/* recompute turnout scores hover tooltip */
.recompute-tooltip {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 300px;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #e0e0e0;
    background: #1e1e2e;
    border: 1px solid #3a3d4a;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
    z-index: 1050;
    pointer-events: none;
}

/* version badge */
.version-badge {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-left: 0.5rem;
    user-select: all;
}

/* voter analytics heatmap */
.heatmap-high { background-color: rgba(220, 53, 69, 0.25); }
.heatmap-med { background-color: rgba(255, 193, 7, 0.2); }
.heatmap-low { background-color: rgba(108, 117, 125, 0.1); }
.heatmap-detail { font-size: 0.65rem; line-height: 1.2; }
.heatmap-detail .badge-sm { font-size: 0.6rem; padding: 0.1em 0.35em; }
.heatmap-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}
