* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #111827;
}

/* Login */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 28px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0,0,0,0.25);
}

.login-logo {
    max-width: 180px;
    margin-bottom: 24px;
}

.login-card h1 {
    font-size: 28px;
    margin: 0 0 8px;
}

.login-card p {
    color: #6b7280;
    margin-bottom: 28px;
}

.login-card input {
    width: 100%;
    padding: 15px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    margin-bottom: 14px;
    font-size: 15px;
}

.login-card button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 14px;
    background: #000;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}

/* Layout */

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #111827;
    color: #ffffff;
    padding: 30px 20px;
}

.sidebar-brand {
    text-align: center;
    margin-bottom: 35px;
}

.brand-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 30px;
    font-weight: bold;
}

.sidebar-brand h3 {
    margin: 0;
    font-size: 18px;
}

.sidebar-brand p {
    margin: 6px 0 0;
    color: #9ca3af;
    font-size: 13px;
}

.sidebar-menu a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    padding: 13px 16px;
    border-radius: 999px;
    margin-bottom: 8px;
    font-weight: 600;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #ffffff;
    color: #111827;
}

.sidebar-menu a.logout {
    color: #f87171;
    margin-top: 35px;
}

.main-content {
    flex: 1;
    padding: 45px;
}

h1 {
    font-size: 34px;
    margin: 0;
}

.page-subtitle {
    color: #6b7280;
    margin-top: 8px;
    margin-bottom: 30px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}

.card {
    background: #ffffff;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

.card span {
    display: block;
    color: #6b7280;
    margin-bottom: 12px;
}

.card strong {
    font-size: 42px;
}

/* Responsive */

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-radius: 0;
    }

    .main-content {
        padding: 25px;
    }
}

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

.btn-primary{
    background:#111827;
    color:#fff;
    text-decoration:none;
    padding:12px 20px;
    border-radius:10px;
    font-weight:bold;
}

.search-form{
    margin-bottom:25px;
}

.search-form input{
    padding:12px;
    width:350px;
    border:1px solid #ddd;
    border-radius:10px;
}

.search-form button{
    padding:12px 18px;
    border:none;
    background:#111827;
    color:#fff;
    border-radius:10px;
    cursor:pointer;
}

.table-container{
    background:#fff;
    border-radius:20px;
    overflow:hidden;
    box-shadow:0 10px 30px rgba(0,0,0,.05);
}

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

thead{
    background:#f3f4f6;
}

th{
    text-align:left;
    padding:15px;
}

td{
    padding:15px;
    border-top:1px solid #eee;
}

.badge-success{
    background:#dcfce7;
    color:#166534;
    padding:5px 10px;
    border-radius:20px;
}

.badge-danger{
    background:#fee2e2;
    color:#991b1b;
    padding:5px 10px;
    border-radius:20px;
}

.btn-small{
    text-decoration:none;
    background:#111827;
    color:white;
    padding:8px 12px;
    border-radius:8px;
    margin-right:5px;
}

.btn-danger{
    background:#b91c1c;
}

.btn-success{
    background:#166534;
}


.card-form{

    background:#fff;

    padding:30px;

    border-radius:20px;

    box-shadow:0 10px 30px rgba(0,0,0,.05);
}

.card-form h2{

    margin-top:0;
}

.form-grid{

    display:grid;

    grid-template-columns:
        repeat(2,1fr);

    gap:20px;
}

.card-form label{
    display:block;
    margin-bottom:8px;
    font-weight:bold;
}

.card-form input,
.card-form textarea,
.card-form select{
    width:100%;
    padding:12px 14px;
    border:1px solid #ddd;
    border-radius:12px;
    background:#fff;
    font-size:15px;
    color:#111827;
}

.card-form hr{
    margin:35px 0;
}

@media(max-width:768px){
    .form-grid{
        grid-template-columns:1fr;
    }
}

.alert-success-box {
    background: #dcfce7;
    color: #166534;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: bold;
}

.alert-error-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: bold;
}

