/**
 * ISIS@MACH Instrument Requests - stili frontend (scientist e staff)
 * Shortcode [isismach_instrument_requests] e [isismach_instrument_requests_staff].
 * Design system (HANDOFF): font Helvetica/DejaVu Sans, floor 14px, radius max 3px,
 * palette #001f69 #3366ca #569400 #ffc107.
 * REGOLA (2026-10-09): nessun contenitore con max-width diverso da 100%: la
 * larghezza la decide la pagina Bricks. Tabelle nello stile "All Proposals":
 * header navy, zebra, divisori verticali, bottoni blu pieni.
 */

.isis-ir { width: 100%; max-width: 100%; margin: 0; font-family: Helvetica, "DejaVu Sans", sans-serif; font-size: 15px; color: #2c3338; box-sizing: border-box; }
.isis-ir *, .isis-ir *:before, .isis-ir *:after { box-sizing: border-box; }
.isis-ir h3 { margin: 0; font-size: 20px; font-weight: 600; color: #001f69; }
.isis-ir h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 600; color: #001f69; }
.isis-ir p  { margin: 0 0 10px; }
.isis-ir-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 1px solid #c9ced8; flex-wrap: wrap; }
.isis-ir-help { font-size: 14px; color: #555; margin: 4px 0 8px; }
.isis-ir-muted { color: #888; font-size: 14px; font-weight: normal; }
.isis-ir-req { color: #c00; font-size: 14px; font-weight: normal; }
.isis-ir-right { text-align: right; }
.isis-ir-sub { font-size: 14px; font-weight: 600; margin: 8px 0 4px; }
.isis-ir-count { font-size: 15px; font-style: italic; margin: 10px 0 8px; }
.isis-ir-count strong { font-style: normal; }

/* Barra filtri / pannello */
.isis-ir-bar { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; padding: 14px 20px; margin: 0 0 14px; background: #f8f9fb; border: 1px solid #e3e6ec; border-radius: 3px; }
.isis-ir-bar-group { flex: 1 1 320px; }
.isis-ir-bar-label { font-size: 15px; color: #2c3338; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid #c9ced8; }
.isis-ir-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.isis-ir-chip { display: inline-block; padding: 4px 10px; font-size: 15px; color: #001f69; text-decoration: none; border-radius: 3px; }
.isis-ir-chip:hover { background: #e8edf8; color: #001f69; }
.isis-ir-chip--on { background: #001f69; color: #fff; }
.isis-ir-chip--on:hover { background: #001f69; color: #fff; }

/* Notice */
.isis-ir-notice { padding: 10px 14px; border: 1px solid #c9ced8; border-left: 4px solid #3366ca; background: #f8f9fb; border-radius: 3px; margin: 0 0 14px; font-size: 15px; }
.isis-ir-notice--ok   { border-left-color: #569400; }
.isis-ir-notice--warn { border-left-color: #ffc107; }
.isis-ir-notice--err  { border-left-color: #c00; }
.isis-ir-errors { margin: 0 0 14px; padding: 10px 14px 10px 30px; border: 1px solid #c00; background: #fff5f5; border-radius: 3px; font-size: 14px; color: #a00; }

/* Bottoni: pieni blu come "PDF" della pagina proposals */
.isis-ir-btn { display: inline-block; padding: 7px 16px; border: 1px solid #3366ca; border-radius: 3px; background: #3366ca; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.3; font-family: inherit; white-space: nowrap; }
.isis-ir-btn:hover { background: #001f69; border-color: #001f69; color: #fff; }
.isis-ir-btn--primary { background: #001f69; border-color: #001f69; }
.isis-ir-btn--primary:hover { background: #3366ca; border-color: #3366ca; }
.isis-ir-btn--ghost { background: #fff; color: #3366ca; }
.isis-ir-btn--ghost:hover { background: #f0f3fa; color: #001f69; }
.isis-ir-link { font-size: 14px; color: #3366ca; }
.isis-ir-inline { display: inline-block; margin: 8px 8px 8px 0; }
.isis-ir-actions { margin: 20px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Badge */
.isis-ir-badge { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 14px; font-weight: 600; background: #eee; color: #2c3338; white-space: nowrap; }
.isis-ir-badge--draft     { background: #fff3cd; color: #7a5a00; }
.isis-ir-badge--submitted { background: #e3ecfb; color: #001f69; }
.isis-ir-badge--in_review { background: #e3ecfb; color: #3366ca; }
.isis-ir-badge--approved  { background: #e6f2d8; color: #3b6600; }
.isis-ir-badge--published { background: #569400; color: #fff; }
.isis-ir-badge--rejected  { background: #ffe1e1; color: #a00; }
.isis-ir-badge--withdrawn { background: #eee; color: #666; }

/* Tabelle: stile "All Proposals" */
.isis-ir-table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; background: #fff; }
.isis-ir-table thead th { padding: 10px 12px; text-align: left; font-size: 15px; font-weight: 700; color: #001f69; background: #fff; border-bottom: 1px solid #c9ced8; }
.isis-ir-table tbody td, .isis-ir-table tbody th { padding: 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #eef0f4; }
.isis-ir-table tbody th { font-weight: 700; color: #001f69; }
.isis-ir-table tbody tr:nth-child(even) { background: #f3f6fc; }
.isis-ir-table tbody td + td, .isis-ir-table tbody th + td { border-left: 1px solid #d9dde6; }
.isis-ir-table tbody td.isis-ir-right { white-space: nowrap; }
.isis-ir-table a:not(.isis-ir-btn) { color: #2c3338; text-decoration: none; }
.isis-ir-table a:not(.isis-ir-btn):hover { color: #3366ca; text-decoration: underline; }
.isis-ir-table--diff tbody th { width: 200px; vertical-align: top; }
.isis-ir-table--diff tbody td { white-space: pre-line; vertical-align: top; }
.isis-ir-changed td { background: #fffbe6 !important; }
.isis-ir-table--rep tbody td { padding: 6px; border-left: 0; }
.isis-ir-table--rep input { width: 100%; }

/* Form */
.isis-ir-form { margin: 0 0 30px; width: 100%; }
.isis-ir-field { margin: 0 0 16px; }
.isis-ir-field label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 4px; color: #2c3338; }
.isis-ir-field input[type="text"], .isis-ir-field input[type="url"], .isis-ir-field input[type="number"], .isis-ir-field textarea, .isis-ir-field select { width: 100%; padding: 8px 10px; border: 1px solid #c9ced8; border-radius: 3px; font-family: inherit; font-size: 15px; color: #2c3338; background: #fff; }
.isis-ir-field input[type="number"] { width: 120px; }
.isis-ir-field textarea { resize: vertical; line-height: 1.4; }
.isis-ir-field input:focus, .isis-ir-field textarea:focus, .isis-ir-field select:focus { outline: none; border-color: #3366ca; box-shadow: 0 0 0 2px rgba(51,102,202,.15); }
.isis-ir-static { padding: 8px 10px; background: #f8f9fb; border: 1px solid #e3e6ec; border-radius: 3px; }
.isis-ir-counter { font-size: 14px; color: #888; margin-top: 4px; }
.isis-ir-counter--bad { color: #c00; }
.isis-ir-counter--ok  { color: #569400; }
.isis-ir-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.isis-ir-field input[type="file"] { font-size: 14px; margin-top: 6px; }
.isis-ir-settings h4:first-child { margin-top: 8px; }

/* Immagini */
.isis-ir-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }
.isis-ir-thumb { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; color: #555; text-decoration: none; }
.isis-ir-thumb img { width: 160px; height: 100px; object-fit: cover; border: 1px solid #c9ced8; border-radius: 3px; display: block; }
.isis-ir-images[data-set="squares"] .isis-ir-thumb img, .isis-ir-thumbs--squares .isis-ir-thumb img { width: 110px; height: 110px; }
.isis-ir-thumb--cur img { opacity: .8; }
.isis-ir-thumb input { margin-right: 4px; }

/* Storico */
.isis-ir-log { list-style: none; margin: 0 0 20px; padding: 0; font-size: 14px; }
.isis-ir-log li { padding: 6px 0; border-bottom: 1px solid #eef0f4; }

@media (max-width: 700px) {
    .isis-ir-table--diff tbody th, .isis-ir-table--diff tbody td { display: block; width: auto; border-left: 0; }
    .isis-ir-table--diff tbody tr { display: block; margin-bottom: 10px; border-bottom: 2px solid #d9dde6; }
}

/* Submit / publish in evidenza: verde ufficiale (2026-10-09) */
.isis-ir-btn--submit { background: #569400; border-color: #569400; color: #fff; }
.isis-ir-btn--submit:hover { background: #3f6e00; border-color: #3f6e00; color: #fff; }

/* Tabelle su mobile: ogni riga diventa una card, l etichetta di colonna arriva da data-label (JS) */
@media (max-width: 700px) {
    .isis-ir-table thead { display: none; }
    .isis-ir-table tbody tr { display: block; margin: 0 0 12px; border: 1px solid #d9dde6; border-radius: 3px; background: #fff; }
    .isis-ir-table tbody tr:nth-child(even) { background: #f3f6fc; }
    .isis-ir-table tbody td, .isis-ir-table tbody th { display: block; width: auto; border-left: 0 !important; border-bottom: 1px solid #eef0f4; padding: 8px 12px; white-space: normal; }
    .isis-ir-table tbody tr > :last-child { border-bottom: 0; }
    .isis-ir-table tbody td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 14px; font-weight: 700; color: #001f69; margin-bottom: 2px; }
    .isis-ir-table tbody td.isis-ir-right { text-align: left; }
    .isis-ir-table tbody td.isis-ir-right .isis-ir-btn { display: block; text-align: center; }
    .isis-ir-table--rep tbody td { padding: 4px 12px; }
    .isis-ir-head { flex-direction: column; align-items: flex-start; }
    .isis-ir-bar { padding: 12px; }
    .isis-ir-actions .isis-ir-btn { flex: 1 1 auto; text-align: center; }
}

/* Colonna Status degli strumenti: Published in verde ufficiale, Draft in evidenza minore */
.isis-ir-badge--post-publish { background: #569400; color: #fff; }
.isis-ir-badge--post-draft   { background: #fff3cd; color: #7a5a00; }
.isis-ir-badge--post-pending { background: #e3ecfb; color: #001f69; }
.isis-ir-badge--post-private { background: #eee; color: #666; }
.isis-ir-badge--post-future  { background: #e3ecfb; color: #3366ca; }

/* Home scientist (2026-10-09): strumenti a sinistra, "My requests" in sidebar a destra.
 * Il pannello My requests e l unica eccezione voluta alla regola radius 3px (10 px, richiesta utente). */
.isis-ir-home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; width: 100%; }
.isis-ir-main { min-width: 0; }
.isis-ir-side { background: rgba(86, 148, 0, 0.2); border-radius: 10px; padding: 18px; min-width: 0; }
.isis-ir-side-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(0, 31, 105, 0.25); }
.isis-ir-side-head h3 { margin: 0; }
.isis-ir-side-count { display: inline-block; min-width: 28px; padding: 2px 8px; text-align: center; background: #001f69; color: #fff; border-radius: 10px; font-size: 14px; font-weight: 700; }
.isis-ir-side .isis-ir-help { color: #2c3338; }
.isis-ir-req-card { background: rgba(255, 255, 255, 0.85); border-radius: 10px; padding: 12px 14px; margin: 0 0 10px; }
.isis-ir-req-title { font-size: 15px; font-weight: 700; color: #001f69; margin: 0 0 2px; }
.isis-ir-req-meta { font-size: 14px; color: #555; margin: 0 0 8px; }
.isis-ir-req-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1000px) {
    .isis-ir-home { grid-template-columns: 1fr; }
    .isis-ir-side { order: -1; }   /* mobile: My requests per prime */
}

/* Tabella strumenti (home): facility piu piccola, intestazioni su una riga */
.isis-ir-table--inst thead th { white-space: nowrap; }
.isis-ir-table--inst tbody td:nth-child(2) { font-size: 14px; color: #555; }

/* Publications strutturate (2026-10-27): "et al." fisso accanto al primo autore, campi corti, lista in pagina */
.isis-ir-table--pubs input[type="text"] { width: 100%; min-width: 90px; }
.isis-ir-etal-wrap { display: flex; align-items: center; gap: 6px; }
.isis-ir-table--pubs .isis-ir-etal-sel { width: 100%; min-width: 100px; padding: 7px 8px; border: 1px solid #c9ced8; border-radius: 3px; font-family: inherit; font-size: 14px; }
.isis-ir-etal-wrap input { flex: 1 1 auto; }
.isis-ir-etal { white-space: nowrap; font-style: italic; color: #555; font-size: 14px; }
.isis-ir-table--pubs .isis-ir-year { max-width: 100%; width: 70px; min-width: 60px; }
.isis-ir-table--pubs .isis-ir-short { width: 70px; min-width: 60px; }
.isis-ir-rep-count { display: inline-block; margin-left: 10px; }
.isis-ir-notice details { margin-top: 6px; }
.isis-ir-notice summary { cursor: pointer; color: #3366ca; font-size: 14px; }
.isis-ip-list { margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.isis-ip-item { margin: 0 0 8px; padding-left: 0; }
.isis-ip-etal { font-style: italic; }
.isis-ip-list a { color: #3366ca; word-break: break-all; }
