:root{
  --app-bg:#f5f7fb;
  --card-radius:18px;
  --nav-height:72px;
  --topbar-bg:#ffffff;
  --nav-bg:#ffffff;
  --nav-active:#0d6efd;
  --text-muted:#6c757d;
  --app-modal-vh:100vh;
}

@supports (height: 100dvh) {
  :root {
    --app-modal-vh:100dvh;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--app-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100%;
}

.app-body {
  background: var(--app-bg);
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--topbar-bg);
}

.app-main {
  padding-bottom: 200px !important;
}

.app-card {
  background: #fff;
  border-radius: var(--card-radius);
  border: 0;
  box-shadow: 0 6px 18px rgba(18, 38, 63, .06);
}

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: var(--nav-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #e9ecef;
  z-index: 1020;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 14px rgba(0,0,0,.06);
}

.mobile-bottom-nav .nav-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #666;
  font-size: 12px;
  padding: 8px 4px;
}

.mobile-bottom-nav .nav-item i {
  display: block;
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.mobile-bottom-nav .nav-item.active {
  color: var(--nav-active);
  font-weight: 600;
}

.page-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quick-btn {
  border-radius: 18px;
  padding: 18px 14px;
  background: #fff;
  text-decoration: none;
  color: #212529;
  box-shadow: 0 6px 18px rgba(18, 38, 63, .06);
}

.quick-btn i {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.desktop-top-nav .btn {
  border-radius: 12px;
}

@media (min-width: 768px) {
  .app-main {
    padding-bottom: 20px;
  }
}
.min-w-0 {
  min-width: 0;
}

.app-topbar-main {
  min-height: 68px;
}

.app-topbar-leading {
  min-width: 0;
  flex: 1 1 auto;
}

.app-topbar-heading {
  min-width: 0;
}

.app-menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.app-menu-toggle i {
  font-size: 1.35rem;
  line-height: 1;
}

.app-mobile-drawer {
  --bs-offcanvas-width: min(88vw, 360px);
  background: var(--app-bg);
}

.app-mobile-drawer .offcanvas-header {
  align-items: center;
  gap: 12px;
}

.app-company-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.app-company-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: 0 10px 24px rgba(13, 110, 253, .18);
  flex: 0 0 auto;
}

.app-company-logo--small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: .9rem;
}

.app-company-logo-image-wrap {
  padding: 0;
  overflow: hidden;
  background: #fff;
  color: inherit;
  box-shadow: 0 8px 20px rgba(18, 38, 63, .12);
}

.app-company-logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.app-topbar-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.app-drawer-account {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(18, 38, 63, .06);
}

.app-drawer-section-label {
  letter-spacing: .08em;
}

.app-drawer-nav {
  display: grid;
  gap: 10px;
}

.app-drawer-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  color: #212529;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(18, 38, 63, .06);
  transition: transform .15s ease, box-shadow .15s ease, color .15s ease;
}

.app-drawer-nav-link:active {
  transform: scale(.99);
}

.app-drawer-nav-link:hover {
  color: #212529;
  box-shadow: 0 8px 20px rgba(18, 38, 63, .09);
}

.app-drawer-nav-link.active {
  color: var(--nav-active);
  box-shadow: 0 8px 20px rgba(13, 110, 253, .14);
}

.app-drawer-nav-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 110, 253, .08);
  font-size: 1.05rem;
  flex: 0 0 auto;
}

.app-drawer-nav-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

.app-drawer-nav-arrow {
  color: var(--text-muted);
  font-size: .9rem;
  flex: 0 0 auto;
}

.app-drawer-logout {
  border-radius: 14px;
}

html[dir="rtl"] .app-topbar-leading,
html[dir="rtl"] .app-company-brand,
html[dir="rtl"] .app-drawer-nav-link {
  flex-direction: row-reverse;
}

html[dir="rtl"] .app-topbar-heading,
html[dir="rtl"] .app-drawer-nav-link,
html[dir="rtl"] .app-company-brand {
  text-align: right;
}

html[dir="rtl"] .app-drawer-nav-arrow {
  transform: rotate(180deg);
}

@media (max-width: 767.98px) {
  .app-topbar-main {
    min-height: 62px;
  }
}

.modal-dialog-scrollable .modal-content {
  max-height: calc(var(--app-modal-vh) - 2rem);
}

.modal-dialog-scrollable .modal-content > form,
.modal-fullscreen .modal-content > form,
.modal-fullscreen-sm-down .modal-content > form,
.modal-fullscreen-md-down .modal-content > form,
.modal-fullscreen-lg-down .modal-content > form,
.modal-fullscreen-xl-down .modal-content > form,
.modal-fullscreen-xxl-down .modal-content > form {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.modal-dialog-scrollable .modal-body {
  padding-bottom: 1.5rem;
}

.modal-dialog-scrollable .modal-content > form .modal-header,
.modal-dialog-scrollable .modal-content > form .modal-footer,
.modal-fullscreen .modal-content > form .modal-header,
.modal-fullscreen .modal-content > form .modal-footer,
.modal-fullscreen-sm-down .modal-content > form .modal-header,
.modal-fullscreen-sm-down .modal-content > form .modal-footer,
.modal-fullscreen-md-down .modal-content > form .modal-header,
.modal-fullscreen-md-down .modal-content > form .modal-footer,
.modal-fullscreen-lg-down .modal-content > form .modal-header,
.modal-fullscreen-lg-down .modal-content > form .modal-footer,
.modal-fullscreen-xl-down .modal-content > form .modal-header,
.modal-fullscreen-xl-down .modal-content > form .modal-footer,
.modal-fullscreen-xxl-down .modal-content > form .modal-header,
.modal-fullscreen-xxl-down .modal-content > form .modal-footer {
  flex: 0 0 auto;
}

.modal-dialog-scrollable .modal-content > form .modal-body,
.modal-fullscreen .modal-content > form .modal-body,
.modal-fullscreen-sm-down .modal-content > form .modal-body,
.modal-fullscreen-md-down .modal-content > form .modal-body,
.modal-fullscreen-lg-down .modal-content > form .modal-body,
.modal-fullscreen-xl-down .modal-content > form .modal-body,
.modal-fullscreen-xxl-down .modal-content > form .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-dialog-scrollable .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: #fff;
  border-top: 1px solid #e9ecef;
  padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
}

.modal-fullscreen-lg-down .modal-footer,
.modal-fullscreen-md-down .modal-footer,
.modal-fullscreen-sm-down .modal-footer,
.modal-fullscreen .modal-footer {
  padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
}

@media (max-width: 767.98px) {
  .modal-dialog-scrollable .modal-content,
  .modal-fullscreen .modal-content,
  .modal-fullscreen-sm-down .modal-content,
  .modal-fullscreen-md-down .modal-content,
  .modal-fullscreen-lg-down .modal-content,
  .modal-fullscreen-xl-down .modal-content,
  .modal-fullscreen-xxl-down .modal-content {
    max-height: var(--app-modal-vh);
    min-height: var(--app-modal-vh);
    border-radius: 0;
  }
}


.company-logo-preview {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  overflow: hidden;
}

.company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-logo-preview-fallback {
  font-size: 1.6rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: .04em;
}

.company-logo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.company-logo-actions .btn {
  min-width: 140px;
}
