html {
  font-size: 14px;
}

:root {
  color-scheme: light;
}

body {
  background-color: #ffffff;
  color: #212529;
}

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

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
}

.app-brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 .25rem .45rem rgba(0, 0, 0, .18));
}

.app-brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
}

.app-brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .18rem;
}

.app-brand-subtitle {
  font-size: .7rem;
  opacity: .88;
}

.app-version-strip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}

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

.card {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.08);
}

.card-header {
  background: linear-gradient(135deg, #0d6efd 0%, #6ea8fe 100%);
  color: #fff;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
}

.table-container {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.06);
  padding: 1rem;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: #f8f9fa;
}

html[data-bs-theme="dark"] {
  color-scheme: dark;
}

html[data-bs-theme="dark"] body {
  background-color: #212529;
  color: #e9ecef;
}

html[data-bs-theme="dark"] .table-container {
  background: #1f2328;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.2);
}

html[data-bs-theme="dark"] .table {
  color: #e9ecef;
}

html[data-bs-theme="dark"] .table thead th {
  background-color: #2b3035;
  color: #e9ecef;
}

.hero {
  background: linear-gradient(135deg, #e8f0ff 0%, #ffffff 100%);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 0.75rem 1.5rem rgba(13,110,253,0.08);
}

.quick-link {
  display: block;
  text-decoration: none;
  border-radius: 0.75rem;
  padding: 1.25rem;
  background: #ffffff;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,0.08);
}

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

/* RTL global support */
html[lang="fa"] {
  direction: rtl;
}

body {
  text-align: right;
}

.table th, .table td {
  text-align: right;
}

.form-control, .form-select {
  text-align: right;
}

.input-group {
  direction: rtl;
}

/* Dropdown alignment for RTL */
.dropdown-menu {
  right: 0;
  left: auto;
  text-align: right;
}

/* Bootstrap utility overrides for RTL when default CSS is LTR */
html[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .me-auto { margin-left: auto !important; margin-right: 0 !important; }
html[dir="rtl"] .float-start { float: right !important; }
html[dir="rtl"] .float-end { float: left !important; }

.btn-dashboard {
  font-size: 1.05rem;
  padding: .5rem .9rem;
}

.btn-icon {
  padding: .25rem .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon .bi {
  font-size: 1.2rem;
  line-height: 1;
}

.navbar-nav .nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  min-width: 92px;
  height: 56px;
  border-radius: 14px 14px 0 0;
  padding: .35rem 1rem .65rem;
  margin-inline: .15rem;
  margin-top: .3rem;
  margin-bottom: -.4rem;
  font-size: .9rem;
  opacity: .85;
}

@media (max-width: 991.98px) {
  .app-brand-subtitle {
    display: none;
  }

  .app-brand-title {
    letter-spacing: .12rem;
    font-size: .92rem;
  }

  .app-brand-logo {
    width: 36px;
    height: 36px;
  }
}

.navbar-nav .nav-link .bi {
  font-size: 1.1rem;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show,
.navbar-nav .nav-item.show > .nav-link {
  background-color: #ffffff;
  color: #0d6efd !important;
  opacity: 1;
  box-shadow: 0 .2rem .45rem rgba(0,0,0,.18);
}

.navbar-nav .nav-link:not(.active):hover {
  background-color: rgba(255,255,255,.14);
  opacity: 1;
}

html[data-bs-theme="dark"] .navbar-nav .nav-link.active,
html[data-bs-theme="dark"] .navbar-nav .nav-link.show,
html[data-bs-theme="dark"] .navbar-nav .nav-item.show > .nav-link {
  background-color: #f8f9fa;
  color: #0d6efd !important;
}
