/* Agent Ekibi paneli — Anthropic Console tarzı */
.at-app { display: flex; flex-direction: column; min-height: 600px; }
.at-page-header { display: flex; justify-content: space-between; padding: 10px 0 14px; }
.at-page-header h1 { margin: 0; font-size: 22px; }
.at-shell {
  display: grid; grid-template-columns: 320px 1fr;
  gap: 0; min-height: 600px;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: white;
}

/* ====== Sidebar ====== */
.at-sidebar-wrap { border-right: 1px solid var(--border); background: var(--bg); display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 200px); overflow-y: auto; }
.at-list-header { padding: 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.at-search { width: 100%; padding: 8px 12px; font-size: 13px; font-family: inherit; border: 1px solid var(--border); border-radius: 8px; background: white; outline: none; box-sizing: border-box; }
.at-search:focus { border-color: var(--primary); }
.at-list { padding: 8px; }
.at-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 6px; border: 1px solid transparent; transition: all 0.15s; }
.at-item:hover { background: var(--surface-hover); border-color: var(--border); }
.at-item.active { background: rgba(104,22,32,0.08); border-color: var(--primary); }
.at-item-top { display: flex; align-items: center; gap: 6px; }
.at-name { font-weight: 700; font-size: 13px; color: var(--text); flex: 1; }
.at-lock { font-size: 11px; }
.at-status { font-size: 10px; }
.at-role { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.at-model { margin-top: 4px; }
.at-tier { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.at-tier.tier-auto { background: linear-gradient(135deg, #ddd6fe, #c4b5fd); color: #5b21b6; }
.at-tier.tier-1 { background: #dcfce7; color: #166534; }
.at-tier.tier-2 { background: #fef3c7; color: #92400e; }
.at-tier.tier-3 { background: #fee2e2; color: #991b1b; }
.at-tier.tier-4 { background: #f3e8ff; color: #6b21a8; }

/* ====== Editor ====== */
.at-editor-wrap { background: white; min-height: 0; display: flex; flex-direction: column; }
#at-editor { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.at-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.at-title { margin: 0; font-size: 19px; font-weight: 700; color: var(--text); }
.at-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.at-header-actions { display: flex; gap: 8px; align-items: center; }
.at-readonly-pill { background: #fee2e2; color: #991b1b; padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }

.at-btn { padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; font-family: inherit; border: 1px solid var(--border); transition: all 0.15s; }
.at-btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.at-btn-primary:hover { background: var(--primary-hover); }
.at-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.at-btn-primary.dirty { background: #16a34a; border-color: #16a34a; }
.at-btn-ghost { background: white; color: var(--text); }
.at-btn-ghost:hover { background: var(--surface-hover); }

.at-tabs { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--border); background: var(--bg); flex-wrap: wrap; }
.at-tab { padding: 10px 14px; background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 12.5px; font-family: inherit; color: var(--text-secondary); font-weight: 600; }
.at-tab:hover { background: rgba(0,0,0,0.04); }
.at-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: white; }

.at-tab-body { flex: 1; overflow-y: auto; padding: 18px 22px; min-height: 0; }

.at-form { display: flex; flex-direction: column; gap: 16px; max-width: 800px; }
.at-field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.at-field input, .at-field select, .at-field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13.5px; font-family: inherit; background: white; outline: none; box-sizing: border-box;
}
.at-field input:focus, .at-field select:focus, .at-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(104,22,32,0.1); }
.at-field input:disabled, .at-field textarea:disabled, .at-field select:disabled { background: #f5f5f5; cursor: not-allowed; }
.at-field textarea { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13px; line-height: 1.45; resize: vertical; }

.at-info { padding: 10px 14px; background: #f0f7ff; border-left: 3px solid #3b82f6; border-radius: 4px; font-size: 12.5px; color: #1e3a8a; }
.at-info code { background: rgba(0,0,0,0.05); padding: 1px 5px; border-radius: 3px; font-size: 11.5px; }

.at-prompt-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.at-char-count { font-size: 11.5px; color: var(--text-tertiary); }
.at-textarea-big {
  width: 100%; min-height: 480px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13px; line-height: 1.55;
  background: #fafafa; outline: none; resize: vertical; box-sizing: border-box;
}
.at-textarea-big:focus { background: white; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(104,22,32,0.1); }
.at-textarea-big:disabled { background: #f5f5f5; cursor: not-allowed; }

.at-model-info { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

.at-tools-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 14px; }
.at-tools-list li { padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.at-tools-list code { font-family: ui-monospace, Menlo, monospace; color: var(--primary); }

.at-test-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.at-test-grid label { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.at-test-grid textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 13.5px; resize: vertical; outline: none; box-sizing: border-box;
}
.at-response {
  white-space: pre-wrap; padding: 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; min-height: 160px; font-size: 13.5px; line-height: 1.55;
}

.at-history-list { list-style: none; padding: 0; }
.at-history-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.at-history-list li:hover { background: var(--surface-hover); }

.at-empty { padding: 80px 20px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.at-spinner { width: 36px; height: 36px; margin: 0 auto; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: atSpin 0.7s linear infinite; }
@keyframes atSpin { to { transform: rotate(360deg); } }

.agent-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 22px; background: #323232; color: white; border-radius: 8px;
  font-size: 13px; z-index: 10000; opacity: 0; transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); font-family: inherit;
}
.agent-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.agent-toast.error { background: #c62828; }

@media (max-width: 900px) {
  .at-shell { grid-template-columns: 1fr; }
  .at-sidebar-wrap { max-height: 200px; }
  .at-test-grid { grid-template-columns: 1fr; }
}
