/* ================= PÁGINA / SECCIÓN DEMO ================= */

.home-demo-section {
    max-width: 1240px;
    margin: 40px auto 60px;
    padding: 0 20px;
}

.home-demo-intro {
    text-align: center;
    color: #5c4633;
    max-width: 720px;
    margin: 8px auto 28px;
}

.demo-wrap {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fffaf3;
    border: 1px solid rgba(127, 85, 57, 0.18);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(84, 61, 40, 0.15);
    padding: 20px;
}

/* ---- banner informativo ---- */
.demo-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #7f5539, #543d28);
    color: #f7efe5;
    padding: 18px 22px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.demo-banner-cow {
    width: 74px;
    height: 74px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
}

.demo-banner h2 { margin: 0 0 6px; font-size: 1.35rem; }

.demo-banner p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 560px;
}

.demo-badge-btn {
    margin-left: auto;
    background: #eed9b6;
    color: #4b3621;
    border: none;
    border-bottom: 4px solid #c4a076;
    box-shadow: 0 4px 0 #a58563;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.12s;
}

.demo-badge-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a58563; }

/* ---- mini sidebar ---- */
.demo-sidebar {
    width: 210px;
    flex-shrink: 0;
    background: #543d28;
    padding: 20px 15px;
    border-radius: 14px;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25);
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.demo-sidebar .sidebar-header {
    text-align: center;
    color: #f3e4cb;
    margin-bottom: 24px;
}

.demo-sidebar .sidebar-header h3 { margin: 8px 0 0; font-size: 1.05rem; }
.demo-sidebar .sidebar-header h3 small { font-size: 0.7rem; opacity: .8; }

.demo-sidebar .icon-3d {
    height: 44px;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
}

.demo-sidebar .sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-sidebar .btn-3d {
    background: #c7a97a;
    color: #4b3621;
    padding: 12px 15px;
    border-radius: 10px;
    font-weight: bold;
    text-decoration: none;
    border: none;
    border-bottom: 4px solid #9b7b54;
    box-shadow: 0 4px 0 #8b6b47;
    transition: 0.12s;
    cursor: pointer;
    text-align: left;
    display: block;
    width: 100%;
    font-size: 0.92rem;
}

.demo-sidebar .btn-3d:hover { background: #d8be92; }

.demo-sidebar .btn-3d:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #8b6b47;
}

.demo-sidebar .btn-main {
    background: #eed9b6;
    border-bottom: 4px solid #c4a076;
    box-shadow: 0 4px 0 #a58563;
}

.demo-sidebar .demo-exit {
    background: #b05a3c;
    color: #fff3e4;
    border-bottom: 4px solid #8b4327;
    box-shadow: 0 4px 0 #7a3a20;
    margin-top: auto;
    text-align: center;
}

.demo-note {
    margin-top: 16px;
    margin-bottom: 12px;
    color: #cbb691;
    font-size: 0.72rem;
    text-align: center;
    line-height: 1.4;
}

/* ---- contenido ---- */
.demo-content {
    flex: 1;
    min-width: 0;
}

/* tarjetas de datos */
.demo-content .animal-table {
    background: #f5e8d8;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.demo-content .data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.demo-content .data-card-header h3 { margin: 0; color: #4a2f1a; font-size: 1.05rem; }

.demo-content .data-card-count {
    background: #7f5539;
    color: #fff6e8;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.demo-content .animal-searchbar { margin-bottom: 12px; }

.demo-content .animal-search-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-content .animal-search-controls input {
    flex: 1;
    min-width: 200px;
}

.demo-content input,
.demo-content select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #bca58b;
    box-sizing: border-box;
    background: #fffaf3;
    color: #4a2f1a;
    font-size: 0.92rem;
}

.demo-content label {
    font-weight: 600;
    color: #4a2f1a;
    font-size: 0.88rem;
    display: block;
}

/* tabla */
.demo-content .animals-table-shell {
    overflow-x: auto;
    border: 1px solid rgba(127, 85, 57, 0.18);
    border-radius: 10px;
    background: #fffaf3;
}

.demo-content .animals-data-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
}

