/* RE CRM — Frontend Styles */

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

/* ── Reset body ─────────────────────────────────────────────── */
body.recrm-fe-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: #f0f2f5;
    color: #1e293b;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Ocultar barra admin de WP en esta página si está logueado */
body.recrm-fe-body #wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* ══════════════════════════════════════════════════════════════
   AUTH — Pantalla de login / recuperar
══════════════════════════════════════════════════════════════ */
.recrm-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
    padding: 24px;
}

.recrm-auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.30);
}

/* Logo */
.recrm-auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.recrm-auth-logo img {
    max-height: 52px;
    width: auto;
}

.recrm-auth-site-name {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
}

/* Titles */
.recrm-auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.recrm-auth-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 28px;
}

/* Notice */
.recrm-auth-notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.5;
}

.recrm-auth-notice-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.recrm-auth-notice-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* Form fields */
.recrm-form { display: flex; flex-direction: column; gap: 18px; }

.recrm-field { display: flex; flex-direction: column; gap: 6px; }

.recrm-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.recrm-field input[type="text"],
.recrm-field input[type="password"],
.recrm-field input[type="email"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.recrm-field input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* Password toggle */
.recrm-password-wrap {
    position: relative;
}

.recrm-password-wrap input {
    padding-right: 44px;
}

.recrm-toggle-pass {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    display: flex;
    align-items: center;
}

.recrm-toggle-pass:hover { color: #374151; }

/* Checkbox row */
.recrm-field-check { flex-direction: row; align-items: center; }
.recrm-field-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
}
.recrm-field-check input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* Links */
.recrm-auth-links {
    text-align: center;
    margin-top: 20px;
}

.recrm-auth-links a {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.recrm-auth-links a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */
.recrm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

.recrm-btn:active { transform: scale(0.98); }

.recrm-btn-primary {
    background: #2563eb;
    color: #fff;
}
.recrm-btn-primary:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,0.3); }

.recrm-btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e2e8f0;
}
.recrm-btn-secondary:hover { background: #e2e8f0; }

.recrm-btn-ghost {
    background: transparent;
    color: #94a3b8;
    border: 1px solid transparent;
}
.recrm-btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }

