* { box-sizing: border-box; }

:root {
    --vm-bg: #f4f7fb;
    --vm-ink: #0f172a;
    --vm-muted: #475569;
    --vm-primary: #0e5db8;
    --vm-primary-2: #0a4a93;
    --vm-success: #166534;
    --vm-warning: #92400e;
    --vm-danger: #991b1b;
    --vm-card-border: #e2e8f0;
    --vm-shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
}

body.vm-body {
    margin: 0;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top left, #eef4ff, #f8fafc 40%, #f4f7fb 100%);
    color: var(--vm-ink);
}

body.vm-body.vm-login-bg {
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 20%, rgba(59, 130, 246, 0.18), transparent 42%),
        radial-gradient(circle at 85% 85%, rgba(125, 211, 252, 0.12), transparent 44%),
        linear-gradient(150deg, #071024 0%, #0a1b3b 36%, #102f66 74%, #1d4e89 100%);
}

.vm-network-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

body.vm-body.vm-app-bg {
    min-height: 100vh;
    background:
        radial-gradient(circle at 16% 16%, rgba(59, 130, 246, 0.18), transparent 42%),
        radial-gradient(circle at 84% 84%, rgba(125, 211, 252, 0.10), transparent 45%),
        linear-gradient(150deg, #071024 0%, #0b1d40 42%, #123b79 76%, #1e4d8d 100%);
    background-attachment: fixed;
}

.vm-network-canvas.vm-network-canvas-app {
    opacity: 0.5;
}

body.vm-body.vm-app-bg .vm-topbar {
    background: linear-gradient(120deg, rgba(6, 11, 22, 0.95) 0%, rgba(13, 35, 74, 0.94) 55%, rgba(22, 53, 111, 0.93) 100%);
    backdrop-filter: blur(8px);
    border-bottom-color: rgba(147, 197, 253, 0.32);
    box-shadow: 0 12px 30px rgba(2, 8, 23, 0.45);
}

body.vm-body.vm-app-bg .vm-container {
    position: relative;
    z-index: 1;
}

body.vm-body.vm-app-bg .vm-card {
    background: rgba(248, 250, 255, 0.95);
    border: 1px solid rgba(191, 219, 254, 0.45);
    box-shadow: 0 16px 40px rgba(2, 8, 23, 0.22);
}

body.vm-body.vm-app-bg .vm-topbar nav a {
    background: rgba(147, 197, 253, 0.14);
    border: 1px solid rgba(191, 219, 254, 0.4);
}

body.vm-body.vm-app-bg .vm-topbar nav a:hover {
    background: rgba(147, 197, 253, 0.28);
}

body.vm-body.vm-app-bg .vm-topbar nav a.vm-nav-active {
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.5) 0%, rgba(96, 165, 250, 0.42) 100%);
    border-color: rgba(191, 219, 254, 0.8);
    box-shadow: inset 0 0 0 1px rgba(219, 234, 254, 0.35);
}

body.vm-body.vm-app-bg .vm-toolbar {
    background: rgba(248, 250, 255, 0.94);
    border: 1px solid rgba(191, 219, 254, 0.5);
    border-radius: 14px;
    padding: 10px 12px;
}

.vm-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.vm-login-wrap::before,
.vm-login-wrap::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

.vm-login-wrap::before {
    width: 360px;
    height: 360px;
    top: -130px;
    right: -70px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.26) 0%, rgba(96, 165, 250, 0) 70%);
}

.vm-login-wrap::after {
    width: 320px;
    height: 320px;
    left: -90px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(125, 211, 252, 0.22) 0%, rgba(125, 211, 252, 0) 68%);
}

.vm-login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 580px;
    background: rgba(249, 251, 255, 0.94);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(191, 219, 254, 0.35);
    box-shadow: 0 28px 80px rgba(2, 8, 23, 0.5);
    padding: 26px 24px 22px;
}

.vm-login-card h1 {
    margin: 4px 0 8px;
    text-align: center;
    font-size: clamp(1.45rem, 1.5vw + 1rem, 2rem);
    color: #0f172a;
}

.vm-login-subtitle {
    margin: 0 0 18px;
    text-align: center;
    color: #475569;
    line-height: 1.45;
}

.vm-brand-login {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.vm-brand-login img {
    max-width: 220px;
    width: 100%;
    height: auto;
}

.vm-login-eyebrow {
    margin: 0 auto 10px;
    padding: 6px 12px;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #92400e;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
}

.vm-login-form {
    margin-top: 6px;
}

.vm-field {
    margin-bottom: 10px;
}

.vm-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
}