.acciones-legado {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.btn-icon,
.btn-icon-primary {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(0,0,0,.06);
    font-size: 16px;
}

.btn-icon-primary {
    background: #0d6efd;
    color: #ffffff;
    border-color: #0d6efd;
}

.btn-pill-dark {
    background: #000;
    color: #fff;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.btn-icon:hover,
.btn-icon-primary:hover,
.btn-pill-dark:hover {
    transform: translateY(-1px);
    opacity: .9;
}

/*LOGO*/

.brand-logo{
    width:90px;
    height:90px;
    margin:0 auto 15px auto;
    background:#ffffff;
    border-radius:50%;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 15px rgba(0,0,0,.25);
}

.brand-logo img{
    max-width:120px;
    max-height:80px;

    width:auto;
    height:auto;

    object-fit:contain;

    display:block;
    margin:0 auto;
}

/*BOTONES LEGADOS*/
.btn-circle{
    width:42px;
    height:42px;

    border-radius:50%;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    text-decoration:none;

    transition:.2s;

    margin-right:5px;
}

.btn-circle:hover{
    transform:translateY(-2px);
}

.btn-primary{
    background:#1e73ff;
    color:#fff;
    box-shadow:0 4px 12px rgba(30,115,255,.25);
}

.btn-light{
    background:#fff;
    color:#111;

    border:1px solid #ddd;

    box-shadow:0 4px 12px rgba(0,0,0,.08);
}

.btn-dark-pill{
    background:#000;
    color:#fff;

    padding:10px 18px;

    border-radius:999px;

    text-decoration:none;
    font-weight:600;

    display:inline-flex;
    align-items:center;
    gap:8px;
}

/*NOTIFICACIONES DE ACCIONES EJECUTADAS*/
.alert-success-box{
    background:#dcfce7;
    color:#166534;
    border:1px solid #bbf7d0;
    padding:15px;
    border-radius:12px;
    margin-bottom:20px;
    font-weight:600;
}

.alert-error-box{
    background:#fee2e2;
    color:#991b1b;
    border:1px solid #fecaca;
    padding:15px;
    border-radius:12px;
    margin-bottom:20px;
    font-weight:600;
}

.btn-secondary{
    background:#ffffff;
    color:#111827;
    border:1px solid #d1d5db;
    padding:10px 18px;
    border-radius:999px;
    text-decoration:none;
    font-weight:600;
    box-shadow:0 4px 10px rgba(0,0,0,.08);
}

.thumb-tributo{
    width:60px;
    height:60px;
    border-radius:12px;
    object-fit:cover;
    box-shadow:0 4px 10px rgba(0,0,0,.15);
}

.badge-success{
    background:#dcfce7;
    color:#166534;
    padding:6px 12px;
    border-radius:999px;
    font-size:.85rem;
    font-weight:600;
}

.badge-warning{
    background:#fef3c7;
    color:#92400e;
    padding:6px 12px;
    border-radius:999px;
    font-size:.85rem;
    font-weight:600;
}
.card-table{
    background:#fff;
    border-radius:24px;
    overflow:hidden;
    box-shadow:0 10px 30px rgba(0,0,0,.06);
}

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

.table-modern thead{
    background:#f8fafc;
}

.table-modern th{
    padding:18px;
    text-align:left;
    font-weight:700;
}

.table-modern td{
    padding:16px 18px;
    border-top:1px solid #edf2f7;
    vertical-align:middle;
}

.thumb-tributo{
    width:70px;
    height:70px;
    object-fit:cover;
    border-radius:14px;
    box-shadow:0 5px 15px rgba(0,0,0,.12);
}

.badge-success{
    background:#dcfce7;
    color:#166534;
    padding:6px 12px;
    border-radius:999px;
    font-size:.85rem;
    font-weight:600;
}

.badge-warning{
    background:#fef3c7;
    color:#92400e;
    padding:6px 12px;
    border-radius:999px;
    font-size:.85rem;
    font-weight:600;
}

.empty-state{
    padding:40px;
    text-align:center;
    color:#6b7280;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 11px;
    background: transparent !important;
    color: #6b7280 !important;
    border: none !important;
    width: auto !important;
    padding: 0 !important;
    cursor: pointer;
    font-size: 18px;
}

.forgot-link {
    display: block;
    margin: 12px 0 18px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
}

.forgot-link:hover {
    text-decoration: underline;
}

.alert-success-box{
    background:#dcfce7;
    color:#166534;
    border:1px solid #bbf7d0;
    padding:15px;
    border-radius:12px;
    margin-bottom:20px;
    font-weight:600;
}

.alert-error-box{
    background:#fee2e2;
    color:#991b1b;
    border:1px solid #fecaca;
    padding:15px;
    border-radius:12px;
    margin-bottom:20px;
    font-weight:600;
}

/*=========================================
= DASHBOARD NUEVO
=========================================*/

.dashboard-metrics{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
    gap:22px;
    margin-bottom:30px;
}

.metric-card{
    background:#fff;
    padding:28px;
    border-radius:24px;
    box-shadow:0 8px 30px rgba(0,0,0,.06);
    transition:.2s;
}

.metric-card:hover{
    transform:translateY(-3px);
}

.metric-card span{
    display:block;
    color:#6b7280;
    font-size:14px;
    margin-bottom:12px;
}

.metric-card strong{
    display:block;
    font-size:38px;
    color:#111827;
}

.metric-card small{
    display:block;
    margin-top:8px;
    color:#9ca3af;
}

.metric-card.warning{
    border-left:6px solid #f59e0b;
}

.metric-card.dark{
    background:#111827;
}

.metric-card.dark span,
.metric-card.dark strong,
.metric-card.dark small{
    color:white;
}


/*=========================================
= GRIDS
=========================================*/

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:25px;
    margin-bottom:25px;
}

.dashboard-grid-large{
    margin-top:30px;
}

.dashboard-grid-funeraria{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:25px;
    margin-bottom:25px;
}


/*=========================================
= TARJETAS DE GRAFICOS
=========================================*/

.chart-card{
    background:#fff;
    border-radius:24px;
    padding:28px;
    box-shadow:0 10px 30px rgba(0,0,0,.05);
}

.chart-card h2{
    margin-top:0;
    margin-bottom:6px;
    font-size:20px;
}

.chart-card-header{
    margin-bottom:15px;
}

.chart-card-header span{
    color:#9ca3af;
    font-size:14px;
}


/*=========================================
= ALTURAS DE GRAFICOS
=========================================*/

.chart-box{
    position:relative;
}

.chart-box-sm{
    height:300px;
}

.chart-box-md{
    height:360px;
}

.chart-box-lg{
    height:450px;
}

.chart-box canvas{
    width:100% !important;
    height:100% !important;
}


/*=========================================
= ACTIVIDAD
=========================================*/

.activity-card{
    background:#fff;
    border-radius:24px;
    padding:28px;
    box-shadow:0 10px 30px rgba(0,0,0,.05);
    margin-bottom:25px;
}

.activity-card h2{
    margin-top:0;
}


/*=========================================
= TABLAS
=========================================*/

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

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

.table-modern thead{
    background:#f8fafc;
}

.table-modern th{
    padding:18px;
    font-weight:700;
}

.table-modern td{
    padding:16px 18px;
    border-top:1px solid #edf2f7;
}


/*=========================================
= BADGES
=========================================*/

.status-badge{
    padding:6px 12px;
    border-radius:999px;
    font-size:.85rem;
    font-weight:600;
}

.status-badge.aprobado{
    background:#dcfce7;
    color:#166534;
}

.status-badge.pendiente{
    background:#fef3c7;
    color:#92400e;
}

.status-badge.rechazado{
    background:#fee2e2;
    color:#991b1b;
}


/*=========================================
= RESPONSIVE
=========================================*/

@media(max-width:1100px){

    .dashboard-grid,
    .dashboard-grid-funeraria{
        grid-template-columns:1fr;
    }

}


@media(max-width:768px){

    .metric-card strong{
        font-size:30px;
    }

    .chart-box-lg{
        height:350px;
    }

    .chart-box-md{
        height:300px;
    }

    .chart-box-sm{
        height:250px;
    }

}

/* ESTADOS */

.status-badge{
    display:inline-block;
    padding:8px 18px;
    border-radius:999px;
    font-size:14px;
    font-weight:600;
}

/* Correcto */

.status-badge.aprobado,
.status-badge.activo,
.status-badge.correcto{
    background:#dcfce7;
    color:#166534;
}

/* Pendiente */

.status-badge.pendiente{
    background:#fef3c7;
    color:#92400e;
}

/* Incorrecto */

.status-badge.rechazado,
.status-badge.incorrecto,
.status-badge.inactivo{
    background:#fee2e2;
    color:#991b1b;
}

.search-box{
    position:relative;
    max-width:500px;
}

.search-box i{
    position:absolute;
    left:15px;
    top:50%;
    transform:translateY(-50%);
    color:#9ca3af;
}

.search-box input{
    width:100%;
    padding:14px 18px 14px 45px;
    border:1px solid #e5e7eb;
    border-radius:14px;
    background:#fff;
    font-size:15px;
}

.search-box input:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 4px rgba(37,99,235,.15);
}


