/**
 * ISIS@MACH User Tickets - stili (utente e staff)
 * Shortcode [isismach_ticket_form], [isismach_tickets], [isismach_tickets_staff].
 * Design system (HANDOFF): Helvetica/DejaVu Sans, floor 14px, radius max 3px,
 * palette #001f69 #3366ca #569400 #ffc107. REGOLA: nessun contenitore con
 * max-width diverso da 100%. Tabelle nello stile "All Proposals", card su mobile.
 */

.isis-tk { width: 100%; max-width: 100%; margin: 0; font-family: Helvetica, "DejaVu Sans", sans-serif; font-size: 15px; color: #2c3338; box-sizing: border-box; }
.isis-tk *, .isis-tk *:before, .isis-tk *:after { box-sizing: border-box; }
.isis-tk h3 { margin: 0; font-size: 20px; font-weight: 600; color: #001f69; }
.isis-tk h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 600; color: #001f69; }
.isis-tk p  { margin: 0 0 10px; }
.isis-tk-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-tk-help { font-size: 14px; color: #555; margin: 4px 0 8px; }
.isis-tk-muted { color: #888; font-size: 14px; font-weight: normal; }
.isis-tk-req { color: #c00; font-size: 14px; font-weight: normal; }
.isis-tk-right { text-align: right; }
.isis-tk-count { font-size: 15px; font-style: italic; margin: 10px 0 8px; }
.isis-tk-count strong { font-style: normal; }
.isis-tk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Barra filtri */
.isis-tk-bar { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; padding: 14px 20px; margin: 0 0 14px; background: #f8f9fb; border: 1px solid #e3e6ec; border-radius: 3px; }
.isis-tk-bar-group { flex: 1 1 320px; min-width: 0; }
.isis-tk-bar-label { font-size: 15px; color: #2c3338; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid #c9ced8; }
.isis-tk-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.isis-tk-chip { display: inline-block; padding: 4px 10px; font-size: 15px; color: #001f69; text-decoration: none; border-radius: 3px; }
.isis-tk-chip:hover { background: #e8edf8; color: #001f69; }
.isis-tk-chip--on, .isis-tk-chip--on:hover { background: #001f69; color: #fff; }
.isis-tk-filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.isis-tk-filter-row input[type="text"], .isis-tk-filter-row select { flex: 1 1 160px; padding: 7px 10px; border: 1px solid #c9ced8; border-radius: 3px; font-family: inherit; font-size: 14px; }

/* Notice */
.isis-tk-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-tk-notice--ok  { border-left-color: #569400; }
.isis-tk-notice--err { border-left-color: #c00; }
.isis-tk-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 */
.isis-tk-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-tk-btn:hover { background: #001f69; border-color: #001f69; color: #fff; }
.isis-tk-btn--primary { background: #001f69; border-color: #001f69; }
.isis-tk-btn--primary:hover { background: #3366ca; border-color: #3366ca; }
.isis-tk-btn--submit { background: #569400; border-color: #569400; }
.isis-tk-btn--submit:hover { background: #3f6e00; border-color: #3f6e00; }
.isis-tk-btn--ghost { background: #fff; color: #3366ca; }
.isis-tk-btn--ghost:hover { background: #f0f3fa; color: #001f69; }
.isis-tk-link { font-size: 14px; color: #3366ca; }
.isis-tk-inline { display: inline-block; margin: 0; }
.isis-tk-actions { margin: 16px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Badge */
.isis-tk-badge { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 14px; font-weight: 600; background: #eee; color: #2c3338; white-space: nowrap; }
.isis-tk-badge--open         { background: #e3ecfb; color: #001f69; }
.isis-tk-badge--in_progress  { background: #001f69; color: #fff; }
.isis-tk-badge--waiting_user { background: #fff3cd; color: #7a5a00; }
.isis-tk-badge--resolved     { background: #569400; color: #fff; }
.isis-tk-badge--closed       { background: #eee; color: #666; }
.isis-tk-badge--internal     { background: #fff3cd; color: #7a5a00; font-size: 12px; }
.isis-tk-badge--p-low    { background: #eef0f4; color: #555; }
.isis-tk-badge--p-medium { background: #e3ecfb; color: #001f69; }
.isis-tk-badge--p-high   { background: #fff3cd; color: #7a5a00; }
.isis-tk-badge--p-urgent { background: #ffe1e1; color: #a00; }

/* Tabelle: stile "All Proposals" */
.isis-tk-table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; background: #fff; }
.isis-tk-table thead th { padding: 10px 12px; text-align: left; font-size: 15px; font-weight: 700; color: #001f69; background: #fff; border-bottom: 1px solid #c9ced8; white-space: nowrap; }
.isis-tk-table tbody td, .isis-tk-table tbody th { padding: 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #eef0f4; }
.isis-tk-table tbody th { font-weight: 700; color: #001f69; white-space: nowrap; }
.isis-tk-table tbody tr:nth-child(even) { background: #f3f6fc; }
.isis-tk-table tbody td + td, .isis-tk-table tbody th + td, .isis-tk-table tbody td + th { border-left: 1px solid #d9dde6; }
.isis-tk-table--info tbody th { width: 140px; }

/* Thread */
.isis-tk-thread { margin: 16px 0; }
.isis-tk-msg { padding: 12px 14px; margin: 0 0 10px; border-radius: 3px; border: 1px solid #e3e6ec; background: #fff; }
.isis-tk-msg--user { border-left: 4px solid #3366ca; }
.isis-tk-msg--staff { border-left: 4px solid #569400; background: #f6fbf0; }
.isis-tk-msg--internal { border-left: 4px solid #ffc107; background: #fffbe6; }
.isis-tk-msg--system { background: #f8f9fb; color: #555; font-size: 14px; padding: 6px 12px; border: 0; }
.isis-tk-msg-head { font-size: 14px; color: #555; margin: 0 0 6px; }
.isis-tk-msg-body { white-space: normal; line-height: 1.5; }
.isis-tk-att { margin-top: 8px; font-size: 14px; }
.isis-tk-att a { display: inline-block; margin: 0 10px 4px 0; color: #3366ca; }

/* Form */
.isis-tk-form { margin: 0 0 24px; width: 100%; }
.isis-tk-reply { padding: 14px; background: #f8f9fb; border: 1px solid #e3e6ec; border-radius: 3px; }
.isis-tk-field { margin: 0 0 14px; }
.isis-tk-field label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 4px; color: #2c3338; }
.isis-tk-field input[type="text"], .isis-tk-field input[type="email"], .isis-tk-field input[type="number"], .isis-tk-field textarea, .isis-tk-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-tk-field input[type="number"] { width: 120px; }
.isis-tk-field textarea { resize: vertical; line-height: 1.4; }
.isis-tk-field input:focus, .isis-tk-field textarea:focus, .isis-tk-field select:focus { outline: none; border-color: #3366ca; box-shadow: 0 0 0 2px rgba(51,102,202,.15); }
/* Selettore allegati: input nativo nascosto ma accessibile, bottone nostro + nome file (come il motore utenti) */
.isis-tk-file { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 0; cursor: pointer; font-weight: normal; }
.isis-tk-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.isis-tk-file-btn { margin: 0; }
.isis-tk-file-input:focus + .isis-tk-file-btn { outline: 2px solid #3366ca; outline-offset: 2px; }
.isis-tk-file-name { font-size: 14px; color: #555; overflow-wrap: anywhere; }
.isis-tk-file-name.is-set { color: #000; font-weight: 600; }
.isis-tk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.isis-tk-field--btn { display: flex; align-items: flex-end; }

/* [isismach_tickets layout="cards"] (2026-10-09): lista a schede per i contenitori stretti (colonna destra della
 * pagina account). Stessa resa di "My requests" degli strumenti: stessa eccezione voluta al radius 3px (10 px). */
.isis-tk--compact .isis-tk-head { margin-top: 0; }
.isis-tk-cards { width: 100%; }
.isis-tk-card { background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(0, 31, 105, 0.12); border-radius: 10px; padding: 12px 14px; margin: 0 0 10px; }
.isis-tk-card-title { font-size: 15px; font-weight: 700; color: #001f69; margin: 0 0 2px; overflow-wrap: anywhere; }
.isis-tk-card-meta { font-size: 14px; color: #555; margin: 0 0 8px; }
.isis-tk-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; }
.isis-tk-card-row > span { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Mobile: tabelle a card (data-label dal JS) */
@media (max-width: 700px) {
    .isis-tk-table thead { display: none; }
    .isis-tk-table tbody tr { display: block; margin: 0 0 12px; border: 1px solid #d9dde6; border-radius: 3px; background: #fff; }
    .isis-tk-table tbody tr:nth-child(even) { background: #f3f6fc; }
    .isis-tk-table tbody td, .isis-tk-table tbody th { display: block; width: auto; border-left: 0 !important; border-bottom: 1px solid #eef0f4; padding: 8px 12px; white-space: normal; }
    .isis-tk-table tbody tr > :last-child { border-bottom: 0; }
    .isis-tk-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-tk-table tbody td.isis-tk-right { text-align: left; }
    .isis-tk-table tbody td.isis-tk-right .isis-tk-btn { display: block; text-align: center; }
    .isis-tk-head { flex-direction: column; align-items: flex-start; }
    .isis-tk-actions .isis-tk-btn { flex: 1 1 auto; text-align: center; }
}
