/* ============================================================
   ProspectSemSite — app.css  v1.2
   Paleta: Ouro #D9B348 / Marinho #0F3057 / Carvão #2F343A
   ============================================================ */

/* ── Custom Properties ───────────────────────────────────── */
:root {
    --font:       'Archivo', sans-serif;

    /* Paleta do projeto */
    --gold:       #D9B348;   /* primary accent    */
    --gold-d:     #C9A227;   /* hover / deep       */
    --navy:       #0F3057;   /* surface / cards    */
    --charcoal:   #2F343A;   /* input bg / low     */

    /* Derivados */
    --bg:         #1A1F27;   /* page background    */
    --card-low:   #1D2535;   /* kanban card bg     */
    --grey:       #7B8794;   /* muted text         */
    --text:       #EDF2F7;   /* main text          */
    --green:      #34D399;   /* success            */
    --border:     rgba(255,255,255,0.07);
    --gold-glow:  rgba(217,179,72,0.16);

    --r:    16px;  /* card radius  */
    --rb:   10px;  /* btn radius   */
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body ────────────────────────────────────────────────── */
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image: radial-gradient(ellipse at 80% 0%,
        rgba(217,179,72,0.06) 0%, transparent 55%);
}

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes slideUp   { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }
@keyframes fadeDown  { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }
@keyframes fadeIn    { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform: translateY(0); } }

/* ================================================================
   HEADER
   ================================================================ */
.header {
    background: var(--navy);
    border-bottom: 1px solid rgba(217,179,72,0.15);
    padding: 0.85rem 2rem;
    display: flex; align-items: center; gap: 0.9rem;
    position: sticky; top: 0; z-index: 50;
}
.header-logo { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.4px; }
.header-logo span { color: var(--gold); }

.header-badge {
    font-size: 0.62rem;
    background: rgba(217,179,72,0.12);
    color: var(--gold);
    border: 1px solid rgba(217,179,72,0.3);
    padding: 2px 8px; border-radius: 20px; font-weight: 700;
}
.header-spacer { flex: 1; }

