/* ============================================================
   VegaTurnos — Sistema de diseño (marca Dr. Diego Vega MD)
   Estética médica: limpia, clara, elegante.
   Los estilos usan !important en propiedades visuales clave
   para no ser pisados por el tema activo o Elementor.
   ============================================================ */

:root {
	/* Paleta */
	--vgt-azul-profundo: #1F4E7A;
	--vgt-azul-medio:     #2C6BA8;
	--vgt-azul-cielo:     #5C9BD1;
	--vgt-azul-palido:    #A9CCE8;
	--vgt-azul-niebla:    #EAF3FB;
	--vgt-gris-texto:     #233649;
	--vgt-gris-sec:       #6A7C8D;
	--vgt-borde:          #E2ECF5;
	--vgt-verde:          #2FB17C;
	--vgt-verde-claro:    #45C892;
	--vgt-naranja:        #E5A13C;
	--vgt-morado:         #8A78C4;
	--vgt-rojo:           #D8543A;
	--vgt-blanco:         #FFFFFF;

	/* Degradados */
	--vgt-grad-azul:   linear-gradient(135deg, #3279B8 0%, #1F4E7A 100%);
	--vgt-grad-verde:  linear-gradient(135deg, #45C892 0%, #2FA873 100%);
	--vgt-grad-fondo:  linear-gradient(165deg, #F3F9FE 0%, #E6F1FB 100%);
	--vgt-grad-azul-suave: linear-gradient(135deg, #EAF3FB 0%, #DCEBF8 100%);

	/* Sombras */
	--vgt-sombra:     0 12px 34px rgba(31, 78, 122, 0.10);
	--vgt-sombra-sm:  0 6px 18px rgba(31, 78, 122, 0.08);
	--vgt-sombra-btn: 0 8px 18px rgba(31, 78, 122, 0.22);

	/* Radios (escala única y consistente) */
	--vgt-r-sm:   12px;   /* botones, inputs, chips */
	--vgt-r-md:   18px;   /* kpis, sub-tarjetas */
	--vgt-r-lg:   24px;   /* tarjetas, modales */
	--vgt-r-pill: 999px;  /* badges */

	/* Tipografía */
	--vgt-font:      'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--vgt-font-data: 'Poppins', system-ui, sans-serif;
}

/* ---------- Contenedores raíz ---------- */
.vgt-app,
.vgt-login-wrap,
.vgt-digiturno,
.vgt-modal {
	font-family: var(--vgt-font);
	color: var(--vgt-gris-texto);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.vgt-app *,
.vgt-login-wrap *,
.vgt-digiturno *,
.vgt-modal * {
	box-sizing: border-box;
}

.vgt-app {
	background: var(--vgt-grad-fondo) !important;
	min-height: 100vh;
	margin: 0;
}

/* Reset de tipografía de controles para que el tema no la cambie */
.vgt-app button,
.vgt-app input,
.vgt-app select,
.vgt-app textarea,
.vgt-modal button,
.vgt-modal input,
.vgt-modal select,
.vgt-modal textarea,
.vgt-login-wrap button,
.vgt-login-wrap input {
	font-family: var(--vgt-font);
	letter-spacing: 0;
}

/* Encabezados dentro de los paneles, sin herencia rara del tema */
.vgt-app h1, .vgt-app h2, .vgt-app h3,
.vgt-modal h3 {
	font-family: var(--vgt-font);
	color: var(--vgt-azul-profundo);
	line-height: 1.2;
}

/* ============================================================
   BOTONES — todos con el mismo radio y comportamiento
   ============================================================ */
.vgt-btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: var(--vgt-font) !important;
	font-weight: 700 !important;
	font-size: 15px !important;
	line-height: 1.1 !important;
	padding: 12px 22px !important;
	margin: 0;
	border: 1.5px solid transparent !important;
	border-radius: var(--vgt-r-sm) !important;
	cursor: pointer;
	text-decoration: none !important;
	text-transform: none !important;
	box-shadow: none;
	transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease, border-color .14s ease;
	-webkit-appearance: none;
	appearance: none;
}
.vgt-btn:hover { transform: translateY(-2px); }
.vgt-btn:active { transform: translateY(0); }
.vgt-btn:focus-visible { outline: 3px solid rgba(92,155,209,.45); outline-offset: 2px; }
.vgt-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.vgt-btn-azul {
	background: var(--vgt-grad-azul) !important;
	color: #fff !important;
	border-color: transparent !important;
}
.vgt-btn-azul:hover { box-shadow: var(--vgt-sombra-btn); }

.vgt-btn-verde {
	background: var(--vgt-grad-verde) !important;
	color: #fff !important;
	border-color: transparent !important;
}
.vgt-btn-verde:hover { box-shadow: 0 8px 18px rgba(47,177,124,.32); }

.vgt-btn-ghost {
	background: #fff !important;
	color: var(--vgt-azul-profundo) !important;
	border: 1.5px solid var(--vgt-azul-palido) !important;
}
.vgt-btn-ghost:hover {
	background: var(--vgt-azul-niebla) !important;
	border-color: var(--vgt-azul-cielo) !important;
	box-shadow: var(--vgt-sombra-sm);
}

.vgt-btn-block { width: 100%; }
.vgt-btn-grande { font-size: 19px !important; padding: 17px 34px !important; }
.vgt-btn-sm { font-size: 13.5px !important; padding: 9px 16px !important; }

/* ============================================================
   BADGES DE ESTADO
   ============================================================ */
.vgt-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 13px !important;
	border-radius: var(--vgt-r-pill) !important;
	font-family: var(--vgt-font-data);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .2px;
	white-space: nowrap;
	border: none;
}
.vgt-badge::before {
	content: "";
	width: 7px; height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: .9;
}
.vgt-badge-naranja { background: #FBEBD3 !important; color: #B16E0C !important; }
.vgt-badge-verde   { background: #D5F3E6 !important; color: #1C8456 !important; }
.vgt-badge-azul    { background: #DBEAF8 !important; color: #1F4E7A !important; }
.vgt-badge-morado  { background: #E7E1F5 !important; color: #57459A !important; }
.vgt-badge-cyan    { background: #D2F0F2 !important; color: #137A82 !important; }
.vgt-badge-gris    { background: #E5EBF1 !important; color: #5A6B79 !important; }

/* ============================================================
   AVISOS
   ============================================================ */
.vgt-aviso {
	background: var(--vgt-azul-niebla);
	border: 1px solid var(--vgt-azul-palido);
	color: var(--vgt-azul-profundo);
	border-radius: var(--vgt-r-sm);
	padding: 14px 18px;
	margin: 16px auto;
	max-width: 640px;
	font-weight: 500;
}
.vgt-aviso a { color: var(--vgt-azul-medio); font-weight: 700; }
.vgt-aviso-error {
	background: #FCEAE5;
	border-color: #F0B6A6;
	color: #B23A1E;
}

/* ============================================================
   TOPBAR DE PANELES
   ============================================================ */
.vgt-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 28px;
	background: #fff;
	box-shadow: 0 2px 18px rgba(31,78,122,.07);
	border-bottom: 1px solid var(--vgt-borde);
	position: sticky;
	top: 0;
	z-index: 50;
}
.vgt-topbar-left { display: flex; align-items: center; gap: 16px; }
.vgt-topbar-logo { height: 50px; width: auto; }
.vgt-topbar-titles { display: flex; flex-direction: column; line-height: 1.25; }
.vgt-topbar-titles strong { font-size: 20px; font-weight: 800; color: var(--vgt-azul-profundo); }
.vgt-topbar-titles span { font-size: 13px; color: var(--vgt-gris-sec); font-weight: 500; }
.vgt-topbar-right { display: flex; align-items: center; gap: 18px; }
.vgt-user { text-align: right; line-height: 1.35; }
.vgt-user-name { display: block; font-weight: 700; font-size: 14px; color: var(--vgt-gris-texto); }
.vgt-user-role { display: block; font-size: 12px; color: var(--vgt-gris-sec); }

/* ============================================================
   MAIN + TARJETAS
   ============================================================ */
.vgt-main { max-width: 1220px; margin: 0 auto; padding: 28px 24px 64px; }

.vgt-card {
	background: #fff;
	border: 1px solid var(--vgt-borde);
	border-radius: var(--vgt-r-lg);
	box-shadow: var(--vgt-sombra);
	padding: 24px 26px;
	margin-bottom: 24px;
}
.vgt-card-title {
	margin: 0 0 18px !important;
	font-size: 18px;
	font-weight: 800;
	color: var(--vgt-azul-profundo);
}

/* ============================================================
   KPIs
   ============================================================ */
.vgt-kpis {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
	margin-bottom: 24px;
}
.vgt-kpis-3 { grid-template-columns: repeat(3, 1fr); }
.vgt-kpis-4 { grid-template-columns: repeat(4, 1fr); }

.vgt-kpi {
	position: relative;
	background: #fff;
	border: 1px solid var(--vgt-borde);
	border-radius: var(--vgt-r-md);
	box-shadow: var(--vgt-sombra-sm);
	padding: 22px 24px 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	overflow: hidden;
	transition: transform .14s ease, box-shadow .14s ease;
}
.vgt-kpi::before {
	content: "";
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 6px;
	background: var(--vgt-azul-cielo);
}
.vgt-kpi:hover { transform: translateY(-2px); box-shadow: var(--vgt-sombra); }
.vgt-kpi-num {
	font-family: var(--vgt-font-data);
	font-size: 34px;
	font-weight: 700;
	color: var(--vgt-gris-texto);
	line-height: 1.05;
}
.vgt-kpi-lbl { font-size: 13px; color: var(--vgt-gris-sec); font-weight: 500; }

.vgt-kpi-naranja::before { background: var(--vgt-naranja); }
.vgt-kpi-verde::before   { background: var(--vgt-verde); }
.vgt-kpi-azul::before    { background: var(--vgt-azul-medio); }
.vgt-kpi-morado::before  { background: var(--vgt-morado); }
.vgt-kpi-gris::before    { background: var(--vgt-gris-sec); }

/* KPI destacado de recaudo (verde lleno) */
.vgt-kpi-recaudo {
	background: var(--vgt-grad-verde);
	border-color: transparent;
	box-shadow: 0 12px 28px rgba(47,177,124,.28);
}
.vgt-kpi-recaudo::before { display: none; }
.vgt-kpi-recaudo .vgt-kpi-num { color: #fff; font-size: 32px; }
.vgt-kpi-recaudo .vgt-kpi-lbl { color: rgba(255,255,255,.92); font-weight: 600; }

/* ============================================================
   TOOLBAR
   ============================================================ */
.vgt-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}
.vgt-toolbar .vgt-card-title { margin: 0 !important; }
.vgt-toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   TABLAS
   ============================================================ */
.vgt-table-wrap {
	overflow-x: auto;
	border-radius: var(--vgt-r-md);
	border: 1px solid var(--vgt-borde);
}
.vgt-table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; }
.vgt-table thead th {
	text-align: left;
	padding: 14px 16px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .5px;
	color: var(--vgt-gris-sec);
	background: var(--vgt-azul-niebla);
	border-bottom: 1px solid var(--vgt-borde);
	font-family: var(--vgt-font-data);
	font-weight: 600;
	white-space: nowrap;
}
.vgt-table tbody td {
	padding: 14px 16px;
	border-bottom: 1px solid #EFF4F9;
	vertical-align: middle;
	color: var(--vgt-gris-texto);
}
.vgt-table tbody tr:last-child td { border-bottom: none; }
.vgt-table tbody tr { transition: background .12s ease; }
.vgt-table tbody tr:hover { background: #F5FAFE; }
.vgt-empty { text-align: center; color: var(--vgt-gris-sec); padding: 30px 0; font-style: italic; }

/* ============================================================
   CAMPOS DE FORMULARIO
   ============================================================ */
.vgt-field { display: flex; flex-direction: column; gap: 7px; }
.vgt-field > span {
	font-size: 13px;
	font-weight: 600;
	color: var(--vgt-gris-texto);
	font-family: var(--vgt-font-data);
}
.vgt-field input,
.vgt-field select,
.vgt-field textarea {
	font-family: var(--vgt-font) !important;
	font-size: 15px !important;
	padding: 12px 14px !important;
	border: 1.5px solid var(--vgt-borde) !important;
	border-radius: var(--vgt-r-sm) !important;
	background: #fff !important;
	color: var(--vgt-gris-texto) !important;
	width: 100%;
	transition: border-color .14s ease, box-shadow .14s ease;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none !important;
}
.vgt-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232C6BA8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	padding-right: 38px !important;
}
.vgt-field input:focus,
.vgt-field select:focus,
.vgt-field textarea:focus {
	outline: none;
	border-color: var(--vgt-azul-medio) !important;
	box-shadow: 0 0 0 3px rgba(92,155,209,.22) !important;
}
.vgt-field input::placeholder { color: #9DB0C0; }
.vgt-hint { font-size: 12px; color: var(--vgt-verde); font-weight: 600; min-height: 14px; }
.vgt-check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--vgt-gris-sec); cursor: pointer; }
.vgt-check input { width: auto !important; accent-color: var(--vgt-azul-medio); }

/* ============================================================
   MODALES
   ============================================================ */
.vgt-modal { position: fixed; inset: 0; z-index: 99999; display: none; }
.vgt-modal.is-open { display: block; }
.vgt-modal-backdrop {
	position: absolute; inset: 0;
	background: rgba(20,52,82,.45);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}
.vgt-modal-box {
	position: relative;
	max-width: 760px;
	width: calc(100% - 36px);
	margin: 5vh auto;
	background: #fff;
	border-radius: var(--vgt-r-lg);
	box-shadow: 0 30px 70px rgba(15,45,75,.35);
	padding: 28px 30px;
	max-height: 90vh;
	overflow-y: auto;
	animation: vgt-pop .2s ease;
}
.vgt-modal-sm { max-width: 480px; }
@keyframes vgt-pop { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.vgt-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.vgt-modal-head h3 { margin: 0 !important; font-size: 21px; font-weight: 800; color: var(--vgt-azul-profundo); }
.vgt-modal-x {
	background: var(--vgt-azul-niebla) !important;
	border: none !important;
	color: var(--vgt-azul-profundo) !important;
	width: 38px; height: 38px;
	border-radius: 11px !important;
	font-size: 22px; cursor: pointer; line-height: 1;
	transition: background .12s ease;
}
.vgt-modal-x:hover { background: var(--vgt-azul-palido) !important; }
.vgt-modal-help { color: var(--vgt-gris-sec); font-size: 14px; margin: 0 0 16px; }

/* Form grid */
.vgt-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.vgt-col-2 { grid-column: span 2; }
.vgt-col-3 { grid-column: span 3; }
.vgt-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; }
.vgt-form-actions > div:last-child { display: flex; gap: 10px; }
.vgt-form-msg { font-size: 14px; font-weight: 600; min-height: 18px; }
.vgt-form-msg.ok { color: var(--vgt-verde); }
.vgt-form-msg.err { color: var(--vgt-rojo); }

/* Resumen de paciente */
.vgt-paciente-resumen {
	background: var(--vgt-grad-azul-suave);
	border: 1px solid var(--vgt-azul-palido);
	border-radius: var(--vgt-r-md);
	padding: 16px 20px;
	margin-bottom: 18px;
}
.vgt-paciente-resumen strong { color: var(--vgt-azul-profundo); font-size: 18px; }
.vgt-paciente-resumen .vgt-pr-meta { color: var(--vgt-gris-sec); font-size: 13px; margin-top: 4px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 820px) {
	.vgt-kpis, .vgt-kpis-3, .vgt-kpis-4 { grid-template-columns: 1fr 1fr; }
	.vgt-form-grid { grid-template-columns: 1fr 1fr; }
	.vgt-col-2, .vgt-col-3 { grid-column: span 2; }
	.vgt-topbar { padding: 12px 18px; }
}
@media (max-width: 540px) {
	.vgt-kpis, .vgt-kpis-3, .vgt-kpis-4, .vgt-form-grid { grid-template-columns: 1fr; }
	.vgt-col-2, .vgt-col-3 { grid-column: span 1; }
	.vgt-main { padding: 20px 14px 48px; }
	.vgt-form-actions { flex-direction: column; align-items: stretch; }
	.vgt-form-actions > div:last-child { flex-direction: column; }
}