.vm-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.vm-input-wrap i {
    width: 42px;
    text-align: center;
    color: #1d4ed8;
    opacity: 0.95;
}

.vm-input-wrap:focus-within {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.16);
}

.vm-input-wrap .vm-input {
    margin: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 11px 12px 11px 4px;
}

.vm-input-wrap .vm-input:focus {
    box-shadow: none;
}

.vm-btn-block {
    width: 100%;
    margin-top: 8px;
    padding-top: 11px;
    padding-bottom: 11px;
    font-size: 0.98rem;
}

.vm-login-form .vm-btn-primary {
    background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 58%, #1d4ed8 100%);
    border: 1px solid rgba(30, 58, 138, 0.24);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.25);
}

.vm-login-form .vm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3);
}

.vm-topbar {
    background: linear-gradient(120deg, #0b1f3b 0%, #0f3f78 55%, #0e5db8 100%);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.vm-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vm-brand-logo {
    width: 200px;
    max-width: 38vw;
    height: auto;
    background: #fff;
    border-radius: 10px;
    padding: 5px 10px;
    box-shadow: 0 6px 16px rgba(2, 8, 23, 0.22);
}

.vm-brand h1 {
    margin: 0 0 2px;
    font-size: clamp(1.35rem, 1.1vw + 1rem, 1.9rem);
    line-height: 1.1;
}

.vm-brand small {
    opacity: 0.9;
    display: block;
    font-size: 0.98rem;
}

.vm-brand > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 2px;
}

.vm-brand-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vm-avatar-link {
    text-decoration: none;
    display: inline-flex;
    border-radius: 999px;
    transition: transform .2s ease, filter .2s ease;
    order: -1;
}

.vm-avatar-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.vm-brand .vm-topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(191, 219, 254, 0.85);
    box-shadow: 0 4px 12px rgba(2, 8, 23, 0.28);
    background: rgba(255, 255, 255, 0.18);
}

.vm-brand .vm-topbar-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #eff6ff;
    background: rgba(147, 197, 253, 0.28);
    border: 1px solid rgba(191, 219, 254, 0.8);
    font-size: 0.78rem;
}

.vm-topbar nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vm-topbar nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: .2s ease;
}

.vm-topbar nav a:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.24);
}

