/* Stionex Audit – portal de clientes
   Paleta: tinta #13303a · verificación #0e6d74 · papel #ffffff · lavado #f3f6f6 · línea #d4dee0 */
.stx-portal {
	--stx-ink: #13303a;
	--stx-teal: #0e6d74;
	--stx-teal-dark: #0a5257;
	--stx-paper: #ffffff;
	--stx-wash: #f3f6f6;
	--stx-line: #d4dee0;
	--stx-muted: #5b7178;
	--stx-ok: #1a6b4f;
	--stx-off: #8a2424;
	--stx-warn: #7a4d00;
	font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	color: var(--stx-ink);
	max-width: 980px;
	margin: 0 auto;
	padding: 8px 0 48px;
	box-sizing: border-box;
}
.stx-portal *, .stx-portal *::before, .stx-portal *::after { box-sizing: border-box; }
.stx-portal h1, .stx-portal h2 { color: var(--stx-ink); font-family: inherit; letter-spacing: -0.01em; }
.stx-portal a { color: var(--stx-teal); }
.stx-portal a:hover { color: var(--stx-teal-dark); }
.stx-portal :focus-visible { outline: 3px solid var(--stx-teal); outline-offset: 2px; }

/* Encabezado: bloque de control del documento */
.stx-head {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px;
	padding: 20px 0 18px;
	border-bottom: 3px double var(--stx-line);
}
.stx-head__id { display: flex; align-items: center; gap: 18px; min-width: 0; }
.stx-head__id .stx-logo { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--stx-line); padding: 6px; background: var(--stx-paper); }
.stx-head__name { margin: 0; font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.15; }
.stx-head__meta { margin: 6px 0 0; color: var(--stx-muted); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.stx-head__user { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.9rem; gap: 2px; }
.stx-head__role { color: var(--stx-muted); }

/* Pestañas */
.stx-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--stx-line); margin-bottom: 24px; }
.stx-tabs a { padding: 12px 0 10px; text-decoration: none; color: var(--stx-muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.stx-tabs a[aria-current="page"] { color: var(--stx-ink); border-bottom-color: var(--stx-teal); }

/* Secciones */
.stx-section { padding: 4px 0 28px; }
.stx-section + .stx-section { border-top: 1px solid var(--stx-line); padding-top: 24px; }
.stx-section h2 { font-size: 1.15rem; margin: 0 0 12px; }
.stx-empty-line { color: var(--stx-muted); margin: 0; max-width: 62ch; }
.stx-help { color: var(--stx-muted); margin: -4px 0 16px; max-width: 62ch; }

/* Registro de normas tipo libro de control */
.stx-ledger { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; margin: 0; border-top: 1px solid var(--stx-line); }
.stx-ledger dt, .stx-ledger dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--stx-line); }
.stx-ledger dt { font-weight: 700; font-variant-numeric: tabular-nums; }
.stx-ledger dd { display: flex; flex-direction: column; gap: 2px; }
.stx-ledger__scope { color: var(--stx-muted); font-size: 0.9rem; }

/* Tablas */
.stx-table-wrap { overflow-x: auto; }
.stx-portal .stx-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.stx-portal .stx-table th { text-align: left; font-weight: 600; color: var(--stx-muted); font-size: 0.85rem; padding: 8px 12px 8px 0; border-bottom: 2px solid var(--stx-line); }
.stx-portal .stx-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--stx-line); vertical-align: top; }
.stx-portal .stx-table small { color: var(--stx-muted); }
.stx-state { font-weight: 600; font-size: 0.85rem; }
.stx-state--on { color: var(--stx-ok); }
.stx-state--off { color: var(--stx-off); }

/* Formularios */
.stx-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-items: end; }
.stx-form label, .stx-login label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.stx-portal input[type=text], .stx-portal input[type=email], .stx-portal input[type=password] {
	width: 100%; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--stx-ink);
	border: 1px solid #a9b9bd; border-radius: 3px; background: var(--stx-paper);
}
.stx-portal input:focus { border-color: var(--stx-teal); outline: 2px solid var(--stx-teal); outline-offset: 0; }
.stx-button, .stx-portal .button-primary, .stx-portal #wp-submit {
	display: inline-block; padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer;
	color: #fff; background: var(--stx-teal); border: 0; border-radius: 3px; text-decoration: none;
}
.stx-button:hover, .stx-portal #wp-submit:hover { background: var(--stx-teal-dark); color: #fff; }
.stx-form .stx-button { grid-column: 1 / -1; justify-self: start; }
.stx-link { background: none; border: 0; padding: 0; font: inherit; font-size: 0.9rem; color: var(--stx-teal); text-decoration: underline; cursor: pointer; }
.stx-inline { margin: 0; }

