/* Import parent styles variables */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #141824;
    --bg-tertiary: #1a1f2e;
    --text-primary: #e8f0fe;
    --text-secondary: #b8c8e0;
    --accent-primary: #6bb6ff;
    --accent-secondary: #4a9eff;
    --border-color: #2a3342;
    --error-color: #ff6b6b;
    --success-color: #4caf50;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Account Wrapper */
.account-wrapper {
    width: 100%;
    max-width: 650px;
    position: relative;
}

.account-wrapper:has(.account-container--dashboard) {
    max-width: 1800px;
}

.dashboard-jump-link {
    position: fixed;
    left: 18px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid rgba(107, 182, 255, 0.34);
    background:
        linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(8, 12, 20, 0.82));
    color: #dff1ff;
    font-size: 1.45rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow:
        0 18px 34px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(8, 12, 20, 0.4);
    backdrop-filter: blur(10px);
    z-index: 30;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.dashboard-jump-link:hover {
    transform: translateY(-2px);
    border-color: rgba(107, 182, 255, 0.6);
    color: #ffffff;
    box-shadow:
        0 22px 40px rgba(0, 0, 0, 0.42),
        0 0 18px rgba(107, 182, 255, 0.18);
}

.dashboard-jump-link:focus-visible {
    outline: 2px solid rgba(107, 182, 255, 0.8);
    outline-offset: 3px;
}

.dashboard-jump-link--down {
    top: 18px;
}

.dashboard-jump-link--up {
    bottom: 18px;
}

.dashboard-scroll-target {
    width: 100%;
    height: 1px;
}

.account-wrapper::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(107, 182, 255, 0.03) 0%, transparent 50%);
    animation: pulse 10s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Account Container */
.account-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 100px rgba(107, 182, 255, 0.05);
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    /* Default compact width for Login */
}

.account-container--wide {
    max-width: 1200px;
    /* Expanded width for Profile/Register */
    margin: 0 auto;
}

.account-container--dashboard {
    max-width: 1800px;
    /* Extra wide for Dashboard */
}

/* Account Header */
.account-header {
    text-align: center;
    margin-bottom: 2rem;
}

.account-logo {
    height: 50px;
    width: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 12px rgba(107, 182, 255, 0.4));
}

.account-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.account-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Forms */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* 3-column layout for very wide screens */
@media (min-width: 1000px) {
    .account-container--wide .form-row {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .account-container--wide .form-row:has(.form-group:only-child) {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-jump-link {
        left: 12px;
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 1.2rem;
    }

    .dashboard-jump-link--down {
        top: 12px;
    }

    .dashboard-jump-link--up {
        bottom: 12px;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(107, 182, 255, 0.1);
}

.form-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: -0.25rem;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.checkbox-label span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -0.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    /* Full width to match fields */
    max-width: 100%;
    /* Remove the 280px restriction */
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(107, 182, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 182, 255, 0.4);
}

.btn-primary--compact {
    width: auto;
    max-width: none;
    min-width: 120px;
    padding: 0.45rem 0.9rem;
    font-size: 0.84rem;
    line-height: 1.2;
}

.btn-primary--compact:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.2);
}

