.ai-assistant-toggle {
  position: static;
  z-index: auto;
  width: 100%;
  height: 30px;
  border: 1px solid #b8bec8;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  padding: 0 9px;
  font-family: var(--ui-font);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  box-shadow: none;
}

.ai-assistant-toggle:hover {
  background: #f3f6fa;
}

.ai-assistant-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-left: 1px solid #d7dbe1;
  box-shadow: -16px 0 36px rgba(17, 24, 39, 0.16);
  transform: translateX(100%);
  transition: transform 180ms ease;
  font-family: var(--ui-font);
}

.ai-assistant-drawer.open {
  transform: translateX(0);
}

.ai-assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.ai-assistant-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.ai-assistant-header p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12px;
}

.ai-assistant-close,
.ai-assistant-actions button {
  height: 30px;
  border: 1px solid #b8bec8;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  padding: 0 10px;
  cursor: pointer;
}

.ai-assistant-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  overflow: auto;
}

.ai-field {
  display: grid;
  gap: 5px;
}

.ai-field label {
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.ai-field input,
.ai-field select {
  min-height: 34px;
  border: 1px solid #b8bec8;
  border-radius: 6px;
  padding: 6px 8px;
  background: #ffffff;
  color: #111827;
}

.ai-assistant-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-assistant-actions button:first-child {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.ai-result {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
  font-size: 13px;
}

.ai-result h3 {
  margin: 0;
  font-size: 14px;
}

.ai-result table {
  width: 100%;
  border-collapse: collapse;
}

.ai-result th,
.ai-result td {
  border-bottom: 1px solid #edf0f4;
  padding: 6px 4px;
  text-align: left;
  vertical-align: top;
}

.ai-result td:last-child,
.ai-result th:last-child {
  text-align: right;
  white-space: nowrap;
}

.ai-status {
  color: #6b7280;
  font-size: 12px;
  min-height: 18px;
}

@media print {
  .ai-assistant-toggle,
  .ai-assistant-drawer {
    display: none;
  }
}
