﻿/* ================================================================
   AVASYS — Design System CSS Centralizado
   Basado en: avasys-design-guide.html v1.0
   
   Instrucciones de uso:
   1. Importar Google Fonts en _Layout.cshtml:
      <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
   2. Referenciar este archivo después de Tailwind:
      <link rel="stylesheet" href="~/css/avasys-design.css" />
   ================================================================ */

/* ================================================================
   01 — VARIABLES / TOKENS DE DISEÑO
   ================================================================ */
:root {
    /* --- Paleta principal: Verde --- */
    --av-green-950: #052e16;
    --av-green-900: #14532d;
    --av-green-800: #166534;
    --av-green-700: #15803d;
    --av-green-600: #16a34a;
    --av-green-500: #22c55e;
    --av-green-400: #4ade80;
    --av-green-300: #86efac;
    --av-green-200: #bbf7d0;
    --av-green-100: #dcfce7;
    --av-green-50: #f0fdf4;
    /* --- Neutrales: Slate --- */
    --av-slate-950: #020617;
    --av-slate-900: #0f172a;
    --av-slate-800: #1e293b;
    --av-slate-700: #334155;
    --av-slate-600: #475569;
    --av-slate-500: #64748b;
    --av-slate-400: #94a3b8;
    --av-slate-300: #cbd5e1;
    --av-slate-200: #e2e8f0;
    --av-slate-100: #f1f5f9;
    --av-slate-50: #f8fafc;
    /* --- Acentos semánticos --- */
    --av-amber-500: #f59e0b;
    --av-amber-100: #fef3c7;
    --av-amber-50: #fffbeb;
    --av-red-500: #ef4444;
    --av-red-100: #fee2e2;
    --av-red-50: #fef2f2;
    --av-blue-500: #3b82f6;
    --av-blue-100: #dbeafe;
    --av-blue-50: #eff6ff;
    --av-purple-500: #8b5cf6;
    --av-purple-50: #f5f3ff;
    /* --- Superficies --- */
    --av-bg-app: #f8fafc;
    --av-bg-card: #ffffff;
    --av-bg-elevated: #ffffff;
    --av-border: #e2e8f0;
    --av-border-light: #f1f5f9;
    /* --- Sombras --- */
    --av-shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --av-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --av-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --av-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    /* --- Border Radius --- */
    --av-radius-sm: 6px;
    --av-radius-md: 10px;
    --av-radius-lg: 14px;
    --av-radius-xl: 20px;
    --av-radius-full: 100px;
    /* --- Tipografía --- */
    --av-font-primary: 'Plus Jakarta Sans', sans-serif;
    --av-font-mono: 'DM Sans', sans-serif;
}


/* ================================================================
   02 — BASE / RESET
   ================================================================ */
body {
    font-family: var(--av-font-primary);
    background: var(--av-bg-app);
    color: var(--av-slate-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ================================================================
   03 — TIPOGRAFÍA
   ================================================================ */
.av-h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--av-slate-900);
    letter-spacing: -0.8px;
    line-height: 1.2;
}

.av-h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--av-slate-900);
    letter-spacing: -0.4px;
    line-height: 1.3;
}

.av-h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--av-slate-800);
    line-height: 1.4;
}

.av-body {
    font-size: 15px;
    font-weight: 400;
    color: var(--av-slate-600);
    line-height: 1.6;
}

.av-caption {
    font-size: 13px;
    font-weight: 500;
    color: var(--av-slate-500);
}

.av-mono {
    font-size: 13px;
    font-weight: 600;
    color: var(--av-slate-500);
    font-family: var(--av-font-mono);
}

.av-section-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--av-green-600);
}


/* ================================================================
   04 — BOTONES
   ================================================================ */
.av-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--av-radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--av-font-primary);
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.4;
}

.av-btn-primary {
    background: var(--av-green-600);
    color: #fff;
}

    .av-btn-primary:hover {
        background: var(--av-green-700);
        box-shadow: 0 2px 8px rgba(22,163,74,0.3);
    }

.av-btn-secondary {
    background: var(--av-green-50);
    color: var(--av-green-700);
    border: 1px solid var(--av-green-200);
}

    .av-btn-secondary:hover {
        background: var(--av-green-100);
    }

.av-btn-ghost {
    background: transparent;
    color: var(--av-slate-600);
    border: 1px solid var(--av-border);
}

    .av-btn-ghost:hover {
        background: var(--av-slate-50);
        border-color: var(--av-slate-300);
    }

