/* P2 Zen — RednBlue Logistics Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --zen-bg: #FCFBF9;
  --zen-sidebar: #001C3E;
  --zen-primary: #006EF2;
  --zen-card: #FFFFFF;
  --zen-border: #EFEFEF;
  --zen-title: #1E2432;
  --zen-body: #1E2432;
  --zen-secondary: #8A8A8A;
  --zen-muted: #ABABAB;
  --zen-surface: #F5F4F2;
  --zen-table-header: #FAFAF8;
  --zen-danger: #E85A4F;
  --zen-radius-card: 16px;
  --zen-radius-btn: 10px;
  --zen-radius-input: 12px;
}

/* ─── Base ─── */
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
  background: var(--zen-bg) !important;
  color: var(--zen-body) !important;
  margin: 0;
}

/* ─── Top bar ─── */
.swagger-ui .topbar {
  background: var(--zen-sidebar) !important;
  padding: 12px 40px !important;
  border-bottom: none !important;
}

.swagger-ui .topbar .download-url-wrapper,
.swagger-ui .topbar .download-url-wrapper input,
.swagger-ui .topbar form,
.swagger-ui .topbar .topbar-wrapper > button {
  display: none !important;
}

.swagger-ui .topbar a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  flex: 0 0 auto !important;
}

/* Hide Swagger SVG logo and images */
.swagger-ui .topbar a svg,
.swagger-ui .topbar img {
  display: none !important;
}

/* Hide "Supported by SmartBear" and default text */
.swagger-ui .topbar a span {
  font-size: 0 !important;
  visibility: hidden !important;
  width: 0 !important;
  overflow: hidden !important;
}

/* Brand: "R" logo square */
.swagger-ui .topbar a::before {
  content: 'R';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--zen-primary);
  border-radius: 8px;
  color: white;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  visibility: visible !important;
}

/* Brand: "RednBlue" text + "ENGINE" subtitle */
.swagger-ui .topbar a::after {
  content: 'RednBlue';
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #FFFFFF;
  visibility: visible !important;
}

.swagger-ui .topbar .topbar-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 10px;
}

.swagger-ui .topbar .topbar-wrapper::after {
  content: 'ENGINE';
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 3px;
  color: #6B8AB5;
}

/* Hide the standalone Swagger quill icon */
.swagger-ui .topbar .topbar-wrapper > *:not(:first-child) {
  display: none !important;
}

/* ─── Wrapper ─── */
.swagger-ui .wrapper {
  max-width: 1200px !important;
  padding: 32px 40px !important;
}

/* ─── Info section ─── */
.swagger-ui .info {
  margin: 0 0 32px 0 !important;
}

.swagger-ui .info .title {
  font-family: 'Outfit', sans-serif !important;
  font-size: 28px !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
}

.swagger-ui .info .title small {
  background: var(--zen-primary) !important;
  border-radius: 8px !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  vertical-align: middle !important;
}

.swagger-ui .info .title small pre {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
}

.swagger-ui .info .description,
.swagger-ui .info .description p,
.swagger-ui .info .description li {
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px !important;
  color: var(--zen-secondary) !important;
  line-height: 1.6 !important;
}

.swagger-ui .info a {
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px !important;
  color: var(--zen-primary) !important;
}

.swagger-ui .info .base-url {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  color: var(--zen-muted) !important;
}

/* ─── Info description markdown ─── */
.swagger-ui .info .description h2 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
  margin: 28px 0 12px 0 !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid var(--zen-border) !important;
}

.swagger-ui .info .description h3 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
  margin: 20px 0 8px 0 !important;
}

.swagger-ui .info .description h4 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
  margin: 16px 0 6px 0 !important;
}

.swagger-ui .info .description hr {
  border: none !important;
  border-top: 1px solid var(--zen-border) !important;
  margin: 24px 0 !important;
}

