html {
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f4f6f8;
  color: #1f2933;
}

.backoffice-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.side-menu {
  background: #fff;
  border-right: 1px solid #d9e1e8;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  align-items: center;
  display: flex;
  min-height: 52px;
  padding: 4px 2px 14px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  border-radius: 6px;
  color: #344054;
  font-weight: 700;
  padding: 10px 12px;
  text-decoration: none;
}

.side-nav a:hover {
  background: #eef5fb;
  color: #185a9d;
}

.side-user {
  border-top: 1px solid #e4e9ee;
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
}

.side-user span {
  color: #52606d;
  font-size: .92rem;
}

.side-user a {
  color: #185a9d;
  font-weight: 700;
  text-decoration: none;
}

.content-shell {
  min-width: 0;
  padding: 28px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.app-shell {
  padding-top: 28px;
}

.brand-logo-link {
  align-items: center;
  display: flex;
  min-height: 44px;
  padding-bottom: 6px;
  padding-top: 6px;
}

.brand-logo {
  display: block;
  height: 34px;
  object-fit: contain;
  width: auto;
}

.toolbar {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.toolbar h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}

.toolbar p {
  color: #657282;
  margin: 6px 0 0;
}

.filters {
  display: flex;
  gap: 10px;
}

.filters input,
.filters select {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
}

.filters button {
  background: #185a9d;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 16px;
}

.secondary-link {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  color: #344054;
  display: inline-flex;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 14px;
  text-decoration: none;
}

.provision-form,
.user-form,
.sms-form,
.status-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1.4fr 2fr 1fr auto auto;
  padding: 16px;
}

.user-form {
  grid-template-columns: 1.4fr 1fr 1.3fr 1fr auto auto;
}

.sms-form {
  grid-template-columns: 1.5fr 1.2fr 1fr auto;
}

.status-form {
  grid-template-columns: 2fr 1.5fr 1.2fr auto;
}

.movement-filters {
  flex-wrap: wrap;
  justify-content: end;
}

.provision-form label,
.user-form label,
.sms-form label,
.status-form label,
.modal-form label {
  display: grid;
  gap: 5px;
}

.provision-form span,
.user-form span,
.sms-form span,
.status-form span,
.modal-form span {
  color: #657282;
  font-size: .82rem;
  font-weight: 600;
}

.provision-form input:not([type="checkbox"]),
.user-form input:not([type="checkbox"]),
.user-form select,
.sms-form input,
.sms-form select,
.sms-form textarea,
.status-form input,
.chart-filter-form select,
.modal-form select,
.modal-form input {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
}

.sms-form textarea {
  min-height: 92px;
  resize: vertical;
}

.provision-form button,
.user-form button,
.sms-form button,
.status-form button,
.primary-action {
  background: #28724f;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 16px;
}

.user-form button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 142px;
}

.sms-message {
  min-width: 220px;
}

.sms-message-full {
  grid-column: 1 / -1;
}

.inline-form {
  display: inline;
  margin: 0;
}

