/* ====================================================
   CRM DOMAMARKETING — Stylesheet
   Paleta: Negro #0a0a0a · Amarillo #FFD200 · Blanco
   ==================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --yellow: #FFD200;
    --yellow-dark: #E6BD00;
    --black:  #0a0a0a;
    --white:  #ffffff;
    --gray-50:  #fafafa;
    --gray-100: #f4f4f4;
    --gray-200: #e8e8e8;
    --gray-500: #888;
    --gray-700: #444;
    --radius: 12px;
    --shadow: 0 2px 16px rgba(0,0,0,.08);
    --shadow-md: 0 8px 32px rgba(0,0,0,.12);
    --font: 'Outfit', sans-serif;
    --nav-h: 60px;
}
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--gray-100); color: var(--black); overflow-x: hidden; }

/* ---- LOGIN ---- */
.login-body { background: var(--black); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 400px; padding: 24px; }
.login-card { background: white; border-radius: 20px; padding: 40px 36px; box-shadow: var(--shadow-md); }
.login-logo { height: 56px; width: auto; display: block; margin: 0 auto 20px; }
.login-card h1 { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--gray-500); font-size: 0.9rem; margin-bottom: 28px; }

/* ---- NAVBAR ---- */
.crm-nav { position: sticky; top: 0; z-index: 100; background: var(--black); height: var(--nav-h); display: flex; align-items: center; padding: 0 24px; gap: 24px; box-shadow: 0 2px 20px rgba(0,0,0,.3); }
.nav-brand img { height: 36px; width: auto; filter: brightness(0) invert(1); }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link { color: rgba(255,255,255,.6); text-decoration: none; font-size: 0.88rem; font-weight: 600; padding: 7px 14px; border-radius: 8px; transition: all .2s; }
.nav-link:hover, .nav-link.active { background: rgba(255,210,0,.15); color: var(--yellow); }
.nav-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-user > span { color: rgba(255,255,255,.8); font-size: 0.85rem; }
.badge-role { background: var(--yellow); color: var(--black); font-size: 0.7rem; font-weight: 800; padding: 2px 10px; border-radius: 100px; text-transform: uppercase; letter-spacing: .5px; }