.av-btn-danger {
    background: var(--av-red-50);
    color: var(--av-red-500);
    border: 1px solid var(--av-red-100);
}

    .av-btn-danger:hover {
        background: var(--av-red-100);
    }

.av-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.av-btn-lg {
    padding: 12px 24px;
    font-size: 14px;
}


/* ================================================================
   05 — BADGES
   ================================================================ */
.av-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--av-radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--av-font-primary);
}

.av-badge-green {
    background: var(--av-green-50);
    color: var(--av-green-700);
}

.av-badge-amber {
    background: var(--av-amber-50);
    color: #b45309;
}

.av-badge-red {
    background: var(--av-red-50);
    color: var(--av-red-500);
}

.av-badge-blue {
    background: var(--av-blue-50);
    color: var(--av-blue-500);
}

.av-badge-slate {
    background: var(--av-slate-100);
    color: var(--av-slate-600);
}

.av-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.av-badge-green .av-badge-dot {
    background: var(--av-green-500);
}

.av-badge-amber .av-badge-dot {
    background: var(--av-amber-500);
}

.av-badge-red .av-badge-dot {
    background: var(--av-red-500);
}

.av-badge-blue .av-badge-dot {
    background: var(--av-blue-500);
}


/* ================================================================
   06 — CARDS
   ================================================================ */
.av-card {
    background: var(--av-bg-card);
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-xs);
    transition: all 0.2s ease;
}

.av-card-hover:hover {
    box-shadow: var(--av-shadow-md), 0 0 0 3px var(--av-green-50);
    border-color: var(--av-green-300);
    transform: translateY(-2px);
}


/* ================================================================
   07 — STAT CARDS (Dashboard)
   ================================================================ */
.av-stat-card {
    background: var(--av-bg-card);
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

    .av-stat-card::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
    }

.av-stat-card-green::after {
    background: var(--av-green-500);
}

.av-stat-card-amber::after {
    background: var(--av-amber-500);
}

.av-stat-card-red::after {
    background: var(--av-red-500);
}

.av-stat-card-blue::after {
    background: var(--av-blue-500);
}

.av-stat-card-purple::after {
    background: var(--av-purple-500);
}

.av-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--av-slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.av-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--av-slate-900);
    letter-spacing: -0.5px;
}

.av-stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

.av-stat-change-up {
    color: var(--av-green-600);
}

.av-stat-change-down {
    color: var(--av-red-500);
}

.av-stat-change-flat {
    color: var(--av-slate-400);
}


/* ================================================================
   08 — PAGE HEADER
   ================================================================ */
.av-page-header {
    background: var(--av-bg-card);
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.av-page-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--av-radius-md);
    background: var(--av-green-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--av-green-600);
    flex-shrink: 0;
}

    .av-page-icon svg {
        width: 22px;
        height: 22px;
    }

.av-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--av-slate-900);
    letter-spacing: -0.3px;
}

.av-page-subtitle {
    font-size: 13px;
    color: var(--av-slate-500);
    margin-top: 2px;
}


/* ================================================================
   09 — MENU CARDS (Menú Principal)
   ================================================================ */
.av-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .av-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .av-menu-grid {
        grid-template-columns: 1fr;
    }
}

.av-menu-card {
    background: var(--av-bg-card);
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-md);
    padding: 24px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

    .av-menu-card:hover {
        border-color: var(--av-green-300);
        box-shadow: var(--av-shadow-md), 0 0 0 3px var(--av-green-50);
        transform: translateY(-2px);
    }

.av-menu-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--av-radius-md);
    background: var(--av-green-50);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--av-green-600);
    transition: background 0.2s ease;
}

    .av-menu-card-icon svg {
        width: 24px;
        height: 24px;
    }

.av-menu-card:hover .av-menu-card-icon {
    background: var(--av-green-100);
}

.av-menu-card-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--av-slate-800);
    line-height: 1.3;
}

.av-menu-card-desc {
    font-size: 12px;
    color: var(--av-slate-400);
    margin-top: 4px;
}


/* ================================================================
   10 — FLOW STEPPER (Dashboard de flujo)
   ================================================================ */
