/* Gestión de Expedientes — estilos (todo bajo .ge-app para no afectar al tema) */
.ge-app, .ge-app * { box-sizing: border-box; }
.ge-app {
	--ge-ind: #4338ca; --ge-ind-2: #4f46e5; --ge-ind-soft: #eef0ff;
	--ge-bg: #f0f2f7; --ge-card: #fff; --ge-tx: #111827; --ge-mut: #6b7280; --ge-line: #e5e7eb;
	--ge-dark: #111827; --ge-red: #ef4444;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ge-tx); background: var(--ge-bg); padding: 28px; border-radius: 12px; line-height: 1.4;
	font-size: 14px; position: relative; min-height: 70vh;
}
.ge-app.ge-in-admin { margin: 20px 20px 20px 0; }
.ge-app button, .ge-app input, .ge-app select, .ge-app textarea { font-family: inherit; font-size: 14px; }

/* Cabecera */
.ge-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ge-app h1.ge-title { margin: 0; padding: 0; font-size: 30px; font-weight: 900; letter-spacing: -.5px; color: #000; line-height: 1.1; }
.ge-subtitle { margin: 4px 0 0; color: var(--ge-mut); font-size: 14px; }
.ge-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.ge-btn {
	display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border: 1px solid var(--ge-line);
	background: #fff; color: var(--ge-tx); font-weight: 700; padding: 11px 20px; border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: transform .08s, box-shadow .15s, background .15s;
}
.ge-btn:hover { box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.ge-btn:active { transform: translateY(1px); }
.ge-btn:disabled { opacity: .55; cursor: not-allowed; }
.ge-btn .ge-ico { color: var(--ge-ind-2); display: inline-flex; }
.ge-btn-primary { background: var(--ge-ind); border-color: var(--ge-ind); color: #fff; box-shadow: 0 6px 16px rgba(67,56,202,.35); }
.ge-btn-primary:hover { background: #3730a3; }
.ge-btn-primary .ge-ico { color: #fff; }
.ge-btn-gray { background: #f3f4f6; border-color: #f3f4f6; box-shadow: none; color: #374151; }
.ge-btn-danger { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.45); color: #f87171; box-shadow: none; justify-content: center; width: 100%; }
.ge-btn-danger .ge-ico { color: #f87171; }
.ge-btn-block { width: 100%; justify-content: center; }
.ge-btn-sm { padding: 6px 12px; border-radius: 8px; font-size: 13px; box-shadow: none; }

/* Tarjetas y formularios */
.ge-card { background: var(--ge-card); border: 1px solid #eceef3; border-radius: 18px; padding: 22px; box-shadow: 0 1px 3px rgba(17,24,39,.04); }
.ge-card h3 { margin: 0; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.ge-card h3 .ge-ico { color: var(--ge-ind-2); display: inline-flex; }
.ge-lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #9ca3af; margin-bottom: 6px; }
.ge-field > label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: #111; }
.ge-input, .ge-select, .ge-textarea {
	width: 100%; border: 1px solid var(--ge-line); background: #fff; color: var(--ge-tx); border-radius: 12px;
	padding: 11px 14px; outline: none; min-height: 44px; box-shadow: none;
}
.ge-select { background: #fafafb; appearance: auto; }
.ge-textarea { min-height: 70px; resize: vertical; }
.ge-input:focus, .ge-select:focus, .ge-textarea:focus { border-color: var(--ge-ind-2); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.ge-input::placeholder, .ge-textarea::placeholder { color: #9ca3af; }

.ge-quick { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 26px; }
.ge-quick .ge-select { width: 370px; max-width: 100%; }
.ge-iconbtn { border: 0; background: transparent; cursor: pointer; color: #6b7280; padding: 8px; border-radius: 8px; display: inline-flex; }
.ge-iconbtn:hover { background: rgba(0,0,0,.06); color: #111; }

/* Estado vacío */
.ge-empty { border: 2px dashed #dfe3ec; border-radius: 22px; background: #fff; text-align: center; padding: 90px 20px; }
.ge-empty-ico { width: 92px; height: 92px; border-radius: 50%; background: var(--ge-ind-soft); color: #818cf8; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.ge-empty-ico svg { width: 36px; height: 36px; }
.ge-empty h2 { margin: 0 0 8px; font-size: 21px; font-weight: 800; }
.ge-empty p { margin: 0 auto; max-width: 340px; color: #9ca3af; }

/* Ficha */
.ge-layout { display: grid; grid-template-columns: 385px minmax(0, 1fr); gap: 26px; align-items: start; }
.ge-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.ge-ficha { text-align: left; }
.ge-ficha-top { text-align: center; padding-bottom: 14px; border-bottom: 1px solid #eef0f4; margin-bottom: 8px; }
.ge-nombre { font-size: 19px; font-weight: 800; margin: 0; }
.ge-cod { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #3730a3; margin-top: 2px; }
.ge-dni { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.ge-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; }
.ge-fila span:first-child { color: #9ca3af; }
.ge-fila span:last-child { font-weight: 800; text-align: right; }
.ge-fila.ge-split { border-top: 1px solid #eef0f4; margin-top: 6px; padding-top: 14px; align-items: flex-start; }
.ge-fila.ge-split > div { display: flex; flex-direction: column; gap: 2px; }
.ge-fila.ge-split small { color: #9ca3af; font-size: 11px; }
.ge-fila.ge-split b { font-weight: 800; }
.ge-fila.ge-split > div:last-child { text-align: right; }

.ge-pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; padding: 4px 11px; border-radius: 999px; background: #dcfce7; color: #166534; }
.ge-st-pendiente { background: #fef3c7; color: #92400e; }
.ge-st-resuelto { background: #dbeafe; color: #1e40af; }
.ge-st-archivado { background: #e5e7eb; color: #374151; }

/* Documentos */
.ge-doc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ge-add { border: 0; background: #f3f4f6; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 18px; color: #4b5563; }
.ge-add:hover { background: #e5e7eb; }
.ge-docs { display: flex; flex-direction: column; gap: 8px; }
.ge-doc { display: flex; align-items: center; gap: 10px; background: #fafafb; border: 1px solid #f1f2f6; border-radius: 10px; padding: 10px 12px; font-size: 12px; font-weight: 700; }
.ge-doc .ge-ico { color: #818cf8; display: inline-flex; }
.ge-doc a { color: inherit; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-doc a:hover { color: var(--ge-ind); text-decoration: underline; }
.ge-doc small { color: #9ca3af; font-weight: 500; font-size: 10px; }
.ge-doc .ge-iconbtn { padding: 2px; color: #9ca3af; }
.ge-none { color: #9ca3af; font-size: 13px; padding: 6px 2px; }

/* Panel de acciones */
.ge-dark { background: var(--ge-dark); color: #fff; border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.ge-dark h3 { margin: 0; font-size: 17px; font-weight: 800; color: #fff; display: flex; gap: 8px; align-items: center; }
.ge-dark .ge-lbl { color: #9ca3af; font-size: 10px; margin-bottom: 4px; }
.ge-dark .ge-select { background: #1f2937; color: #fff; border-color: #374151; }
.ge-dark .ge-select:focus { border-color: #6366f1; }

/* Resumen y bitácora */
.ge-resumen { margin-top: 14px; white-space: pre-wrap; font-style: italic; color: #1f2937; word-break: break-word; }
.ge-nota-add { display: flex; gap: 12px; margin: 16px 0 18px; }
.ge-nota-add .ge-input { flex: 1; }
.ge-notas { display: flex; flex-direction: column; gap: 16px; }
.ge-nota { display: flex; gap: 12px; align-items: flex-start; border-left: 3px solid #6366f1; padding-left: 12px; }
.ge-nota-body { flex: 1; min-width: 0; }
.ge-nota-fecha { font-size: 11px; font-weight: 700; color: #4f46e5; }
.ge-nota-fecha em { font-style: normal; color: #9ca3af; font-weight: 500; }
.ge-nota-txt { margin-top: 1px; word-break: break-word; white-space: pre-wrap; }
.ge-nota .ge-iconbtn { color: #cbd0d9; padding: 2px; }
.ge-nota .ge-iconbtn:hover { color: var(--ge-red); background: transparent; }

/* Modales */
.ge-ov {
	position: fixed; inset: 0; z-index: 100000; background: rgba(17,24,39,.45); backdrop-filter: blur(5px);
	display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto;
}
.ge-modal { position: relative; background: #fff; border-radius: 22px; padding: 30px 32px; width: 100%; max-width: 760px; box-shadow: 0 25px 60px rgba(0,0,0,.3); }
.ge-modal.ge-wide { max-width: 1080px; }
.ge-modal h2 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.3px; }
.ge-modal .ge-sub { margin: 2px 0 18px; color: var(--ge-mut); font-size: 13px; }
.ge-x { position: absolute; top: 22px; right: 24px; border: 0; background: transparent; cursor: pointer; color: #6b7280; padding: 4px; border-radius: 8px; display: inline-flex; }
.ge-x:hover { background: #f3f4f6; color: #111; }

.ge-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ge-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ge-file { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ge-file-btn { background: #e0e7ff; color: #3730a3; font-weight: 700; padding: 10px 18px; border-radius: 999px; cursor: pointer; border: 0; }
.ge-file-txt { color: #6b7280; font-size: 13px; }
.ge-id-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; margin-bottom: 22px; }
.ge-id-box { background: #f9fafb; border: 1px solid var(--ge-line); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: #9ca3af; padding: 6px; text-align: center; }
.ge-form-btns { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; }
.ge-form-btns .ge-btn { justify-content: center; padding: 15px; border-radius: 14px; }

/* Tablas */
.ge-filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ge-tablewrap { overflow-x: auto; }
.ge-table { width: 100%; border-collapse: collapse; }
.ge-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #9ca3af; padding: 14px 14px; user-select: none; white-space: nowrap; }
.ge-table th.ge-sort { cursor: pointer; }
.ge-table th.ge-sort:hover { color: #4b5563; }
.ge-table th .ge-arr { float: right; font-size: 9px; margin-left: 10px; opacity: .6; }
.ge-table td { padding: 14px; border-top: 1px solid #f3f4f6; vertical-align: middle; }
.ge-table tbody tr.ge-click { cursor: pointer; }
.ge-table tbody tr.ge-click:hover { background: #f5f6fb; }
.ge-table .ge-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; font-weight: 700; color: #3730a3; }
.ge-table .ge-nm { font-weight: 800; }
.ge-table .ge-mut { color: #6b7280; }
.ge-table td .ge-input, .ge-table td .ge-select { min-height: 38px; padding: 7px 10px; }
.ge-table .ge-acc { white-space: nowrap; text-align: right; }
.ge-table .ge-acc .ge-btn { margin-left: 6px; }

/* Catálogos */
.ge-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid #eef0f4; margin-bottom: 18px; }
.ge-tab { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; color: #6b7280; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.ge-tab:hover { color: #111; }
.ge-tab.on { color: var(--ge-ind); border-bottom-color: var(--ge-ind-2); }
.ge-addrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; background: #f9fafb; border: 1px solid #eef0f4; border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.ge-addrow .ge-input, .ge-addrow .ge-select { flex: 1; min-width: 150px; width: auto; }
.ge-addrow .ge-btn { padding: 8px 18px; }
.ge-filter-one { margin-bottom: 8px; }

/* Aviso */
.ge-toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 100001; background: #262626; color: #fff; padding: 14px 26px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3); max-width: 90vw; }
.ge-toast.ge-error { background: #b91c1c; }
.ge-loading { text-align: center; color: #9ca3af; padding: 80px 0; }

@media (max-width: 900px) {
	.ge-layout { grid-template-columns: 1fr; }
	.ge-filters { grid-template-columns: 1fr 1fr; }
	.ge-grid2, .ge-grid3 { grid-template-columns: 1fr; }
	.ge-modal { padding: 24px 18px; }
	.ge-app { padding: 16px; }
}

/* ---------- Acceso (login en el front) ---------- */
.ge-login { max-width: 420px; margin: 30px auto; background: #fff; border: 1px solid #eceef3; border-radius: 18px; padding: 30px; box-shadow: 0 6px 24px rgba(17,24,39,.08); }
.ge-login h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; }
.ge-login p { color: var(--ge-mut); margin: 0 0 16px; }
.ge-login label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.ge-login input[type=text], .ge-login input[type=password] { width: 100%; border: 1px solid var(--ge-line); border-radius: 12px; padding: 11px 14px; min-height: 44px; margin-bottom: 14px; }
.ge-login input[type=submit] { width: 100%; background: var(--ge-ind); color: #fff; border: 0; border-radius: 12px; padding: 13px; font-weight: 700; cursor: pointer; }
.ge-login input[type=submit]:hover { background: #3730a3; color: #fff; }
.ge-login .login-remember label { font-weight: 500; }

/* ---------- Compatibilidad con temas / Elementor (Hello, etc.) ---------- */
.ge-app h1, .ge-app h2, .ge-app h3 { font-family: inherit; text-transform: none; letter-spacing: normal; }
.ge-app p { margin-top: 0; }
.ge-app button { text-transform: none; letter-spacing: normal; line-height: 1.2; }

.ge-app .ge-input, .ge-app .ge-select, .ge-app .ge-textarea {
	width: 100%; border: 1px solid var(--ge-line); background-color: #fff; color: var(--ge-tx); border-radius: 12px;
	padding: 11px 14px; min-height: 44px; box-shadow: none; font-size: 14px; height: auto; margin: 0;
}
.ge-app .ge-select { background-color: #fafafb; }
.ge-app .ge-textarea { min-height: 70px; }
.ge-app .ge-input:focus, .ge-app .ge-select:focus, .ge-app .ge-textarea:focus { border-color: var(--ge-ind-2); box-shadow: 0 0 0 3px rgba(79,70,229,.15); outline: none; }
.ge-app .ge-dark .ge-select { background-color: #1f2937; color: #fff; border-color: #374151; }
.ge-app .ge-addrow .ge-input, .ge-app .ge-addrow .ge-select { width: auto; flex: 1; min-width: 150px; }
.ge-app .ge-table td .ge-input, .ge-app .ge-table td .ge-select { min-height: 38px; padding: 7px 10px; }

.ge-app button.ge-btn { background: #fff; color: var(--ge-tx); border: 1px solid var(--ge-line); border-radius: 12px; }
.ge-app button.ge-btn:hover, .ge-app button.ge-btn:focus { background: #fff; color: var(--ge-tx); border-color: var(--ge-line); }
.ge-app button.ge-btn-primary { background: var(--ge-ind); color: #fff; border-color: var(--ge-ind); }
.ge-app button.ge-btn-primary:hover, .ge-app button.ge-btn-primary:focus { background: #3730a3; color: #fff; border-color: #3730a3; }
.ge-app button.ge-btn-gray { background: #f3f4f6; color: #374151; border-color: #f3f4f6; }
.ge-app button.ge-btn-gray:hover, .ge-app button.ge-btn-gray:focus { background: #e5e7eb; color: #374151; border-color: #e5e7eb; }
.ge-app button.ge-btn-danger { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.45); }
.ge-app button.ge-btn-danger:hover, .ge-app button.ge-btn-danger:focus { background: rgba(239,68,68,.22); color: #fca5a5; border-color: rgba(239,68,68,.6); }
.ge-app button.ge-btn-sm { border-radius: 8px; }
.ge-app button.ge-iconbtn, .ge-app button.ge-x { background: transparent; border: 0; color: #6b7280; padding: 6px; }
.ge-app button.ge-iconbtn:hover, .ge-app button.ge-iconbtn:focus, .ge-app button.ge-x:hover, .ge-app button.ge-x:focus { background: rgba(0,0,0,.06); color: #111; }
.ge-app .ge-nota button.ge-iconbtn { color: #cbd0d9; padding: 2px; }
.ge-app .ge-nota button.ge-iconbtn:hover { background: transparent; color: var(--ge-red); }
.ge-app .ge-doc button.ge-iconbtn { padding: 2px; color: #9ca3af; }
.ge-app button.ge-add { background: #f3f4f6; color: #4b5563; border: 0; border-radius: 10px; }
.ge-app button.ge-add:hover, .ge-app button.ge-add:focus { background: #e5e7eb; color: #111; }
.ge-app button.ge-file-btn { background: #e0e7ff; color: #3730a3; border: 0; }
.ge-app button.ge-file-btn:hover, .ge-app button.ge-file-btn:focus { background: #c7d2fe; color: #3730a3; }
.ge-app button.ge-tab { background: transparent; color: #6b7280; border: 0; border-bottom: 3px solid transparent; border-radius: 0; }
.ge-app button.ge-tab:hover, .ge-app button.ge-tab:focus { background: transparent; color: #111; }
.ge-app button.ge-tab.on { color: var(--ge-ind); border-bottom-color: var(--ge-ind-2); }

.ge-app .ge-table { margin: 0; border: 0; font-size: 14px; background: transparent; }
.ge-app .ge-table th, .ge-app .ge-table td { border: 0; background: transparent; }
.ge-app .ge-table td { border-top: 1px solid #f3f4f6; }
.ge-app .ge-table tbody > tr > td, .ge-app .ge-table tbody > tr > th { background: transparent; }
.ge-app .ge-table tbody > tr.ge-click:hover > td { background: #f5f6fb; }
.ge-app .ge-table thead th { border-bottom: 0; color: #9ca3af; }
.ge-app label { margin-bottom: 0; }
