@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css");

* { box-sizing: border-box; }

:root {
  --app-header-height: 60px;
  --app-sidebar-width: 250px;
  --app-border: #dee2e6;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-size: .875rem;
  background: #f8f9fa;
  overflow-x: hidden;
}

.app-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1040;
  height: var(--app-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 .75rem;
  background: #212529;
  color: #fff;
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

.app-header-left,
.app-header-right {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .75rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: .5rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

.app-brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
  border-radius: .375rem;
  background: #fff;
}

.app-brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-account-name {
  color: #fff;
  text-decoration: none;
  max-width: 28vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sidebar-toggle,
.sidebar-close {
  cursor: pointer;
  user-select: none;
}

.sidebar-toggle {
  display: none;
  padding: .35rem .5rem;
  border-radius: .375rem;
  font-size: 1.35rem;
  line-height: 1;
}

.app-sidebar {
  position: fixed;
  top: var(--app-header-height);
  bottom: 0;
  left: 0;
  z-index: 1030;
  width: var(--app-sidebar-width);
  background: #fff;
  border-right: 1px solid var(--app-border);
  overflow-y: auto;
}

.sidebar-inner {
  min-height: 100%;
  padding: 1rem .75rem;
}

.sidebar-mobile-header {
  display: none;
}

.sidebar-organization-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: 0 .25rem 1rem;
  padding: .75rem;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: .5rem;
}

.sidebar-organization-logo-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.app-nav .nav-link {
  color: #343a40;
  border-radius: .375rem;
  padding: .65rem .75rem;
  margin-bottom: .2rem;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
  background: #f1f3f5;
  color: #0d6efd;
}

.app-nav-divider {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--app-border);
}

.app-main {
  min-height: 100vh;
  padding: 1.5rem;
}

.app-main-authenticated {
  padding-top: calc(var(--app-header-height) + 1.5rem);
  margin-left: var(--app-sidebar-width);
}

.app-content {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 991.98px) {
  :root {
    --app-sidebar-width: 230px;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
  }

  .app-sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease-in-out;
    box-shadow: .5rem 0 1rem rgba(0, 0, 0, .12);
  }

  .sidebar-toggle-input:checked ~ .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle-input:checked ~ .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--app-header-height) 0 0 0;
    z-index: 1025;
    background: rgba(0, 0, 0, .35);
  }

  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .25rem .75rem;
    margin-bottom: .5rem;
    font-weight: 600;
    border-bottom: 1px solid var(--app-border);
  }

  .sidebar-close {
    font-size: 1.8rem;
    line-height: 1;
    color: #6c757d;
  }

  .app-main-authenticated {
    margin-left: 0;
  }
}