.swagger-ui .info .description pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 13px !important;
  background: var(--zen-sidebar) !important;
  color: #E8F4FD !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  border: none !important;
  margin: 12px 0 !important;
  overflow-x: auto !important;
  line-height: 1.5 !important;
}

.swagger-ui .info .description code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 12px !important;
  background: var(--zen-surface) !important;
  color: var(--zen-primary) !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  border: 1px solid var(--zen-border) !important;
}

.swagger-ui .info .description pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 13px !important;
}

.swagger-ui .info .description table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 12px 0 !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border: 1px solid var(--zen-border) !important;
}

.swagger-ui .info .description table thead th {
  font-family: 'Outfit', sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: var(--zen-secondary) !important;
  background: var(--zen-surface) !important;
  padding: 10px 16px !important;
  text-align: left !important;
  border-bottom: 1px solid var(--zen-border) !important;
}

.swagger-ui .info .description table tbody td {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  color: var(--zen-body) !important;
  padding: 10px 16px !important;
  border-bottom: 1px solid var(--zen-surface) !important;
}

.swagger-ui .info .description table tbody tr:last-child td {
  border-bottom: none !important;
}

.swagger-ui .info .description table tbody tr:hover {
  background: var(--zen-surface) !important;
}

.swagger-ui .info .description strong {
  font-weight: 600 !important;
  color: var(--zen-title) !important;
}

.swagger-ui .info .description ul,
.swagger-ui .info .description ol {
  padding-left: 20px !important;
  margin: 8px 0 !important;
}

.swagger-ui .info .description li {
  margin-bottom: 4px !important;
}

.swagger-ui .info .description blockquote {
  border-left: 3px solid var(--zen-primary) !important;
  margin: 12px 0 !important;
  padding: 8px 16px !important;
  background: rgba(0, 110, 242, 0.04) !important;
  border-radius: 0 8px 8px 0 !important;
}

/* ─── Filter / Search bar ─── */
.swagger-ui .filter-container {
  padding: 0 0 20px 0 !important;
}

.swagger-ui .filter-container .operation-filter-input {
  font-family: 'Outfit', sans-serif !important;
  border: 1px solid var(--zen-border) !important;
  border-radius: var(--zen-radius-input) !important;
  background: var(--zen-card) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  color: var(--zen-body) !important;
  max-width: 400px !important;
}

.swagger-ui .filter-container .operation-filter-input:focus {
  border-color: var(--zen-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(0, 110, 242, 0.1) !important;
}

/* ─── Sections / Tags ─── */
.swagger-ui .opblock-tag-section {
  margin-bottom: 16px !important;
}

.swagger-ui .opblock-tag {
  font-family: 'Outfit', sans-serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
  border-bottom: 1px solid var(--zen-border) !important;
  padding: 16px 0 !important;
}

.swagger-ui .opblock-tag:hover {
  background: transparent !important;
}

.swagger-ui .opblock-tag small {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  color: var(--zen-secondary) !important;
}

/* ─── Operation blocks ─── */
.swagger-ui .opblock {
  border-radius: var(--zen-radius-card) !important;
  border: 1px solid var(--zen-border) !important;
  box-shadow: none !important;
  margin-bottom: 12px !important;
  overflow: hidden !important;
  background: var(--zen-card) !important;
}

.swagger-ui .opblock .opblock-summary {
  padding: 12px 20px !important;
  border: none !important;
}

.swagger-ui .opblock .opblock-summary:hover {
  background: var(--zen-surface) !important;
}

.swagger-ui .opblock .opblock-summary-method {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: 1px !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  min-width: 70px !important;
  text-align: center !important;
}

.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-path a {
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--zen-title) !important;
}

.swagger-ui .opblock .opblock-summary-description {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  color: var(--zen-secondary) !important;
}

/* GET */
.swagger-ui .opblock.opblock-get {
  border-color: #E8F4FD !important;
  background: var(--zen-card) !important;
}
.swagger-ui .opblock.opblock-get .opblock-summary-method {
  background: #E8F4FD !important;
  color: var(--zen-primary) !important;
}
.swagger-ui .opblock.opblock-get .opblock-summary {
  border-color: transparent !important;
}

