@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 {
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

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

.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: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

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