:root {
    --bg: #1a1a1a;
    --bg-elevated: #232323;
    --bg-soft: #2c2c2c;
    --gold: #c9a84c;
    --gold-strong: #e0c265;
    --text: #f5f2e9;
    --muted: #bbb5a6;
    --line: rgba(255, 255, 255, 0.1);
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
    letter-spacing: 0;
}

body {
    background:
        linear-gradient(180deg, rgba(201, 168, 76, 0.08), rgba(26, 26, 26, 0) 360px),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.app-navbar {
    background: rgba(26, 26, 26, 0.94);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
}

.navbar-brand {
    color: var(--text);
    font-weight: 800;
}

.brand-logo {
    display: block;
    width: 174px;
    height: auto;
}

.nav-link {
    color: var(--muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--gold-strong) !important;
}

.page-hero,
.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-actions,
.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.page-actions form,
.table-actions form {
    margin: 0;
}

.page-hero {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.16), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(201, 168, 76, 0.24);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

h1 {
    font-weight: 800;
    color: #fffaf0;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.04;
}

.section-title {
    color: #fffaf0;
    font-size: 1.25rem;
    font-weight: 750;
}

.eyebrow,
.panel-label {
    color: var(--gold-strong);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.text-soft {
    color: var(--muted);
}

.panel,
.metric-card,
.contact-card {
    background: rgba(35, 35, 35, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.25rem;
}

.metric-card {
    min-height: 132px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.metric-card strong,
.metric {
    color: #fffaf0;
    font-size: 2.2rem;
    font-weight: 850;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-gold,
.btn-outline-gold:hover,
.btn-check:checked + .btn-gold {
    background: var(--gold);
    border-color: var(--gold);
    color: #191919;
    font-weight: 750;
}

.btn-gold:hover {
    background: var(--gold-strong);
    border-color: var(--gold-strong);
    color: #111;
}

.btn-outline-gold {
    border-color: rgba(201, 168, 76, 0.72);
    color: var(--gold-strong);
    font-weight: 700;
}

.btn-outline-danger-soft {
    border-color: rgba(255, 143, 143, 0.72);
    color: #ffaaa8;
    font-weight: 700;
}

.btn-outline-danger-soft:hover {
    background: #ff8f8f;
    border-color: #ff8f8f;
    color: #151515;
}

.btn-outline-gold:focus-visible,
.btn-gold:focus-visible,
.btn-outline-danger-soft:focus-visible {
    box-shadow: 0 0 0 0.22rem rgba(201, 168, 76, 0.24);
}

.link-gold {
    color: var(--gold-strong);
    font-weight: 700;
}

.link-gold:hover {
    color: #f1d675;
}

.form-label {
    color: var(--muted);
    font-weight: 650;
}

.form-control-dark,
.form-control-dark:focus {
    background-color: #181818;
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.form-control-dark::placeholder {
    color: #807b70;
}

.form-control-dark:focus {
    border-color: rgba(201, 168, 76, 0.72);
    box-shadow: 0 0 0 0.22rem rgba(201, 168, 76, 0.16);
}

.progress-dark {
    height: 12px;
    background: #151515;
    border-radius: 999px;
}

.progress-gold {
    background: linear-gradient(90deg, var(--gold), #f0d778);
}

.status-pill,
.status-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: #111;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.status-identificado {
    background: #8fc7ff;
}

.status-mensagem {
    background: #f0cb68;
}

.status-respondeu {
    background: #7bdcb5;
}

.status-conversa {
    background: #b79cff;
}

.status-sem-retorno {
    background: #ff8f8f;
}

.status-convertido {
    background: #8be26f;
}

.status-neutro {
    background: #c7c7c7;
}

.status-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.status-toggle {
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.58;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.status-toggle:hover {
    transform: translateY(-1px);
    opacity: 0.86;
}

.btn-check:checked + .status-toggle {
    opacity: 1;
    border-color: #fff6d7;
    box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.18);
}

.return-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.return-toggle .btn {
    min-width: 88px;
    font-weight: 800;
}

.return-fields.is-hidden {
    display: none;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1rem;
    color: var(--text);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 168, 76, 0.45);
    background: rgba(44, 44, 44, 0.98);
    color: var(--text);
}

.contact-card h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.contact-card p {
    margin: 0.2rem 0 0.55rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.avatar,
.profile-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    color: #111;
    background: var(--gold);
    font-weight: 900;
}

.avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
}

.avatar-sm {
    width: 42px;
    height: 42px;
    font-size: 0.95rem;
}

.avatar img,
.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-panel {
    position: sticky;
    top: 96px;
}

.profile-photo {
    width: 168px;
    height: 168px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    font-size: 4rem;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.edit-photo-box {
    display: grid;
    gap: 1rem;
    align-content: start;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
}

.profile-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

.profile-list dt {
    color: var(--gold-strong);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.profile-list dd {
    margin: -0.45rem 0 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.app-table {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.app-table thead th {
    color: var(--gold-strong);
    font-size: 0.78rem;
    text-transform: uppercase;
    border-bottom-color: rgba(201, 168, 76, 0.24);
}

.empty-state {
    padding: 2rem;
    color: var(--muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 8px;
}

.timeline {
    position: relative;
    display: grid;
    gap: 1rem;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 11px;
    width: 2px;
    background: rgba(201, 168, 76, 0.24);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 1rem;
}

.timeline-marker {
    width: 24px;
    height: 24px;
    border: 4px solid #252525;
    border-radius: 50%;
    z-index: 1;
}

.timeline-content {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
}

.timeline-content time {
    color: var(--muted);
    font-weight: 700;
}

.message-text {
    color: var(--text);
    white-space: normal;
    overflow-wrap: anywhere;
}

.return-box {
    padding: 0.85rem;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 8px;
}

.min-w-0 {
    min-width: 0;
}

@media (max-width: 767.98px) {
    .page-hero,
    .page-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions,
    .table-actions {
        justify-content: stretch;
    }

    .page-actions .btn,
    .page-actions form,
    .page-actions button,
    .table-actions .btn,
    .table-actions form,
    .table-actions button {
        width: 100%;
    }

    .page-hero {
        padding: 1.25rem;
    }

    .page-hero .btn,
    .page-title-row .btn {
        width: 100%;
    }

    .panel {
        padding: 1rem;
    }

    .profile-panel {
        position: static;
    }

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

    .status-toggle {
        width: 100%;
    }
}
