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-bottom: 60px;
}

.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;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(145deg, #f0f4f8 0%, #e2e8f0 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.login-card__header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.login-card__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
}

.login-card__subtitle {
  font-size: 0.9375rem;
  color: #64748b;
  margin: 0;
}

.login-form__group {
  margin-bottom: 1.25rem;
}

.login-form__group--row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.login-form__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.login-form__label--checkbox {
  margin-bottom: 0;
  font-weight: 400;
  color: #4b5563;
}

.login-form__input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #1a202c;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form__input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-form__input::placeholder {
  color: #9ca3af;
}

.login-form__checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #3b82f6;
}

.login-form__error {
  display: block;
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

.login-form__submit {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.login-form__submit:hover:not(:disabled) {
  background: #1d4ed8;
}

.login-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.login-alert--danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.login-alert--warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.dashboard-wrap {
  padding: 3rem 0 4rem 0;
  background: radial-gradient(circle at top, #eef2ff 0%, #f8fafc 45%, #ffffff 100%);
  min-height: calc(100vh - 60px);
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.75rem;
  padding: 1.75rem 2rem;
  border-radius: 20px;
  background: linear-gradient(140deg, #111827 0%, #1e3a8a 45%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22) 0%, transparent 50%),
              radial-gradient(circle at 80% 10%, rgba(56, 189, 248, 0.3) 0%, transparent 45%);
  opacity: 0.8;
  pointer-events: none;
}

.dashboard-hero--pro {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.dashboard-hero__brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.dashboard-hero__logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.25);
}

.dashboard-hero__logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.dashboard-hero__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dashboard-hero__subtitle {
  font-size: 1rem;
  opacity: 0.85;
}

.dashboard-hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.dashboard-hero__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-weight: 600;
}

.dashboard-hero__actions .btn-light {
  background: #fff;
  border-color: #fff;
  color: #1f2937;
}

.dashboard-hero__actions .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.settings-menu .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.settings-menu .dropdown-menu {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  padding: 0.4rem;
}

.settings-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 8px;
  font-weight: 600;
}

.settings-menu .dropdown-item i {
  color: #2563eb;
}

.database-modal .modal-content {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.database-modal .modal-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.5rem 1.75rem;
}

.database-modal .modal-body {
  padding: 1.5rem 1.75rem 2rem;
}

.database-modal__title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.database-modal__title-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
  font-size: 1.35rem;
}

.database-modal__subtitle {
  color: #64748b;
  font-size: 0.9rem;
}

.database-panel {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  height: 100%;
}

.database-panel--list {
  background: #ffffff;
}

.database-panel__header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.database-panel__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  font-size: 1.2rem;
}

.database-panel__icon--secondary {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.database-panel__title {
  font-weight: 700;
  color: #0f172a;
}

.database-panel__subtitle {
  color: #64748b;
  font-size: 0.85rem;
}

.database-form .form-control,
.database-form .form-select {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.database-form .form-control:focus,
.database-form .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.database-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.database-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1rem 1.25rem;
  background: #f8fafc;
}

.database-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.database-card__identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.database-card__dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.1);
}

.database-card__name {
  font-weight: 700;
  color: #0f172a;
}

.database-card__meta {
  font-size: 0.8rem;
  color: #94a3b8;
}

.database-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.database-card__actions {
  margin-top: 0.75rem;
}

.database-card__delete {
  align-self: flex-end;
}

.database-empty {
  padding: 2rem;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.database-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
  font-size: 1.4rem;
}

.database-empty__title {
  font-weight: 700;
  color: #0f172a;
}

.database-empty__subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
}

.database-form--row .form-label {
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card {
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 55%);
  pointer-events: none;
}

.stat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.stat-label {
  color: #64748b;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0.5rem;
}

.stat-meta {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #1f2937;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.25);
  position: relative;
  z-index: 1;
}

.stat-icon--primary {
  background: rgba(59, 130, 246, 0.18);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.stat-icon--accent {
  background: rgba(14, 116, 144, 0.18);
  color: #0e7490;
  border-color: rgba(14, 116, 144, 0.3);
}

.stat-icon--success {
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.stat-icon--warning {
  background: rgba(249, 115, 22, 0.18);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.3);
}

.backups-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.backups-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.backups-card__title {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.backups-card__title-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-size: 1.25rem;
}

.backups-card__subtitle {
  font-size: 0.9rem;
  color: #64748b;
}

.backups-card__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.backups-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.85rem;
  font-weight: 600;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filters .form-select {
  min-width: 160px;
}

.backups-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.backups-table__filters th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.backups-table__filters .form-control,
.backups-table__filters .form-select {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 0.8rem;
}

.table-header {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.table-header i {
  font-size: 0.9rem;
  color: #94a3b8;
}

.table-primary-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.table-primary-text i {
  color: #1d4ed8;
  font-size: 1rem;
}

.backups-table tbody tr {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.backups-table tbody tr:hover {
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.backups-table__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.backups-table__actions .btn {
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-soft {
  background: #eef2ff;
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-soft i {
  margin-right: 0.35rem;
}

.badge-full {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-diff {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.pagination .page-link {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

.pagination .page-item.active .page-link {
  background: #2563eb;
  border-color: #2563eb;
}

@media (max-width: 768px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
  }

  .dashboard-hero__brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-hero__logo-wrap {
    width: 64px;
    height: 64px;
  }

  .dashboard-hero__logo {
    width: 46px;
    height: 46px;
  }

  .backups-card__header {
    align-items: flex-start;
  }

  .backups-card__title {
    width: 100%;
  }
}