.av-flow-container {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.av-flow-card {
    flex: 0 0 auto;
    width: 210px;
}

.av-flow-card-inner {
    background: var(--av-bg-card);
    border-radius: var(--av-radius-lg);
    padding: 28px 16px 16px;
    text-align: center;
    position: relative;
    box-shadow: var(--av-shadow-sm);
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
    height: 100%;
}

.av-flow-card:hover .av-flow-card-inner {
    transform: translateY(-4px);
    box-shadow: var(--av-shadow-lg);
}

.av-flow-card[data-color="blue"]:hover .av-flow-card-inner {
    border-color: var(--av-blue-500);
}

.av-flow-card[data-color="amber"]:hover .av-flow-card-inner {
    border-color: var(--av-amber-500);
}

.av-flow-card[data-color="red"]:hover .av-flow-card-inner {
    border-color: var(--av-red-500);
}

.av-flow-card[data-color="green"]:hover .av-flow-card-inner {
    border-color: var(--av-green-500);
}

.av-flow-card[data-color="purple"]:hover .av-flow-card-inner {
    border-color: var(--av-purple-500);
}

.av-flow-step-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-family: var(--av-font-primary);
}

.av-flow-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--av-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

    .av-flow-icon svg {
        width: 26px;
        height: 26px;
    }

.av-flow-count {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--av-font-primary);
}

.av-flow-label {
    font-size: 12px;
    color: var(--av-slate-500);
    line-height: 1.45;
    font-weight: 500;
    min-height: 36px;
}

.av-flow-hint {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--av-border-light);
    font-size: 11px;
    color: var(--av-slate-400);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: color 0.2s;
}

.av-flow-card:hover .av-flow-hint {
    color: var(--av-slate-600);
}

.av-flow-hint svg {
    width: 12px;
    height: 12px;
}

/* Conectores */
.av-flow-connector {
    display: flex;
    align-items: center;
    width: 40px;
    flex-shrink: 0;
}

.av-flow-connector-line {
    height: 2px;
    flex: 1;
    background: var(--av-slate-300);
    border-radius: 1px;
}

.av-flow-connector-arrow {
    display: flex;
    align-items: center;
    color: var(--av-slate-400);
}

/* Loader dentro del count */
.av-flow-loader {
    width: 20px;
    height: 20px;
    border: 3px solid var(--av-border);
    border-top-color: var(--av-slate-400);
    border-radius: 50%;
    animation: av-spin 0.8s linear infinite;
}

@keyframes av-spin {
    to {
        transform: rotate(360deg);
    }
}

.av-flow-count-animated {
    animation: av-countIn 0.4s ease-out;
}

@keyframes av-countIn {
    from {
        opacity: 0;
        transform: scale(0.6);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive: apilar verticalmente */
@media (max-width: 1100px) {
    .av-flow-container {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .av-flow-card {
        width: 280px;
    }

    .av-flow-connector {
        width: auto;
        height: 28px;
        flex-direction: column;
    }

    .av-flow-connector-line {
        width: 2px;
        height: 100%;
    }

    .av-flow-connector-arrow svg {
        transform: rotate(90deg);
    }
}


/* ================================================================
   11 — SECTION DIVIDER
   ================================================================ */
.av-section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
}

    .av-section-divider::before,
    .av-section-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--av-border);
    }

.av-section-divider-text {
    font-size: 12px;
    color: var(--av-slate-500);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}


/* ================================================================
   12 — TABLA DE DATOS (DataGrid overrides)
   ================================================================ */
.av-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

    .av-table th {
        text-align: left;
        padding: 10px 14px;
        font-size: 11px;
        font-weight: 700;
        color: var(--av-slate-500);
        text-transform: uppercase;
        letter-spacing: 0.6px;
        background: var(--av-slate-50);
        border-bottom: 1px solid var(--av-border);
    }

    .av-table td {
        padding: 12px 14px;
        font-size: 13px;
        color: var(--av-slate-700);
        border-bottom: 1px solid var(--av-border-light);
    }

    .av-table tr:hover td {
        background: var(--av-green-50);
    }

.av-table-action {
    width: 30px;
    height: 30px;
    border-radius: var(--av-radius-sm);
    border: 1px solid var(--av-border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--av-slate-500);
    transition: all 0.15s;
}

    .av-table-action:hover {
        background: var(--av-green-50);
        color: var(--av-green-600);
        border-color: var(--av-green-200);
    }


/* ================================================================
   13 — UTILIDADES
   ================================================================ */
.av-text-green-600 {
    color: var(--av-green-600);
}

.av-text-green-700 {
    color: var(--av-green-700);
}

.av-text-slate-500 {
    color: var(--av-slate-500);
}

.av-text-slate-900 {
    color: var(--av-slate-900);
}

.av-text-blue-500 {
    color: var(--av-blue-500);
}