/* ---- MAIN ---- */
.crm-main { max-width: 1300px; margin: 0 auto; padding: 28px 24px 60px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-header h2 { font-size: 1.5rem; font-weight: 800; }
.page-header p { color: var(--gray-500); font-size: 0.9rem; margin-top: 2px; }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-weight: 700; font-size: 0.9rem; padding: 10px 20px; border-radius: 100px; border: none; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--black); color: white; }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.btn-yellow  { background: var(--yellow); color: var(--black); }
.btn-yellow:hover  { box-shadow: 0 6px 20px rgba(255,210,0,.35); }
.btn-ghost   { background: white; color: var(--black); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover { border-color: var(--black); }
.btn-sm { font-size: 0.78rem; padding: 6px 14px; }
.w-full { width: 100%; justify-content: center; }

/* ---- ALERTS ---- */
.alert { padding: 12px 18px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 20px; font-weight: 600; }
.alert-error { background: #FEF2F2; color: #DC2626; border: 1px solid #FCA5A5; }
.alert-ok    { background: #F0FDF4; color: #16A34A; border: 1px solid #86EFAC; }

/* ---- FORMS ---- */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: 0.82rem; font-weight: 700; color: var(--gray-700); }
.form-group input, .form-group select, .form-group textarea { font-family: var(--font); font-size: 0.92rem; color: var(--black); background: white; border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 10px 14px; outline: none; transition: border-color .2s, box-shadow .2s; width: 100%; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,210,0,.18); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Checkbox grid */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.check-item { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; cursor: pointer; padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--gray-200); transition: border-color .2s, background .2s; }
.check-item:hover { border-color: var(--yellow); background: #FFFBEB; }
.check-item input:checked + * { font-weight: 700; }
.check-item:has(input:checked) { border-color: var(--yellow); background: #FFFBEB; }

/* ---- CARDS ---- */
.section-card { background: white; border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header h3 { font-size: 1.05rem; font-weight: 800; }

/* ---- METRICS ---- */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card { background: white; border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; }
.metric-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.metric-value { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.metric-label { font-size: 0.78rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ---- TABLE ---- */
.crm-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.crm-table thead th { background: var(--gray-50); padding: 10px 14px; text-align: left; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); border-bottom: 2px solid var(--gray-200); }

.dropdown-menu-custom {
    position: absolute; top: 30px; right: 0; background: white; color: #333; width: 250px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); padding: 10px; z-index: 999;
}

.crm-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.crm-table tbody tr:hover { background: var(--gray-50); }
.crm-table tbody tr:last-child td { border-bottom: none; }
.link-name { color: var(--black); text-decoration: none; font-weight: 700; }
.link-name:hover { color: #9A7A00; text-decoration: underline; }
.input-inline { border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 8px 10px; font-family: var(--font); font-size: 0.85rem; width: 100%; outline: none; }
.input-inline:focus { border-color: var(--yellow); }

/* ---- BADGES ---- */
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 100px; text-transform: capitalize; white-space: nowrap; }
.badge-blue   { background: #EFF6FF; color: #1D4ED8; }
.badge-yellow { background: #FFFBEB; color: #D97706; }
.badge-purple { background: #F5F3FF; color: #7C3AED; }
.badge-orange { background: #FFF7ED; color: #C2410C; }
.badge-green  { background: #F0FDF4; color: #16A34A; }
.badge-red    { background: #FEF2F2; color: #DC2626; }
.badge-gray   { background: #F9FAFB; color: #6B7280; }

/* ---- PIPELINE ---- */
.filter-bar { margin-bottom: 16px; background: white; border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.filter-input { border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 8px 12px; font-family: var(--font); font-size: 0.9rem; outline: none; width: 220px; }
.filter-input:focus { border-color: var(--yellow); }
.pipeline-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 20px; }
.pipeline-step { background: white; border-radius: var(--radius); padding: 14px 12px; text-align: center; box-shadow: var(--shadow); text-decoration: none; transition: transform .2s; }
.pipeline-step:hover { transform: translateY(-2px); }
.pipeline-count { font-size: 1.6rem; font-weight: 900; }
.pipeline-label { font-size: 0.72rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ---- ACTIVITY FEED ---- */
.activity-feed { display: flex; flex-direction: column; gap: 12px; max-height: 380px; overflow-y: auto; }
.activity-item { display: flex; gap: 12px; padding: 12px; border-radius: 10px; background: var(--gray-50); }
.activity-icon { font-size: 1.1rem; flex-shrink: 0; }
.activity-item p { font-size: 0.88rem; color: var(--gray-700); margin-top: 4px; }

/* ---- QUOTES ---- */
.quote-item { border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 14px; margin-bottom: 12px; transition: border-color .2s; }
.quote-item:hover { border-color: var(--yellow); }
.quote-summary { background: var(--gray-50); border-radius: 10px; padding: 14px 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; border-bottom: 1px solid var(--gray-200); }
.summary-row:last-child { border-bottom: none; }
.total-row { font-weight: 900; font-size: 1.05rem; border-top: 2px solid var(--black); margin-top: 4px; padding-top: 10px; }

/* ---- INFO LIST ---- */
.info-list { display: flex; flex-direction: column; gap: 0; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 0.88rem; }
.info-row span:first-child { color: var(--gray-500); font-weight: 600; }
.info-row:last-child { border-bottom: none; }

.hamburger { display: none; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; }
.nav-menu { display: flex; flex: 1; align-items: center; justify-content: space-between; }

/* ---- GRIDS ---- */
.grid-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.grid-cols-aside { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.grid-cols-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

/* ---- RESPONSIVE ---- */
.table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 900px) {
    .form-row { grid-template-columns: 1fr; }
    .pipeline-bar { grid-template-columns: repeat(3, 1fr); }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .grid-cols-2 { grid-template-columns: 1fr; }
    .grid-cols-aside { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .crm-nav { justify-content: space-between; padding: 12px 20px; }
    .hamburger { display: block; }
    
    .nav-menu { 
        display: none; 
        flex-direction: column; 
        width: 100%; 
        position: absolute; 
        top: var(--nav-h); 
        left: 0; 
        background: var(--black); 
        padding: 20px; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
        z-index: 1000;
    }
    .nav-menu.show { display: flex; }
    
    .nav-links { flex-direction: column; width: 100%; gap: 12px; margin-bottom: 20px; }
    .nav-link { font-size: 1.1rem; padding: 12px; text-align: center; }
    
    .nav-user { flex-direction: column; width: 100%; gap: 12px; }
    .nav-user > span { font-size: 1rem; }
    .nav-user .btn { width: 100%; justify-content: center; padding: 12px; }
    
    .dropdown-menu-custom {
        position: static !important;
        width: 100% !important;
        margin-top: 10px;
        box-shadow: none !important;
        border: 1px solid #eee;
    }
    
    .crm-main { padding: 16px 12px 60px; }
    .page-header { flex-direction: column; align-items: stretch; text-align: center; }
    .page-header .btn { width: 100%; justify-content: center; margin-top: 10px; padding: 14px 20px; font-size: 1rem; }
    
    .pipeline-bar { grid-template-columns: repeat(2, 1fr); }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-aside, .grid-cols-2-1 { grid-template-columns: 1fr; }
    
    .section-card { padding: 16px; }
    
    /* Responsive Table as Cards */
    .crm-table thead { display: none; }
    .crm-table, .crm-table tbody, .crm-table tr, .crm-table td { display: block; width: 100%; }
    .crm-table tr { margin-bottom: 16px; border: 1.5px solid var(--gray-200); border-radius: 12px; padding: 12px; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.04); position: relative; }
    .crm-table td { text-align: right; padding: 10px 0; border-bottom: 1px solid var(--gray-100); min-height: 40px; display: flex; justify-content: space-between; align-items: center; gap: 15px; word-break: break-word; }
    
    /* Expandable rows on mobile */
    .crm-table tr.mobile-collapsed { cursor: pointer; }
    .crm-table tr.mobile-collapsed td:not(:first-child):not(.always-visible) { display: none; }
    .crm-table tr.mobile-collapsed td:first-child::after { content: " ▼"; float: right; font-size: 0.8em; color: #888; margin-left: 10px; }
    .crm-table tr.mobile-expanded { cursor: pointer; }
    .crm-table tr.mobile-expanded td:first-child::after { content: " ▲"; float: right; font-size: 0.8em; color: #888; margin-left: 10px; }
    .crm-table td:last-child { border-bottom: none; }
    .crm-table td::before { content: attr(data-label); font-weight: 800; color: var(--gray-500); text-transform: uppercase; font-size: 0.75rem; flex-shrink: 0; }
    .crm-table td > div { text-align: right; } /* ensure inner flex items align right */
    
    .login-card { padding: 30px 20px; }
}