/* POST */
.swagger-ui .opblock.opblock-post {
  border-color: #E6F9ED !important;
  background: var(--zen-card) !important;
}
.swagger-ui .opblock.opblock-post .opblock-summary-method {
  background: #E6F9ED !important;
  color: #1B7D3A !important;
}

/* PUT / PATCH */
.swagger-ui .opblock.opblock-put,
.swagger-ui .opblock.opblock-patch {
  border-color: #FFF3E0 !important;
  background: var(--zen-card) !important;
}
.swagger-ui .opblock.opblock-put .opblock-summary-method,
.swagger-ui .opblock.opblock-patch .opblock-summary-method {
  background: #FFF3E0 !important;
  color: #C46200 !important;
}

/* DELETE */
.swagger-ui .opblock.opblock-delete {
  border-color: #FDECEB !important;
  background: var(--zen-card) !important;
}
.swagger-ui .opblock.opblock-delete .opblock-summary-method {
  background: #FDECEB !important;
  color: var(--zen-danger) !important;
}

/* ─── Expanded operation body ─── */
.swagger-ui .opblock-body {
  background: var(--zen-card) !important;
}

.swagger-ui .opblock-body pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 13px !important;
  background: var(--zen-sidebar) !important;
  color: #E8F4FD !important;
  border-radius: 12px !important;
  padding: 16px !important;
  border: none !important;
}

.swagger-ui .opblock-section-header {
  background: var(--zen-table-header) !important;
  border-bottom: 1px solid var(--zen-border) !important;
  box-shadow: none !important;
  padding: 12px 20px !important;
}

.swagger-ui .opblock-section-header h4 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  color: var(--zen-secondary) !important;
}

/* ─── Parameters table ─── */
.swagger-ui table thead tr th,
.swagger-ui table thead tr td,
.swagger-ui .parameters-col_description,
.swagger-ui .parameters-col_name {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  color: var(--zen-body) !important;
  border-color: var(--zen-border) !important;
}

.swagger-ui table thead tr th {
  font-weight: 600 !important;
  color: var(--zen-secondary) !important;
  font-size: 12px !important;
  letter-spacing: 1px !important;
}

.swagger-ui .parameter__name {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 500 !important;
  color: var(--zen-title) !important;
}

.swagger-ui .parameter__name.required span {
  color: var(--zen-danger) !important;
}

.swagger-ui .parameter__type {
  font-family: 'Outfit', sans-serif !important;
  font-size: 12px !important;
  color: var(--zen-muted) !important;
}

/* ─── Buttons ─── */
.swagger-ui .btn {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  border-radius: var(--zen-radius-btn) !important;
  font-size: 13px !important;
  padding: 8px 16px !important;
  transition: all 0.2s ease !important;
}

.swagger-ui .btn.execute {
  background: var(--zen-primary) !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: var(--zen-radius-btn) !important;
}

.swagger-ui .btn.execute:hover {
  background: #0058C4 !important;
}

.swagger-ui .btn.cancel {
  font-family: 'Outfit', sans-serif !important;
  border-color: var(--zen-border) !important;
  color: var(--zen-secondary) !important;
}

.swagger-ui .btn.authorize {
  border-color: var(--zen-primary) !important;
  color: var(--zen-primary) !important;
}

/* ─── Input fields ─── */
.swagger-ui input[type=text],
.swagger-ui textarea,
.swagger-ui select {
  font-family: 'Outfit', sans-serif !important;
  border: 1px solid var(--zen-border) !important;
  border-radius: var(--zen-radius-input) !important;
  background: var(--zen-card) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  color: var(--zen-body) !important;
  transition: border-color 0.2s ease !important;
}

