/* Mail Admin - the VIDEODL look in plain CSS on top of Bootstrap 5.3 (vendor/bootstrap.min.css), forked from
   containers/pureftpd-container/app/ui/styles.css (0.12.1). No external assets, no icon font: icons are inline SVG.
   Colours come from Bootstrap theme variables (data-bs-theme on <html>); the top bar and footer stay dark. */

body {
  font-variant-numeric: lining-nums;
  background: var(--bs-body-bg);
}

.text-muted {
  color: var(--bs-secondary-color) !important;
}

.ico {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  vertical-align: -.15em;
}

/* ------------------------------------------------------------------ page frame */

.page-frame {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Top bar: dark in both colour schemes, slightly lifted in dark mode. */
.topbar {
  background: #1b2430;
  color: #fff;
  padding: .4rem 0;
}

html[data-bs-theme="dark"] .topbar {
  background: #222c38;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: #fff;
}

.counters {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .85rem;
  color: rgb(255 255 255 / 70%);
}

.counters li {
  white-space: nowrap;
}

.counters li:empty {
  display: none;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
}

.topbar .btn-link {
  color: rgb(255 255 255 / 85%);
  text-decoration: none;
}

.topbar .btn-link:hover,
.topbar .btn-link:focus {
  color: #fff;
}

.topbar .btn-outline-warning {
  white-space: nowrap;
}

/* Colour scheme trigger: the glyph for the active mode is shown, the others are hidden. */
.theme-glyph [data-glyph] {
  display: none;
}

.theme-glyph[data-mode="light"] [data-glyph="light"],
.theme-glyph[data-mode="dark"] [data-glyph="dark"],
.theme-glyph[data-mode="auto"] [data-glyph="auto"] {
  display: inline-block;
}

.scheme-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-width: 9rem;
}

.scheme-glyph {
  width: 1rem;
  opacity: .6;
}

.scheme-check {
  display: none;
  margin-left: auto;
}

.scheme-menu .theme-option.active .scheme-check {
  display: inline-block;
}

/* Footer: dark in both schemes, versions centred. */
.site-foot {
  padding: .9rem 1rem;
  color: rgb(255 255 255 / 85%);
  background: #15191d;
}

.versions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.75rem;
  margin: 0;
  font-size: .85rem;
}

.versions div {
  display: flex;
  align-items: baseline;
  gap: .45rem;
}

.versions dt {
  font-weight: 400;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .65;
}

.versions dd {
  margin: 0;
  font-family: var(--bs-font-monospace);
}

/* Workspace: 16px side gutter on phones, no horizontal page scroll. */
.workspace {
  padding-left: 1rem;
  padding-right: 1rem;
  padding-bottom: 3rem;
}

/* ------------------------------------------------------------------ notices (replace toasts) */

.notice-stack {
  position: fixed;
  top: .75rem;
  right: .75rem;
  /* Above the admin overlay (9998), the login overlay (9999) and Bootstrap modals (1055): a notice is never
     hidden behind a layer (owner finding 2026-10-15). */
  z-index: 10100;
  display: grid;
  gap: .4rem;
  width: min(26rem, calc(100vw - 1.5rem));
}

.notice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  width: 100%;
  padding: .65rem .85rem;
  border: 0;
  border-left: 4px solid rgb(0 0 0 / 25%);
  border-radius: .4rem;
  text-align: left;
  font-size: .9rem;
  color: #fff;
  box-shadow: 0 .4rem 1rem rgb(0 0 0 / 25%);
  animation: notice-in .25s ease-out;
}

.notice[data-tone="error"] {
  background: #b4232f;
}

.notice[data-tone="success"] {
  background: #1d7a4a;
}

.notice[data-tone="info"] {
  background: #1f5fa8;
}

.notice-text {
  flex: 1;
  overflow-wrap: anywhere;
}

.notice-x {
  font-size: 1.15rem;
  line-height: 1;
  opacity: .75;
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(-.5rem);
  }
}

/* ------------------------------------------------------------------ login overlay */

