/* =====================================================================
   Central de Suporte Workview — Identidade visual
   Branco + verde Workview. Inter. Bordas 8px. Sombra suave.
   Override do Bootstrap 5 (primary/success = verde) sem build SCSS.
   ===================================================================== */

:root {
    --wv-primary: #7AC142;
    --wv-primary-hover: #5FA032;
    --wv-surface: #EAF7DD;
    --wv-surface-2: #f4faed;
    --wv-bg: #f6f9f2;
    --wv-border: #e6efdb;
    --wv-text: #1f2a1a;
    --wv-muted: #6b7a5e;
    --wv-radius: 8px;
    --wv-shadow: 0 2px 10px rgba(31, 42, 26, .06);
    --wv-shadow-lg: 0 18px 40px rgba(31, 42, 26, .14);

    /* Sobrescreve tokens do Bootstrap */
    --bs-primary: #7AC142;
    --bs-primary-rgb: 122, 193, 66;
    --bs-success: #5FA032;
    --bs-success-rgb: 95, 160, 50;
    --bs-link-color: #5FA032;
    --bs-link-color-rgb: 95, 160, 50;
    --bs-link-hover-color: #4a7f27;
    --bs-border-radius: 8px;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

body {
    background: var(--wv-bg);
    color: var(--wv-text);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ---------- Botões / cores utilitárias (verde) ---------- */
.btn-primary {
    --bs-btn-bg: var(--wv-primary);
    --bs-btn-border-color: var(--wv-primary);
    --bs-btn-hover-bg: var(--wv-primary-hover);
    --bs-btn-hover-border-color: var(--wv-primary-hover);
    --bs-btn-active-bg: var(--wv-primary-hover);
    --bs-btn-active-border-color: var(--wv-primary-hover);
    --bs-btn-disabled-bg: var(--wv-primary);
    --bs-btn-disabled-border-color: var(--wv-primary);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: #fff;
}
.btn-success {
    --bs-btn-bg: var(--wv-primary-hover);
    --bs-btn-border-color: var(--wv-primary-hover);
    --bs-btn-hover-bg: #4a7f27;
    --bs-btn-hover-border-color: #4a7f27;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}
.btn-outline-primary {
    --bs-btn-color: var(--wv-primary-hover);
    --bs-btn-border-color: var(--wv-primary);
    --bs-btn-hover-bg: var(--wv-primary);
    --bs-btn-hover-border-color: var(--wv-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--wv-primary);
    --bs-btn-active-border-color: var(--wv-primary);
}
.bg-primary { background-color: var(--wv-primary) !important; }
.text-primary { color: var(--wv-primary-hover) !important; }
.text-bg-primary { background-color: var(--wv-primary) !important; color: #fff !important; }
.border-primary { border-color: var(--wv-primary) !important; }
.bg-success { background-color: var(--wv-primary-hover) !important; }
a { color: var(--wv-primary-hover); }
a:hover { color: #4a7f27; }

.form-control:focus, .form-select:focus {
    border-color: var(--wv-primary);
    box-shadow: 0 0 0 .2rem rgba(122, 193, 66, .25);
}
.form-check-input:checked {
    background-color: var(--wv-primary);
    border-color: var(--wv-primary);
}

.card { border-color: var(--wv-border); border-radius: 12px; box-shadow: var(--wv-shadow); }
.badge.bg-primary { background-color: var(--wv-primary) !important; }

/* ---------- Layout geral ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 250px;
    background: #fff;
    color: var(--wv-text);
    border-right: 1px solid var(--wv-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    transition: transform .2s ease;
    z-index: 1000;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px; border-bottom: 1px solid var(--wv-border);
}
.brand-mark {
    width: 38px; height: 38px; border-radius: var(--wv-radius);
    background: var(--wv-primary); color: #fff; font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    box-shadow: 0 4px 10px rgba(122, 193, 66, .35);
}
.brand-text { font-weight: 600; color: var(--wv-text); line-height: 1.2; font-size: 15px; }
.brand-text small { color: var(--wv-muted); font-weight: 400; }

.sidebar-nav { padding: 14px 10px; flex: 1; }
.sidebar-nav .nav-link {
    color: #4b5945; padding: 10px 14px; border-radius: var(--wv-radius);
    margin-bottom: 4px; font-size: 14px; display: flex; align-items: center; gap: 10px;
    font-weight: 500;
}
.sidebar-nav .nav-link:hover { background: var(--wv-surface-2); color: var(--wv-primary-hover); }
.sidebar-nav .nav-link.active { background: var(--wv-surface); color: var(--wv-primary-hover); font-weight: 600; }
.sidebar-footer { padding: 14px 10px; border-top: 1px solid var(--wv-border); }
.sidebar-footer .nav-link { padding: 10px 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; }

.app-main { margin-left: 250px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar {
    background: #fff; border-bottom: 1px solid var(--wv-border);
    padding: 12px 24px; display: flex; align-items: center;
    position: sticky; top: 0; z-index: 900;
}
.topbar-user { text-align: right; font-size: 14px; }
.app-content { padding: 24px; }

@media (max-width: 992px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: var(--wv-shadow-lg); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
}

/* ---------- Cards de indicadores ---------- */
.stat-card {
    background: #fff; border: 1px solid var(--wv-border); border-radius: 12px;
    padding: 18px 20px; height: 100%; box-shadow: var(--wv-shadow);
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--wv-text); }
.stat-card .stat-label { color: var(--wv-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.stat-card .stat-icon { font-size: 22px; color: var(--wv-primary); opacity: .9; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    position: relative; padding: 0 0 20px 28px; border-left: 2px solid var(--wv-border);
}
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: ''; position: absolute; left: -7px; top: 2px;
    width: 12px; height: 12px; border-radius: 50%; background: var(--wv-primary);
    box-shadow: 0 0 0 3px var(--wv-surface);
}
.timeline .timeline-date { font-size: 12px; color: var(--wv-muted); }
.timeline .timeline-desc { font-size: 14px; color: #29344a; }

/* ---------- Mensagens do chamado (chat) ---------- */
.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg-bubble { max-width: 78%; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--wv-border); }
.msg-bubble.msg-mine { margin-left: auto; background: var(--wv-surface); border-color: #cbe8ab; }
.msg-bubble.msg-interno { background: #fff7e6; border-color: #ffe3ac; }
.msg-meta { font-size: 12px; color: var(--wv-muted); margin-bottom: 4px; }

/* ---------- Auth ---------- */
.auth-body {
    background: linear-gradient(135deg, var(--wv-surface) 0%, #fff 60%);
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.auth-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.auth-brand { text-align: center; color: var(--wv-text); margin-bottom: 24px; }
.auth-brand h1 { font-size: 24px; font-weight: 700; margin: 8px 0 0; }
.auth-brand p { color: var(--wv-muted); font-size: 13px; }
.auth-brand .brand-mark { margin: 0 auto; }
.auth-card { background: #fff; border-radius: 14px; padding: 28px; box-shadow: var(--wv-shadow-lg); border: 1px solid var(--wv-border); }

/* ---------- KB suggestion box ---------- */
#kbSugestoes { border: 1px solid var(--wv-border); border-radius: 10px; margin-top: 8px; overflow: hidden; display: none; background: #fff; box-shadow: var(--wv-shadow); }
#kbSugestoes .kb-item { padding: 10px 14px; border-bottom: 1px solid var(--wv-border); cursor: pointer; font-size: 14px; }
#kbSugestoes .kb-item:last-child { border-bottom: none; }
#kbSugestoes .kb-item:hover { background: var(--wv-surface-2); }

.char-counter { font-size: 12px; color: var(--wv-muted); }
.dropzone {
    border: 2px dashed var(--wv-border); border-radius: 10px; padding: 24px;
    text-align: center; color: var(--wv-muted); cursor: pointer; transition: .15s;
    background: var(--wv-surface-2);
}
.dropzone.dragover { border-color: var(--wv-primary); background: var(--wv-surface); color: var(--wv-primary-hover); }
