body {
  min-height: 100vh;
  margin: 0;
  background: #ffffff;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #f5f7fb;
}

.login-shell {
  width: min(100% - 2rem, 420px);
}

.login-panel,
.admin-card {
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.login-panel {
  padding: 2rem;
}

.admin-card {
  padding: 1.5rem;
}

.metric-card {
  height: 100%;
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.metric-card span {
  display: block;
  color: #64748b;
  font-size: 0.9rem;
}

.metric-card strong {
  display: block;
  margin-top: 0.25rem;
  color: #0f172a;
  font-size: 1.75rem;
}

.audit-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.audit-browser {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid #e5e9f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.audit-tree {
  border-right: 1px solid #e5e9f0;
  background: #f8fafc;
  padding: 1rem;
}

.audit-tree-title {
  margin-bottom: 1rem;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.audit-tree-list,
.audit-tree-list ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.audit-tree-list ul {
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid #dbe3ef;
}

.audit-tree-item {
  display: block;
  width: 100%;
  margin-bottom: 0.25rem;
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  background: transparent;
  color: #334155;
  font-size: 0.92rem;
  text-decoration: none;
  text-align: left;
}

.audit-tree-item:hover,
.audit-tree-item.active {
  background: #e8f1fb;
  color: #125ea1;
}

.audit-empty-tree {
  display: block;
  padding: 0.5rem 0.65rem;
  color: #64748b;
  font-size: 0.9rem;
}

.audit-panel {
  min-width: 0;
  padding: 1rem;
}

.audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.audit-breadcrumb {
  display: block;
  margin-bottom: 0.35rem;
  color: #64748b;
  font-size: 0.85rem;
}

.audit-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 180px 170px auto;
  gap: 0.5rem;
  width: min(100%, 920px);
}

.audit-path-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem;
  background: #f8fafc;
  color: #475569;
  font-size: 0.9rem;
}

.audit-path-preview span::after {
  margin-left: 0.35rem;
  color: #94a3b8;
  content: "/";
}

.audit-table {
  min-width: 780px;
}

.audit-doc-name {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.audit-doc-name span {
  display: block;
  color: #64748b;
  font-size: 0.85rem;
}

.audit-file-icon {
  display: inline-flex;
  width: 46px;
  height: 34px;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 700;
}

.audit-sample-row {
  opacity: 0.82;
}

.audit-note {
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.92rem;
}

.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  min-height: 100vh;
  flex: 0 0 300px;
  align-items: center;
  background: #125ea1;
}

.sidebar-logo {
  display: inline-flex;
  width: 250px;
  height: 100px;
  align-items: center;
  justify-content: center;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar .nav-link {
  border-radius: 6px;
  padding: 0.75rem 1rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus,
.sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-parent {
  position: relative;
}

.sidebar-parent::after {
  position: absolute;
  right: 1rem;
  content: "+";
}

.sidebar-parent[aria-expanded="true"]::after {
  content: "-";
}

.sidebar-submenu {
  margin: 0.25rem 0 0.75rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-submenu .nav-link {
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
}

.sidebar-ip {
  word-break: break-word;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 2rem;
}

.sidebar-toggle {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1050;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: #125ea1;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(18, 94, 161, 0.24);
  --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.sidebar-toggle .navbar-toggler-icon {
  background-image: var(--bs-navbar-toggler-icon-bg);
  filter: brightness(0) invert(1);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1030;
  display: none;
  background: rgba(0, 0, 0, 0.35);
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open .sidebar-backdrop {
  display: block;
}

@media (max-width: 991.98px) {
  .app-layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: min(300px, 86vw);
    height: 100vh;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 12px 0 28px rgba(0, 0, 0, 0.18);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .content {
    padding: 5rem 1.25rem 1.5rem;
  }

  .audit-browser {
    grid-template-columns: 1fr;
  }

  .audit-tree {
    border-right: 0;
    border-bottom: 1px solid #e5e9f0;
  }

  .audit-filters {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (min-width: 992px) {
  .sidebar {
    position: sticky;
    top: 0;
  }
}
