@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

#wam-app {
  --green:  #25d366; --green2: #128c7e; --teal: #075e54;
  --blue:   #3b82f6; --orange: #f59e0b; --red: #ef4444;
  --bg:     #0d1117; --bg2: #161b22; --bg3: #21262d;
  --border: #30363d; --text: #e6edf3; --muted: #7d8590;
  --radius: 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg); color: var(--text);
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.wam-settings-bar { background: var(--teal); padding: 14px 18px; border-bottom: 1px solid var(--green2); }
.wam-settings-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.wam-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.wam-field-sm { max-width: 110px; min-width: 80px; }
.wam-field label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.7px; color: rgba(255,255,255,0.8); }
.wam-field input { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; padding: 8px 12px; color: #fff; font-family: 'IBM Plex Mono',monospace; font-size: 13px; outline: none; transition: border-color 0.2s; width: 100%; box-sizing: border-box; }
.wam-field input:focus { border-color: var(--green); }
.wam-status-bar { margin-top: 8px; font-size: 12px; color: rgba(255,255,255,0.7); min-height: 16px; transition: all 0.3s; }
.wam-status-bar.success { color: #86efac; } .wam-status-bar.error { color: #fca5a5; } .wam-status-bar.info { color: #93c5fd; }

.wam-layout { display: grid; grid-template-columns: 260px 1fr 250px; min-height: 560px; }
@media(max-width:900px){ .wam-layout{grid-template-columns:1fr;} .wam-panel{border-right:none!important;border-bottom:1px solid var(--border);} }
@media(max-width:600px){ .wam-settings-row{flex-direction:column;} .wam-field,.wam-field-sm{min-width:100%;max-width:100%;} .wam-tabs{overflow-x:auto;} .wam-tab{font-size:11px;padding:10px 10px;} }

.wam-panel { background: var(--bg2); display: flex; flex-direction: column; }
.wam-panel-groups { border-right: 1px solid var(--border); }
.wam-panel-progress { border-left: 1px solid var(--border); background: var(--bg); }
.wam-panel-header { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wam-panel-header h3 { margin: 0; font-size: 13px; font-weight: 600; white-space: nowrap; }
.wam-search { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; color: var(--text); font-size: 12px; outline: none; width: 100%; font-family: inherit; box-sizing: border-box; }
.wam-search:focus { border-color: var(--green); }

.wam-labels-filter { padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 5px; border-bottom: 1px solid var(--border); }
.wam-label-tag { background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 11px; cursor: pointer; transition: all 0.15s; color: var(--muted); user-select: none; }
.wam-label-tag.active,.wam-label-tag:hover { background: var(--green2); border-color: var(--green); color: #fff; }

.wam-groups-list { flex: 1; overflow-y: auto; padding: 6px; }
.wam-group-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: background 0.15s; border: 1px solid transparent; }
.wam-group-item:hover { background: var(--bg3); }
.wam-group-item.selected { background: rgba(37,211,102,0.1); border-color: var(--green); }
.wam-group-item input[type=checkbox] { accent-color: var(--green); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.wam-group-info { flex: 1; min-width: 0; }
.wam-group-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wam-group-meta { font-size: 10px; color: var(--muted); margin-top: 1px; }
.wam-group-jid { font-size: 9px; color: var(--muted); font-family: 'IBM Plex Mono',monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wam-group-label { font-size: 10px; padding: 2px 7px; border-radius: 10px; background: var(--bg3); color: var(--muted); border: 1px solid var(--border); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.wam-group-label:hover { border-color: var(--green); color: var(--green); }

.wam-select-actions { padding: 8px 10px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); background: var(--bg); flex-wrap: wrap; }
#wam-selected-count { font-size: 11px; color: var(--muted); margin-left: auto; }

.wam-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg); }
.wam-tab { padding: 11px 14px; background: none; border: none; color: var(--muted); font-size: 12px; font-family: inherit; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; white-space: nowrap; }
.wam-tab:hover { color: var(--text); }
.wam-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

.wam-tab-content { display: none; padding: 14px; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; }
.wam-tab-content.active { display: flex; }

#wam-msg-text { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-family: inherit; font-size: 13px; resize: vertical; outline: none; box-sizing: border-box; }
#wam-msg-text:focus { border-color: var(--green); }

.wam-msg-id-box { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 11px; }
.wam-msg-id-label { color: var(--muted); display: block; margin-bottom: 4px; font-weight: 600; }
#wam-msg-id-list { font-family: 'IBM Plex Mono',monospace; font-size: 10px; color: var(--green); max-height: 80px; overflow-y: auto; }
.wam-msg-id-entry { padding: 2px 0; border-bottom: 1px solid var(--border); }
.wam-msg-id-entry:last-child { border-bottom: none; }

.wam-msg-actions,.wam-member-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wam-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }
.wam-hint { font-size: 11px; color: var(--muted); margin: 0; font-style: italic; }

.wam-btn { display: inline-flex; align-items: center; gap: 5px; padding: 9px 14px; border-radius: 7px; border: none; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.wam-btn:active { transform: scale(0.97); }
.wam-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wam-btn-save   { background: var(--green2); color: #fff; }
.wam-btn-save:hover:not(:disabled) { background: var(--green); }
.wam-btn-sync   { background: var(--blue); color: #fff; }
.wam-btn-sync:hover:not(:disabled) { filter: brightness(1.15); }
.wam-btn-green  { background: var(--green); color: #111; }
.wam-btn-green:hover:not(:disabled) { background: #1ab256; }
.wam-btn-blue   { background: var(--blue); color: #fff; }
.wam-btn-blue:hover:not(:disabled) { filter: brightness(1.15); }
.wam-btn-orange { background: var(--orange); color: #111; }
.wam-btn-orange:hover:not(:disabled) { filter: brightness(1.1); }
.wam-btn-red    { background: var(--red); color: #fff; }
.wam-btn-red:hover:not(:disabled) { filter: brightness(1.1); }

.wam-btn-sm { padding: 5px 11px; font-size: 11px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg3); color: var(--text); cursor: pointer; font-family: inherit; font-weight: 500; transition: all 0.15s; }
.wam-btn-sm:hover { border-color: var(--green); color: var(--green); }
.wam-btn-sm-red:hover { border-color: var(--red); color: var(--red); }

.wam-input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-family: 'IBM Plex Mono',monospace; font-size: 13px; outline: none; box-sizing: border-box; }
.wam-input:focus { border-color: var(--green); }

.wam-media-upload { border: 2px dashed var(--border); border-radius: 10px; padding: 28px; text-align: center; cursor: pointer; transition: border-color 0.2s; color: var(--muted); }
.wam-media-upload:hover,.wam-media-upload.dragover { border-color: var(--green); color: var(--text); }
.wam-drop-icon { font-size: 32px; margin-bottom: 6px; }
.wam-media-preview img,.wam-media-preview video { max-width: 100%; max-height: 150px; border-radius: 8px; object-fit: cover; }

.wam-tasklist-header { display: flex; align-items: center; justify-content: space-between; }
.wam-tasklist-header h4 { margin: 0; font-size: 13px; }
.wam-task-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-top: 8px; max-height: 340px; }
.wam-task-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; background: var(--bg3); border-radius: 8px; border: 1px solid var(--border); font-size: 11px; }
.wam-task-status { font-size: 14px; flex-shrink: 0; }
.wam-task-info { flex: 1; min-width: 0; }
.wam-task-name { font-weight: 600; font-size: 11px; }
.wam-task-target { color: var(--muted); font-size: 10px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wam-task-item.done   { border-color: var(--green); background: rgba(37,211,102,0.06); }
.wam-task-item.failed { border-color: var(--red); background: rgba(239,68,68,0.06); }
.wam-task-item.running { border-color: var(--blue); animation: wam-pulse 1s infinite; }
@keyframes wam-pulse { 0%,100%{opacity:1}50%{opacity:0.6} }
.wam-task-controls { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.wam-progress-log { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.wam-log-entry { font-size: 11px; font-family: 'IBM Plex Mono',monospace; padding: 6px 9px; border-radius: 6px; background: var(--bg2); border-left: 3px solid var(--border); line-height: 1.5; word-break: break-all; }
.wam-log-entry.success { border-left-color: var(--green); }
.wam-log-entry.error   { border-left-color: var(--red); }
.wam-log-entry.info    { border-left-color: var(--blue); }
.wam-log-time { color: var(--muted); margin-right: 5px; }
.wam-progress-stats { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; gap: 12px; font-size: 12px; font-weight: 600; flex-wrap: wrap; }

.wam-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 20px; }

.wam-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 99999; display: flex; align-items: center; justify-content: center; }
.wam-modal-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 22px; min-width: 260px; display: flex; flex-direction: column; gap: 12px; }
.wam-modal-box h4 { margin: 0; font-size: 15px; }
.wam-modal-box select { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-family: inherit; font-size: 13px; outline: none; }
.wam-modal-actions { display: flex; gap: 10px; }

#wam-app ::-webkit-scrollbar { width: 4px; }
#wam-app ::-webkit-scrollbar-track { background: var(--bg); }
#wam-app ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
#wam-app ::-webkit-scrollbar-thumb:hover { background: var(--muted); }
