/* ============================================================
   base.css — Complice Manager v3.0
   Fonte única de verdade: variáveis, reset, componentes globais
   ============================================================ */

/* ── Variáveis ────────────────────────────────────────────── */
:root {
    /* Superfícies */
    --bg:           #f4f6f9;
    --surface:      #ffffff;
    --surface-alt:  #f8fafc;
    --nav-bg:       #0d1520;
    --panel-bg:     #f4f6f9;

    /* Acento principal */
    --accent:       #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft:  #eff6ff;
    --accent-muted: #dbeafe;

    /* Texto */
    --text-primary:   #0f172a;
    --text-secondary: #334155;
    --text-muted:     #64748b;
    --text-faint:     #94a3b8;

    /* Bordas */
    --border:       #e2e8f0;
    --border-focus: #93c5fd;

    /* Semânticas */
    --success:        #10b981;
    --success-soft:   #d1fae5;
    --success-text:   #065f46;
    --warning:        #f59e0b;
    --warning-soft:   #fef3c7;
    --warning-text:   #92400e;
    --danger:         #ef4444;
    --danger-soft:    #fee2e2;
    --danger-text:    #991b1b;
    --info:           #3b82f6;
    --info-soft:      #dbeafe;
    --info-text:      #1e40af;

    /* Tipografia */
    --font-sans: 'DM Sans', sans-serif;
    --font-mono: 'DM Mono', monospace;

    /* Espaçamentos */
    --radius-sm:  6px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-primary);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Status Badges ────────────────────────────────────────── */
/* Alinhados com os valores em inglês do backend */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
}

/* Aprovação de documentos */
.status-badge.pending     { background: #f1f5f9;            color: #475569; }
.status-badge.in_review   { background: var(--warning-soft); color: var(--warning-text); }
.status-badge.approved    { background: var(--success-soft); color: var(--success-text); }
.status-badge.rejected    { background: var(--danger-soft);  color: var(--danger-text); }
.status-badge.expired     { background: #fce7f3;             color: #9d174d; }

/* Auditorias */
.status-badge.rascunho      { background: #f1f5f9;            color: #475569; }
.status-badge.em_andamento  { background: var(--info-soft);   color: var(--info-text); }
.status-badge.concluida     { background: var(--success-soft);color: var(--success-text); }
.status-badge.respondida    { background: var(--success-soft);color: var(--success-text); }
.status-badge.nao_aplicavel { background: var(--warning-soft);color: var(--warning-text); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
    opacity: .35;
}
.empty-state p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Modais ───────────────────────────────────────────────── */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 20px 24px 16px;
}
.modal-header .modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}
.modal-body   { padding: 20px 24px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }

/* ── Formulários ──────────────────────────────────────────── */
.form-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.form-label-custom {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}

.form-control {
    font-family: var(--font-sans);
    font-size: 13px;
    border-radius: var(--radius-md);
    border-color: var(--border);
    color: var(--text-primary);
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-control-custom {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    resize: vertical;
}
.form-control-custom:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-control-custom::placeholder { color: var(--text-faint); }

.form-select-custom {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    cursor: pointer;
    appearance: auto;
}
.form-select-custom:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

input[type="month"].form-control-custom {
    -webkit-appearance: auto;
    appearance: auto;
    cursor: pointer;
}

/* ── Botões ───────────────────────────────────────────────── */
.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
    flex-shrink: 0;
}
.btn-icon:hover           { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-icon.success         { color: var(--success); border-color: #a7f3d0; }
.btn-icon.success:hover   { background: var(--success); border-color: var(--success); color: #fff; }
.btn-icon.warning         { color: var(--warning); border-color: #fde68a; }
.btn-icon.warning:hover   { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-icon.danger          { color: var(--danger); border-color: #fca5a5; }
.btn-icon.danger:hover    { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-primary-custom {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s;
    line-height: 1;
}
.btn-primary-custom:hover { background: var(--accent-hover); }

.btn-secondary-custom {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: border-color .15s, color .15s;
    line-height: 1;
}
.btn-secondary-custom:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-sans);
    background: transparent;
    color: var(--danger);
    border: 1px solid #fca5a5;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background .15s;
    line-height: 1;
}
.btn-ghost-danger:hover { background: var(--danger-soft); }

/* ── Toast ────────────────────────────────────────────────── */
.toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast-item {
    background: #0f172a;
    color: #f1f5f9;
    padding: 11px 16px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    animation: toastIn .2s ease;
    pointer-events: all;
    min-width: 220px;
    max-width: 360px;
    border-left: 3px solid transparent;
}
.toast-item.success { border-left-color: var(--success); }
.toast-item.error   { border-left-color: var(--danger);  }
.toast-item.info    { border-left-color: var(--info);    }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 4px; bottom: 4px;
    width: 1.5px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    margin-bottom: 20px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 1px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1.5px var(--border);
}
.timeline-dot.upload   { background: var(--info);    color: #fff; box-shadow: 0 0 0 1.5px #93c5fd; }
.timeline-dot.revisao  { background: var(--warning);  color: #fff; box-shadow: 0 0 0 1.5px #fde68a; }
.timeline-dot.aprovado { background: var(--success);  color: #fff; box-shadow: 0 0 0 1.5px #6ee7b7; }
.timeline-dot.rejeitado{ background: var(--danger);   color: #fff; box-shadow: 0 0 0 1.5px #fca5a5; }
.timeline-dot.pendente { background: #e2e8f0; color: var(--text-faint); }

.timeline-label { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.timeline-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.timeline-item.pending .timeline-label { color: var(--text-faint); }

/* ── Progress Bar ─────────────────────────────────────────── */
.progress-bar-wrap {
    height: 5px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width .7s cubic-bezier(.4,0,.2,1);
}

/* ── Upload Zone ──────────────────────────────────────────── */
.upload-zone {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--surface-alt);
}
.upload-zone:hover,
.upload-zone.dragover   { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone i          { font-size: 26px; color: var(--text-muted); margin-bottom: 8px; display: block; }
.upload-zone p          { margin: 0; font-size: 13px; color: var(--text-muted); }
.upload-zone .file-selected { font-size: 13px; font-weight: 500; color: var(--accent); margin-top: 4px; }

/* ── Required asterisk ────────────────────────────────────── */
.required { color: var(--danger); }

/* ── Domain Tab (shared across panels) ───────────────────── */
.domain-tab {
    padding: 5px 11px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: background .12s, color .12s;
    font-family: var(--font-sans);
    line-height: 1;
}
.domain-tab:hover  { background: #e2e8f0; color: var(--text-primary); }
.domain-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }