.form-panel { max-width: 760px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 4px 20px;
}

.field { margin-bottom: 14px; display: flex; flex-direction: column; }
.field-label {
  font-size: .82rem; font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-bottom: 1.5px solid var(--muted);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: .9rem;
  font-family: var(--font);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-bottom-color: var(--primary); box-shadow: var(--glow); }
.input::placeholder { color: var(--muted); opacity: .7; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888888' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.textarea { resize: vertical; min-height: 74px; }

.file { padding: 7px; }
.file::file-selector-button {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 11px; margin-right: 10px;
  cursor: pointer; font-family: var(--font); font-size: .8rem;
}

.check-field {
  display: flex; align-items: center; gap: 9px;
  margin: 10px 0 14px; cursor: pointer; font-size: .88rem;
}
.check-input { width: 16px; height: 16px; accent-color: var(--primary); }

.field-error { color: var(--danger); font-size: .76rem; margin-top: 4px; }
.has-error .input { border-color: var(--danger); border-bottom-color: var(--danger); }

/* Marcadores de obligatorio / opcional y ayuda contextual */
.req { color: var(--danger); font-weight: 700; margin-left: 1px; }
.opt { color: var(--muted); font-weight: 400; font-size: .78rem; margin-left: 4px; }
.field-help { color: var(--muted); font-size: .78rem; margin-top: 5px; line-height: 1.4; }
.help-row { display: flex; justify-content: space-between; align-items: baseline;
            gap: 12px; flex-wrap: wrap; }
.char-count { color: var(--muted); font-size: .74rem; white-space: nowrap; }
.char-count.near { color: var(--warning); }
.char-count.over { color: var(--danger); }

/* ---------- Formulario de ticket: layout con panel de ayuda ---------- */
.ticket-form-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.ticket-form-layout .form-panel { max-width: none; }
.tips-panel { position: sticky; top: 78px; }
.tips-panel h3 { font-size: .92rem; }
.tips-list { margin: 0 0 16px; padding-left: 18px; font-size: .84rem; color: var(--muted); }
.tips-list li { margin-bottom: 7px; line-height: 1.45; }
.tips-list strong { color: var(--text); font-weight: 600; }
.tips-sla { border-top: 1px solid var(--border); padding-top: 12px; }
.tips-sla-title { display: block; font-size: .78rem; font-weight: 600; color: var(--muted);
                  text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.tips-sla-row { display: flex; justify-content: space-between; align-items: center;
                margin-bottom: 8px; font-size: .82rem; }

/* ---------- Selector de categoría en tarjetas ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.choice-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; text-align: center; background: var(--input-bg);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.choice-card:hover { border-color: var(--muted); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-ico { font-size: 1.35rem; line-height: 1; }
.choice-txt { font-size: .8rem; font-weight: 500; }
.choice-card:has(input:checked) {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: var(--glow); font-weight: 600;
}
.choice-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Variante en fila con descripción (usada en Solicitudes) */
.choice-grid-wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice-card-row { flex-direction: row; align-items: center; text-align: left; padding: 12px 14px; }
.choice-card-row .choice-ico { font-size: 1.5rem; }
.choice-col { display: flex; flex-direction: column; gap: 2px; }
.choice-desc { font-size: .74rem; font-weight: 400; color: var(--muted); line-height: 1.3; }

/* Lista de flujo numerada del panel de ayuda */
.flow-list { margin: 0 0 16px; padding-left: 20px; font-size: .84rem; color: var(--muted); }
.flow-list li { margin-bottom: 7px; line-height: 1.4; }
.flow-list strong { color: var(--text); font-weight: 600; }

/* ---------- Control segmentado de prioridad ---------- */
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg-option {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; text-align: center; background: var(--input-bg);
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.seg-option input { position: absolute; opacity: 0; pointer-events: none; }
.seg-label { font-size: .84rem; font-weight: 600; }
.seg-sla { font-size: .7rem; color: var(--muted); }
.seg-option:has(input:checked) { border-color: var(--primary); box-shadow: var(--glow); }
.seg-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.seg-option.prio-baja:has(input:checked)    { background: var(--b-muted-bg); border-color: var(--muted); }
.seg-option.prio-media:has(input:checked)   { background: var(--b-blue-bg); border-color: var(--blue); }
.seg-option.prio-alta:has(input:checked)    { background: var(--b-warning-bg); border-color: var(--warning); }
.seg-option.prio-critica:has(input:checked) { background: var(--b-danger-bg); border-color: var(--danger); }

.form-actions {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 10px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------- Filtros de listados (barra gris clara, en paralelo) ---------- */
.filters {
  display: flex; gap: 10px; flex-wrap: nowrap; align-items: center;
  margin-bottom: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.filters .field { margin-bottom: 0; }
.filters .clear-filters { color: var(--muted); }

/* Buscador ocupa el espacio disponible */
.search-box { position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.search-box .search-ico {
  position: absolute; left: 12px; font-size: .9rem; opacity: .55; pointer-events: none;
}
.search-box .input { width: 100%; min-width: 0; padding-left: 34px; }

/* Selects: ancho fijo, blancos para resaltar sobre la barra gris */
.filters .select {
  flex: 0 0 210px; width: 210px; min-width: 0;
  background-color: var(--input-bg);
  border: 1px solid var(--muted);
  font-weight: 500;
}
.filters .select:hover { border-color: var(--primary); }
.filters .btn { flex: 0 0 auto; white-space: nowrap; }