/* Mensajes */
.stx-flash { padding: 12px 16px; margin: 0 0 20px; border-left: 4px solid var(--stx-ok); background: #e9f4f0; }
.stx-flash--error { border-color: var(--stx-off); background: #fbecec; }
.stx-flash--warning { border-color: #c48a00; background: #fcf3e1; }
.stx-notice { padding: 24px; background: var(--stx-wash); border: 1px solid var(--stx-line); }

/* Ingreso */
.stx-login { max-width: 420px; margin: 32px auto; padding: 32px; background: var(--stx-paper); border: 1px solid var(--stx-line); border-top: 4px solid var(--stx-teal); }
.stx-login__title { margin: 0 0 6px; font-size: 1.6rem; }
.stx-login__lead { color: var(--stx-muted); margin: 0 0 20px; font-size: 0.95rem; }
.stx-login form p { margin: 0 0 14px; }
.stx-login .login-remember label { flex-direction: row; align-items: center; font-weight: 400; }

.stx-portal .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 720px) {
	.stx-head__user { align-items: flex-start; }
	.stx-form { grid-template-columns: 1fr; }
	.stx-ledger { grid-template-columns: 1fr; }
	.stx-ledger dt { border-bottom: 0; padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { .stx-portal * { transition: none !important; } }

/* Ingreso, recuperación y nueva contraseña (0.1.1) */
.stx-login__form { display: flex; flex-direction: column; gap: 14px; margin: 0 0 16px; }
.stx-login__form .stx-button { align-self: flex-start; }
.stx-login .stx-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.stx-login .stx-check input { width: auto; margin: 0; }
.stx-login__alt { margin: 0; font-size: 0.95rem; }
.stx-login .stx-flash { margin-bottom: 18px; }

/* ---------- Auditorías, evidencias y acciones (0.2) ---------- */
.stx-tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.stx-todo { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--stx-line); }
.stx-todo li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--stx-line); }
.stx-todo li a { font-weight: 600; }
.stx-todo__kind { grid-column: 1; color: var(--stx-muted); font-size: 0.85rem; }
.stx-todo .stx-due { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.stx-due { font-size: 0.85rem; color: var(--stx-muted); white-space: nowrap; }
.stx-task__meta .stx-due { margin-left: 8px; }
.stx-due--late { color: var(--stx-off); font-weight: 600; }

.stx-task { border: 1px solid var(--stx-line); border-left: 4px solid var(--stx-line); padding: 16px 18px; margin: 0 0 16px; background: var(--stx-paper); }
.stx-task--pending, .stx-task--open { border-left-color: var(--stx-teal); }
.stx-task--rejected { border-left-color: #c48a00; }
.stx-task--submitted, .stx-task--pending_verification, .stx-task--in_progress { border-left-color: #6b8a91; }
.stx-task--accepted, .stx-task--closed { border-left-color: var(--stx-ok); opacity: .9; }
.stx-task__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.stx-task__head h3 { margin: 0; font-size: 1.05rem; }
.stx-task__status { font-size: 0.85rem; font-weight: 600; color: var(--stx-muted); white-space: nowrap; }
.stx-task__meta { color: var(--stx-muted); font-size: 0.9rem; margin: 4px 0 10px; }
.stx-task__form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.stx-task__form label, .stx-file { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 0.9rem; }
.stx-task__form small, .stx-file small { font-weight: 400; color: var(--stx-muted); }
.stx-portal textarea { width: 100%; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--stx-ink); border: 1px solid #a9b9bd; border-radius: 3px; background: var(--stx-paper); }
.stx-portal textarea:focus { border-color: var(--stx-teal); outline: 2px solid var(--stx-teal); outline-offset: 0; }
.stx-portal textarea:disabled { background: var(--stx-wash); color: var(--stx-ink); }
.stx-file input[type=file] { font-weight: 400; }
.stx-task__buttons { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.stx-quote { margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--stx-line); background: var(--stx-wash); }
.stx-files { list-style: none; margin: 8px 0; padding: 0; }
.stx-files li { padding: 4px 0; }
.stx-files li::before { content: "↓ "; color: var(--stx-teal); }
.stx-files__size { color: var(--stx-muted); font-size: 0.85rem; }
.stx-findings { list-style: none; margin: 0; padding: 0; }
.stx-findings__item { border-left: 4px solid var(--stx-line); padding: 8px 14px; margin: 0 0 12px; }
.stx-findings__item p { margin: 6px 0; }
.stx-findings__item--nc_major { border-left-color: var(--stx-off); }
.stx-findings__item--nc_minor { border-left-color: #c48a00; }
.stx-findings__item--strength { border-left-color: var(--stx-ok); }
.stx-findings__item--observation, .stx-findings__item--improvement { border-left-color: var(--stx-teal); }