.demo-content .animals-data-table th,
.demo-content .animals-data-table td {
    padding: 10px 9px;
    border-bottom: 1px solid rgba(124, 86, 54, 0.16);
    text-align: left;
    vertical-align: middle;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.demo-content .animals-data-table th {
    background: #6f4f35;
    color: #fff6e8;
    font-size: 0.78rem;
    font-weight: 700;
}

.demo-content .animals-data-table tbody tr:nth-child(even) { background: #f8efe3; }
.demo-content .animals-data-table tbody tr:hover { background: #f1dfc8; }

.demo-content .animal-name { color: #3f2c1d; font-weight: 700; }

/* botones de acción */
.demo-content .btn {
    background: #8b5e3c;
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.88rem;
}

.demo-content .btn:hover { background: #6b452e; }
.demo-content .btn-small { padding: 6px 10px; font-size: 0.78rem; }
.demo-content .btn-ver { background: #3e6db5; }
.demo-content .btn-ver:hover { background: #305692; }
.demo-content .btn-danger { background: #b23b32; }
.demo-content .btn-danger:hover { background: #8f2f27; }

.demo-content .btn-cafe { font-size: 0.88rem; }

.actions-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* badges de estatus (iguales al panel real) */
.estatus-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #4b3621;
    background: #e6d4bd;
    line-height: 1.1;
}

.estatus-badge.activo { background: #d8f1df; color: #1e6b37; }
.estatus-badge.vendido { background: #dbeafe; color: #1d4f8f; }
.estatus-badge.baja-muerto { background: #ffd2d0; color: #a03533; }

/* vacíos */
.demo-empty {
    text-align: center;
    color: #806854;
    padding: 22px 10px;
    margin: 0;
}

/* formularios inline (pesajes, vet, ventas) */
.demo-form-inline {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: #f5e8d8;
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.demo-form-inline label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}

.demo-form-inline .btn {
    min-width: 180px;
    min-height: 42px;
}

/* estadísticas */
.demo-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.demo-stat-card {
    background: #f5e8d8;
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.demo-stat-card strong { display: block; font-size: 2rem; color: #7f5539; }
.demo-stat-card span { color: #806854; font-size: 0.85rem; }

.demo-tip {
    background: #f5e8d8;
    border-radius: 12px;
    padding: 22px;
}

.demo-tip h4 { margin-top: 0; color: #4a2f1a; }
.demo-tip ul { color: #5c4633; line-height: 1.8; margin: 0 0 14px; padding-left: 20px; }

/* toast */
.demo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #543d28;
    color: #f7efe5;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 10000;
    font-size: 0.9rem;
    pointer-events: none;
}

.demo-toast.show { opacity: 1; transform: translateY(0); }

/* modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.modal-card {
    background: #f5e8d8;
    padding: 24px;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: min(86vh, 780px);
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    position: relative;
}

.close-btn {
    position: absolute;
    right: 12px;
    top: 8px;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #4a2f1a;
}

/* responsive */
@media (max-width: 900px) {
    .demo-wrap { flex-direction: column; }

    .demo-sidebar {
        width: 100%;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        flex-wrap: wrap;
    }

    .demo-sidebar .sidebar-header { margin-bottom: 0; }
    .demo-sidebar .sidebar-header h3 { display: none; }
    .demo-sidebar .icon-3d { height: 36px; }

    .demo-sidebar .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
    }

    .demo-sidebar .btn-3d { width: auto; text-align: center; }
    .demo-sidebar .demo-exit { margin-top: 0; }
    .demo-note { display: none; }
}

@media (max-width: 576px) {
    .demo-banner { flex-direction: column; text-align: center; }
    .demo-badge-btn { margin-left: 0; }
    .demo-form-inline .btn { width: 100%; }
    .demo-stats { grid-template-columns: repeat(2, 1fr); }
}
