/*
 * Archivo: assets/css/app.css
 * Estilos visuales de ProFin para escritorio, tableta y celular.
 */

:root {
    --profin-dark: #0f172a;
    --profin-blue: #1d4ed8;
    --profin-indigo: #4338ca;
    --profin-slate: #475569;
    --profin-bg: #f1f5f9;
    --profin-border: #e2e8f0;
    --profin-success: #047857;
    --profin-danger: #b91c1c;
}

html,
body {
    min-height: 100%;
    background: var(--profin-bg);
    color: #1e293b;
}

body {
    font-family: Arial, Helvetica, sans-serif;
}

.login-page {
    min-height: 100vh;
    background: radial-gradient(circle at top right, #dbeafe, transparent 35%), linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.login-card {
    max-width: 430px;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16);
}

.brand-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--profin-blue), var(--profin-indigo));
    color: #fff;
    font-weight: 800;
    letter-spacing: -1px;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    background: var(--profin-dark);
    color: #cbd5e1;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.2s ease;
}

.sidebar-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link {
    color: #cbd5e1;
    border-radius: 9px;
    margin: 2px 10px;
    padding: 9px 12px;
    font-size: 0.88rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(79, 70, 229, 0.55);
}

.main-content {
    margin-left: 270px;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--profin-border);
}

.page-wrap {
    padding: 24px;
}

.panel-card,
.metric-card {
    border: 1px solid var(--profin-border);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.metric-card .metric-label {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card .metric-value {
    color: var(--profin-dark);
    font-size: 1.25rem;
    font-weight: 800;
}

.section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--profin-dark);
}

.table thead th {
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f8fafc;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.table-sm-input {
    min-width: 88px;
    font-size: 0.78rem;
}

.chart-box {
    position: relative;
    min-height: 340px;
    width: 100%;
}

.chart-box canvas {
    width: 100%;
    height: 340px;
}

.chart-tooltip {
    position: absolute;
    display: none;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.94);
    color: #fff;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.75rem;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.project-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.7rem;
    font-weight: 800;
}

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

.status-autorizado,
.status-vendida,
.status-asignado {
    background: #d1fae5;
    color: #065f46;
}

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

.status-pagado,
.status-escriturada {
    background: #dbeafe;
    color: #1e40af;
}

.status-apartada,
.status-transito {
    background: #ede9fe;
    color: #5b21b6;
}

.premium-unit {
    border: 1px solid #c4b5fd;
    background: #f5f3ff;
    color: #6d28d9;
    border-radius: 8px;
    padding: 5px 8px;
    margin: 3px;
    font-size: 0.76rem;
}

.premium-unit.active {
    background: #6d28d9;
    color: #fff;
}

.sequence-item {
    border: 1px solid var(--profin-border);
    border-radius: 8px;
    padding: 7px 10px;
    background: #fff;
    cursor: grab;
    margin-bottom: 5px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(248, 250, 252, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.mobile-menu-button {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .page-wrap {
        padding: 14px;
    }
}

@media print {
    .sidebar,
    .topbar,
    .no-print,
    .btn {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .tab-pane {
        display: block !important;
    }
}