.av-text-amber-500 {
    color: var(--av-amber-500);
}

.av-text-red-500 {
    color: var(--av-red-500);
}

.av-text-purple-500 {
    color: var(--av-purple-500);
}

.av-bg-green-50 {
    background: var(--av-green-50);
}

.av-bg-blue-50 {
    background: var(--av-blue-50);
}

.av-bg-amber-50 {
    background: var(--av-amber-50);
}

.av-bg-red-50 {
    background: var(--av-red-50);
}

.av-bg-purple-50 {
    background: var(--av-purple-50);
}

.av-bg-blue-badge {
    background: var(--av-blue-500);
}

.av-bg-amber-badge {
    background: var(--av-amber-500);
}

.av-bg-red-badge {
    background: var(--av-red-500);
}

.av-bg-green-badge {
    background: var(--av-green-600);
}

.av-bg-purple-badge {
    background: var(--av-purple-500);
}

/* Flow pill (etiqueta inferior del flujo) */
.av-flow-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 20px;
    border-radius: var(--av-radius-full);
    box-shadow: var(--av-shadow-xs);
    border: 1px solid var(--av-border);
    font-size: 12px;
    color: var(--av-slate-500);
}

    .av-flow-pill strong {
        color: var(--av-green-700);
    }

/* Refresh button */
.av-refresh-btn {
    background: none;
    border: 1px solid var(--av-slate-300);
    border-radius: var(--av-radius-sm);
    padding: 4px 12px;
    font-size: 12px;
    color: var(--av-slate-500);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--av-font-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .av-refresh-btn:hover {
        background: var(--av-slate-100);
        border-color: var(--av-slate-400);
    }

    .av-refresh-btn svg {
        width: 12px;
        height: 12px;
    }
/* ================================================================
   14 — BREADCRUMB
   ================================================================ */
.av-breadcrumb {
    display: flex;
    align-items: center;
    margin-top: 24px;
    margin-bottom: 24px;
}

    .av-breadcrumb ol {
        display: inline-flex;
        align-items: center;
        gap: 0;
        list-style: none;
        padding: 0;
        margin: 0;
    }

.av-breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.av-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--av-slate-600);
    text-decoration: none;
    transition: color 0.15s;
}

    .av-breadcrumb-link svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

    .av-breadcrumb-link:hover {
        color: var(--av-green-600);
    }

.av-breadcrumb-sep {
    display: flex;
    align-items: center;
    padding: 0 6px;
    color: var(--av-slate-300);
}

    .av-breadcrumb-sep svg {
        width: 12px;
        height: 12px;
    }

.av-breadcrumb-current {
    font-size: 14px;
    font-weight: 500;
    color: var(--av-slate-500);
}


/* ================================================================
   15 — PAGE HEADER: sub-elementos
   ================================================================ */

/* Contenedor lado izquierdo (icono + textos) */
.av-page-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Contenedor lado derecho (acciones) */
.av-page-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}


/* ================================================================
   16 — POPUP / MODAL REUTILIZABLE
   ================================================================ */

/* Contenedor raíz del popup (dentro del ContentTemplate de DevExtreme) */
.av-popup {
    font-family: var(--av-font-primary);
    display: flex;
    flex-direction: column;
    border-radius: var(--av-radius-md);
    overflow: hidden;
}

/* Header con gradiente verde institucional */
.av-popup-header {
    background: linear-gradient(135deg, var(--av-green-950), var(--av-green-700));
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.av-popup-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--av-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

    .av-popup-header-icon svg {
        width: 22px;
        height: 22px;
    }

.av-popup-header-text {
    flex: 1;
    min-width: 0;
}

.av-popup-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.av-popup-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 3px;
}

/* Botón cerrar (X) en el header */
.av-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: var(--av-radius-sm);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
    font-family: var(--av-font-primary);
    line-height: 1;
}

    .av-close-btn:hover {
        background: rgba(255, 255, 255, 0.28);
    }

/* Cuerpo del popup */
.av-popup-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--av-bg-card);
}

/* Pie del popup */
.av-popup-footer {
    padding: 14px 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--av-border-light);
    background: var(--av-slate-50);
    flex-shrink: 0;
}


/* ================================================================
   17 — FILAS DE INFORMACIÓN (dentro de popup-body)
   ================================================================ */
.av-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    background: var(--av-slate-50);
    border: 1px solid var(--av-border);
    border-radius: 8px;
    gap: 12px;
}

.av-info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--av-slate-500);
    flex-shrink: 0;
}

