/* ============================================================
   CRM RH ROOM — design system
   Paleta e componentes espelhados do RecruteRoom (RHROOM) para
   manter a mesma identidade visual entre os dois sistemas.
   ============================================================ */

:root {
    /* Cores idênticas ao RecruteRoom (RHROOM) */
    --navy:        #1b3a6b;
    --navy-dark:   #122748;
    --coral:       #e8635a;
    --coral-dark:  #d14e45;

    /* Neutros */
    --bg:          #f7f8fc;
    --white:       #ffffff;
    --border:      #e4e8f1;
    --text:        #22283a;
    --text-muted:  #6b7280;
    --text-light:  #9ca3af;

    /* Estados (mesmos tons dos badges do RecruteRoom) */
    --success-bg:  #e3f6ea;
    --success-text:#2e9e5b;
    --warning-bg:  #fff6e0;
    --warning-text:#d69e2e;
    --danger-bg:   #fbe7e6;
    --danger-text: #e8635a;

    --radius:      12px;
    --radius-sm:   8px;
    --shadow:      none;
    --shadow-md:   0 20px 60px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

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

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--navy);
    color: #cfd7e6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-top { padding: 24px 20px 0; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 0 4px;
}

.sidebar-logo .icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-logo .brand {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.sidebar-logo .brand .b1 { color: #ffffff; }
.sidebar-logo .brand .b2 { color: var(--coral); }

.sidebar-tagline {
    font-size: 11px;
    color: #8391ac;
    margin: -20px 0 20px 4px;
}

.nav-list { list-style: none; margin: 0; padding: 0; }

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 17px;
    border-left: 3px solid transparent;
    color: rgba(255,255,255,.7);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item a .dot {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.nav-item a:hover { background: rgba(255,255,255,.06); color: #fff; }

.nav-item.active a {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-left-color: var(--coral);
}

.sidebar-bottom {
    padding: 16px 20px 22px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.sidebar-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--coral);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user .name { font-size: 13.5px; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar-user .role { font-size: 11.5px; color: #8391ac; }

.sidebar-links { font-size: 12.5px; display: flex; gap: 12px; }
.sidebar-links a { color: #8391ac; }
.sidebar-links a:hover { color: #fff; }

/* ---------------- Conteúdo principal ---------------- */
.main {
    flex: 1;
    padding: 28px 34px;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--navy);
}

.page-header .subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---------------- Botões ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { filter: brightness(0.94); }

.btn-secondary { background: #eef0f4; color: var(--navy); }
.btn-secondary:hover { filter: brightness(0.97); }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: #f9fafb; }

.btn-danger-text { background: none; border: none; color: var(--danger-text); font-size: 13px; cursor: pointer; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 20px 22px;
}

.stat-card .value { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* ---------------- Tabelas ---------------- */
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light);
    font-weight: 700;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

tbody td {
    padding: 14px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

.cell-title { font-weight: 600; color: var(--navy); }
.cell-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg); color: var(--danger-text); }
.badge-neutral { background: #eef0f4; color: var(--text-muted); }

/* ---------------- Kanban (Negócios) ---------------- */
.kanban-wrap { overflow-x: auto; padding-bottom: 10px; }

.kanban-board {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-height: 60vh;
}

.kanban-column {
    background: #eef0f4;
    border-radius: var(--radius);
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 78vh;
}

.kanban-column-header {
    padding: 14px 14px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-header .title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--navy);
}

.kanban-column-header .count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--white);
    border-radius: 999px;
    padding: 2px 9px;
}

.kanban-cards {
    padding: 0 10px 10px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kanban-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    cursor: grab;
    border-left: 3px solid var(--coral);
}

.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.4; }

.kanban-card .deal-name { font-size: 13.5px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.kanban-card .deal-meta { font-size: 12px; color: var(--text-muted); }
.kanban-card .deal-value { font-size: 12.5px; font-weight: 700; color: var(--coral-dark); margin-top: 6px; }

.kanban-column.drag-over { outline: 2px dashed var(--coral); outline-offset: -4px; }

/* ---------------- Formulários / Modal ---------------- */
.form-group { margin-bottom: 16px; }

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(217, 105, 92, 0.15);
}

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(16, 24, 40, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 420px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.modal h2 { margin: 0 0 18px; font-size: 18px; color: var(--navy); }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* ---------------- Login ---------------- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 360px;
    max-width: 100%;
}

.login-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; }
.login-logo .icon {
    width: 34px; height: 34px; border-radius: 8px;
    background: var(--navy); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.login-logo .brand { font-size: 24px; font-weight: 800; }
.login-logo .brand .b1 { color: var(--navy); }
.login-logo .brand .b2 { color: var(--coral); }

.login-subtitle { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 28px; }

.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 18px;
}
.alert-error { background: var(--danger-bg); color: var(--danger-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }

/* ---------------- Utilidades ---------------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; }
.text-muted { color: var(--text-muted); }
.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

@media (max-width: 860px) {
    .sidebar { display: none; }
    .main { padding: 18px; }
}
