.apej-docs-shell {
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  background: hsl(var(--card));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin: 0 auto;
  max-width: 72rem;
  padding: 1.25rem;
}

.apej-docs-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.apej-docs-title {
  color: hsl(var(--primary));
  font-family: var(--app-font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.apej-docs-muted {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.apej-docs-grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.apej-docs-field-full {
  grid-column: 1 / -1;
}

.apej-docs-label {
  color: hsl(var(--muted-foreground));
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.apej-docs-input,
.apej-docs-select {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: 8px;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  min-height: 42px;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.apej-docs-input[type="file"] {
  padding: 0.45rem 0.6rem;
}

.apej-docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.apej-docs-button {
  align-items: center;
  background: hsl(var(--primary));
  border: 1px solid hsl(var(--primary));
  border-radius: 8px;
  color: hsl(var(--primary-foreground));
  cursor: pointer;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 0.85rem;
}

.apej-docs-button.secondary {
  background: hsl(var(--background));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.apej-docs-button.danger {
  background: hsl(var(--destructive));
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.apej-docs-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.apej-docs-tabs {
  background: hsl(var(--muted));
  border-radius: 10px;
  display: inline-flex;
  gap: 0.25rem;
  margin: 1.25rem 0 0.75rem;
  padding: 0.25rem;
}

.apej-docs-tab {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  min-height: 38px;
  padding: 0.5rem 0.75rem;
}

.apej-docs-tab.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.apej-docs-table-wrap {
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.apej-docs-table {
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 900px;
  width: 100%;
}

.apej-docs-table th,
.apej-docs-table td {
  border-bottom: 1px solid hsl(var(--border));
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

.apej-docs-table th {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 700;
}

.apej-docs-table tr:last-child td {
  border-bottom: 0;
}

.apej-docs-pill {
  background: hsl(var(--primary) / 0.1);
  border-radius: 999px;
  color: hsl(var(--primary));
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
}

.apej-docs-link {
  color: hsl(var(--accent));
  font-weight: 700;
  text-decoration: underline;
}

.apej-docs-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 180px;
}

.apej-docs-status {
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.apej-docs-status.error {
  color: hsl(var(--destructive));
}

.apej-docs-status.ok {
  color: #15803d;
}

.apej-contact-cui {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(32, 41, 57, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 0.25rem;
}

.apej-contact-cui-label {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.apej-contact-cui-value {
  color: hsl(var(--foreground));
  font-weight: 700;
}

#apej-public-documents-enhanced {
  padding: 0 1rem 3rem;
}

#apej-public-documents-enhanced .apej-docs-shell {
  margin-top: 1rem;
}

@media (max-width: 767px) {
  .apej-docs-shell {
    border-radius: 10px;
    padding: 1rem;
  }

  .apej-docs-header,
  .apej-docs-grid {
    display: block;
  }

  .apej-docs-field,
  .apej-docs-field-full {
    margin-bottom: 0.875rem;
  }

  .apej-docs-tabs {
    display: flex;
    width: 100%;
  }

  .apej-docs-tab {
    flex: 1;
    white-space: normal;
  }
}