/* Links */
.link-primary {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.link-primary:hover {
    color: var(--accent-secondary);
    text-shadow: 0 0 10px rgba(107, 182, 255, 0.4);
}

.link-secondary {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.link-secondary:hover {
    color: var(--accent-primary);
}

/* Form Messages */
.form-message {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: var(--success-color);
}

.form-message.error {
    display: block;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--error-color);
}

/* Account Footer */
.account-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.account-footer p {
    margin-bottom: 0.75rem;
}

/* Profile Sections */
.profile-info {
    background: linear-gradient(135deg, rgba(107, 182, 255, 0.1) 0%, rgba(74, 158, 255, 0.05) 100%);
    border: 1px solid rgba(107, 182, 255, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.75rem;
    text-align: center;
}

.profile-welcome {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 0.4rem;
}

.profile-sections {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    width: 100%;
}

/* Wider screens: 2-column layout for some sections */
@media (min-width: 900px) {
    .profile-sections {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-section:first-child {
        grid-column: 1 / -1;
    }

    .profile-section:nth-child(4) {
        grid-column: 1 / -1;
    }
}

.profile-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.75rem;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* Prevent content from spilling out */
}

.profile-section h2 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-section .account-form {
    width: 100%;
}

.profile-section .form-row {
    gap: 1.25rem;
}

/* ... existing styles ... */

.profile-section button {
    margin-top: 1rem;
    width: 100%;
    /* Full width to match inputs */
    max-width: none;
    /* Remove restriction */
    display: block;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Stack by default */
    gap: 1rem;
}

@media (min-width: 600px) {
    .status-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on wider screens */
    }

    /* Make Privileges span full width to prevent overflow */
    .status-item:last-child {
        grid-column: 1 / -1;
    }
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-wrap: break-word;
    /* Prevent text overflow */
}

/* ... existing styles ... */

/* Specific fix for Change Password form to stack inputs */
#passwordForm .form-row {
    grid-template-columns: 1fr;
    /* Stack inputs vertically */
}

/* Ensure Account Details form uses 2 columns but stacks on mobile */
#profileForm .form-row {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    #profileForm .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.status-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

/* Admin Controls */
.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.admin-controls button {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 180px;
    max-width: none;
}

/* Account Footer */
.account-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.account-footer p {
    margin-bottom: 0.65rem;
}

.account-footer button {
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .account-container {
        padding: 2rem;
    }

    .account-container--wide {
        padding: 2rem 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .account-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .account-logo {
        height: 48px;
    }

    .admin-controls {
        flex-direction: column;
    }

    .admin-controls button {
        width: 100%;
    }
}

/* ============================================================================
   Dashboard Styles
   ============================================================================ */

/* Dashboard Stats Cards */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1000px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.stat-card--has-tooltip {
    overflow: visible;
    z-index: 2;
}

.stat-icon {
    width: 44px;
    height: 44px;
    background: rgba(107, 182, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent-primary);
}

.stat-icon--success {
    background: rgba(76, 175, 80, 0.15);
}

.stat-icon--success svg {
    color: var(--success-color);
}

.stat-icon--warning {
    background: rgba(255, 193, 7, 0.15);
}

.stat-icon--warning svg {
    color: #ffc107;
}

.stat-icon--info {
    background: rgba(107, 182, 255, 0.15);
}

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-label--with-tooltip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    width: max-content;
}

.stat-tooltip-trigger {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: none;
    cursor: help;
}

.stat-tooltip {
    position: absolute;
    bottom: calc(100% + 0.35rem);
    left: 50%;
    width: min(280px, calc(100vw - 4rem));
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 20;
}

