/* ============================================
   EL FOGÓN PLAYERO - Admin Dashboard Styles
   ============================================ */

:root {
    --coral: #D4724E;
    --coral-dark: #B85A3A;
    --deep-orange: #E8853A;
    --golden: #F0B429;
    --sand: #F5E6D3;
    --sand-light: #FAF3EB;
    --charcoal: #1A1A1A;
    --charcoal-light: #2A2A2A;
    --charcoal-mid: #333333;
    --text-primary: #F5E6D3;
    --text-secondary: rgba(245, 230, 211, 0.6);
    --border: rgba(245, 230, 211, 0.08);
    --card-bg: rgba(42, 42, 42, 0.6);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--charcoal);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ---- Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    background: var(--charcoal-light);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 8px;
}

.sidebar-header h2 {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--coral);
}

.sidebar-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: rgba(212, 114, 78, 0.1);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(212, 114, 78, 0.15);
    color: var(--coral);
    font-weight: 600;
}

.nav-icon { font-size: 1.1rem; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.back-to-site {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.back-to-site:hover { color: var(--coral); }

/* ---- Main Content ---- */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--charcoal);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header h1 {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: var(--sand);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-export {
    padding: 8px 20px;
    background: var(--coral);
    color: var(--sand);
    border: none;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-export:hover { background: var(--coral-dark); }

.admin-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ---- Tab Content ---- */
.tab-content {
    display: none;
    padding: 24px 32px;
}

.tab-content.active { display: block; }

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.2s;
}

.stat-card:hover { border-color: rgba(212, 114, 78, 0.3); }

.stat-card.small {
    padding: 16px;
    flex-direction: column;
    text-align: center;
    gap: 4px;
}

.stat-icon { font-size: 2rem; }

.stat-info { display: flex; flex-direction: column; }

.stat-value {
    font-family: 'Bebas Neue', cursive;
    font-size: 2rem;
    color: var(--coral);
    line-height: 1;
}

.stat-card.small .stat-value { font-size: 1.6rem; }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ---- Cards ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--sand);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ---- Bar Chart ---- */
.chart-area { min-height: 200px; }

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 200px;
    padding: 0 16px;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar {
    width: 100%;
    max-width: 60px;
    background: linear-gradient(to top, var(--coral), var(--deep-orange));
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height 0.6s ease;
}

.bar-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bar-value {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.1rem;
    color: var(--coral);
}

/* ---- Timeline ---- */
.timeline { display: flex; flex-direction: column; gap: 12px; }

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--coral);
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-content { flex: 1; }

.timeline-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.timeline-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ---- Interactions Summary ---- */
.interactions-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.interaction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(26, 26, 26, 0.5);
    border-radius: 8px;
    flex: 1;
    min-width: 160px;
}

.interaction-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.interaction-dot.inversionista { background: var(--golden); }
.interaction-dot.comensal { background: var(--coral); }
.interaction-dot.aliado { background: var(--deep-orange); }
.interaction-dot.curioso { background: var(--text-secondary); }

.interaction-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.interaction-count {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.3rem;
    color: var(--sand);
    margin-left: auto;
}

/* ---- Leads Table ---- */
.leads-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box input {
    padding: 10px 16px;
    background: var(--charcoal-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    width: 280px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus { border-color: var(--coral); }

.search-box input::placeholder { color: var(--text-secondary); }

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-group select {
    padding: 10px 14px;
    background: var(--charcoal-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.filter-group select option { background: var(--charcoal-light); }

.table-container { overflow-x: auto; }

.leads-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.leads-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    background: rgba(26, 26, 26, 0.5);
    border-bottom: 1px solid var(--border);
}

.leads-table td {
    padding: 12px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.leads-table tr:last-child td { border-bottom: none; }

.leads-table tr:hover td { background: rgba(212, 114, 78, 0.05); }

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.inversionista { background: rgba(240, 180, 41, 0.15); color: var(--golden); }
.type-badge.comensal { background: rgba(212, 114, 78, 0.15); color: var(--coral); }
.type-badge.aliado { background: rgba(232, 133, 58, 0.15); color: var(--deep-orange); }
.type-badge.curioso { background: rgba(245, 230, 211, 0.1); color: var(--text-secondary); }

.status-select {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}

.status-select option { background: var(--charcoal-light); }

.btn-delete {
    padding: 4px 10px;
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete:hover { background: rgba(220, 53, 69, 0.3); }

/* ---- Kanban Board ---- */
.pipeline-header {
    margin-bottom: 20px;
}

.pipeline-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 400px;
}

.kanban-column {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.kanban-title {
    font-family: 'Bebas Neue', cursive;
    font-size: 1rem;
    letter-spacing: 1px;
    color: var(--sand);
}

.kanban-count {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 114, 78, 0.15);
    color: var(--coral);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.kanban-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.kanban-card {
    background: rgba(26, 26, 26, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.kanban-card:hover { border-color: rgba(212, 114, 78, 0.3); }

.kanban-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kanban-card-info {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.kanban-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.kanban-btn {
    padding: 3px 8px;
    background: rgba(212, 114, 78, 0.1);
    border: 1px solid rgba(212, 114, 78, 0.2);
    color: var(--coral);
    font-size: 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.2s;
}

.kanban-btn:hover { background: rgba(212, 114, 78, 0.2); }

/* ---- Conversations ---- */
.conversations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.conversation-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s;
}

.conversation-card:hover { border-color: rgba(212, 114, 78, 0.3); }

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.conversation-user {
    font-weight: 600;
    font-size: 0.9rem;
}

.conversation-type {
    font-size: 0.7rem;
    color: var(--coral);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conversation-messages {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.conv-msg {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.conv-msg.bot {
    background: rgba(212, 114, 78, 0.1);
    color: var(--text-primary);
    align-self: flex-start;
    max-width: 85%;
}

.conv-msg.user {
    background: rgba(245, 230, 211, 0.1);
    color: var(--sand);
    align-self: flex-end;
    max-width: 85%;
}

.conversation-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: right;
}

/* ---- Waitlist ---- */
.waitlist-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.waitlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.waitlist-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.waitlist-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.waitlist-contact {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.waitlist-type-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--coral);
    background: rgba(212, 114, 78, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

/* ---- Empty State ---- */
.empty-state {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 8px; }
    .nav-item { white-space: nowrap; padding: 8px 12px; font-size: 0.8rem; }
    .admin-main { margin-left: 0; }
    .admin-header { padding: 16px 20px; }
    .tab-content { padding: 16px 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .kanban-board { grid-template-columns: 1fr; }
    .leads-toolbar { flex-direction: column; align-items: stretch; }
    .search-box input { width: 100%; }
}