.swagger-ui input[type=text]:focus,
.swagger-ui textarea:focus {
  border-color: var(--zen-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(0, 110, 242, 0.1) !important;
}

.swagger-ui select {
  background-image: none !important;
}

/* ─── Models section ─── */
.swagger-ui section.models {
  border: 1px solid var(--zen-border) !important;
  border-radius: var(--zen-radius-card) !important;
  overflow: hidden !important;
  background: var(--zen-card) !important;
}

.swagger-ui section.models h4 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid var(--zen-border) !important;
  margin: 0 !important;
}

.swagger-ui section.models .model-container {
  background: var(--zen-card) !important;
  margin: 0 !important;
  padding: 12px 20px !important;
  border-bottom: 1px solid var(--zen-surface) !important;
}

.swagger-ui .model-title {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 500 !important;
  color: var(--zen-title) !important;
}

.swagger-ui .model .property {
  font-family: 'Outfit', sans-serif !important;
  color: var(--zen-body) !important;
}

.swagger-ui .model .property.primitive {
  color: var(--zen-primary) !important;
}

/* ─── Response section ─── */
.swagger-ui .responses-inner h4,
.swagger-ui .responses-inner h5 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--zen-secondary) !important;
}

.swagger-ui .response-col_status {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
}

.swagger-ui .response-col_description {
  font-family: 'Outfit', sans-serif !important;
  color: var(--zen-secondary) !important;
}

.swagger-ui .responses-table thead td {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  color: var(--zen-secondary) !important;
  font-size: 12px !important;
}

/* ─── Try it out badge ─── */
.swagger-ui .try-out__btn {
  font-family: 'Outfit', sans-serif !important;
  border-color: var(--zen-primary) !important;
  color: var(--zen-primary) !important;
  border-radius: var(--zen-radius-btn) !important;
  font-weight: 500 !important;
}

.swagger-ui .try-out__btn:hover {
  background: rgba(0, 110, 242, 0.06) !important;
}

/* ─── Loading bar ─── */
.swagger-ui .loading-container .loading::after {
  border-color: var(--zen-primary) !important;
}

/* ─── Scheme container ─── */
.swagger-ui .scheme-container {
  background: var(--zen-card) !important;
  border: 1px solid var(--zen-border) !important;
  border-radius: var(--zen-radius-card) !important;
  box-shadow: none !important;
  padding: 16px 20px !important;
  margin-bottom: 24px !important;
}

/* ─── Auth dialog ─── */
.swagger-ui .dialog-ux .modal-ux {
  border-radius: var(--zen-radius-card) !important;
  border: 1px solid var(--zen-border) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1) !important;
  font-family: 'Outfit', sans-serif !important;
}

.swagger-ui .dialog-ux .modal-ux-header h3 {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  color: var(--zen-title) !important;
}

/* ─── Scrollbar ─── */
.swagger-ui ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.swagger-ui ::-webkit-scrollbar-track {
  background: var(--zen-surface);
  border-radius: 3px;
}

.swagger-ui ::-webkit-scrollbar-thumb {
  background: var(--zen-muted);
  border-radius: 3px;
}

/* ─── Arrow toggle icons ─── */
.swagger-ui .expand-operation svg,
.swagger-ui .arrow svg {
  fill: var(--zen-muted) !important;
}

/* ─── Footer link / info ─── */
.swagger-ui .info hgroup a {
  font-family: 'Outfit', sans-serif !important;
  color: var(--zen-primary) !important;
}

/* ─── Smooth transitions ─── */
.swagger-ui .opblock,
.swagger-ui .opblock-tag,
.swagger-ui .btn,
.swagger-ui input,
.swagger-ui select {
  transition: all 0.15s ease !important;
}

/* ─── Embedded mode (inside dashboard iframe) ─── */
@media all {
  .embedded .swagger-ui .topbar { display: none !important; }
  .embedded body { background: white !important; }
  .embedded .swagger-ui .scheme-container { display: none !important; }
  .embedded .swagger-ui .filter-container { display: none !important; }
}
