* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; color: #222; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

/* New sidedrawer styles (converted from Vue SCSS) */
.sidedrawer { position: relative; float: left; height: 100vh; width: 183px; margin-right: max(14px, 1%); background-color: #3c3c3c; color: #e5e7eb; transition: width 0.2s ease-in-out; }
.sidedrawer-closed { width: 44px; }
.nonius-logo-wrapper { padding-top: 16px; }
.nonius-logo { margin: 14px 12px; height: 32px; display: block; font-weight: 700; letter-spacing: 1px; color: #ffffff; text-align: center; }
.nonius-small-logo { display: none; }
.sidedrawer.sidedrawer-closed #logoFull { display: none; }
.sidedrawer.sidedrawer-closed #logoSmall { display: block; }

/* Topbar (search next to the sidedrawer at the top) */
.topbar { display: flex; align-items: center; gap: .75rem; padding: .75rem 0 0 0; }
.topbar .search-input { padding: .5rem .75rem .5rem 2rem; border-radius: 6px; border: 1px solid #ccc; min-width: 280px; background-color: #fff; background-repeat: no-repeat; background-position: 10px center; background-size: 16px 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
/* Pager controls */
.pager { display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; }
.pager-label { color: #374151; font-size: 14px; }
.pager-select { padding: .25rem .5rem; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #111827; }
.pager-btn { padding: .25rem .5rem; border: 1px solid #d1d5db; background: #fff; color: #111827; border-radius: 6px; cursor: pointer; min-width: 30px; }
.pager-btn:disabled { opacity: .5; cursor: default; }
.pager-input { width: 48px; text-align: center; padding: .25rem .25rem; border: 1px solid #d1d5db; border-radius: 6px; }
.pager-pages { color: #6b7280; font-size: 14px; }

.navigation-menu-items { width: 100%; padding: 0; margin: 0; list-style: none; }
.navigation-menu-item { width: 100%; margin-bottom: 4px; display: flex; flex-flow: column; min-height: fit-content; padding: 0; }
.navigation-menu-item-content { width: 100%; height: 40px; background-color: #3c3c3c; display: flex; align-items: center; justify-content: space-between; padding: 0; user-select: none; }
.navigation-menu-item-content:hover { background-color: #2f2f2f; cursor: pointer; }
.navigation-menu-item-content-info { display: flex; flex-direction: row; align-items: center; }
.navigation-menu-item-content-icon { margin-left: 12px; margin-right: 10px; height: 18px; }
.navigation-menu-item-content-title { font-size: 14px; font-weight: 600; line-height: 18px; letter-spacing: 0.5px; color: #cfcfcf; margin: 0; }
.sidedrawer.sidedrawer-closed .navigation-menu-item-content-title { display: none; }
.sidedrawer.sidedrawer-closed .navigation-menu-item-content { justify-content: center; }

.navigation-sub-menu-item-toggle-icon { margin-right: 12px; margin-top: 4px; }
.navigation-sub-menu-items { display: flex; flex-direction: column; gap: 4px; min-width: 100%; background-color: #e8e8e8; padding-bottom: 4px; }
.navigation-sub-menu-items .server-item { background-color: #f4f4f4; width: 100%; height: 40px; display: flex; align-items: center; flex-flow: row; cursor: pointer; user-select: none; color: #0f172a; border: 0; }
.navigation-sub-menu-items .server-item:hover { background-color: #e9e9e9; }

.server-list { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }
.server-item { width: 100%; text-align: left; padding: .5rem .6rem; border-radius: 6px; border: 1px solid transparent; background: transparent; color: #0f172a; cursor: pointer; }
.server-item.active { background: #dbeafe; border-color: #93c5fd; }
.server-item.all { color: #374151; font-weight: 600; }

.container { flex: 1; padding: 1rem 1.25rem; display: flex; flex-direction: column; overflow: hidden; height: 100vh; }
.notice { padding: .75rem 1rem; border-radius: 8px; background: #f1f5f9; color: #0f172a; margin: .75rem 0; }
.notice.error { background: #fee2e2; color: #991b1b; }

.tenants { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.tenants th, .tenants td { padding: .5rem .6rem; border-bottom: 1px solid #e5e7eb; text-align: left; }
.tenants thead th { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
.tenants tbody tr:hover { background: #f9fafb; }

.group { margin-bottom: 1.5rem; }
.group h2 { margin: .5rem 0; font-size: 1rem; color: #334155; }

.app-footer { padding: .75rem 1.25rem; border-top: 1px solid #e5e7eb; color: #475569; font-size: .875rem; }

/* Drawer toggle button */
.side-drawer-toggle { position: absolute; right: -10px; top: 16px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid #1f2937; background: #f8fafc; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; padding: 0; }
.side-drawer-toggle img { width: 14px; height: 14px; display: block; }

/* Table styles to match Vue visual */
.table { width: 100%; margin-top: 10px; background-color: #fff; border-collapse: separate; border-spacing: 0 5px; table-layout: fixed; }
.table th, .table td { padding: 0 10px; text-align: left; }
.table thead tr { position: sticky; top: 0; z-index: 10; background-color: #fff; color: #8d8d8d; font-family: SourceSansPro-SemiBold, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; font-size: 14px; letter-spacing: 0.23px; }
.table thead .table-header-div { display: flex; flex-direction: row; align-items: center; gap: 5px; }
.table tbody tr { background-color: #f4f4f4; }
.table tbody tr div { height: 40px; width: auto; display: flex; align-items: center; }
.table tbody td { color: #5f5f5f; font-family: SourceSansPro-Regular, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; font-size: 16px; letter-spacing: 0.5px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tbody td:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.table tbody td:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }

/* Responsive: collapse sidebar under narrow widths */
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidedrawer { width: 100%; height: auto; margin-right: 0; }
}


/* Total table sizing: reduce background width to about half of previous (≈16.7%) and align left */
.total-table { width: 16.666% !important; }
/* Keep Total Tenants header on one line */
.total-table thead .table-header-div { white-space: nowrap; }


/* Scrollable content pane inside the main container */
.scroll-area {
  flex: 1 1 auto;
  min-height: 0; /* allow flexbox to shrink so the area can actually scroll */
  overflow-y: auto;
  overflow-x: hidden;
}


/* Sidebar Swagger link: remove underline and keep colors inherited */
.sidedrawer a.navigation-menu-item-content,
.sidedrawer a.navigation-menu-item-content:visited,
.sidedrawer a.navigation-menu-item-content:hover,
.sidedrawer a.navigation-menu-item-content:active,
.sidedrawer a.navigation-menu-item-content:focus {
  text-decoration: none;
  color: inherit;
  outline: none;
}

/* ReDoc embedded view should scroll within the content area */
#redocView {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0; /* allow inner container to shrink */
  overflow-y: auto; /* make this the scroll container */
  overflow-x: hidden;
  padding-top: .45rem; /* match tenants topbar top padding exactly */
  border-top: 1px solid transparent; /* prevent any margin-collapsing quirks on deep links */
  scroll-padding-top: calc(44px + .75rem); /* account for sticky back bar + top padding on deep links */
  padding-bottom: 56px; /* reserve space for Redoc footer/banner to avoid jumps */
  -webkit-overflow-scrolling: touch;
}
/* Persistent back bar above ReDoc content */
.redoc-backbar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  height: 44px; /* fixed height so we can offset ReDoc header */
  display: flex;
  align-items: center;
}
/* Redoc mount container inside the scroll area */
#redoc-container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: visible; /* let Redoc manage its internal panes */
  margin-top: 44px; /* offset below the sticky back bar height */
}

/* Stacking context fix: ensure ReDoc view sits above the tenants/search UI to avoid overlap */
.container { position: relative; }
.scroll-area { position: relative; z-index: 1; }
#redocView { position: relative; z-index: 2; background: #fff; }