.token-code {
  background: #f2f4f7;
  border: 1px solid #e4e7ec;
  border-radius: 5px;
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  padding: 4px 6px;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.notice {
  background: #eef7f1;
  border: 1px solid #b8dfc5;
  border-radius: 8px;
  color: #245b3b;
  font-weight: 600;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.status-result {
  background: #101828;
  color: #f2f4f7;
  margin: 0;
  overflow-x: auto;
  padding: 14px 16px;
  white-space: pre-wrap;
}

.doc-panel {
  background: #fff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  margin-bottom: 24px;
  padding: 26px;
}

.doc-content {
  max-width: 980px;
}

.doc-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 26px 0 10px;
}

.doc-content h2:first-child {
  margin-top: 0;
}

.doc-content pre {
  background: #101828;
  border-radius: 8px;
  color: #f2f4f7;
  overflow-x: auto;
  padding: 14px 16px;
}

.doc-content code {
  font-size: .9rem;
}

.doc-content li {
  margin-bottom: 6px;
}

.secondary-action {
  background: #fff;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  color: #344054;
  font-weight: 600;
  min-height: 40px;
  padding: 8px 16px;
}

.danger-action {
  background: #fff1f0;
  border: 1px solid #ffa39e;
  border-radius: 6px;
  color: #a8071a;
  font-weight: 700;
  min-height: 32px;
  padding: 5px 10px;
}

.check-row {
  align-items: center;
  display: flex !important;
  gap: 8px;
  min-height: 40px;
}

.nav-user {
  align-items: center;
  display: flex;
  gap: 12px;
  font-size: .92rem;
}

.nav-user span {
  color: #52606d;
}

.nav-user a {
  color: #185a9d;
  font-weight: 600;
  text-decoration: none;
}

.login-shell {
  display: grid;
  min-height: calc(100vh - 180px);
  place-items: center;
}

.login-panel {
  background: #fff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  max-width: 420px;
  padding: 28px;
  width: 100%;
}

.login-panel h1 {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0;
}

.login-logo {
  display: block;
  height: auto;
  margin-bottom: 2px;
  max-width: 220px;
  width: 70%;
}

.login-panel p {
  color: #657282;
  margin: 0;
}

.login-panel label {
  display: grid;
  gap: 5px;
}

.login-panel span {
  color: #657282;
  font-size: .86rem;
  font-weight: 600;
}

.login-panel input {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 42px;
  padding: 8px 10px;
}

.login-panel button {
  background: #185a9d;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  min-height: 42px;
}

.form-error {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  border-radius: 6px;
  color: #a8071a !important;
  padding: 8px 10px;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 24px;
}

.metrics article,
.panel {
  background: #fff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
}

.metrics article {
  padding: 16px;
}

.metrics span {
  color: #657282;
  display: block;
  font-size: .86rem;
}

.metrics strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 4px;
}

.analysis-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chart-panel {
  overflow: visible;
}

.chart-filter-form {
  align-items: end;
  display: flex;
  gap: 10px;
}

.chart-filter-form label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.chart-filter-form span {
  color: #657282;
  font-size: .82rem;
  font-weight: 600;
}

.chart-filter-form button {
  background: #185a9d;
  border: 0;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  min-height: 40px;
  padding: 8px 16px;
}

.chart-wrap {
  padding: 20px;
}

.panel {
  margin-bottom: 22px;
  overflow: hidden;
}

.section-title {
  align-items: center;
  border-bottom: 1px solid #e4e9ee;
  display: flex;
  min-height: 48px;
  padding: 0 16px;
}

.panel-title-actions {
  justify-content: space-between;
  gap: 16px;
}

.section-title h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.page-size-form label {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
}

.page-size-form span {
  color: #657282;
  font-size: .82rem;
  font-weight: 600;
}

.page-size-form select {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  min-height: 34px;
  padding: 5px 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #edf1f5;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #52606d;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.num {
  text-align: right;
}

.pagination-bar {
  align-items: center;
  background: #fafbfd;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 10px 16px;
}

.pagination-bar span {
  color: #657282;
  font-size: .9rem;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.pagination-actions a,
.disabled-page {
  border: 1px solid #cbd5df;
  border-radius: 6px;
  color: #185a9d;
  font-weight: 700;
  min-width: 88px;
  padding: 6px 10px;
  text-align: center;
  text-decoration: none;
}

.disabled-page {
  color: #98a2b3;
}

.actions-cell {
  text-align: right;
  white-space: nowrap;
}

.icon-action {
  background: #eef5fb;
  border: 1px solid #b8d3ea;
  border-radius: 6px;
  color: #185a9d;
  font-weight: 700;
  min-height: 32px;
  padding: 5px 10px;
}

.link-action {
  display: inline-flex;
  text-decoration: none;
}

.form-hint {
  color: #657282;
  font-size: .9rem;
  margin: 0;
}

.detail-list {
  display: grid;
  gap: 12px;
}

.detail-list div {
  border-bottom: 1px solid #edf1f5;
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
}

.detail-list span {
  color: #657282;
  font-size: .82rem;
  font-weight: 700;
}

.detail-list strong {
  color: #1f2933;
  font-size: .98rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-form {
  display: grid;
  gap: 14px;
}

@media (max-width: 900px) {
  .backoffice-layout {
    grid-template-columns: 1fr;
  }

  .side-menu {
    height: auto;
    position: static;
  }

  .content-shell {
    padding: 18px;
  }

  .toolbar,
  .filters,
  .chart-filter-form,
  .provision-form,
  .user-form,
  .sms-form,
  .status-form {
    align-items: stretch;
  }

  .toolbar,
  .filters,
  .chart-filter-form {
    flex-direction: column;
  }

  .panel-title-actions,
  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .provision-form,
  .user-form,
  .sms-form,
  .status-form {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