.header-user {
    font-size: 0.8rem; color: var(--grey);
    display: flex; align-items: center; gap: 0.5rem;
}
.header-avatar {
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(217,179,72,0.15); color: var(--gold);
    font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    text-transform: uppercase;
}
.btn-logout {
    font-family: var(--font); font-size: 0.78rem; font-weight: 600;
    color: var(--grey); background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0.35rem 0.85rem; border-radius: var(--rb);
    cursor: pointer; text-decoration: none;
    transition: border-color .2s, color .2s;
    display: inline-flex; align-items: center; gap: 5px;
}
.btn-logout:hover { border-color: rgba(239,68,68,0.5); color: #fca5a5; }

/* ================================================================
   LAYOUT
   ================================================================ */
.page { padding: 1.8rem 0 3rem; }
.container { max-width: 1600px; margin: 0 auto; padding: 0 2rem; }

/* ================================================================
   STATS GRID
   ================================================================ */
.stats-grid {
    display: grid; grid-template-columns: repeat(4,1fr);
    gap: 1rem; margin-bottom: 1.4rem;
}
.stat-card {
    background: var(--navy); border: 1px solid var(--border);
    border-radius: var(--r); padding: 1.3rem 1.4rem;
    display: flex; align-items: center; gap: 1rem;
    transition: border-color .2s, transform .15s;
}
.stat-card:hover { border-color: var(--gold-glow); transform: translateY(-1px); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-num { font-size: 1.85rem; font-weight: 900; line-height: 1; }
.stat-lbl { font-size: 0.68rem; color: var(--grey); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* ================================================================
   CARD (genérico)
   ================================================================ */
.card {
    background: var(--navy); border: 1px solid var(--border);
    border-radius: var(--r); margin-bottom: 1.4rem;
}
.card-body { padding: 1.3rem 1.5rem; }

/* ================================================================
   BOTÕES
   ================================================================ */
.btn {
    font-family: var(--font); padding: 0.5rem 1.2rem; border-radius: var(--rb);
    border: none; cursor: pointer; font-weight: 700; font-size: 0.83rem;
    transition: background .2s, transform .1s;
    text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--gold); color: #1A1F27; }
.btn-primary:hover { background: var(--gold-d); }

.btn-ghost {
    background: transparent; border: 1px solid rgba(255,255,255,0.13); color: var(--text);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.btn-sm { padding: 0.28rem 0.75rem; font-size: 0.74rem; }

/* ================================================================
   TOOLBAR & FILTROS
   ================================================================ */
.toolbar {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.filter-form { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-label {
    font-size: 0.67rem; color: var(--grey);
    text-transform: uppercase; letter-spacing: 0.9px; font-weight: 600;
}
.filter-input,
.filter-select {
    font-family: var(--font); background: var(--charcoal);
    border: 1px solid rgba(255,255,255,0.1); color: var(--text);
    padding: 0.5rem 0.85rem; border-radius: var(--rb);
    font-size: 0.83rem; outline: none; transition: border-color .2s; min-width: 130px;
}
.filter-input:focus, .filter-select:focus { border-color: var(--gold); }
.filter-input::placeholder { color: rgba(255,255,255,0.22); }
.filter-select option { background: var(--charcoal); }

.toolbar-right { display: flex; gap: 0.6rem; align-items: center; flex-shrink: 0; }

.btn-rules {
    font-family: var(--font); font-size: 0.78rem; font-weight: 600;
    background: transparent; border: 1px solid rgba(255,255,255,0.13);
    color: var(--grey); padding: 0.4rem 0.85rem; border-radius: var(--rb);
    cursor: pointer; transition: border-color .2s, color .2s;
    display: inline-flex; align-items: center; gap: 5px;
}
.btn-rules:hover, .btn-rules.active { border-color: var(--gold); color: var(--gold); }

.view-toggle {
    display: flex; background: rgba(255,255,255,0.05);
    border: 1px solid var(--border); border-radius: var(--rb); overflow: hidden;
}
.view-btn {
    font-family: var(--font); font-size: 0.75rem; font-weight: 600;
    background: transparent; border: none; color: var(--grey);
    padding: 0.38rem 0.85rem; cursor: pointer; transition: background .15s, color .15s;
}
.view-btn.active { background: rgba(217,179,72,0.12); color: var(--gold); }
.view-btn:hover:not(.active) { color: var(--text); }

/* ================================================================
   BADGES & HELPERS
   ================================================================ */
.badge {
    display: inline-block; padding: 3px 9px; border-radius: 20px;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.rating { color: #ED9808; font-weight: 700; }
.rating::before { content: '★ '; }

.lead-avatar {
    width: 32px; height: 32px; border-radius: 9px;
    background: rgba(217,179,72,0.1); color: var(--gold);
    font-weight: 700; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; text-transform: uppercase;
}
.lead-nome { font-size: 0.83rem; font-weight: 700; line-height: 1.3; }
.lead-cat  { font-size: 0.7rem; color: var(--grey); margin-top: 2px; }
.lead-cell { display: flex; align-items: center; gap: 0.7rem; }

.link-icon {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--gold); text-decoration: none; font-size: 0.76rem; font-weight: 600;
    transition: color .2s;
}
.link-icon:hover { color: var(--gold-d); }

/* ================================================================
   RÉGUAS DE MARKETING
   ================================================================ */
.rules-section { margin-bottom: 1.4rem; animation: fadeDown .22s ease; }

.rules-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }

.rule-card {
    background: var(--navy); border: 1px solid var(--border);
    border-top: 3px solid transparent; border-radius: var(--r); padding: 1.2rem;
}
.rule-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.rule-icon   { font-size: 1rem; }
.rule-title  { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; }
.rule-list   { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.rule-list li {
    font-size: 0.75rem; color: rgba(237,242,247,0.62); line-height: 1.45;
    padding-left: 1rem; position: relative;
}
.rule-list li::before { content: '›'; position: absolute; left: 0; font-weight: 700; color: var(--grey); }

/* ================================================================
   KANBAN BOARD
   ================================================================ */
.kanban-board {
    display: flex; gap: 1rem;
    align-items: flex-start; overflow-x: auto; padding-bottom: 1rem;
}
.kanban-col {
    flex: 1; min-width: 250px; background: var(--navy);
    border: 1px solid var(--border); border-radius: var(--r);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 295px);
    transition: border-color .2s, background .2s;
}
.kanban-col.drag-over {
    background: rgba(217,179,72,0.04);
    border-color: rgba(217,179,72,0.4);
}
.kanban-col-header {
    padding: 0.9rem 1.1rem 0.75rem;
    border-bottom: 1px solid var(--border);
    border-top: 3px solid transparent;
    border-radius: 15px 15px 0 0;
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.kanban-col-title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
}
.col-count {
    font-size: 0.68rem; font-weight: 700;
    background: rgba(255,255,255,0.07); color: var(--grey);
    padding: 2px 7px; border-radius: 20px; min-width: 22px; text-align: center;
}

/* Cards area */
.kanban-cards {
    padding: 0.75rem; overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 0.65rem; min-height: 60px;
}
.kanban-cards::-webkit-scrollbar { width: 4px; }
.kanban-cards::-webkit-scrollbar-track { background: transparent; }
.kanban-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Individual card */
.kanban-card {
    background: var(--card-low); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 0.9rem;
    cursor: grab; user-select: none;
    transition: border-color .15s, box-shadow .15s, opacity .15s;
}
.kanban-card:hover {
    border-color: rgba(217,179,72,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.kanban-card:active  { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.35; }

.card-lead-header { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.6rem; }
.card-meta {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.72rem; color: var(--grey); margin-bottom: 0.45rem;
}
.card-phone {
    font-size: 0.71rem; color: var(--grey);
    margin-bottom: 0.55rem; font-variant-numeric: tabular-nums;
}
.card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 0.6rem; border-top: 1px solid rgba(255,255,255,0.05);
}
.card-links { display: flex; gap: 0.4rem; }
.link-chip {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.68rem; font-weight: 700; padding: 3px 8px;
    border-radius: 6px; text-decoration: none; transition: opacity .15s;
}
.link-chip:hover { opacity: 0.7; }
.link-chip.wpp { background: rgba(34,197,94,0.15); color: #4ade80; }
.link-chip.ig  { background: rgba(217,70,239,0.15); color: #e879f9; }

.empty-col {
    font-size: 0.74rem; color: rgba(255,255,255,0.18);
    text-align: center; padding: 1.5rem 0.5rem;
}

/* ================================================================
   TABELA (view alternativa)
   ================================================================ */
#tableView { display: none; }

.table-card { background: var(--navy); border: 1px solid var(--border); border-radius: var(--r); }
.table-card-header {
    padding: 1rem 1.4rem; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.count-label { font-size: 0.8rem; color: var(--grey); }
.count-label strong { color: var(--gold); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
thead th {
    padding: 0.8rem 1.1rem; text-align: left;
    font-size: 0.67rem; text-transform: uppercase; letter-spacing: 1px; color: var(--grey);
    border-bottom: 1px solid var(--border); white-space: nowrap; font-weight: 600;
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background .15s; }
tbody tr:hover { background: rgba(217,179,72,0.04); }
tbody td { padding: 0.85rem 1.1rem; vertical-align: middle; }
.td-id { color: var(--grey); font-size: 0.7rem; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state { text-align: center; padding: 3.5rem 2rem; color: var(--grey); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.8rem; opacity: .45; }
.empty-state p { font-size: 0.85rem; line-height: 1.7; }
.empty-state code {
    background: rgba(255,255,255,0.07); padding: 2px 6px;
    border-radius: 5px; font-size: 0.8rem;
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(6px);
    z-index: 100; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--navy); border: 1px solid rgba(217,179,72,0.22);
    border-radius: 20px; padding: 2rem; width: 100%; max-width: 500px;
    animation: slideUp .25s ease; box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 1.4rem; }
.modal-title span { color: var(--gold); }

.form-group { margin-bottom: 0.95rem; }
.form-group label {
    display: block; font-size: 0.67rem; color: var(--grey);
    text-transform: uppercase; letter-spacing: .9px; font-weight: 600; margin-bottom: 5px;
}
.form-group select,
.form-group textarea,
.form-group input[type="text"] {
    width: 100%; font-family: var(--font); background: var(--charcoal);
    border: 1px solid rgba(255,255,255,0.1); color: var(--text);
    padding: 0.6rem 0.9rem; border-radius: var(--rb);
    font-size: 0.84rem; outline: none; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.form-group select:focus,
.form-group textarea:focus,
.form-group input[type="text"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(217,179,72,0.1);
}
.form-group select option { background: var(--charcoal); }

.abordagem-box {
    background: rgba(217,179,72,.07); border: 1px solid rgba(217,179,72,.2);
    border-radius: var(--rb); padding: 0.8rem;
    font-size: 0.79rem; line-height: 1.6; color: #d4c387;
    margin-bottom: 1rem; font-style: italic;
}
.modal-actions { display: flex; gap: .7rem; justify-content: flex-end; margin-top: 1.4rem; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
body.login-body {
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    background-image:
        radial-gradient(ellipse at 65% 15%, rgba(217,179,72,0.09) 0%, transparent 55%),
        radial-gradient(ellipse at 20% 85%, rgba(15,48,87,0.5)    0%, transparent 50%);
}
.login-card {
    background: var(--navy); border: 1px solid rgba(217,179,72,0.22);
    border-radius: 24px; padding: 3rem 2.5rem; width: 100%; max-width: 400px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5); animation: fadeIn .3s ease;
}
.login-logo {
    font-size: 1.65rem; font-weight: 900; color: var(--text);
    letter-spacing: -0.5px; margin-bottom: 0.3rem;
}
.login-logo span { color: var(--gold); }
.login-subtitle { font-size: 0.83rem; color: var(--grey); margin-bottom: 2.5rem; }

.login-input {
    width: 100%; font-family: var(--font); background: var(--charcoal);
    border: 1px solid rgba(255,255,255,0.1); color: var(--text);
    padding: 0.8rem 1rem; border-radius: var(--rb); font-size: 0.9rem;
    outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(217,179,72,0.1);
}
.login-input::placeholder { color: rgba(255,255,255,0.2); }

.btn-login {
    width: 100%; font-family: var(--font); background: var(--gold); color: #1A1F27;
    border: none; padding: 0.85rem; border-radius: var(--rb);
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    margin-top: 0.5rem; transition: background .2s, transform .1s;
}
.btn-login:hover { background: var(--gold-d); }
.btn-login:active { transform: scale(0.98); }

.alert-error {
    background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--rb); padding: 0.75rem 1rem;
    font-size: 0.84rem; color: #fca5a5; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.alert-error::before { content: '⚠'; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .rules-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .container { padding: 0 1rem; }
    .header { padding: 0.85rem 1rem; }
}
@media (max-width: 768px) {
    .kanban-board { flex-direction: column; }
    .kanban-col { min-width: unset; max-height: none; }
    .rules-grid { grid-template-columns: repeat(2,1fr); }
    .header-user span:not(.header-avatar) { display: none; }
    .toolbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .rules-grid { grid-template-columns: 1fr; }
    .filter-form { flex-direction: column; }
    .filter-input, .filter-select { min-width: unset; width: 100%; }
    thead th:nth-child(n+5) { display: none; }
    tbody  td:nth-child(n+5) { display: none; }
    .login-card { padding: 2rem 1.5rem; }
}