.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bs-body-bg);
  z-index: 9999;
  overflow-y: auto;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 2rem;
  border-radius: 8px;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 4px 24px rgb(0 0 0 / 10%);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #1b2430;
  color: #fff;
}

html[data-bs-theme="dark"] .login-card {
  box-shadow: 0 4px 24px rgb(0 0 0 / 40%);
}

.login-foot {
  margin-top: 1rem;
  text-align: center;
}

.version-chip {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-family: var(--bs-font-monospace);
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
}

/* ------------------------------------------------------------------ user account block */

.account-block {
  max-width: 64rem;
  margin: 2.5rem auto 0;
}

/* Message of the day: a banner above the account block; the text keeps the server's line breaks. */
.motd-card {
  max-width: 64rem;
  margin: 2.5rem auto 0;
}

.motd-card + .account-block {
  margin-top: 1rem;
}

.motd-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .9rem;
}

/* Settings grid: the textareas use the monospace font (addresses and file-name patterns are typed text). */
#ftp-form textarea {
  font-family: var(--bs-font-monospace, monospace);
}

.pick-label {
  display: block;
  margin-bottom: .2rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

#view-user > .row {
  margin-top: 2rem;
}

/* ------------------------------------------------------------------ ledgers (tables as cards) */

.ledger {
  margin-top: 2rem;
  overflow: hidden;
}

.ledger.flush,
.admin-sec > .ledger:first-child,
.row > [class*="col"] > .ledger {
  margin-top: 0;
}

.ledger-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding: .75rem 1rem;
  background: var(--bs-tertiary-bg);
  border-bottom: 1px solid var(--bs-border-color);
}

.ledger-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.ledger-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}

.ledger > .card-body {
  background: var(--bs-body-bg);
}

/* Tables: header cells are small uppercase labels, no grey Bootstrap "table-light" fill. */
thead th {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  background: var(--bs-tertiary-bg);
}

.filter-row th {
  font-weight: normal;
  font-size: inherit;
  text-transform: none;
  letter-spacing: 0;
  padding-top: .25rem;
  padding-bottom: .25rem;
}

/* The filter selects keep their words ("any", "yes") when a wide column squeezes them. */
.filter-row .form-select {
  min-width: 4.5rem;
}

.table td {
  font-variant-numeric: tabular-nums;
}

.col-acts {
  width: 1%;
  white-space: nowrap;
  text-align: right;
  padding-right: 1rem;
}

.col-acts .btn {
  padding: .15rem .4rem;
}

/* Disabled users keep the table colours of the current scheme. */
tr.table-secondary {
  --bs-table-bg: var(--bs-secondary-bg);
  --bs-table-color: var(--bs-secondary-color);
}

.dir-list {
  max-height: 26rem;
  overflow-y: auto;
}

/* Folder rules (directory policies): the rules text is cut with an ellipsis; the full text is the title. */
.policy-badge {
  display: inline-block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.policy-cell {
  min-width: 10rem;
}

.policy-cell .usage-meter {
  width: 8rem;
  max-width: 100%;
}

/* The rules text of the Storage ledger wraps before it reaches the Used column. */
.policy-rules {
  min-width: 13rem;
  max-width: 22rem;
}

/* The sample rows of a policy preview scroll inside the modal instead of making it taller than the screen. */
.dp-preview-list {
  max-height: 14rem;
  overflow-y: auto;
}

.breadcrumb {
  flex-wrap: wrap;
}

.font-monospace {
  word-break: break-all;
}

/* ------------------------------------------------------------------ stat cards */

.stat-tile {
  height: 100%;
  padding: .85rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  background: var(--bs-tertiary-bg);
}

.stat-tile .stat-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .35rem;
}