.vm-topbar nav a.vm-nav-active {
    background: rgba(255, 255, 255, 0.34);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.vm-container {
    width: min(1400px, 96vw);
    margin: 18px auto 30px;
}

.vm-card {
    background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
    border-radius: 14px;
    border: 1px solid var(--vm-card-border);
    box-shadow: var(--vm-shadow);
    padding: 16px;
}

.vm-card h2,
.vm-card h3 {
    margin-top: 0;
    color: #0b2954;
}

.vm-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.vm-grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.vm-grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.vm-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.vm-alert {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}
.vm-alert-ok { background: #ecfdf3; color: var(--vm-success); border-color: #86efac; }
.vm-alert-error { background: #fef2f2; color: var(--vm-danger); border-color: #fca5a5; }
.vm-alert-warning { background: #fefce8; color: var(--vm-warning); border-color: #fde68a; }

.vm-input,
textarea.vm-input,
select.vm-input {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    margin-top: 4px;
    margin-bottom: 8px;
    background: #fff;
    color: var(--vm-ink);
    font: inherit;
}

.vm-input:focus {
    outline: none;
    border-color: var(--vm-primary);
    box-shadow: 0 0 0 3px rgba(14, 93, 184, 0.15);
}

.vm-input-prefix-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    margin-top: 4px;
    margin-bottom: 8px;
}

.vm-input-prefix {
    padding: 0 10px;
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid #e2e8f0;
}

.vm-input.vm-input-with-prefix {
    border: 0;
    margin: 0;
    border-radius: 0 9px 9px 0;
}

.vm-input-prefix-wrap:focus-within {
    border-color: var(--vm-primary);
    box-shadow: 0 0 0 3px rgba(14, 93, 184, 0.15);
}

.vm-input-prefix-wrap:focus-within .vm-input.vm-input-with-prefix {
    box-shadow: none;
}

.vm-btn {
    border: 0;
    border-radius: 9px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 600;
    transition: .2s ease;
}

.vm-btn:hover { transform: translateY(-1px); }

.vm-btn-primary {
    background: linear-gradient(120deg, var(--vm-primary) 0%, var(--vm-primary-2) 100%);
    color: #fff;
}

.vm-btn-light {
    background: #e2e8f0;
    color: #0f172a;
}

.vm-btn-light:hover { background: #cbd5e1; }

.vm-btn-danger {
    background: linear-gradient(120deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
}

.vm-btn-warning {
    background: linear-gradient(120deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.vm-btn-warning:hover {
    background: linear-gradient(120deg, #fbbf24 0%, #ea580c 100%);
}

.vm-btn-success {
    background: linear-gradient(120deg, #16a34a 0%, #15803d 100%);
    color: #fff;
}

.vm-btn-success:hover {
    background: linear-gradient(120deg, #22c55e 0%, #16a34a 100%);
}

.vm-btn-info {
    background: linear-gradient(120deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
}

.vm-btn-info:hover {
    background: linear-gradient(120deg, #3b82f6 0%, #2563eb 100%);
}

.vm-btn-xs {
    padding: 4px 8px;
    font-size: 0.78rem;
}

.vm-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--vm-primary);
    text-decoration: none;
    font-weight: 600;
}
.vm-link:hover { text-decoration: underline; }

.vm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.vm-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.vm-form-grid { display: grid; gap: 4px; }

.vm-form-divider {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e293b;
}

.vm-form-divider strong {
    display: block;
    margin-bottom: 4px;
}

.vm-form-divider small {
    color: #475569;
}

.vm-compact-note {
    grid-column: 1 / -1;
    margin-top: 4px;
}

.vm-avatar-box {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
}

.vm-avatar-preview {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #bfdbfe;
    background: #e2e8f0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.vm-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    font-size: 1.8rem;
}

.vm-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: #334155;
}

.vm-progress {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

.vm-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #06b6d4, #0e5db8);
}

.vm-table-wrap { overflow: auto; }

.vm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.vm-table th,
.vm-table td {
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    padding: 8px;
    font-size: 0.9rem;
    vertical-align: top;
}

.vm-table th {
    background: #f1f5f9;
    color: #0b2954;
}

.vm-list { margin: 0; padding-left: 18px; }
.vm-list li { margin-bottom: 8px; }

.vm-alert-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.vm-alert-actions form {
    margin: 0;
}

.vm-alert-date-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vm-alert-date-input {
    width: 148px;
    margin: 0;
    padding: 4px 7px;
    min-height: auto;
}

.vm-alert-edit {
    width: 100%;
    margin-top: 4px;
}

.vm-alert-edit > summary {
    cursor: pointer;
    color: #1d4ed8;
    font-size: 0.82rem;
    list-style: none;
}

.vm-alert-edit > summary::-webkit-details-marker {
    display: none;
}

.vm-alert-edit-form {
    margin-top: 6px;
    padding: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.vm-alert-edit-form label {
    font-size: 0.8rem;
    color: #334155;
}

.vm-note {
    margin-top: 14px;
    font-size: 0.9rem;
    color: #334155;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px dashed #cbd5e1;
    padding: 10px;
    border-radius: 8px;
}

.vm-login-card .vm-link {
    color: #1e3a8a;
}

.vm-report-header {
    border-left: 5px solid var(--vm-primary);
}

.vm-report-header p { margin: 6px 0; color: var(--vm-muted); }

.vm-semaforo-wrap { display: grid; gap: 8px; }

.vm-semaforo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.vm-semaforo-item small {
    display: block;
    color: #475569;
    margin-top: 3px;
}

.vm-chart-box {
    position: relative;
    width: 100%;
}

.vm-chart-box-sm {
    height: 240px;
}

.vm-chart-box-md {
    height: 270px;
}

.vm-chart-box-xs {
    height: 210px;
}

.vm-chart-inline {
    max-width: 420px;
    margin-bottom: 14px;
}

.vm-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12) inset;
}

.vm-dot-verde { background: #16a34a; }
.vm-dot-amarillo { background: #eab308; }
.vm-dot-rojo { background: #dc2626; }

@media (max-width: 780px) {
    .vm-topbar {
        position: static;
        flex-direction: column;
        align-items: flex-start;
    }
    .vm-brand { width: 100%; }
    .vm-brand-logo { width: 145px; max-width: 48vw; }
    .vm-brand .vm-topbar-avatar,
    .vm-brand .vm-topbar-avatar-placeholder { width: 24px; height: 24px; }
    .vm-container { width: 94vw; }
    .vm-table { min-width: 100%; }
    .vm-alert-actions {
        align-items: stretch;
    }
    .vm-alert-date-form {
        width: 100%;
    }
    .vm-alert-date-input {
        width: 100%;
    }
}