.stat-label--with-tooltip:hover .stat-tooltip,
.stat-label--with-tooltip:focus-within .stat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.stat-chart {
    position: absolute;
    right: 1rem;
    bottom: 0.75rem;
    opacity: 0.6;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Panels */
.dashboard-panel {
    position: relative;
    isolation: isolate;
    --panel-glow-a: rgba(93, 135, 255, 0.13);
    --panel-glow-b: rgba(40, 212, 255, 0.08);
    background:
        radial-gradient(circle at top left, var(--panel-glow-a), transparent 36%),
        radial-gradient(circle at bottom right, var(--panel-glow-b), transparent 32%),
        linear-gradient(180deg, rgba(20, 25, 42, 0.94), rgba(15, 19, 31, 0.96));
    border: 1px solid rgba(120, 137, 172, 0.22);
    border-radius: 12px;
    padding: 1.5rem;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 34px rgba(4, 8, 18, 0.18);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dashboard-grid > .dashboard-panel:nth-child(3n + 1) {
    --panel-glow-a: rgba(87, 139, 255, 0.16);
    --panel-glow-b: rgba(70, 227, 177, 0.08);
}

.dashboard-grid > .dashboard-panel:nth-child(3n + 2) {
    --panel-glow-a: rgba(157, 110, 255, 0.16);
    --panel-glow-b: rgba(88, 140, 255, 0.08);
}

.dashboard-grid > .dashboard-panel:nth-child(3n + 3) {
    --panel-glow-a: rgba(255, 126, 172, 0.13);
    --panel-glow-b: rgba(106, 218, 255, 0.08);
}

.dashboard-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 0;
}

.dashboard-panel > * {
    position: relative;
    z-index: 1;
}

.dashboard-panel:hover {
    border-color: rgba(142, 165, 208, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 42px rgba(8, 14, 29, 0.24);
    transform: translateY(-1px);
}

.dashboard-panel--wide {
    grid-column: 1 / -1;
}

.dashboard-panel--span-2 {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .dashboard-panel--span-2 {
        grid-column: 1;
    }
}

.dashboard-panel--chart {
    display: flex;
    flex-direction: column;
}

.dashboard-panel--lifecycle {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(110, 90, 255, 0.16), transparent 34%),
        radial-gradient(circle at top right, rgba(84, 197, 255, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(8, 13, 30, 0.98), rgba(17, 20, 34, 0.98));
    border-color: rgba(125, 141, 173, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 48px rgba(3, 6, 18, 0.3);
}

.dashboard-panel--lifecycle::before {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.panel-header--lifecycle {
    align-items: flex-start;
    gap: 1rem;
}

.panel-subtitle {
    margin: 0.35rem 0 0;
    max-width: 720px;
    font-size: 0.84rem;
    line-height: 1.45;
    color: rgba(213, 221, 238, 0.72);
}

.panel-title-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.panel-badge {
    background: rgba(107, 182, 255, 0.15);
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.panel-badge--muted {
    background: rgba(184, 200, 224, 0.1);
    color: var(--text-secondary);
}

.signalcast-placeholder {
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.signalcast-stream {
    flex: 1;
    min-height: 220px;
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: rgba(107, 182, 255, 0.04);
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.signalcast-stream .empty-state {
    min-height: 220px;
    text-align: center;
}

.signalcast-entry {
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.signalcast-entry:last-child {
    border-bottom: 0;
}

.signalcast-entry__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.signalcast-entry__headline {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
}

.signalcast-entry__details {
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.signalcast-entry__comments {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.client-lifecycle {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.client-lifecycle__highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.client-lifecycle__card {
    padding: 0.95rem 1.05rem;
    border: 1px solid rgba(136, 151, 178, 0.16);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(19, 24, 43, 0.96), rgba(10, 14, 28, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.client-lifecycle__card-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(214, 220, 235, 0.66);
}

.client-lifecycle__card-value {
    display: block;
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 700;
    color: #f7f9ff;
}

.client-lifecycle__card-meta {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: rgba(207, 214, 228, 0.62);
}

.client-lifecycle__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.6rem;
    font-size: 0.85rem;
    color: rgba(219, 227, 240, 0.78);
}

.client-lifecycle__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.client-lifecycle__swatch {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    box-shadow: 0 0 16px rgba(140, 134, 255, 0.35);
}

.client-lifecycle__swatch--retained {
    background: linear-gradient(180deg, #6438ff, #3f0fff);
}

.client-lifecycle__swatch--reactivated {
    background: linear-gradient(180deg, #c6b7ff, #8d78ff);
}

.client-lifecycle__swatch--churn {
    background: linear-gradient(180deg, #ff74aa, #ff4d8d);
}

.client-lifecycle__plot {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(117, 136, 168, 0.18);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(23, 27, 45, 0.95), rgba(11, 15, 28, 0.98)),
        radial-gradient(circle at center, rgba(83, 62, 255, 0.12), transparent 60%);
}

.client-lifecycle__scroll {
    position: relative;
    min-width: 1640px;
    padding: 1.35rem 1.1rem 1rem;
}

.client-lifecycle__scroll::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% - 1px);
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(212, 220, 236, 0.58), rgba(255, 255, 255, 0));
    z-index: 1;
}

.client-lifecycle__grid {
    position: absolute;
    inset: 1.35rem 1.1rem 1rem;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    pointer-events: none;
}

.client-lifecycle__grid span {
    border-top: 1px solid rgba(173, 184, 209, 0.08);
}

.client-lifecycle__bars {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(72, minmax(0, 1fr));
    gap: 0.14rem;
    align-items: stretch;
    min-height: 360px;
}

.client-lifecycle__column {
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.72fr) auto;
    align-items: stretch;
    min-width: 0;
}

.client-lifecycle__stack,
.client-lifecycle__reflection {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.1rem;
    min-height: 0;
    overflow: hidden;
}

.client-lifecycle__stack {
    justify-content: flex-end;
    padding-bottom: 0.42rem;
}

.client-lifecycle__reflection {
    justify-content: flex-start;
    padding-top: 0.42rem;
    opacity: 0.54;
    filter: blur(0.55px);
    mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.14) 58%, rgba(255, 255, 255, 0));
}

.client-lifecycle__segment {
    width: 100%;
    min-height: 6px;
    border-radius: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 10px 22px rgba(34, 20, 89, 0.28);
}

.client-lifecycle__segment--retained {
    background: linear-gradient(180deg, #6a43ff, #4715ff);
}

.client-lifecycle__segment--reactivated {
    background: linear-gradient(180deg, #d1c4ff, #9a84ff);
}

.client-lifecycle__segment--churn {
    background: linear-gradient(180deg, #ff89b8, #ff4b90);
}

.client-lifecycle__reflection .client-lifecycle__segment {
    background: linear-gradient(180deg, rgba(202, 208, 223, 0.76), rgba(110, 117, 138, 0.32));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.02),
        0 8px 18px rgba(18, 20, 29, 0.1);
}

.client-lifecycle__label {
    display: block;
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: rgba(202, 211, 227, 0.46);
}

.client-lifecycle__footnote {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(209, 217, 231, 0.62);
}

@media (max-width: 1200px) {
    .client-lifecycle__scroll {
        min-width: 1320px;
    }
}

@media (max-width: 768px) {
    .client-lifecycle__highlights {
        grid-template-columns: 1fr;
    }

    .panel-header--lifecycle {
        flex-direction: column;
        align-items: flex-start;
    }

    .client-lifecycle__scroll {
        min-width: 1080px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .client-lifecycle__label {
        font-size: 0.62rem;
    }
}

/* Key Management Panel */
.key-mgmt-header {
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.key-mgmt-generate-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.key-mgmt-inline-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.key-mgmt-layout {
    display: grid;
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
    gap: 0.95rem;
}

.key-mgmt-stats {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.key-mgmt-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.key-mgmt-stat-row strong {
    color: var(--text-primary);
    font-size: 0.86rem;
}

.key-mgmt-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.key-mgmt-field span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.key-mgmt-field--inline {
    flex-direction: row;
    align-items: center;
    margin-top: 0;
}

.key-mgmt-field--inline span {
    min-width: 46px;
}

.key-mgmt-select {
    width: 100%;
    min-height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
}

.key-mgmt-discard-btn {
    margin-top: 0.45rem;
    width: 100%;
}

.key-mgmt-table-panel {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.key-mgmt-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.key-mgmt-message {
    display: none;
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid transparent;
}

.key-mgmt-message--info {
    display: block;
    color: var(--text-secondary);
    border-color: var(--border-color);
    background: rgba(184, 200, 224, 0.06);
}

.key-mgmt-message--error {
    display: block;
    color: #ffb4b4;
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.11);
}

.key-mgmt-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: auto;
    max-height: 420px;
    background: var(--bg-secondary);
}

.key-mgmt-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.key-mgmt-table th,
.key-mgmt-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 0.55rem 0.65rem;
    text-align: left;
    font-size: 0.79rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.key-mgmt-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.68rem;
}

.key-mgmt-table tbody tr:hover {
    background: rgba(107, 182, 255, 0.06);
}

.key-mgmt-code {
    font-family: "Courier New", Courier, monospace;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.key-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.key-status-badge--unused {
    color: #d2dae6;
    background: rgba(184, 200, 224, 0.2);
}

.key-status-badge--active {
    color: #ffd369;
    background: rgba(255, 211, 105, 0.18);
}

.key-status-badge--expired {
    color: #ff9ea1;
    background: rgba(255, 107, 107, 0.2);
}

.key-status-badge--converted {
    color: #a8efb7;
    background: rgba(76, 175, 80, 0.2);
}

.key-mgmt-empty {
    text-align: center !important;
    color: var(--text-secondary) !important;
    padding: 1.2rem !important;
}

.key-mgmt-note {
    margin: 0.85rem 0 0;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.key-audit-panel {
    margin-top: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    padding: 0.65rem 0.7rem;
}

.key-audit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.key-audit-header h3 {
    margin: 0;
    font-size: 0.83rem;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.key-audit-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.key-audit-entry {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.42rem 0.5rem;
    background: var(--bg-tertiary);
}

.key-audit-entry__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.key-audit-entry__reason {
    font-size: 0.78rem;
    color: #ffb4b4;
}

.key-audit-entry__detail {
    margin-top: 0.18rem;
    font-size: 0.74rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* Landing Hits Panel */
.landing-hits-table {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.landing-hits-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 0.75fr 0.75fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.62rem 0.72rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.landing-hits-row:last-child {
    border-bottom: 0;
}

.landing-hits-row span,
.landing-hits-row strong {
    min-width: 0;
}

.landing-hits-row span:last-child,
.landing-hits-row strong:last-child,
.landing-hits-row span:nth-child(2),
.landing-hits-row strong:nth-child(2),
.landing-hits-row span:nth-child(3),
.landing-hits-row strong:nth-child(3) {
    text-align: right;
}

.landing-hits-row strong {
    color: var(--text-primary);
    font-size: 0.88rem;
}

.landing-hits-row--head {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.67rem;
}

.landing-hits-row--total {
    background: rgba(107, 182, 255, 0.08);
}

.landing-hits-row--total span,
.landing-hits-row--total strong {
    color: var(--text-primary);
    font-weight: 700;
}

.landing-hits-note {
    margin: 0.7rem 0 0;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

#landingHitsPanel {
    display: flex;
    flex-direction: column;
}

#landingHitsPanel .landing-hits-table {
    flex: 0 0 auto;
}

.landing-hits-graph-card {
    margin-top: 0.75rem;
    border: 1px solid rgba(107, 182, 255, 0.22);
    border-radius: 10px;
    background: linear-gradient(180deg, #111a2a 0%, #0a111d 100%);
    padding: 0.6rem 0.65rem 0.55rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 220px;
}

.landing-hits-graph-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.landing-hits-graph-head strong {
    color: #dbe9ff;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.landing-hits-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.landing-hits-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    font-size: 0.7rem;
    color: #c8d6ec;
}

.landing-hits-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

.landing-hits-dot--home {
    color: #2bff88;
    background: #2bff88;
}

.landing-hits-dot--retail {
    color: #34d0ff;
    background: #34d0ff;
}

.landing-hits-dot--guest {
    color: #ff5d8f;
    background: #ff5d8f;
}

.landing-hits-graph {
    width: 100%;
    height: auto;
    min-height: 170px;
    flex: 1 1 auto;
    display: block;
    border-radius: 8px;
    background: rgba(4, 8, 14, 0.38);
}

.landing-hits-graph-meta {
    margin-top: 0.38rem;
    font-size: 0.68rem;
    color: #a9bdd8;
    letter-spacing: 0.02em;
}

@media (max-width: 980px) {
    .key-mgmt-layout {
        grid-template-columns: 1fr;
    }

    .key-mgmt-generate-controls {
        width: 100%;
        margin-left: 0;
    }

    .key-mgmt-generate-controls .btn-primary {
        margin-left: auto;
    }
}

/* Online Users List */
.online-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.online-user-item:hover {
    background: rgba(107, 182, 255, 0.08);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-account {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.user-role {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(107, 182, 255, 0.15);
    color: var(--accent-primary);
}

.user-role.role-owner {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
}

.user-role.role-admin {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.user-role.role-superuser {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    letter-spacing: 0.05em;
}

.user-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 320px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: rgba(107, 182, 255, 0.05);
}

.feedback-feed {
    max-height: 320px;
    overflow-y: auto;
}

.feedback-entry {
    width: 100%;
    border: 1px solid transparent;
    background: var(--bg-secondary);
    color: inherit;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.feedback-entry:hover {
    background: rgba(107, 182, 255, 0.08);
    border-color: rgba(107, 182, 255, 0.25);
}

.feedback-entry-time {
    font-size: 0.68rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.feedback-entry-line {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-feed {
    max-height: 320px;
    overflow-y: auto;
}

.contact-entry {
    width: 100%;
    border: 1px solid transparent;
    background: var(--bg-secondary);
    color: inherit;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.contact-entry:hover {
    background: rgba(107, 182, 255, 0.08);
    border-color: rgba(107, 182, 255, 0.25);
}

.contact-entry-time {
    font-size: 0.68rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.contact-entry-line {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-feed::-webkit-scrollbar {
    width: 6px;
}

.contact-feed::-webkit-scrollbar-track {
    background: transparent;
}

.contact-feed::-webkit-scrollbar-thumb {
    background: rgba(107, 182, 255, 0.18);
    border-radius: 3px;
}

.contact-feed::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 182, 255, 0.32);
}

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 14px;
    height: 14px;
}

.activity-icon--login {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
}

.activity-icon--logout {
    background: rgba(255, 107, 107, 0.15);
    color: var(--error-color);
}

.activity-icon--register {
    background: rgba(107, 182, 255, 0.15);
    color: var(--accent-primary);
}

.activity-icon--password_change {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.activity-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.activity-text {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.activity-text strong {
    font-weight: 500;
}

.activity-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.lead-type-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.lead-type-badge--institutional {
    background: rgba(107, 182, 255, 0.15);
    color: #6bb6ff;
}

.lead-type-badge--retail {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Donut Chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 2rem;
    flex: 1;
    padding: 1rem 0;
}

@media (max-width: 500px) {
    .donut-chart-container {
        flex-direction: column;
        gap: 1.5rem;
    }
}

.donut-chart {
    position: relative;
    width: 140px;
    height: 140px;
}

.donut-chart svg {
    transform: rotate(-90deg);
}

.donut-ring {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 12;
}

.donut-segment {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.donut-segment--institutional {
    stroke: var(--accent-primary);
}

.donut-segment--retail {
    stroke: #ffc107;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-total {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.donut-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-dot--institutional {
    background: var(--accent-primary);
}

.legend-dot--retail {
    background: #ffc107;
}

.legend-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

.legend-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Database Stats Grid */
.db-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 500px) {
    .db-stats-grid {
        grid-template-columns: 1fr;
    }
}

.db-stat-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.db-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.db-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mini Charts */
.mini-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
    margin-top: 0.5rem;
}

.mini-bar {
    background: var(--accent-primary);
    border-radius: 2px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.mini-bar:last-child {
    opacity: 1;
}

.mini-line-chart {
    margin-top: 0.5rem;
}

.storage-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Utilization List */
.utilization-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.utilization-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.utilization-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.utilization-name {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.utilization-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.utilization-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.utilization-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.utilization-bar--normal {
    background: var(--accent-primary);
}

.utilization-bar--high {
    background: #ffc107;
}

.utilization-bar--full {
    background: var(--error-color);
}

/* Health Indicators */
.health-indicators {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.health-dot--good {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.health-dot--warning {
    background: #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
}

.health-dot--error {
    background: var(--error-color);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.health-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.health-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Line Chart Container */
.line-chart-container {
    position: relative;
    width: 100%;
    height: 200px;
}

.line-chart-container canvas {
    width: 100%;
    height: 100%;
}

/* Chart Controls */
.chart-controls {
    display: flex;
    gap: 0.25rem;
}

.chart-control-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-control-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.chart-control-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* Loading & Empty States */
.loading-placeholder,
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer Buttons */
.footer-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-buttons .btn-secondary,
.footer-buttons .btn-primary {
    width: auto;
    min-width: 160px;
}

.footer-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Scrollbar styling for lists */
.online-users-list::-webkit-scrollbar,
.activity-feed::-webkit-scrollbar,
.utilization-list::-webkit-scrollbar,
.feedback-feed::-webkit-scrollbar {
    width: 6px;
}

.online-users-list::-webkit-scrollbar-track,
.activity-feed::-webkit-scrollbar-track,
.utilization-list::-webkit-scrollbar-track,
.feedback-feed::-webkit-scrollbar-track {
    background: transparent;
}

.online-users-list::-webkit-scrollbar-thumb,
.activity-feed::-webkit-scrollbar-thumb,
.utilization-list::-webkit-scrollbar-thumb,
.feedback-feed::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.online-users-list::-webkit-scrollbar-thumb:hover,
.activity-feed::-webkit-scrollbar-thumb:hover,
.utilization-list::-webkit-scrollbar-thumb:hover,
.feedback-feed::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.dashboard-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(8, 13, 22, 0.74);
    z-index: 2200;
}

.dashboard-modal__content {
    width: min(760px, 96vw);
    max-height: 86vh;
    overflow: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.dashboard-modal__header,
.dashboard-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-modal__header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-modal__close {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.dashboard-modal__close:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.dashboard-modal__body {
    padding: 1rem 1.2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.feedback-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.feedback-detail-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.feedback-detail-value {
    font-size: 0.86rem;
    color: var(--text-primary);
    text-align: right;
}

.feedback-detail-comments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feedback-detail-comment-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    color: var(--text-primary);
    font-size: 0.86rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.dashboard-modal__footer {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    justify-content: flex-end;
}

.dashboard-modal__footer .btn-secondary {
    width: auto;
    min-width: 110px;
}

.signalcast-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 1rem;
}

.signalcast-modal-grid .form-group {
    margin: 0;
}

.signalcast-modal-grid .form-group input[readonly] {
    opacity: 0.8;
    cursor: default;
}

.signalcast-modal-footer {
    gap: 0.7rem;
}

.signalcast-modal-footer .btn-primary,
.signalcast-modal-footer .btn-secondary {
    width: auto;
    min-width: 130px;
}

.new-signal-error {
    margin-bottom: 0.9rem;
    padding: 0.7rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #ffb4b4;
    font-size: 0.83rem;
    line-height: 1.35;
}

@media (max-width: 700px) {
    .signalcast-modal-grid {
        grid-template-columns: 1fr;
    }
}

/* Tool Usage Panel */
.tool-usage-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.tool-usage-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tool-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tool-usage-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-usage-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.tool-usage-item:hover {
    background: rgba(107, 182, 255, 0.08);
}

.tool-rank {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.tool-rank--low {
    background: linear-gradient(135deg, #5a6270 0%, #3d4450 100%);
}

.tool-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tool-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-category {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.tool-category--main {
    background: rgba(107, 182, 255, 0.15);
    color: var(--accent-primary);
}

.tool-category--aux {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.tool-bar-container {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.tool-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.tool-bar--high {
    background: linear-gradient(90deg, var(--accent-primary), var(--success-color));
}

.tool-bar--low {
    background: linear-gradient(90deg, #5a6270, #3d4450);
}

.tool-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}

.tool-uses {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-change {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.tool-change--positive {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
}

.tool-change--negative {
    background: rgba(255, 107, 107, 0.15);
    color: var(--error-color);
}

/* ============================================================================
   Auto-refresh Toggle
   ============================================================================ */

.auto-refresh-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    cursor: pointer;
    user-select: none;
}

.auto-refresh-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.auto-refresh-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.refresh-status {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    text-align: center;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.refresh-status--active {
    color: var(--accent-primary);
    opacity: 1;
    animation: refreshPulse 0.9s ease;
}

.refresh-status--paused {
    opacity: 0.65;
}

.refresh-status--error {
    color: var(--error-color);
    opacity: 1;
}

@keyframes refreshPulse {
    0% {
        opacity: 0.45;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.85;
    }
}

/* ============================================================================
   API Stats Panel
   ============================================================================ */

.api-stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 600px) {
    .api-stats-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.api-stats-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.api-stats-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.api-stats-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.api-stat-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.api-stat-big {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.api-stat-med {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.api-stat-sublabel {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.api-stat-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.25rem 0;
}

.api-stat-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
}

.api-stat-cat {
    font-size: 0.8rem;
    color: var(--text-primary);
}

.api-stat-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.api-symbol-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.api-symbol-tag {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(107, 182, 255, 0.1);
    color: var(--accent-primary);
}

.empty-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.6;
}

/* ============================================================================
   Health Section Label
   ============================================================================ */

.health-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================================================
   Current User Detail Grid
   ============================================================================ */

.user-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.user-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.user-detail-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.user-detail-value {
    font-size: 0.8rem;
    color: var(--text-primary);
    word-break: break-all;
}

/* ============================================================================
   Database Data Types
   ============================================================================ */

.db-data-types {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.db-type-item {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.db-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.db-type-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.db-type-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.db-type-detail {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.3;
}

/* ============================================================================
   Utilization Details
   ============================================================================ */

.utilization-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.utilization-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.utilization-detail-row span:first-child {
    color: var(--text-secondary);
}

.utilization-detail-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================================================
   Seat Management Styles
   ============================================================================ */

.seat-mgmt-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Account Cards */
.seat-account-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.seat-account-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.2s ease;
}

.seat-account-card:hover {
    border-color: rgba(107, 182, 255, 0.3);
}

.seat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.seat-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.seat-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Badges */
.seat-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.seat-badge--inst {
    background: rgba(107, 182, 255, 0.15);
    color: var(--accent-primary);
}

.seat-badge--retail {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.seat-badge--count {
    background: rgba(184, 200, 224, 0.1);
    color: var(--text-secondary);
}

.seat-badge--role {
    background: rgba(107, 182, 255, 0.1);
    color: var(--accent-primary);
    text-transform: capitalize;
}

/* User Rows */
.seat-card-users {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.seat-user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    flex-wrap: wrap;
}

.seat-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.seat-user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.seat-user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.seat-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.seat-status--active {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
}

.seat-status--inactive {
    background: rgba(255, 107, 107, 0.15);
    color: var(--error-color);
}

/* Modal */
.seat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.seat-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.seat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.seat-modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.seat-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: auto;
    line-height: 1;
}

.seat-modal-close:hover {
    color: var(--error-color);
}

@media (max-width: 600px) {
    .seat-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .seat-card-actions {
        width: 100%;
    }

    .seat-card-actions button {
        flex: 1;
    }

    .seat-user-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
