@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

/* =====================================================
   CRM EUROVISA — Design tokens
   Paleta: azul-passaporte profundo + latão (carimbo de visto)
   ===================================================== */
:root {
    --ink-900: #0c1826;
    --ink-800: #122236;
    --ink-700: #182b42;
    --ink-600: #24405e;
    --line: rgba(255,255,255,.09);
    --line-strong: rgba(255,255,255,.16);

    --paper: #eef1f5;
    --paper-dim: #aab6c7;
    --paper-faint: #7c8aa0;

    --brass: #c99a4a;
    --brass-bright: #e3b96a;
    --brass-ink: #2a1f0d;

    --azure: #4f8fb0;
    --stamp-red: #b5533f;
    --visa-green: #4a8f66;

    --radius: 10px;
    --radius-lg: 16px;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    --sidebar-width: 248px;
}

* { box-sizing: border-box; }

body {
    background: var(--ink-900);
    background-image:
        radial-gradient(1100px 620px at 88% -8%, rgba(201,154,74,.07), transparent 60%),
        radial-gradient(900px 500px at -6% 8%, rgba(79,143,176,.06), transparent 55%);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: .93rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -.01em;
}

a { color: var(--brass-bright); text-decoration: none; }
a:hover { color: var(--brass); }

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--ink-800);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.4rem 1.25rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .65rem;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.sidebar-brand .stamp {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--brass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .8rem;
    color: var(--brass-bright);
    flex-shrink: 0;
    position: relative;
}
.sidebar-brand .stamp::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 1px dashed rgba(227,185,106,.5);
    border-radius: 50%;
}

.sidebar-brand .wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--paper);
    line-height: 1.15;
    min-width: 0;
}
.sidebar-brand .wordmark small {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: .64rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--paper-faint);
}

/* Área rolável entre a marca e o rodapé — evita que muitos itens de menu
   estourem a altura da tela; a marca e o rodapé ficam sempre fixos. */
.sidebar-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: .6rem 0 .5rem;
}
.sidebar-scroll::-webkit-scrollbar { width: 6px; }

.sidebar-heading {
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--paper-faint);
    padding: 1rem 1.1rem .35rem;
}

.sidebar .nav {
    padding: 0 .6rem;
}

.sidebar .nav-link {
    color: var(--paper-dim);
    padding: .6rem .75rem;
    border-radius: 8px;
    font-size: .87rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .15rem;
    transition: background .12s, color .12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar .nav-link i { font-size: .95rem; width: 18px; text-align: center; opacity: .85; flex-shrink: 0; }

.sidebar .nav-link:hover {
    background: rgba(255,255,255,.04);
    color: var(--paper);
}
.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(201,154,74,.16), rgba(201,154,74,.03));
    color: var(--brass-bright);
    box-shadow: inset 2px 0 0 var(--brass);
}

.sidebar-footer {
    padding: 1rem 1.1rem 1.2rem;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

/* =====================================================
   LAYOUT / HEADER DE PÁGINA
   ===================================================== */
.content { padding: 1.75rem 2rem; min-width: 0; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-header h4 { margin: 0; font-size: 1.35rem; }
.page-header .d-flex { flex-wrap: wrap; }

.breadcrumb-trail {
    font-size: .78rem;
    color: var(--paper-faint);
    margin-bottom: .25rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.breadcrumb-trail .sep { margin: 0 .3rem; opacity: .5; }

/* =====================================================
   CARDS / PAINÉIS
   ===================================================== */
.card {
    background: var(--ink-800);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 rgba(255,255,255,.02) inset;
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    padding: .95rem 1.15rem;
    color: var(--paper);
}
.card-body { padding: 1.15rem; }

/* =====================================================
   BOTÕES
   ===================================================== */
.btn { border-radius: 999px; font-weight: 600; font-size: .84rem; padding: .5rem 1.05rem; border: none; }

.btn-primary {
    background: linear-gradient(180deg, var(--brass-bright), var(--brass));
    color: var(--brass-ink);
}
.btn-primary:hover { background: var(--brass-bright); color: var(--brass-ink); }

.btn-outline, .btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--paper-dim);
}
.btn-outline:hover, .btn-outline-secondary:hover {
    border-color: var(--brass);
    color: var(--brass-bright);
    background: rgba(201,154,74,.06);
}

.btn-whatsapp {
    background: rgba(74,143,102,.16);
    border: 1px solid rgba(74,143,102,.5);
    color: #7fd19d;
}
.btn-whatsapp:hover { background: rgba(74,143,102,.28); color: #a3e6bb; }

.btn-icon-ganho {
    background: rgba(74,143,102,.14);
    border: 1px solid rgba(74,143,102,.45);
    color: #7fd19d;
    border-radius: 999px;
    font-weight: 600; font-size: .84rem; padding: .5rem 1rem;
}
.btn-icon-ganho:hover { background: rgba(74,143,102,.26); }

.btn-icon-perda {
    background: rgba(181,83,63,.14);
    border: 1px solid rgba(181,83,63,.45);
    color: #e0917f;
    border-radius: 999px;
    font-weight: 600; font-size: .84rem; padding: .5rem 1rem;
}
.btn-icon-perda:hover { background: rgba(181,83,63,.26); }

.btn-icon, .btn-icon-sm {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--paper-faint);
    border-radius: 8px;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon-sm { width: 28px; height: 28px; font-size: .8rem; }
.btn-icon:hover, .btn-icon-sm:hover { color: var(--stamp-red); border-color: var(--stamp-red); }

/* =====================================================
   FORMULÁRIOS
   ===================================================== */
.form-control, .form-select {
    background: var(--ink-900);
    border: 1px solid var(--line-strong);
    color: var(--paper);
    border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    background: var(--ink-900);
    border-color: var(--brass);
    box-shadow: 0 0 0 3px rgba(201,154,74,.15);
    color: var(--paper);
}
.form-label { font-size: .8rem; font-weight: 600; color: var(--paper-dim); margin-bottom: .35rem; }

/* =====================================================
   TABELAS
   ===================================================== */
.table { color: var(--paper); margin-bottom: 0; }
.table > :not(caption) > * > * {
    background: transparent;
    border-bottom-color: var(--line);
    padding: .75rem 1.1rem;
}
.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--paper-faint);
    font-weight: 600;
    border-bottom: 1px solid var(--line-strong);
}
.table tfoot td { border-top: 1px solid var(--line-strong); }
.text-accent { color: var(--brass-bright); font-family: var(--font-mono); }

