/* RYR Portal — componentes compartidos (panel y portales) */
:root {
	--ryr-navy: #242F65;
	--ryr-blue: #4266F5;
	--ryr-blue-soft: #EEF2FF;
	--ryr-ink: #1F2440;
	--ryr-muted: #6B7290;
	--ryr-line: #E6E9F2;
	--ryr-bg: #F6F7FB;
	--ryr-card: #FFFFFF;
	--ryr-ok: #12805C;
	--ryr-ok-bg: #E6F6EF;
	--ryr-warn: #9A6200;
	--ryr-warn-bg: #FFF4DB;
	--ryr-danger: #B42318;
	--ryr-danger-bg: #FDECEA;
	--ryr-radius: 12px;
	--ryr-shadow: 0 1px 2px rgba(20, 30, 70, .05), 0 6px 20px rgba(20, 30, 70, .06);
}

.ryr-wrap, .ryr-portal { color: var(--ryr-ink); font-size: 14px; line-height: 1.5; }
.ryr-wrap *, .ryr-portal * { box-sizing: border-box; }

/* Botones */
.ryr-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 38px; padding: 8px 16px; border-radius: 9px; border: 1.5px solid transparent;
	font: 600 14px/1.2 inherit; text-decoration: none !important; cursor: pointer; white-space: nowrap;
	transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.ryr-btn--primary { background: var(--ryr-blue); border-color: var(--ryr-blue); color: #fff !important; }
.ryr-btn--primary:hover { background: var(--ryr-navy); border-color: var(--ryr-navy); }
.ryr-btn--ghost { background: #fff; border-color: var(--ryr-line); color: var(--ryr-navy) !important; }
.ryr-btn--ghost:hover { border-color: var(--ryr-blue); color: var(--ryr-blue) !important; background: var(--ryr-blue-soft); }
.ryr-btn--danger { background: #fff; border-color: #F3C7C2; color: var(--ryr-danger) !important; }
.ryr-btn--danger:hover { background: var(--ryr-danger-bg); border-color: var(--ryr-danger); }
.ryr-btn--sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.ryr-btn.is-loading { opacity: .6; pointer-events: none; }
.ryr-btn:disabled { opacity: .55; cursor: not-allowed; }
.ryr-btn:focus-visible { outline: 3px solid rgba(66, 102, 245, .35); outline-offset: 2px; }
.ryr-inline { display: inline; margin: 0; }
.ryr-link { color: var(--ryr-blue); font-weight: 600; text-decoration: none; }
.ryr-link:hover { text-decoration: underline; }

/* Tarjetas */
.ryr-card {
	background: var(--ryr-card); border: 1px solid var(--ryr-line); border-radius: var(--ryr-radius);
	box-shadow: var(--ryr-shadow); padding: 20px 22px; margin: 0 0 18px;
}
.ryr-card h2, .ryr-card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--ryr-navy); }
.ryr-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ryr-card__head h2, .ryr-card__head h3 { margin: 0; }

/* Estadísticas */
.ryr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 18px; }
.ryr-stat {
	display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: #fff;
	border: 1px solid var(--ryr-line); border-radius: var(--ryr-radius); box-shadow: var(--ryr-shadow);
	text-decoration: none !important; color: inherit; transition: border-color .15s, transform .15s;
}
a.ryr-stat:hover { border-color: var(--ryr-blue); transform: translateY(-1px); }
.ryr-stat span { color: var(--ryr-muted); font-size: 13px; }
.ryr-stat strong { font-size: 28px; line-height: 1.1; color: var(--ryr-navy); font-weight: 700; }
.ryr-stat small { color: var(--ryr-muted); font-size: 12px; }
.ryr-stat--accent { background: linear-gradient(135deg, var(--ryr-navy), #34408A); border-color: transparent; }
.ryr-stat--accent span, .ryr-stat--accent small { color: rgba(255, 255, 255, .75); }
.ryr-stat--accent strong { color: #fff; }

/* Tablas */
.ryr-table-wrap { overflow-x: auto; }
.ryr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ryr-table th {
	text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
	color: var(--ryr-muted); padding: 10px 12px; border-bottom: 1px solid var(--ryr-line); background: #FAFBFD; white-space: nowrap;
}
.ryr-table td { padding: 12px; border-bottom: 1px solid var(--ryr-line); vertical-align: middle; }
.ryr-table tbody tr:hover td { background: #FAFBFF; }
.ryr-table tr:last-child td { border-bottom: 0; }
.ryr-table .num { text-align: right; white-space: nowrap; }
.ryr-table .pos { color: var(--ryr-ok); font-weight: 600; }
.ryr-table .neg { color: var(--ryr-danger); font-weight: 600; }
.ryr-table a { color: var(--ryr-navy); text-decoration: none; }
.ryr-table a:hover { color: var(--ryr-blue); }
.ryr-table a.ryr-btn--primary { color: #fff; }
.ryr-table .strong { font-weight: 600; }
.ryr-table--compact td { padding: 9px 8px; }
.ryr-table tr.is-inactive td { opacity: .55; }
.ryr-table .muted, .ryr-muted, .muted { color: var(--ryr-muted); }
.ryr-row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }

/* Estados */
.ryr-badge {
	display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
	background: #EEF0F6; color: #4A5170;
}
.ryr-badge--enviado { background: var(--ryr-blue-soft); color: #2F47B8; }
.ryr-badge--en_proceso { background: var(--ryr-warn-bg); color: var(--ryr-warn); }
.ryr-badge--completado { background: #EFE8FF; color: #5B3CC4; }
.ryr-badge--informe_listo { background: var(--ryr-ok-bg); color: var(--ryr-ok); }
.ryr-badge--anulada { background: var(--ryr-danger-bg); color: var(--ryr-danger); text-decoration: line-through; }
.ryr-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF0F6; color: #4A5170; white-space: nowrap; }
.ryr-pill--ok { background: var(--ryr-ok-bg); color: var(--ryr-ok); }
.ryr-pill--warn { background: var(--ryr-warn-bg); color: var(--ryr-warn); }
.ryr-pill--danger { background: var(--ryr-danger-bg); color: var(--ryr-danger); }

/* Formularios */
.ryr-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.ryr-field { display: block; margin: 0 0 14px; }
.ryr-field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ryr-navy); margin-bottom: 5px; }
.ryr-field input, .ryr-field select, .ryr-field textarea,
.ryr-filters input, .ryr-filters select {
	width: 100%; max-width: none; min-height: 40px; padding: 8px 12px; border: 1px solid #D5DAE7; border-radius: 9px;
	background: #fff; font: inherit; color: var(--ryr-ink); box-shadow: none;
}
.ryr-field textarea { min-height: 80px; }
.ryr-field input:focus, .ryr-field select:focus, .ryr-field textarea:focus,
.ryr-filters input:focus, .ryr-filters select:focus { border-color: var(--ryr-blue); outline: 0; box-shadow: 0 0 0 3px rgba(66, 102, 245, .15); }
.ryr-field input:user-invalid { border-color: var(--ryr-danger); }
.ryr-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.ryr-check input { margin-top: 3px; }
.ryr-check small { display: block; color: var(--ryr-muted); font-size: 12px; }
.ryr-help { color: var(--ryr-muted); font-size: 13px; margin: 6px 0 12px; }
.ryr-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ryr-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.ryr-filters input[type=search] { flex: 1 1 260px; width: auto; }
.ryr-filters select { flex: 0 1 220px; width: auto; }

/* Avisos */
.ryr-notice, .ryr-alert { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-weight: 500; border: 1px solid; }
.ryr-notice--success, .ryr-alert--success { background: var(--ryr-ok-bg); border-color: #B7E4CF; color: #0B5F44; }
.ryr-notice--error, .ryr-alert--error { background: var(--ryr-danger-bg); border-color: #F3C7C2; color: #8F1C13; }
.ryr-alert--info { background: var(--ryr-blue-soft); border-color: #CBD5FF; color: #26358C; }
.ryr-empty { color: var(--ryr-muted); padding: 18px 0; margin: 0; text-align: center; }

/* Archivos */
.ryr-files { list-style: none; margin: 0 0 14px; padding: 0; }
.ryr-files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--ryr-line); }
.ryr-files li:last-child { border-bottom: 0; }
.ryr-files a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ryr-navy); text-decoration: none; }
.ryr-files a:hover { color: var(--ryr-blue); }
.ryr-files small { color: var(--ryr-muted); flex: 1 1 auto; }
.ryr-files__icon { font-size: 10px; font-weight: 700; color: #fff; background: #D9473B; border-radius: 4px; padding: 3px 5px; }
.ryr-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; border: 1.5px dashed #CBD2E3; border-radius: 10px; background: #FAFBFD; }
.ryr-upload input[type=file] { flex: 1 1 200px; font-size: 13px; }

/* Usuarios */
.ryr-users { list-style: none; margin: 0 0 14px; padding: 0; }
.ryr-users li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ryr-line); }
.ryr-users li.is-inactive { opacity: .55; }
.ryr-users small { display: block; color: var(--ryr-muted); font-size: 12px; }

/* Desplegables */
.ryr-details > summary { cursor: pointer; list-style: none; font-weight: 700; color: var(--ryr-navy); }
.ryr-details > summary::-webkit-details-marker { display: none; }
.ryr-details > summary::after { content: "▾"; float: right; color: var(--ryr-muted); transition: transform .2s; }
.ryr-details[open] > summary { margin-bottom: 14px; }
.ryr-details[open] > summary::after { transform: rotate(180deg); }

.ryr-pages { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.ryr-pages a, .ryr-pages span { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 8px; border: 1px solid var(--ryr-line); text-decoration: none; color: var(--ryr-navy); background: #fff; }
.ryr-pages .current { background: var(--ryr-navy); color: #fff; border-color: var(--ryr-navy); }
.ryr-mt { margin-top: 16px; }
