/* ══════════════════════════════════════════════════════════════
   DESIGN TOKENS — identidade ConversIA
══════════════════════════════════════════════════════════════ */
:root {
    --bg:            #070B12;
    --surface-1:     #0D1420;
    --surface-2:     #161B22;
    --surface-3:     #1E2530;

    --text-primary:   #E7ECF5;
    --text-secondary: #9AA7BD;
    --text-tertiary:  #6B7688;

    --border:        rgba(30, 107, 255, 0.16);
    --border-strong: rgba(30, 107, 255, 0.34);
    --divider:       rgba(255, 255, 255, 0.06);

    --accent-blue: #1E6BFF;
    --accent-cyan: #00D5FF;
    --accent-gradient:       linear-gradient(135deg, #1E6BFF 0%, #00D5FF 100%);
    --accent-gradient-hover: linear-gradient(135deg, #3B82FF 0%, #22E4FF 100%);
    --glow-blue: rgba(30, 107, 255, 0.35);
    --glow-card: rgba(30, 107, 255, 0.08);

    --success: #4ADE80;
    --success-bg: rgba(34, 197, 94, 0.14);
    --warning: #FDE047;
    --warning-bg: rgba(250, 204, 21, 0.14);
    --danger: #F87171;
    --danger-bg: rgba(239, 68, 68, 0.14);
    --orange: #FB923C;
    --orange-bg: rgba(251, 146, 60, 0.16);
    --violet: #C4B5FD;
    --violet-bg: rgba(167, 139, 250, 0.16);
    --sky: #7DD3FC;
    --sky-bg: rgba(56, 189, 248, 0.16);
    --pink: #F9A8D4;
    --pink-bg: rgba(244, 114, 182, 0.16);
    --slate: #94A3B8;
    --slate-bg: rgba(148, 163, 184, 0.14);

    --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg);
}
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--accent-cyan); }

::selection { background: rgba(30, 107, 255, 0.35); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
* { scrollbar-color: var(--surface-3) transparent; scrollbar-width: thin; }

:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}


/* ══════════════════════════════════════════════════════════════
   AUTH — split-screen layout
══════════════════════════════════════════════════════════════ */

.auth-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* ── Brand panel (left) ──────────────────────────────────────── */
.auth-brand {
    flex: 1;
    background:
        radial-gradient(ellipse 600px 500px at 15% 10%, rgba(30, 107, 255, 0.16), transparent 60%),
        radial-gradient(ellipse 500px 400px at 90% 90%, rgba(0, 213, 255, 0.10), transparent 60%),
        var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(30, 107, 255, 0.14);
    filter: blur(10px);
    top: -140px;
    right: -120px;
    pointer-events: none;
    animation: brand-orb-pulse 9s ease-in-out infinite;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(0, 213, 255, 0.10);
    filter: blur(10px);
    bottom: -80px;
    left: -60px;
    pointer-events: none;
    animation: brand-orb-pulse 11s ease-in-out infinite reverse;
}

@keyframes brand-orb-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.12); opacity: 0.75; }
}

.brand-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
    color: var(--text-primary);
}

.brand-logo { margin-bottom: 2rem; }

.brand-logo-img {
    display: block;
    max-width: 380px;
    width: 100%;
    height: auto;
}

.brand-product-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0 0 2rem 0;
}

.brand-tagline {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    margin: 0 0 2rem 0;
    letter-spacing: -0.03em;
}

.brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.brand-features li {
    color: var(--text-secondary);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.brand-features li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(30, 107, 255, 0.22);
    color: var(--accent-cyan);
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Form panel (right) ──────────────────────────────────────── */
.auth-form-panel {
    flex: 1;
    background: var(--surface-1);
    border-left: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.auth-form-container {
    width: 100%;
    max-width: 390px;
}

.auth-form-header { margin-bottom: 2rem; }

.auth-form-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem 0;
    letter-spacing: -0.025em;
}

.auth-form-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-layout .form-group { margin-bottom: 1.25rem; }

.auth-layout label {
    display: block;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.auth-layout input[type="email"],
.auth-layout input[type="password"],
.auth-layout input[type="text"] {
    display: block;
    width: 100%;
    padding: 0.7rem 0.95rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--surface-2);
    outline: none;
    box-shadow: none;
    margin: 0;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.auth-layout input[type="email"]::placeholder,
.auth-layout input[type="password"]::placeholder,
.auth-layout input[type="text"]::placeholder {
    color: var(--text-tertiary);
}

.auth-layout input[type="email"]:focus,
.auth-layout input[type="password"]:focus,
.auth-layout input[type="text"]:focus {
    border-color: var(--accent-blue);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

/* ── Auth buttons ────────────────────────────────────────────── */
.btn-auth {
    display: block;
    width: 100%;
    padding: 0.78rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s, border-color 0.18s;
    border: 1.5px solid transparent;
    margin: 0 0 0.75rem 0;
    text-align: center;
    line-height: 1;
    box-shadow: none;
}

.btn-auth--primary {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

.btn-auth--primary:hover:not(:disabled) {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 20px var(--glow-blue);
    transform: translateY(-1px);
}

.btn-auth--primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.btn-auth--primary:disabled {
    background: rgba(30, 107, 255, 0.28);
    border-color: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
}

.btn-auth--secondary {
    background: transparent;
    color: var(--accent-cyan);
    border-color: var(--border);
    font-weight: 500;
}

.btn-auth--secondary:hover:not(:disabled) {
    background: rgba(30, 107, 255, 0.08);
    border-color: var(--border-strong);
}

/* ── Divider ─────────────────────────────────────────────────── */
.auth-divider {
    text-align: center;
    position: relative;
    margin: 0.25rem 0;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    line-height: 1;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 18px);
    height: 1px;
    background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ── Alerts ──────────────────────────────────────────────────── */
.auth-alert {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.auth-alert--error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.auth-alert--info {
    background: rgba(30, 107, 255, 0.12);
    color: var(--accent-cyan);
    border: 1px solid var(--border-strong);
}

/* ── Confirm-email ───────────────────────────────────────────── */
.auth-confirm { text-align: center; padding: 0.5rem 0; }

.auth-confirm .confirm-icon {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    display: block;
}

.auth-confirm h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.auth-confirm p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0 0 1.5rem 0;
}

/* ── Mobile auth ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-layout { flex-direction: column; }
    .auth-brand { padding: 1.75rem 1.5rem; flex: none; }
    .brand-tagline { font-size: 1.4rem; }
    .brand-features { display: none; }
    .auth-form-panel { padding: 2rem 1.5rem; border-left: none; border-top: 1px solid var(--border); }
}


/* ══════════════════════════════════════════════════════════════
   APP — dashboard 3-colunas
══════════════════════════════════════════════════════════════ */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg);
    overflow: hidden;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.app-topbar {
    height: 68px;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(30, 107, 255, 0.08);
    z-index: 10;
}

.topbar-brand { display: flex; align-items: center; gap: 10px; }

.topbar-logo { height: 56px; width: auto; display: block; }

.topbar-sep {
    color: var(--text-tertiary);
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1;
    user-select: none;
}

.topbar-product {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.topbar-user { display: flex; align-items: center; gap: 0.75rem; }

.topbar-email {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-signout-btn {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topbar-signout-btn:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* ── Body ────────────────────────────────────────────────────── */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* ── Coluna título ───────────────────────────────────────────── */
.col-title {
    padding: 0.8rem 1rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface-1);
}

/* ── Col 1: Agents ───────────────────────────────────────────── */
.col-agents {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.agents-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
}

.agent-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid var(--divider);
    border-radius: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.agent-btn:hover { background: var(--surface-2); color: var(--text-primary); }

.agent-btn.active {
    background: rgba(30, 107, 255, 0.14);
    color: var(--accent-cyan);
    font-weight: 600;
    border-left: 3px solid var(--accent-cyan);
    padding-left: 13px;
}

/* ── Col 2: Leads ────────────────────────────────────────────── */
.col-leads {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leads-search-wrap {
    padding: 8px;
    margin: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.leads-search {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.48rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.82rem;
    color: var(--text-primary);
    background: var(--surface-2);
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.leads-search::placeholder { color: var(--text-tertiary); }

.leads-search:focus {
    border-color: var(--accent-blue);
    background: var(--surface-3);
    box-shadow: 0 0 0 2.5px var(--glow-blue);
}

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

.lead-item {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--divider);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.1s;
}

.lead-item:hover { background: var(--surface-2); }

.lead-item.selected {
    background: rgba(30, 107, 255, 0.14);
    border-left-color: var(--accent-cyan);
}

.lead-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-phone { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.lead-time  { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-tertiary); margin-top: 3px; }

/* ── Col 3: Conversa ─────────────────────────────────────────── */
.col-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.col-conversation .col-title { background: var(--bg); }

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Loading ─────────────────────────────────────────────────── */
.messages-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-tertiary);
    font-size: 0.84rem;
}

.spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(30, 107, 255, 0.18);
    border-top-color: #1E6BFF;
    animation: spinner-spin 0.7s linear infinite;
}

@keyframes spinner-spin {
    to { transform: rotate(360deg); }
}

/* ── Estado vazio ────────────────────────────────────────────── */
.col-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.84rem;
    line-height: 1.6;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .col-agents { width: 160px; }
    .col-leads  { width: 220px; }
}

@media (max-width: 600px) {
    .app-body { flex-direction: column; }
    .col-agents {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .agents-list { flex-direction: row; flex-wrap: wrap; }
    .col-leads {
        width: 100%;
        height: 200px;
        border-right: none;
    }
}


/* ══════════════════════════════════════════════════════════════
   MODAL — feedback de mensagens
══════════════════════════════════════════════════════════════ */

dialog {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 0 0 1px var(--border), 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--glow-card);
    background: var(--surface-2);
    color: var(--text-primary);
}

dialog::backdrop {
    background: rgba(2, 4, 8, 0.75);
}

dialog article {
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

dialog article header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin: 0;
}

dialog article header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

dialog article > p {
    padding: 1rem 1.5rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

dialog article label {
    display: block;
    padding: 0.75rem 1.5rem 0;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-secondary);
}

dialog article select,
dialog article textarea {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--surface-3);
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

dialog article select:focus,
dialog article textarea:focus {
    border-color: var(--accent-blue);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

dialog article textarea { resize: vertical; }

dialog article footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

dialog article footer button {
    padding: 0.55rem 1.2rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: none;
    margin: 0;
}

dialog article footer button.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

dialog article footer button.secondary:hover {
    background: var(--surface-3);
    color: var(--text-primary);
}

dialog article footer button:not(.secondary) {
    background: var(--accent-gradient);
    color: #fff;
}

dialog article footer button:not(.secondary):hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 16px var(--glow-blue);
}

.btn-primary {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: none;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 16px var(--glow-blue);
}

dialog article input[type="text"] {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.55rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--surface-3);
    outline: none;
    box-shadow: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

dialog article input[type="text"]:focus {
    border-color: var(--accent-blue);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px var(--glow-blue);
}

dialog.dialog-wide { max-width: 580px; }


/* ══════════════════════════════════════════════════════════════
   BADGES — status, prioridade, categoria
══════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge--pendente     { background: var(--warning-bg); color: var(--warning); }
.badge--em_andamento { background: rgba(30, 107, 255, 0.16); color: #5AA9FF; }
.badge--concluido    { background: var(--success-bg); color: var(--success); }
.badge--rejeitado    { background: var(--danger-bg);  color: var(--danger); }

.badge--pri-baixa   { background: var(--slate-bg);   color: var(--slate); }
.badge--pri-media   { background: var(--warning-bg); color: var(--warning); }
.badge--pri-alta    { background: var(--orange-bg);  color: var(--orange); }
.badge--pri-urgente { background: var(--danger-bg);  color: var(--danger); }

.badge--cat-funcionalidade { background: var(--violet-bg); color: var(--violet); }
.badge--cat-comportamento  { background: var(--sky-bg);    color: var(--sky); }
.badge--cat-tom            { background: var(--pink-bg);   color: var(--pink); }
.badge--cat-integracao     { background: var(--success-bg); color: var(--success); }
.badge--cat-outro          { background: var(--slate-bg);  color: var(--slate); }

.badge--tp-info_incorreta     { background: var(--danger-bg);  color: var(--danger); }
.badge--tp-tom_inadequado     { background: var(--orange-bg);  color: var(--orange); }
.badge--tp-fluxo_confuso      { background: var(--warning-bg); color: var(--warning); }
.badge--tp-promessa_exagerada { background: var(--violet-bg);  color: var(--violet); }
.badge--tp-outro              { background: var(--slate-bg);  color: var(--slate); }
.badge--tp-melhoria_geral     { background: var(--sky-bg);    color: var(--sky); }


/* ══════════════════════════════════════════════════════════════
   MELHORIAS — página de gestão
══════════════════════════════════════════════════════════════ */

.topbar-nav-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.32rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topbar-nav-link:hover {
    background: var(--surface-2);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.melhorias-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
}

.melhorias-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.toolbar-filters {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.42rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.83rem;
    color: var(--text-primary);
    background: var(--surface-2);
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}

.filter-select::placeholder { color: var(--text-tertiary); }
.filter-select:focus { border-color: var(--accent-blue); }

.btn-primary {
    padding: 0.48rem 1.1rem;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 16px var(--glow-blue);
}

.melhorias-table-wrap {
    flex: 1;
    overflow-y: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 0 24px var(--glow-card);
}

.melhorias-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.melhorias-table thead th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.melhorias-table tbody tr {
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background 0.1s;
}

.melhorias-table tbody tr:last-child { border-bottom: none; }
.melhorias-table tbody tr:hover { background: var(--surface-3); }

.melhorias-table td {
    padding: 0.72rem 1rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.td-titulo {
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 3rem 1rem;
    font-size: 0.875rem;
}

.detalhe-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
}

.detalhe-meta-item > label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0;
    margin-bottom: 0.2rem;
}

.detalhe-meta-item > span {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.feedback-contadores {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