.lead-card{
    background:#fff;
    border-radius:24px;
    box-shadow:0 10px 30px rgba(0,0,0,.05);
    margin-bottom:30px;
    overflow:hidden;
}

.lead-card-header{
    background:#f8fafc;
    padding:20px 30px;
    border-bottom:1px solid #e5e7eb;
}

.lead-card-header h2{
    margin:0;
    color:#111827;
    font-size:22px;
}

.lead-card .table-container{
    margin-bottom:0;
}

/* Auditoria */

.filters-row{
    display:flex;
    gap:15px;
    flex-wrap:wrap;
    margin-bottom:25px;
}

.filters-row input,
.filters-row select{
    padding:10px 14px;
    border-radius:10px;
    border:1px solid #ddd;
min-width:170px;
}

.table-card{
    background:#fff;
    border-radius:20px;
    padding:20px;
    box-shadow:0 15px 35px rgba(0,0,0,.05);
    overflow:auto;
}

.card{
    background:#fff;
    border-radius:20px;
    padding:20px;
    margin-bottom:25px;
    box-shadow:0 15px 35px rgba(0,0,0,.05);
}


.btn-secondary{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:12px 22px;
    background:#ffffff;
    color:#1f2937;
    border:1px solid #d1d5db;
    border-radius:12px;
    text-decoration:none;
    font-weight:600;
    transition:.25s;
    cursor:pointer;
}

.btn-secondary:hover{
    background:#f3f4f6;
    border-color:#9ca3af;
}