.av-info-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--av-slate-900);
    text-align: right;
}


/* ================================================================
   18 — BLOQUE DE AVISO / NOTICE
   ================================================================ */
.av-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 14px;
    background: var(--av-green-50);
    border: 1px solid var(--av-green-200);
    border-radius: 8px;
    font-size: 13px;
    color: var(--av-green-700);
    line-height: 1.5;
}

    .av-notice svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
        margin-top: 1px;
    }

.av-notice-amber {
    background: var(--av-amber-50);
    border-color: var(--av-amber-100);
    color: #92400e;
}

.av-notice-red {
    background: var(--av-red-50);
    border-color: var(--av-red-100);
    color: var(--av-red-500);
}

.av-notice-blue {
    background: var(--av-blue-50);
    border-color: var(--av-blue-100);
    color: var(--av-blue-500);
}


/* ================================================================
   19 — POPUP DE RESULTADO EXITOSO
   ================================================================ */
.av-resultado {
    padding: 36px 28px;
    text-align: center;
    font-family: var(--av-font-primary);
    background: var(--av-bg-card);
}

.av-resultado-check {
    width: 54px;
    height: 54px;
    background: var(--av-green-50);
    color: var(--av-green-600);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 16px;
    border: 2px solid var(--av-green-200);
}

.av-resultado-titulo {
    font-size: 19px;
    font-weight: 700;
    color: var(--av-slate-900);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.av-resultado-sub {
    font-size: 13px;
    color: var(--av-slate-500);
    margin-bottom: 14px;
}

/* Bloque donde se muestra la referencia generada */
.av-resultado-ref {
    font-size: 26px;
    font-weight: 800;
    color: var(--av-green-700);
    letter-spacing: 1px;
    background: var(--av-green-50);
    border: 2px solid var(--av-green-200);
    border-radius: var(--av-radius-md);
    padding: 12px 24px;
    display: inline-block;
    font-family: var(--av-font-mono);
}


/* ================================================================
   20 — DOT (alias de av-badge-dot para compatibilidad)
   ================================================================ */

/* Alias: .av-dot es equivalente a .av-badge-dot
   Usar preferentemente .av-badge-dot en código nuevo.
   .av-dot se mantiene solo por compatibilidad con vistas existentes. */
.av-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    background: currentColor;
}


/* ================================================================
   21 — DEVEXTREME DATAGRID: OVERRIDES GENÉRICOS
   Aplicar via ElementAttr("class", "av-dx-grid")
   ================================================================ */

/* Headers: fondo slate-50, texto uppercase 11px */
.av-dx-grid .dx-datagrid-headers .dx-header-row > td {
    background-color: var(--av-slate-50) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--av-slate-500) !important;
}

/* Hover en filas de datos — solo las celdas de datos, no el panel de grupo */
.av-dx-grid .dx-datagrid-rowsview .dx-data-row:hover > td {
    background-color: var(--av-green-50) !important;
}

/* ================================================================
   22 — DEVEXTREME DATAGRID: FILAS Y ASPECTO REFINADO
   ================================================================ */

/* Eliminar alternancia gris por defecto de DevExtreme */
.av-dx-grid .dx-datagrid-rowsview .dx-row-alt > td,
.av-dx-grid .dx-datagrid-rowsview .dx-row-alt > tr > td {
    background-color: #f7fdf9 !important; /* verde menta muy sutil */
}

/* Filas normales: fondo blanco limpio */
.av-dx-grid .dx-datagrid-rowsview .dx-data-row > td {
    background-color: #ffffff;
    border-bottom: 1px solid var(--av-border-light) !important;
}

/* Separador entre filas más sutil (sin la línea gris gruesa) */
.av-dx-grid .dx-datagrid-rowsview .dx-row > td {
    border-bottom-color: #eef2f7 !important;
}

/* Hover más suave */
.av-dx-grid .dx-datagrid-rowsview .dx-data-row:hover > td {
    background-color: #edfaf2 !important;
    transition: background-color 0.12s ease;
}

/* ── Toolbar vacío del grid: suprimir altura cuando no tiene contenido ── */
.av-dx-grid .dx-toolbar.dx-widget:not(:has(.dx-toolbar-item:not(:empty))) {
    display: none;
}

/* Fallback más compatible para quitar el toolbar vacío */
.av-dx-grid .dx-datagrid-header-panel:empty,
.av-dx-grid .dx-datagrid-header-panel .dx-toolbar-before:empty {
    display: none;
}