.recrm-btn-full { width: 100%; padding: 13px; font-size: 15px; }
.recrm-btn-sm   { padding: 6px 12px; font-size: 12px; }

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════════ */
.recrm-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.recrm-topbar {
    background: #0f172a;
    color: #e2e8f0;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.recrm-topbar-left,
.recrm-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recrm-topbar-logo img  { max-height: 30px; width: auto; filter: brightness(0) invert(1); }
.recrm-topbar-sitename  { font-size: 16px; font-weight: 700; color: #fff; }
.recrm-topbar-divider   { color: #334155; font-size: 18px; }
.recrm-topbar-title     { font-size: 14px; font-weight: 600; color: #94a3b8; letter-spacing: 0.05em; text-transform: uppercase; }

.recrm-topbar-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #cbd5e1;
}

/* ── Main ───────────────────────────────────────────────────── */
.recrm-main {
    flex: 1;
    overflow: hidden;
    padding: 20px 20px 0;
}

/* ══════════════════════════════════════════════════════════════
   KANBAN BOARD
══════════════════════════════════════════════════════════════ */
.recrm-board {
    display: flex;
    gap: 14px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 20px;
    align-items: flex-start;
}

/* Scrollbar */
.recrm-board::-webkit-scrollbar { height: 6px; }
.recrm-board::-webkit-scrollbar-track { background: transparent; }
.recrm-board::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Column ─────────────────────────────────────────────────── */
.recrm-column {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    min-width: 236px;
    max-width: 236px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.recrm-column-header {
    padding: 12px 14px 10px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.recrm-column-header-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.recrm-column-count {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.10);
}

/* Column accent colors */
.recrm-col-nuevo         .recrm-column-header { background: #eff6ff; color: #1d4ed8; border-bottom: 2px solid #bfdbfe; }
.recrm-col-contactado    .recrm-column-header { background: #f0fdf4; color: #166534; border-bottom: 2px solid #bbf7d0; }
.recrm-col-precalificado .recrm-column-header { background: #faf5ff; color: #6d28d9; border-bottom: 2px solid #ddd6fe; }
.recrm-col-visita        .recrm-column-header { background: #fffbeb; color: #92400e; border-bottom: 2px solid #fde68a; }
.recrm-col-reservado     .recrm-column-header { background: #fff7ed; color: #c2410c; border-bottom: 2px solid #fed7aa; }
.recrm-col-escriturado   .recrm-column-header { background: #ecfdf5; color: #065f46; border-bottom: 2px solid #a7f3d0; }
.recrm-col-descartado    .recrm-column-header { background: #f9fafb; color: #6b7280; border-bottom: 2px solid #e5e7eb; }

.recrm-cards {
    padding: 10px 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 80px;
}

.recrm-cards::-webkit-scrollbar { width: 4px; }
.recrm-cards::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.recrm-cards.drag-over {
    background: #dbeafe;
    border-radius: 0 0 12px 12px;
    outline: 2px dashed #93c5fd;
    outline-offset: -4px;
}

/* ── Card ───────────────────────────────────────────────────── */
.recrm-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 13px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
    user-select: none;
}

.recrm-card:last-child { margin-bottom: 0; }

.recrm-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.recrm-card.dragging {
    opacity: 0.35;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.recrm-card-name {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recrm-card-phone {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.recrm-card-income {
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 7px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 6px;
}

.recrm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.recrm-card-days {
    font-size: 11px;
    color: #94a3b8;
}

.recrm-card-id {
    font-size: 10px;
    color: #cbd5e1;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════ */
.recrm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.65);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}

.recrm-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 580px;
    padding: 32px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    margin-bottom: 40px;
    animation: recrm-modal-in 0.18s ease;
}

@keyframes recrm-modal-in {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.recrm-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
}

.recrm-modal-close:hover { background: #fee2e2; color: #dc2626; }

/* Modal sections */
.recrm-modal h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    padding-right: 40px;
}

.recrm-modal-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.recrm-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    margin: 24px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

/* Data grid */
.recrm-data-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 6px 12px;
    font-size: 13px;
}

.recrm-data-label  { color: #94a3b8; font-size: 12px; align-self: center; }
.recrm-data-value  { color: #1e293b; font-weight: 500; }

/* Field rows */
.recrm-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.recrm-field-row label {
    min-width: 130px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.recrm-field-row input,
.recrm-field-row select {
    flex: 1;
    padding: 7px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.12s;
}

.recrm-field-row input:focus,
.recrm-field-row select:focus { border-color: #2563eb; }

/* Inline notice */
.recrm-inline-notice {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 4px;
    margin-bottom: 6px;
}
.recrm-inline-notice-success { background: #f0fdf4; color: #166534; }
.recrm-inline-notice-error   { background: #fef2f2; color: #991b1b; }

/* Comments */
.recrm-comment-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.recrm-comment-list li {
    padding: 9px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.recrm-comment-text { color: #1e293b; }
.recrm-comment-meta { font-size: 11px; color: #94a3b8; margin-top: 3px; }

.recrm-comment-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.recrm-comment-form textarea {
    flex: 1;
    min-height: 64px;
    resize: vertical;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.12s;
    line-height: 1.5;
}

.recrm-comment-form textarea:focus { border-color: #2563eb; }

/* Status badge */
.recrm-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
    vertical-align: middle;
    margin-left: 6px;
}

/* ── Loading spinner ─────────────────────────────────────────── */
.recrm-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 14px;
    padding: 30px;
}

@keyframes recrm-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.recrm-spin { animation: recrm-spin 1s linear infinite; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .recrm-auth-card { padding: 32px 24px; }
    .recrm-topbar    { padding: 0 14px; }
    .recrm-topbar-title,
    .recrm-topbar-divider { display: none; }
    .recrm-main { padding: 12px 10px 0; }
    .recrm-modal { padding: 24px 18px; }
}

/* ── Campos del formulario Meta ─────────────────────────────── */
.recrm-form-fields-grid {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    gap: 8px 12px;
}

.recrm-form-fields-grid .recrm-data-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.recrm-form-fields-grid .recrm-data-value {
    color: #0f172a;
    font-size: 13px;
    word-break: break-word;
}

.recrm-form-name-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}
