html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-border: #dce4ef;
  --app-text: #172033;
  --app-muted: #667085;
  --app-primary: #2563eb;
  --app-primary-dark: #123b8f;
  --app-sidebar-width: 280px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--app-text);
  background: var(--app-bg);
}

a {
  color: var(--app-primary);
}

.btn-primary {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
  border-color: var(--app-primary);
}

.app-header {
  min-height: 64px;
  background: #101828;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.25rem;
}

.user-pill {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.75rem;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.user-pill span {
  color: #c7d7fe;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 64px);
}

.app-sidebar {
  width: var(--app-sidebar-width);
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
}

.app-sidebar .nav-link {
  color: #344054;
  border-radius: 8px;
  font-weight: 600;
  padding: 0.8rem 1rem;
}

.app-sidebar .nav-link:hover {
  color: var(--app-primary);
  background: #eff6ff;
}

.app-sidebar .nav-link.active {
  color: #ffffff;
  background: var(--app-primary);
}

.sidebar-footer {
  border-top: 1px solid var(--app-border);
}

.sidebar-videos {
  display: grid;
  gap: 0.75rem;
}

.sidebar-video-button {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #101828;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  transition: left 0.35s ease, top 0.35s ease, width 0.35s ease, height 0.35s ease, box-shadow 0.35s ease;
  z-index: 1;
}

.sidebar-video-button.is-floating {
  position: fixed;
  object-fit: contain;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.45);
  z-index: 2000;
}

.sidebar-video-placeholder {
  width: 100%;
  border: 1px dashed var(--app-border);
  border-radius: 8px;
  background: #f8fafc;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.content-panel,
.metric-card,
.data-tile,
.video-card,
.login-panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.content-panel {
  padding: 1.25rem;
}

.info-highlight {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem;
  color: #ffffff;
  background: linear-gradient(135deg, #101828, #2563eb);
  border-radius: 8px;
}

.info-highlight span {
  color: #c7d7fe;
  font-weight: 600;
}

.info-highlight strong {
  font-size: 1.35rem;
}

.video-card {
  overflow: hidden;
  height: 100%;
}

.video-stack {
  display: grid;
  width: min(100%, 520px);
  gap: 1rem;
}

.video-card-compact {
  height: auto;
}

.video-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #101828;
  object-fit: cover;
}

.metric-card,
.data-tile {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
}

.metric-card span,
.data-tile span {
  color: var(--app-muted);
  font-weight: 600;
}

.metric-card strong,
.data-tile strong {
  font-size: 2.2rem;
  line-height: 1;
}

.metric-card small,
.data-tile small {
  color: var(--app-muted);
}

.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  color: #1d2939;
  background: #eef4ff;
  border: 1px solid #c7d7fe;
  border-radius: 999px;
  font-weight: 600;
}

.login-page {
  display: grid;
  min-height: calc(100vh - 120px);
  place-items: center;
  padding: 2rem 0;
}

.home-login {
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.login-panel {
  width: min(100%, 460px);
  padding: 2rem;
}

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

@media (min-width: 992px) {
  .app-sidebar {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
  }
}

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

  .app-sidebar {
    width: min(86vw, var(--app-sidebar-width));
  }

  .app-main {
    padding: 1rem;
  }

  .page-heading {
    flex-direction: column;
  }

  .login-page {
    min-height: auto;
  }
}