@media (max-width: 575.98px) {
  .app-header {
    padding: 0 .5rem;
    gap: .5rem;
  }

  .app-header-left,
  .app-header-right {
    gap: .4rem;
  }

  .app-brand {
    max-width: 58vw;
  }

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

  .app-brand-name {
    max-width: 38vw;
  }

  .app-account-name {
    display: none;
  }

  .app-main {
    padding: 1rem;
  }

  .app-main-authenticated {
    padding-top: calc(var(--app-header-height) + 1rem);
  }

  .card-body {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar {
    transition: none;
  }
}

.organization-asset-preview {
  border: 1px solid var(--app-border);
  border-radius: .5rem;
  background: #f8f9fa;
  padding: .75rem;
}

.organization-logo-preview {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #fff;
  border-radius: .375rem;
}

.organization-logo-preview img {
  max-height: 180px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.organization-pdf-preview {
  width: 100%;
  height: 360px;
  background: #fff;
  border-radius: .375rem;
  overflow: hidden;
}

.organization-pdf-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.dashboard-organizations {
  max-height: 220px;
  overflow-y: auto;
}

.dashboard-organization {
  min-width: 0;
  padding: .35rem 0;
  color: inherit;
}

.dashboard-organization:hover {
  text-decoration: underline !important;
}

.dashboard-organization-logo {
  display: block;
  width: 40px;
  height: 32px;
  flex: 0 0 40px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: .25rem;
  padding: .15rem;
}

.dashboard-organization-logo-placeholder {
  display: block;
  width: 40px;
  height: 32px;
  flex: 0 0 40px;
}

.organization-list-logo {
  display: block;
  width: 72px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: .375rem;
  padding: .25rem;
}

.organization-list-pdf {
  width: 140px;
  height: 100px;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: .375rem;
  background: #fff;
}

.organization-list-pdf iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 767.98px) {
  .organization-pdf-preview {
    height: 300px;
  }
}

.auth-page {
  min-height: calc(100vh - 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  border: 0;
}

@media (max-width: 575.98px) {
  .auth-page {
    min-height: calc(100vh - 1rem);
    padding: 1rem .75rem;
  }
}


.login-brand-logo { width: 100%; text-align: center; }
.login-logo { display: block; max-width: 100%; width: auto; height: auto; margin-left: auto; margin-right: auto; }

/* Authentication screens */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: linear-gradient(135deg, #eef6fa 0%, #f5faf6 100%);
}

.auth-card {
  width: 100%;
  max-width: 620px;
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
}

.auth-card .card-body {
  width: 100%;
}

.auth-logo-wrap {
  width: 100%;
  text-align: center;
}

.auth-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.auth-title {
  color: #102f49;
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 700;
}

.auth-subtitle {
  color: #637286;
  font-size: 1rem;
  line-height: 1.55;
}

.auth-form-label {
  color: #10243a;
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .5rem;
}

.auth-input-group .input-group-text,
.auth-input-group .form-control,
.auth-password-toggle {
  min-height: 54px;
  border-color: #cfd9e3;
  background: #fff;
}

.auth-input-group .input-group-text {
  width: 54px;
  justify-content: center;
  color: #647589;
  border-right: 0;
  border-radius: .65rem 0 0 .65rem;
}

.auth-input-group .input-group-text svg,
.auth-password-toggle svg {
  width: 22px;
  height: 22px;
}

.auth-input-group .form-control {
  border-left: 0;
  border-radius: 0;
  font-size: 1rem;
  box-shadow: none;
}

.auth-input-group .form-control:focus {
  border-color: #13a65a;
  box-shadow: 0 0 0 .2rem rgba(19, 166, 90, .12);
}

.auth-password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  color: #647589;
  border-left: 0;
  border-radius: 0 .65rem .65rem 0;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
  color: #102f49;
  background: #fff;
}

.auth-input-group .form-control:not(:focus),
.auth-input-group .input-group-text,
.auth-password-toggle {
  box-shadow: none;
}

.auth-options {
  min-height: 28px;
}

.auth-options .form-check-label {
  color: #263e55;
  font-size: .95rem;
}

.auth-options .form-check-input {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: .05rem;
  margin-right: .35rem;
}

.auth-link {
  color: #0b9d51;
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
  color: #087e41;
  text-decoration: underline;
}

.auth-primary-btn {
  min-height: 54px;
  border: 0;
  border-radius: .65rem;
  background: #0aa653;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 .25rem .7rem rgba(10, 166, 83, .18);
}

.auth-primary-btn:hover,
.auth-primary-btn:focus {
  background: #078e47;
  color: #fff;
}

.auth-divider {
  color: #8390a0;
  font-size: .85rem;
}

.auth-divider hr,
.auth-divider-line {
  border-color: #e0e6ec;
  opacity: 1;
}

.auth-passkey-btn {
  min-height: 52px;
  border: 1px solid #cbd5df;
  border-radius: .65rem;
  color: #102f49;
  background: #fff;
  font-weight: 600;
}

.auth-passkey-btn:hover,
.auth-passkey-btn:focus {
  border-color: #102f49;
  background: #f7f9fb;
}

.auth-divider-line {
  border-top: 1px solid #e0e6ec;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}

.auth-back-link span {
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
}

@media (max-width: 575.98px) {
  .auth-page {
    padding: 1rem .75rem;
  }

  .auth-card {
    border-radius: .75rem;
  }

  .auth-card .card-body {
    padding: 1.5rem !important;
  }

  .auth-options {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }
}


.landing-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #eef2f5 100%);
}

.landing-card {
  width: min(680px, 100%);
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
  background: #fff;
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .08);
}

.landing-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  margin-bottom: 1.5rem;
}

.landing-logo-image {
  display: block;
  max-width: min(360px, 80vw);
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.landing-card h1 {
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.landing-description {
  max-width: 540px;
  margin: 0 auto 2rem;
  color: #6c757d;
  font-size: 1.05rem;
  line-height: 1.7;
}
