.ticket-section-head { align-items: center; }
.ticket-head-actions { display: flex; gap: 10px; }
.ticket-stats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.ticket-stats article { min-height: 86px; padding: 16px 18px; border: 1px solid #dbe7e1; border-radius: 16px; background: #fffdf8; box-shadow: 0 6px 20px rgba(18,64,51,.05); }
.ticket-stats span { display: block; color: #64746d; font-size: 12px; margin-bottom: 7px; }
.ticket-stats strong { color: #123d32; font: 700 27px Georgia,serif; }
.ticket-stats .ticket-critical-stat { border-color: #f1c6c2; background: #fff7f5; }
.ticket-stats .ticket-critical-stat strong { color: #bd2e26; }
.ticket-create-panel { margin-bottom: 16px; border-color: #b8d4c7; }
.ticket-create-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding: 4px 2px; }
.ticket-create-form label { display: grid; gap: 7px; color: #53665e; font-size: 12px; }
.ticket-create-form input,.ticket-create-form select,.ticket-create-form textarea,.ticket-toolbar input,.ticket-toolbar select,.ticket-admin-grid select,.ticket-admin-grid textarea,.ticket-comment-form textarea { width: 100%; border: 1px solid #ccd9d3; border-radius: 10px; background: #fff; color: #15382f; font: inherit; padding: 11px 12px; outline: none; }
.ticket-create-form input:focus,.ticket-create-form select:focus,.ticket-create-form textarea:focus,.ticket-toolbar input:focus,.ticket-toolbar select:focus,.ticket-admin-grid select:focus,.ticket-admin-grid textarea:focus,.ticket-comment-form textarea:focus { border-color: #258462; box-shadow: 0 0 0 3px rgba(37,132,98,.12); }
.ticket-wide { grid-column: 1/-1; }
.ticket-form-actions { display: flex; gap: 10px; }
.ticket-image-field input { padding: 9px; border: 1px dashed #83aa99; background: #f6faf7; }
.ticket-image-field > small { color: #7a8781; }
#ticketImagePreview { display: flex; align-items: center; gap: 10px; color: #2c5749; }
#ticketImagePreview small { color: #74827c; }
.ticket-list-panel { padding: 0; overflow: hidden; }
.ticket-toolbar { display: grid; grid-template-columns: minmax(220px,1fr) 190px 170px; gap: 10px; padding: 16px; border-bottom: 1px solid #e4ebe7; background: #fcfdfb; }
.ticket-list { min-height: 170px; }
.ticket-loading,.ticket-empty { padding: 48px 20px; text-align: center; color: #728078; }
.ticket-row { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 14px; padding: 17px 18px 17px 0; border-bottom: 1px solid #e7ece9; cursor: pointer; transition: background .15s,transform .15s; }
.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: #f6faf7; }
.ticket-priority-bar { border-radius: 0 5px 5px 0; background: #6f9d8c; }
.ticket-row[data-priority="CRITICAL"] .ticket-priority-bar { background: #d43c34; }
.ticket-row[data-priority="HIGH"] .ticket-priority-bar { background: #e18a31; }
.ticket-row[data-priority="LOW"] .ticket-priority-bar { background: #67a6c2; }
.ticket-row-main { min-width: 0; }
.ticket-row-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ticket-row-top b { color: #0e3a2e; font-size: 15px; }
.ticket-row-title { margin: 7px 0 5px; color: #17372f; font-size: 15px; font-weight: 650; }
.ticket-row-description { max-width: 850px; overflow: hidden; color: #65736d; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.ticket-row-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 9px; color: #728078; font-size: 11px; }
.ticket-badge { border-radius: 999px; padding: 4px 8px; background: #edf3ef; color: #436156; font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.ticket-status-OPEN { background: #fff0d5; color: #945c00; }
.ticket-status-IN_PROGRESS { background: #e5f1ff; color: #286aa1; }
.ticket-status-WAITING { background: #f3eaff; color: #7751a0; }
.ticket-status-RESOLVED,.ticket-status-CLOSED { background: #e5f6eb; color: #21734a; }
.ticket-row-arrow { align-self: center; color: #5c776d; font-size: 24px; }
.ticket-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(4,25,20,.62); backdrop-filter: blur(3px); }
.ticket-modal[hidden] { display: none; }
.ticket-modal-card { width: min(920px,100%); max-height: 92vh; overflow: auto; border-radius: 20px; background: #fbfcf9; box-shadow: 0 25px 80px rgba(0,0,0,.3); }
.ticket-modal-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid #dce6e1; background: #0f4d3c; color: #fff; }
.ticket-modal-head small { color: #bfe0d3; }
.ticket-modal-head h3 { margin: 3px 0 0; font-size: 20px; }
.ticket-modal-head button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 24px; cursor: pointer; }
.ticket-detail-body { padding: 20px 22px 24px; }
.ticket-detail-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 16px; }
.ticket-detail-summary div { padding: 11px; border: 1px solid #e1e8e4; border-radius: 11px; background: #fff; }
.ticket-detail-summary small { display: block; color: #7a8781; margin-bottom: 4px; }
.ticket-detail-description,.ticket-resolution { margin: 12px 0; padding: 15px; border-radius: 12px; background: #f0f5f2; color: #355249; white-space: pre-wrap; }
.ticket-resolution { border-left: 4px solid #2b8965; background: #eaf7ef; }
.ticket-admin-panel { margin: 18px 0; padding: 16px; border: 1px solid #cfe0d7; border-radius: 14px; background: #f4f9f6; }
.ticket-admin-panel h4,.ticket-conversation h4 { margin: 0 0 12px; color: #174438; }
.ticket-admin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; }
.ticket-admin-grid label { display: grid; gap: 6px; color: #607068; font-size: 11px; }
.ticket-admin-grid .ticket-admin-wide { grid-column: 1/-1; }
.ticket-admin-actions { margin-top: 12px; }
.ticket-conversation { margin-top: 18px; }
.ticket-comment { padding: 11px 13px; margin-bottom: 8px; border-radius: 12px; background: #fff; border: 1px solid #e0e7e3; }
.ticket-comment-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: #6e7e76; font-size: 11px; }
.ticket-comment p { margin: 0; color: #304c43; white-space: pre-wrap; }
.ticket-comment-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 12px; align-items: end; }
.ticket-comment-form button { min-height: 42px; }
.ticket-history { margin-top: 18px; }
.ticket-history details { color: #62726a; font-size: 12px; }
.ticket-history ul { padding-left: 20px; }
.ticket-attachments-panel,.ticket-whatsapp-panel { margin: 16px 0; padding: 15px; border: 1px solid #dce6e1; border-radius: 14px; background: #fff; }
.ticket-attachments-panel h4,.ticket-whatsapp-panel h4 { margin: 0 0 11px; color: #174438; }
.ticket-attachments { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.ticket-attachment { display: grid; gap: 5px; color: #315f50; text-decoration: none; font-size: 11px; min-width: 0; }
.ticket-attachment img { width: 100%; aspect-ratio: 1.25; object-fit: cover; border-radius: 10px; border: 1px solid #d8e3dd; background: #f1f4f2; }
.ticket-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-no-image { color: #7a8781; font-size: 12px; }
.ticket-attachment-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 11px; }
.ticket-attachment-form input,.ticket-whatsapp-panel select { width: 100%; border: 1px solid #ccd9d3; border-radius: 9px; padding: 9px; background: #fff; }
.ticket-whatsapp-panel { border-color: #afe0c1; background: #f1fbf5; }
.ticket-whatsapp-panel > div { display: grid; grid-template-columns: 1fr auto auto; gap: 9px; }
.ticket-whatsapp-panel > small { display: block; margin-top: 7px; color: #668075; }
.ticket-whatsapp-button { border: 0; border-radius: 9px; padding: 0 15px; background: #1f9d55; color: #fff; font-weight: 700; cursor: pointer; }
.ticket-support-updates { margin:16px 0;padding:15px;border:1px solid #b9d8ca;border-radius:14px;background:#f2faf6; }
.ticket-support-updates h4 { margin:0 0 10px;color:#174438; }
.ticket-support-update { padding:10px 12px;margin-top:8px;border-left:3px solid #39916d;border-radius:8px;background:#fff; }
.ticket-support-update b { color:#285a4a; }.ticket-support-update p { margin:5px 0;color:#445e55;white-space:pre-wrap; }.ticket-support-update small { color:#7b8983;font-size:10px; }

@media (max-width: 900px) {
  .ticket-stats { grid-template-columns: repeat(3,1fr); }
  .ticket-create-form { grid-template-columns: repeat(2,1fr); }
  .ticket-toolbar { grid-template-columns: 1fr 1fr; }
  .ticket-toolbar input { grid-column: 1/-1; }
}
@media (max-width: 600px) {
  .ticket-section-head { align-items: stretch; gap: 12px; }
  .ticket-head-actions { width: 100%; }
  .ticket-head-actions button { flex: 1; }
  .ticket-stats { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .ticket-stats article { min-height: 70px; padding: 12px; border-radius: 12px; }
  .ticket-stats strong { font-size: 23px; }
  .ticket-create-form,.ticket-toolbar { grid-template-columns: 1fr; }
  .ticket-toolbar input { grid-column: auto; }
  .ticket-create-form label,.ticket-wide { grid-column: 1; }
  .ticket-row { grid-template-columns: 6px minmax(0,1fr); gap: 10px; padding-right: 12px; }
  .ticket-row-arrow { display: none; }
  .ticket-row-description { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ticket-modal { padding: 0; align-items: end; }
  .ticket-modal-card { max-height: 96vh; border-radius: 18px 18px 0 0; }
  .ticket-detail-body { padding: 15px; }
  .ticket-detail-summary { grid-template-columns: repeat(2,1fr); }
  .ticket-admin-grid,.ticket-comment-form { grid-template-columns: 1fr; }
  .ticket-attachments { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ticket-attachment-form,.ticket-whatsapp-panel > div { grid-template-columns: 1fr; }
  .ticket-whatsapp-panel button { min-height: 42px; }
  .ticket-admin-grid label,.ticket-admin-grid .ticket-admin-wide { grid-column: 1; }
}
