/* Agentoid 2.0 Admin Web Tab — isolated styling matching HandlerHub Slate/Indigo aesthetic */
#agentoid2-root {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: #1e293b;
  font-family: inherit;
}

@media (min-width: 640px) {
  #agentoid2-root {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  #agentoid2-root {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.a2-header-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.a2-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.a2-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0.25rem 0 0;
}

.a2-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  border-radius: 0.875rem;
}

.a2-subtab-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.a2-subtab-btn:hover {
  background: #f8fafc;
  color: #0f172a;
}

.a2-subtab-btn.active {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
  font-weight: 600;
}

.a2-grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.a2-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  padding: 1.125rem 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.a2-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin: 0 0 0.5rem;
}

.a2-kpi-val {
  font-size: 1.625rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.a2-kpi-meta {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.375rem;
}

.a2-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.875rem;
}

.a2-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.a2-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.a2-input,
.a2-select,
.a2-textarea {
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  color: #0f172a;
  background: #ffffff;
  outline: none;
}

.a2-input:focus,
.a2-select:focus,
.a2-textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.a2-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.a2-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.a2-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.a2-btn-primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.a2-btn-primary:hover:not(:disabled) {
  background: #4338ca;
  border-color: #4338ca;
}

.a2-btn-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.a2-btn-danger:hover:not(:disabled) {
  background: #fee2e2;
}

.a2-btn-warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.a2-btn-warn:hover:not(:disabled) {
  background: #fef3c7;
}

.a2-btn-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.a2-btn-sm {
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
}

.a2-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
}

.a2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.a2-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.a2-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.a2-table tbody tr:hover {
  background: #f8fafc;
}

.a2-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.a2-badge-green { background: #dcfce7; color: #166534; }
.a2-badge-indigo { background: #e0e7ff; color: #3730a3; }
.a2-badge-amber { background: #fef3c7; color: #92400e; }
.a2-badge-red { background: #fee2e2; color: #991b1b; }
.a2-badge-slate { background: #f1f5f9; color: #475569; }
.a2-badge-blue { background: #dbeafe; color: #1e40af; }

.a2-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
}

.a2-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.a2-modal {
  background: #ffffff;
  border-radius: 1rem;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.2);
  border: 1px solid #e2e8f0;
}

.a2-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.a2-modal-body {
  padding: 1.25rem;
}

.a2-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .a2-form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.a2-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.3rem;
}

.a2-field input,
.a2-field select,
.a2-field textarea {
  width: 100%;
  box-sizing: border-box;
}

.a2-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 0.875rem;
}

.a2-qr-code-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #312e81;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 0.4rem 1rem;
  border-radius: 0.5rem;
}

.a2-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 1024px) {
  .a2-two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.a2-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 80;
  padding: 0.7rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.15);
  background: #0f172a;
  color: #ffffff;
}

.a2-toast.error {
  background: #991b1b;
}

.a2-toast.success {
  background: #065f46;
}

.a2-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #64748b;
  font-size: 0.875rem;
}
