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

:root {
    --bg: #060e20;
    --bg-soft: #0a1329;
    --surface: #0d1730;
    --surface-low: #111d39;
    --surface-high: #182646;
    --surface-glass: rgba(16, 27, 52, 0.78);
    --text: #dce5ff;
    --muted: #97a6cc;
    --muted-strong: #b8c4e6;
    --primary: #92acff;
    --primary-strong: #6f93ff;
    --primary-glow: rgba(146, 172, 255, 0.22);
    --secondary: #68f3ba;
    --secondary-soft: rgba(104, 243, 186, 0.12);
    --danger: #ff7c80;
    --danger-soft: rgba(255, 124, 128, 0.14);
    --warning-soft: rgba(255, 195, 110, 0.14);
    --outline: rgba(159, 177, 226, 0.16);
    --shadow: 0 24px 48px -12px rgba(109, 144, 255, 0.18);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(111, 147, 255, 0.15), transparent 28%),
        radial-gradient(circle at bottom right, rgba(104, 243, 186, 0.08), transparent 24%),
        linear-gradient(180deg, #071024 0%, #050b18 100%);
    color: var(--text);
}

body.modal-open {
    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

.hidden {
    display: none !important;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 32px 24px;
    background: linear-gradient(180deg, rgba(6, 14, 32, 0.98) 0%, rgba(8, 15, 33, 0.92) 100%);
    border-right: 1px solid rgba(159, 177, 226, 0.08);
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #607ff1);
    color: #03112e;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: 0 18px 36px -16px rgba(146, 172, 255, 0.55);
}

.brand-title,
.hero-copy h2,
.panel h3,
.card h2,
.support-agent-name,
.modal-header h2,
.support-agent-card h3 {
    font-family: 'Manrope', sans-serif;
}

.brand-title {
    font-size: 1.45rem;
    line-height: 1.1;
    font-weight: 800;
}

.brand-subtitle,
.sidebar-label,
.hero-eyebrow,
.section-tag,
.metric-label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.69rem;
    font-weight: 700;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-switch {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.agent-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.agent-btn:hover {
    background: rgba(146, 172, 255, 0.08);
    color: var(--text);
}

.agent-btn.active {
    background: linear-gradient(180deg, rgba(17, 29, 57, 0.96), rgba(12, 21, 41, 0.96));
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(146, 172, 255, 0.12), var(--shadow);
}

.agent-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(146, 172, 255, 0.12);
    color: var(--primary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-status {
    margin-top: auto;
    padding: 20px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(14, 25, 48, 0.92), rgba(10, 19, 39, 0.92));
    box-shadow: inset 0 0 0 1px rgba(146, 172, 255, 0.08);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--secondary-soft);
    color: var(--secondary);
    margin: 12px 0;
    font-weight: 700;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 0 18px rgba(104, 243, 186, 0.8);
}

.sidebar-note {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.main-shell {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 32px 14px;
    background: linear-gradient(180deg, rgba(6, 14, 32, 0.92), rgba(6, 14, 32, 0.72));
    backdrop-filter: blur(18px);
}

.topbar-search {
    flex: 1;
    max-width: 420px;
}

.topbar-search input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(159, 177, 226, 0.12);
    background: rgba(20, 33, 63, 0.78);
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-panel {
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(17, 29, 57, 0.72);
    min-width: 220px;
}

.header-action-group,
.inline-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.main-content {
    padding: 18px 32px 40px;
}

.panel,
.card,
.modal-content,
.support-agent-card,
.search-result-item,
.opportunity-item,
.bulk-opportunity,
.zpro-config-item {
    background: linear-gradient(180deg, rgba(14, 24, 46, 0.96), rgba(10, 18, 35, 0.94));
    box-shadow: inset 0 0 0 1px rgba(159, 177, 226, 0.07);
}

.subtitle {
    margin-top: 14px;
    max-width: 720px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.mini-stat p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

.tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 16px;
    border: 0;
    border-radius: 16px;
    background: rgba(18, 30, 58, 0.92);
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tab-btn:hover {
    color: var(--text);
    background: rgba(25, 40, 76, 0.94);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #071227;
    box-shadow: 0 16px 30px -14px rgba(146, 172, 255, 0.55);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.prospect-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.7fr);
}

.panel,
.card {
    border-radius: 28px;
    padding: 26px;
    margin-bottom: 20px;
}

.panel-highlight {
    box-shadow: inset 0 0 0 1px rgba(146, 172, 255, 0.08), 0 30px 60px -32px rgba(100, 135, 255, 0.35);
}

.panel-aside {
    min-height: 100%;
}

.panel-header,
.config-header,
.opportunity-header,
.bulk-opportunity-header,
.agent-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.panel h3,
.card h2 {
    margin-top: 8px;
    font-size: 1.6rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.mini-stat-grid,
.support-agents-grid {
    display: grid;
    gap: 16px;
}

.mini-stat {
    padding: 18px;
    border-radius: 20px;
    background: rgba(20, 33, 63, 0.88);
}

.mini-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 1.2rem;
    font-family: 'Manrope', sans-serif;
}

.form-group {
    margin-bottom: 18px;
}

.form-group-end {
    display: flex;
    align-items: flex-end;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.compact-row {
    align-items: end;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted-strong);
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="time"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(159, 177, 226, 0.12);
    background: rgba(25, 40, 76, 0.72);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #7180a8;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(146, 172, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(146, 172, 255, 0.12);
    background: rgba(27, 43, 82, 0.86);
}

textarea {
    resize: none;
    min-height: 120px;
    overflow: hidden;
}

small,
.info,
.info-text {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.info {
    margin-bottom: 16px;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.checkbox-line input,
.checkbox-card input,
.filters input[type="checkbox"] {
    width: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #071227;
    box-shadow: 0 18px 36px -18px rgba(146, 172, 255, 0.8);
}

.btn-secondary {
    background: rgba(25, 40, 76, 0.88);
    color: var(--primary);
}

.btn-danger {
    background: rgba(103, 25, 41, 0.72);
    color: #ffdbe0;
}

.btn-sm {
    padding: 10px 14px;
    font-size: 0.9rem;
}

.btn-spacing {
    margin-left: 10px;
}

.btn-top-spacing {
    margin-top: 20px;
}

.settings-section {
    margin-bottom: 22px;
    padding: 22px;
    border-radius: 24px;
    background: rgba(16, 27, 52, 0.82);
}

.settings-section h3 {
    margin-bottom: 16px;
    font-size: 1.08rem;
    color: var(--text);
}

.settings-section-emphasis {
    background: rgba(111, 147, 255, 0.08);
}

.settings-section-warning {
    background: var(--warning-soft);
}

.zpro-config-item {
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.opportunities-list,
.support-agents-list,
.documents-list {
    display: grid;
    gap: 16px;
}

.opportunity-item,
.bulk-opportunity,
.support-agent-card,
.search-result-item {
    padding: 20px;
    border-radius: 22px;
}

.opportunity-item.transferred {
    background: linear-gradient(180deg, rgba(52, 28, 18, 0.95), rgba(38, 21, 14, 0.95));
}

.opportunity-id {
    font-family: 'Manrope', sans-serif;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 800;
}

.opportunity-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.opportunity-detail {
    color: var(--muted-strong);
    line-height: 1.5;
}

.opportunity-badge,
.opportunity-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
}

.opportunity-badge.transferred {
    background: rgba(255, 195, 110, 0.15);
    color: #ffc36e;
}

.status-open {
    background: rgba(104, 243, 186, 0.12);
    color: var(--secondary);
}

.status-win {
    background: rgba(146, 172, 255, 0.12);
    color: var(--primary);
}

.status-lose {
    background: var(--danger-soft);
    color: var(--danger);
}

.support-agents-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.support-agent-card {
    overflow: hidden;
}

.support-agent-name,
.support-agent-card h3 {
    font-size: 1.5rem;
    line-height: 1.1;
    margin-bottom: 8px;
}

.agent-info {
    display: grid;
    gap: 10px;
    margin: 18px 0 20px;
}

.agent-info p,
.search-result-item p {
    color: var(--muted-strong);
    line-height: 1.6;
}

.result,
.error-message,
.success-message {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    display: none;
}

.result.success,
.success-message {
    display: block;
    background: rgba(104, 243, 186, 0.12);
    color: var(--secondary);
}

.result.error,
.error-message {
    display: block;
    background: var(--danger-soft);
    color: #ffc5ca;
}

.result.info {
    display: block;
    background: rgba(146, 172, 255, 0.12);
    color: #c9d6ff;
}

.result.loading {
    display: block;
    background: rgba(149, 166, 204, 0.12);
    color: var(--muted-strong);
}

.loading {
    color: var(--primary);
    padding: 18px 0;
}

#userInfo {
    color: var(--muted-strong);
    font-size: 0.92rem;
    line-height: 1.55;
}

#userInfo strong {
    display: block;
    color: var(--text);
    font-size: 0.96rem;
}

.mono-text {
    font-family: monospace;
    color: var(--muted-strong);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 32px 20px;
    background: rgba(3, 8, 20, 0.75);
    backdrop-filter: blur(14px);
    overflow-y: auto;
}

.modal-content {
    width: min(960px, 100%);
    margin: 0 auto;
    border-radius: 28px;
    overflow: hidden;
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.modal-wide {
    width: min(1040px, 100%);
}

.modal-header,
.modal-body {
    padding: 24px 28px;
}

.modal-header {
    border-bottom: 1px solid rgba(159, 177, 226, 0.08);
    flex-shrink: 0;
}

.modal-body {
    overflow-y: auto;
}

.close {
    font-size: 1.8rem;
    color: var(--muted);
    cursor: pointer;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(25, 40, 76, 0.72);
    color: var(--muted-strong);
}

.settings-toggle-row {
    margin-bottom: 16px;
}

.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(25, 40, 76, 0.72);
    color: var(--muted-strong);
}

.toggle-card strong,
.toggle-card small {
    display: block;
}

.toggle-card small {
    margin-top: 4px;
    color: var(--muted);
}

.toggle-card input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.inactivity-section-disabled {
    opacity: 0.45;
}

.inactivity-section-disabled input,
.inactivity-section-disabled textarea {
    pointer-events: none;
}

.login-container {
    max-width: 560px;
    margin: 100px auto;
}

.login-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.login-tab-btn {
    flex: 1;
    padding: 12px;
    border: 0;
    border-radius: 16px;
    background: rgba(25, 40, 76, 0.9);
    color: var(--muted);
    font-weight: 700;
}

.login-tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #071227;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

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

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(159, 177, 226, 0.08);
    }

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

@media (max-width: 820px) {
    .topbar,
    .main-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-search {
        max-width: none;
    }

    .topbar-actions {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }

    .header-action-group {
        width: 100%;
    }

    .header-action-group .btn {
        flex: 1;
    }

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

    .tabs {
        flex-direction: column;
    }

    .tab-btn,
    .agent-btn {
        width: 100%;
    }

    .panel,
    .card {
        padding: 20px;
        border-radius: 22px;
    }
}