.badge-tipo { font-weight: 600; padding: .3rem .6rem; border-radius: 999px; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.badge-tipo-produto { background: rgba(79,143,176,.18); color: #8bc4e0; }
.badge-tipo-servico { background: rgba(201,154,74,.18); color: var(--brass-bright); }

/* =====================================================
   MODAIS
   ===================================================== */
.modal-content {
    background: var(--ink-800);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
}
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-family: var(--font-display); font-weight: 600; }

/* =====================================================
   KANBAN — cartões de embarque (boarding pass)
   ===================================================== */
.kanban-board {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-coluna {
    background: rgba(255,255,255,.015);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    min-width: 292px;
    max-width: 292px;
    flex-shrink: 0;
}

.kanban-coluna-header {
    padding: .9rem 1.1rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .92rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.kanban-coluna-header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--etapa-cor, var(--brass));
    border-radius: var(--radius-lg) 0 0 0;
}
.kanban-coluna-header .badge { background: rgba(255,255,255,.08); font-weight: 600; color: var(--paper-dim); }

.kanban-lista { min-height: 60px; padding: .7rem; display: flex; flex-direction: column; gap: .7rem; }

/* Cartão estilo "boarding pass": faixa lateral por etapa + selo circular com iniciais */
.kanban-card {
    background: var(--ink-700);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .85rem .9rem;
    padding-left: 1.05rem;
    cursor: grab;
    position: relative;
    transition: transform .12s, border-color .12s, box-shadow .12s;
}
.kanban-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 10px 0 0 10px;
    background: var(--etapa-cor, var(--brass));
}
.kanban-card:hover {
    border-color: var(--brass);
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
    transform: translateY(-1px);
}
.kanban-card.sortable-ghost { opacity: .35; }

.kanban-card-titulo { font-weight: 600; font-size: .88rem; margin-bottom: .2rem; }

.kanban-card-meta {
    font-size: .76rem;
    color: var(--paper-faint);
    margin-top: .5rem;
    padding-top: .5rem;
    border-top: 1px dashed var(--line-strong);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-card-valor { color: var(--brass-bright); font-family: var(--font-mono); font-weight: 600; font-size: .82rem; }

/* =====================================================
   TIMELINE (anotações)
   ===================================================== */
.timeline-item {
    border-left: 2px solid var(--line-strong);
    padding-left: 1rem;
    padding-bottom: 1rem;
    position: relative;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px; top: 4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brass);
}

/* =====================================================
   NAV TABS (funil-config)
   ===================================================== */
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link {
    color: var(--paper-faint);
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-weight: 600;
    font-size: .85rem;
}
.nav-tabs .nav-link.active {
    color: var(--brass-bright);
    background: transparent;
    border-bottom-color: var(--brass);
}

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: 8px; }

/* =====================================================
   RESPONSIVO — telas estreitas (tablet/celular)
   ===================================================== */
@media (max-width: 860px) {
    .d-flex:has(> .sidebar) { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: .5rem .75rem;
    }
    .sidebar-brand { border-bottom: none; padding: .3rem .5rem; flex-shrink: 0; }
    .sidebar-scroll {
        order: 3;
        width: 100%;
        max-height: 50vh;
        overflow-y: auto;
    }
    .sidebar-footer {
        border-top: none;
        padding: .3rem .5rem;
        margin-left: auto;
        width: auto;
    }
    .sidebar-footer .btn { width: auto; }
    .content { padding: 1.25rem 1rem; }
    .kanban-coluna { min-width: 260px; max-width: 260px; }
}

@media (max-width: 480px) {
    .page-header { flex-direction: column; align-items: stretch; }
    .page-header > div:last-child, .page-header .d-flex { width: 100%; }
}

@media (max-width: 700px) {
    .action-bar .btn-label { display: none; }
    .action-bar .btn { padding: .5rem .65rem; }
}
