:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  color-scheme: light;
}

html,
body,
#app {
  min-height: 100%;
  margin: 0;
}

body {
  background: #f4f7f8;
  color: #24343b;
}

.v-application {
  background: #f4f7f8 !important;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  background: #f7f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-page .v-main__wrap {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f9fa;
}

.login-shell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-shell .v-row {
  margin: 0;
  width: 100%;
}

.login-card {
  border: 1px solid #dfe7ea;
  background: #ffffff;
}

.app-main {
  min-height: 100vh;
  background: #f4f7f8;
}

.content {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid #dfe7ea;
  background: #ffffff !important;
}

.v-tooltip .v-overlay__content {
  background: #152a34 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

.refresh-tooltip,
.refresh-tooltip .v-overlay__content {
  background: #152a34 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

.drawer-brand {
  min-height: 92px;
  display: flex;
  align-items: center;
  background: #173842;
}

.drawer-brand .text-subtitle-1 {
  white-space: nowrap;
}

.drawer-divider {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.v-navigation-drawer {
  background: #173842 !important;
}

.v-navigation-drawer .v-list-item {
  color: #d7e5e8 !important;
}

.v-navigation-drawer .v-list-item:hover {
  background: #214b58 !important;
}

.v-navigation-drawer .v-list-item--active {
  background: #23785b !important;
  color: #ffffff !important;
}

.stat-card {
  border-color: #dfe7ea;
}

.chart {
  width: 100%;
  height: 320px;
  min-height: 240px;
}

.empty-state {
  padding: 32px 16px;
  color: #71818a;
  text-align: center;
  font-size: 0.875rem;
}

.detail-item {
  min-height: 70px;
}

.loading-bar {
  position: fixed;
  z-index: 1100;
  top: 0;
  right: 0;
  left: 0;
}

.admin-table .v-data-table__td {
  vertical-align: middle;
}

.admin-table .v-data-table__th {
  padding-inline: 16px !important;
  white-space: nowrap;
}

.admin-table .v-data-table__td {
  padding-inline: 16px !important;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
}

.admin-table .v-table__wrapper > table {
  width: 100%;
  table-layout: fixed;
}

.admin-table .v-table__wrapper {
  overflow-x: auto;
}

.admin-table .v-data-table__th,
.admin-table .v-data-table__td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cdk-search {
  width: min(260px, 30vw);
  min-width: 160px;
}

.cdk-reveal textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.table-ellipsis {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-detail {
  max-width: 360px;
}

.question-editor {
  border-color: #dfe7ea !important;
  background: #fbfcfc;
}

.option-editor {
  border-left: 3px solid #d8e8e1;
  padding-left: 12px;
}

.json-preview {
  margin: 0;
  max-height: 65vh;
  overflow: auto;
  padding: 16px;
  border: 1px solid #dfe7ea;
  border-radius: 6px;
  background: #152a34;
  color: #edf7f2;
  font: 0.8rem/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.toolbar-wrap {
  flex-wrap: wrap;
}

.library-toolbar {
  row-gap: 10px;
}

.cdk-toolbar {
  row-gap: 10px;
}

.bank-meta-row .v-field {
  min-width: 0;
}

.config-card {
  max-width: 980px;
}

/* Library tables use the server-side pager below the table. */
.library-toolbar ~ .v-data-table,
.cdk-toolbar ~ .v-data-table {
  border-bottom: 1px solid #dfe7ea;
}

@media (max-width: 600px) {
  .content {
    padding: 12px !important;
  }

  .topbar {
    height: 64px !important;
  }

  .cdk-search {
    width: 100%;
    min-width: 0;
  }

  .chart {
    height: 240px;
  }

  .table-ellipsis {
    max-width: 150px;
  }

  .audit-detail {
    max-width: 190px;
  }

  .admin-table .v-table__wrapper > table {
    min-width: 720px;
  }

  .admin-table .v-data-table__th,
  .admin-table .v-data-table__td {
    padding-inline: 12px !important;
  }

  .question-editor .v-card-text {
    padding-inline: 12px;
  }
}

@media (min-width: 601px) {
  .admin-table .v-data-table__th,
  .admin-table .v-data-table__td {
    padding-inline: clamp(12px, 1.25vw, 24px) !important;
  }
}