/* Card: asegurar que el border-radius se aplica al grid interno */
.av-card .dx-datagrid {
    border-radius: inherit;
    overflow: hidden;
}

/* Primera fila de headers pegada al borde superior del card */
.av-dx-grid .dx-datagrid-headers {
    border-top: none !important;
    border-top-left-radius: var(--av-radius-lg);
    border-top-right-radius: var(--av-radius-lg);
}

/* Última fila del grid pegada al borde inferior del card */
.av-dx-grid .dx-datagrid-rowsview {
    border-bottom-left-radius: var(--av-radius-lg);
    border-bottom-right-radius: var(--av-radius-lg);
}

/* Línea separadora entre header y body más definida */
.av-dx-grid .dx-datagrid-headers .dx-header-row > td {
    border-bottom: 2px solid var(--av-border) !important;
}

/* ================================================================
   23 — DETAIL PANEL (Master-Detail DevExtreme)
   ================================================================ */

/* Fondo de la fila de detalle */
.av-dx-grid .dx-master-detail-row > td {
    padding: 0 !important;
    background: var(--av-slate-50) !important;
}

/* Sección de asignación (valuador) — banda superior del detalle */
.av-valuador-section {
    padding: 14px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--av-border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.av-valuador-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--av-slate-700);
    white-space: nowrap;
}

/* Sección de contenido del detalle (comentarios, info, etc.) */
.av-detail-section {
    padding: 20px 24px;
    background: var(--av-slate-50);
    border-top: 1px solid var(--av-border);
}

.av-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.av-detail-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--av-slate-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badge de referencia dentro del detail-title */
.av-ref-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--av-radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--av-green-50);
    color: var(--av-green-700);
}


/* ================================================================
   24 — COMMENT FORM
   ================================================================ */
.av-comment-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: #ffffff;
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-md);
    margin-top: 16px;
}

.av-comment-textarea {
    flex: 1;
    font-family: var(--av-font-primary);
    font-size: 13px;
    padding: 10px 14px;
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-sm);
    resize: vertical;
    min-height: 42px;
    max-height: 120px;
    color: var(--av-slate-700);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.5;
}

    .av-comment-textarea:focus {
        border-color: var(--av-green-600);
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    }

    .av-comment-textarea::placeholder {
        color: var(--av-slate-400);
    }


/* ================================================================
   25 — TOAST / NOTIFICACIÓN FLOTANTE
   ================================================================ */
.av-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--av-radius-md);
    font-family: var(--av-font-primary);
    font-size: 13px;
    font-weight: 600;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: var(--av-shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 340px;
}

    .av-toast.show {
        transform: translateX(0);
    }

.av-toast-success {
    background: var(--av-green-50);
    color: var(--av-green-700);
    border: 1px solid var(--av-green-200);
}

.av-toast-error {
    background: var(--av-red-50);
    color: var(--av-red-500);
    border: 1px solid var(--av-red-100);
}

.av-toast-info {
    background: var(--av-blue-50);
    color: var(--av-blue-500);
    border: 1px solid var(--av-blue-100);
}

.av-toast-amber {
    background: var(--av-amber-50);
    color: #92400e;
    border: 1px solid var(--av-amber-100);
}


/* ================================================================
   26 — BADGE CONTRATO BANCO
   Variante semántica de av-badge para contratos bancarios
   ================================================================ */
.av-badge-contrato {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--av-radius-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--av-blue-50);
    color: var(--av-blue-500);
}

    .av-badge-contrato svg {
        width: 11px;
        height: 11px;
        flex-shrink: 0;
    }


/* ================================================================
   27 — DEVEXTREME: GRID DE COMENTARIOS (detalle anidado)
   Aplicar via elementAttr: { class: 'av-dx-grid av-dx-grid-comments' }
   ================================================================ */
.av-dx-grid-comments .dx-datagrid-rowsview .dx-data-row > td {
    padding: 14px 14px !important;
    font-size: 13.5px !important;
    line-height: 1.65 !important;
    color: var(--av-slate-800) !important;
}

.av-dx-grid-comments .dx-datagrid-rowsview .dx-row-alt > td {
    background-color: var(--av-slate-50) !important;
}

/* ================================================================
   28 — AV-CARD: variante con overflow oculto (para grids)
   ================================================================ */
.av-card-grid {
    background: var(--av-bg-card);
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius-lg);
    box-shadow: var(--av-shadow-xs);
    overflow: hidden; /* necesario para que el grid respete el border-radius */
}