.stat-tile .stat-value {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

/* ------------------------------------------------------------------ usage (storage) */

/* Thin Bootstrap progress bar; the track keeps the scheme's secondary background in light and dark. */
.usage-meter {
  height: .45rem;
  min-width: 7rem;
  margin-top: .3rem;
  background-color: var(--bs-secondary-bg);
}

/* Usage cell: the bar sits inline after the one-line text, so it is narrower and has no generic top margin. */
.usage-cell .usage-meter {
  width: 5rem;
  min-width: 5rem;
  margin-top: 0;
  max-width: 100%;
}

/* Bootstrap modals sit above the admin overlay (9998) and the workspace; notices stay above the modals (10100). */
.modal {
  z-index: 10050;
}

.modal-backdrop {
  z-index: 10040;
}

/* ------------------------------------------------------------------ admin overlay */

.admin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
  padding-left: .5rem;
  padding-right: .5rem;
  padding-bottom: 1rem;
  background: rgb(0 0 0 / 50%);
  z-index: 9998;
  overflow-y: auto;
}

.admin-panel {
  /* As wide as its tables need (the users ledger is wider than 1200 px), capped by the viewport: no inner
     horizontal scrollbar on a desktop; on a narrow screen the table-responsive wrappers scroll instead. */
  width: fit-content;
  min-width: min(100%, 64rem);
  max-width: 100%;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  box-shadow: 0 8px 32px rgb(0 0 0 / 20%);
  margin-bottom: 2rem;
}

/* Users table, actions cell: the five buttons stay on one line (short labels, the full meaning in each title),
   so a user is one row and the panel takes the width the screen offers. */
.admin-panel .row-actions {
  white-space: nowrap;
}

.admin-header h4 {
  font-size: 1.2rem;
}

#admin-tabs .btn {
  white-space: nowrap;
}

.admin-sec {
  margin-top: 1.25rem;
}

/* Logs */
.log-output {
  background: #0b0e11;
  color: #d6dde4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 32rem;
  overflow: auto;
  min-height: 6rem;
}

/* QR code */
.totp-qr svg {
  width: 180px;
  height: 180px;
  max-width: 100%;
  background: #fff;
  padding: .5rem;
  border-radius: .375rem;
}

.cursor-pointer {
  cursor: pointer;
}

/* ------------------------------------------------------------------ phone width */

@media (max-width: 575.98px) {
  .workspace,
  .topbar-inner,
  .login-overlay {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-overlay {
    padding-top: 16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-panel {
    padding: 1rem;
  }

  .modal-dialog {
    margin: .5rem;
  }

  .table-responsive {
    max-width: 100%;
  }

  .account-block {
    margin-top: 1.5rem;
  }
}

/* Two-factor by group (FTP settings → Access): the three group rows keep their selects on one line. */
.totp-groups select {
  min-width: 7.5rem;
}

/* 0.12.0 connectors (app/ui/connectors.js): the step list of a directory or Duo test, and the group mapping rows. */
.conn-steps {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0.25rem;
}
.conn-steps li {
  margin-bottom: 0.2rem;
}
.cd-map-row .cd-map-dn {
  min-width: 12rem;
  flex: 1 1 16rem;
}

/* ------------------------------------------------------------------ mail portal: left nav + section host (A0) */

.shell {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-top: 1rem;
  align-items: start;
}

.side-nav {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .5rem;
  border-radius: .5rem;
  background: var(--bs-tertiary-bg);
}

.side-nav .nav-item-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .45rem .7rem;
  border: 0;
  border-radius: .35rem;
  background: transparent;
  color: var(--bs-body-color);
  text-align: left;
  font-size: .925rem;
}

.side-nav .nav-item-btn:hover {
  background: var(--bs-secondary-bg);
}

.side-nav .nav-item-btn.active {
  background: var(--bs-primary);
  color: #fff;
}

.side-nav .nav-item-btn .nav-badge {
  margin-left: auto;
}

.section-host {
  min-width: 0;
}

.ms-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 .75rem;
}

.ms-placeholder {
  padding: 2rem;
  border: 1px dashed var(--bs-border-color);
  border-radius: .5rem;
  color: var(--bs-secondary-color);
  text-align: center;
}

.ms-banner {
  margin-bottom: 1rem;
}

.mono-break {
  font-family: var(--bs-font-monospace);
  overflow-wrap: anywhere;
  word-break: break-all;
}

@media (max-width: 767.98px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .side-nav .nav-item-btn {
    width: auto;
  }
}
