html {
  font-size: 14px;
}

@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: 0;
  color: #1f2933;
  background: #f4f6f8;
}

.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;
}

.afs-site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f6f8fb;
}

.afs-front-header {
  border-bottom: 1px solid #dde3ea;
  background: #ffffff;
}

.afs-front-nav {
  min-height: 64px;
}

.afs-brand {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.afs-front-main {
  flex: 1;
  padding: 24px 0 36px;
}

.afs-front-footer {
  padding: 18px 0;
  border-top: 1px solid #dde3ea;
  color: #6b7280;
  background: #ffffff;
}

.afs-admin-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  background: #f4f6f8;
}

.afs-admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 260px;
  min-height: 100vh;
  padding: 20px 16px;
  color: #ffffff;
  background: linear-gradient(180deg, #202833 0%, #151b23 100%);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}

.afs-admin-sidebar__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.afs-admin-sidebar__mark,
.afs-admin-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: rgba(255,255,255,0.13);
}

.afs-admin-sidebar__mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.afs-admin-sidebar nav {
  display: flex;
  flex: 1;
  min-height: 0;
}

.afs-admin-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
}

.afs-admin-nav .nav-item + .nav-item {
  margin-top: 2px;
}

.afs-admin-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.afs-admin-nav .nav-link:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  transform: translateX(2px);
}

.afs-admin-nav .nav-link:focus-visible {
  outline: 2px solid #91c5ff;
  outline-offset: 2px;
}

.afs-admin-nav .nav-link.active {
  color: #ffffff;
  background: rgba(255,255,255,0.15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09), 0 4px 14px rgba(0,0,0,0.18);
  font-weight: 600;
}

.afs-admin-nav__icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.afs-admin-nav__section {
  margin-top: 14px;
}

.afs-admin-nav__section-label {
  display: block;
  padding: 8px 10px 6px;
  color: rgba(255,255,255,0.55);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.afs-admin-subnav {
  margin: 0;
  padding: 0 0 0 10px;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.afs-admin-nav__footer-start {
  margin-top: auto;
  padding-top: 24px;
}

.afs-admin-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

.afs-admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px 24px;
  border-bottom: 1px solid #dde3ea;
  background: #ffffff;
}

.afs-admin-topbar__frontlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #26313f;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.16s ease, transform 0.16s ease;
}

.afs-admin-topbar__frontlink:hover {
  color: #0d6efd;
  transform: translateX(-1px);
}

.afs-admin-topbar__frontlink:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 4px;
}

.afs-admin-topbar__environment {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #3d4854;
  background: #eef2f6;
  font-size: 0.82rem;
  font-weight: 600;
}

.afs-admin-content {
  padding: 24px;
}

.afs-admin-page-header {
  max-width: 760px;
  margin-bottom: 22px;
}

.afs-admin-page-header__eyebrow,
.afs-admin-card__label {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.afs-admin-page-header h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
}

.afs-admin-page-header p:last-child {
  margin-bottom: 0;
  color: #52616f;
}

.afs-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.afs-admin-card {
  min-height: 160px;
  padding: 18px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #ffffff;
}

.afs-admin-card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.afs-admin-card p {
  margin: 0;
  color: #52616f;
}

.afs-admin-filter-panel,
.afs-admin-table-card {
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #ffffff;
}

.afs-admin-filter-panel {
  margin-bottom: 18px;
  padding: 18px;
}

.afs-admin-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.afs-admin-filter-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.afs-admin-table-card {
  overflow: hidden;
}

.afs-admin-table-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid #dde3ea;
}

.afs-admin-table-card__header h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.afs-admin-table-card__header p {
  margin: 0;
  color: #52616f;
}

.afs-admin-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #26313f;
  background: #eef2f6;
  font-weight: 700;
}

.afs-admin-empty-state {
  margin: 0;
  padding: 18px;
  color: #52616f;
}

.afs-admin-log-table {
  margin: 0;
}

.afs-admin-log-table th {
  color: #52616f;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.afs-admin-log-table td {
  max-width: 280px;
  vertical-align: top;
}

.afs-admin-log-message,
.afs-admin-log-details {
  overflow-wrap: anywhere;
}

.afs-admin-log-details {
  margin-top: 4px;
  color: #64748b;
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .afs-admin-shell {
    display: block;
  }

  .afs-admin-sidebar {
    position: static;
    width: 100%;
    min-height: 0;
  }

  .afs-admin-grid {
    grid-template-columns: 1fr;
  }

  .afs-admin-filter-grid {
    grid-template-columns: 1fr;
  }
}
