/* Tennant Brand user panel with modal, iframe & filters (v1.4.0) */
.alfa-user-panel { margin: 24px 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.alfa-user-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.alfa-user-header h3 { margin: 0; font-weight: 800; color: #004B87; }
.alfa-user-header .muted { font-size: 12px; color: #6b7a90; }

/* Filters */
.aw-filters { display:flex; flex-wrap:wrap; gap:12px; align-items: flex-end; margin: 12px 0 16px; }
.aw-filter { display:flex; gap:8px; align-items:center; }
.aw-filter label { font-weight:700; color:#0b3d75; }
.aw-filter input[type="date"], .aw-filter input[type="text"], .aw-filter select { border:1px solid #C7D7EA; border-radius:8px; padding:6px 8px; font-size:14px; }
.aw-filter .sep { color:#6b7a90; }

.alfa-user-table-wrapper { width: 100%; overflow-x: auto; }
.alfa-user-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.alfa-user-table th { background: #004B87; color: #fff; text-align: left; padding: 12px 14px; font-size: 14px; letter-spacing: .2px; white-space: nowrap; cursor:pointer; user-select:none; }
.alfa-user-table th.sort-asc::after { content: " ▲"; font-size: 11px; }
.alfa-user-table th.sort-desc::after { content: " ▼"; font-size: 11px; }
.alfa-user-table td { padding: 10px 14px; border-bottom: 1px solid #eef2f6; font-size: 14px; }
.alfa-user-table tr:hover { background: #F5FAFF; }
.col-acoes { width: 120px; text-align: center; }
.alfa-user-table td.acoes { text-align: center; }

.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.status-recebido { background: #FFF3CD; color: #856404; }
.status-em-analise, .status-garantia-em-revisao { background: #E8F4FF; color: #1D5FA7; }
.status-documentacao-pendente { background: #FDE2E1; color: #C0392B; }
.status-garantia-deferida { background: #E6F4EA; color: #1E7A3B; }
.status-garantia-indeferida { background: #FDE2E1; color: #A72E2E; }
.status-indefinido { background: #ECEFF3; color: #425466; }

/* Modal + iframe */
.aw-modal { position: fixed; inset: 0; z-index: 9999; }
.aw-modal__backdrop { position: absolute; inset:0; background: rgba(0,0,0,.4); }
.aw-modal__dialog {
  position: relative;
  width: 95%;
  max-width: 720px;
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.aw-modal__header { padding: 12px 16px; background: #F5FAFF; border-bottom: 1px solid #E6EEF7; display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.aw-edit-subtitle { font-size: 12px; color:#6b7a90; margin-top:4px; }
.aw-modal__footer { border-top: 1px solid #E6EEF7; background: #F5FAFF; padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; }
.aw-modal__close { border:0; background:transparent; font-size: 22px; line-height: 1; cursor:pointer; color:#004B87; }
.aw-modal__body { padding: 16px; overflow-y: auto; flex: 1; max-height: 60vh; }
.aw-snapshot { border: 1px solid #E6EEF7; border-radius: 8px; padding: 12px; margin-bottom: 12px; background: #fff; position: relative; }
.aw-snapshot-loading { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background: rgba(255,255,255,.8); font-weight:700; color:#0b3d75; border-radius:8px; }
.aw-snapshot-frame { width:100%; border:0; min-height: 120px; }

.aw-field { margin-bottom: 12px; }
.aw-field label { display:block; font-weight:700; margin-bottom: 6px; color:#0b3d75; }
.aw-field input[type="text"], .aw-field textarea { width:100%; border:1px solid #C7D7EA; border-radius:8px; padding:8px 10px; font-size:14px; }
.aw-field input[type="file"] { display:block; }

.aw-peca-row { display:grid; grid-template-columns: 1fr 2fr 90px 32px; gap:8px; align-items:center; margin-bottom:8px; }
.aw-peca-row input { width:100%; }
.aw-peca-del { background:transparent; border:1px solid #e33; color:#e33; border-radius:6px; padding:6px 0; cursor:pointer; }
.aw-anexos-existentes a { display:inline-block; margin-right:10px; font-size:13px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 700; border: 1px solid transparent; transition: transform .02s ease, box-shadow .2s ease, background .2s ease; }
.btn-edit { background: #0077C8; color: #fff; }
.btn-edit:hover { background: #005f9e; }
.btn:active { transform: translateY(1px); }
.muted { color: #8E99A8; }
.notice, .empty { background: #F1F8FF; border: 1px solid #CCE1F5; color: #0B3D75; padding: 12px 14px; border-radius: 8px; }

@media (max-width: 768px) {
  .aw-modal__dialog { margin: 20px 12px; width: calc(100% - 24px); max-width: 100%; max-height: 95vh; }
  .aw-modal__body { max-height: 55vh; }
  .alfa-user-table th, .alfa-user-table td { font-size: 13px; padding: 8px 10px; }
  .col-acoes { width: 96px; }
}
