/* ============================================================================
   AutoHR application chrome - layered on top of the design tokens in app.css.
   ========================================================================== */

.autohr-shell {
  min-height: 100vh;
}

/* ---------- App bar (navy gradient, matches design/dashboards mockups) ---------- */
.autohr-appbar {
  background: linear-gradient(90deg, var(--hr-primary-900), var(--hr-primary-700)) !important;
  color: var(--hr-text-inv) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .autohr-appbar {
  background: linear-gradient(90deg, #0b111b, #14293f) !important;
}

/* ---------- Per-tenant accent ----------
   --hr-tenant-accent is set inline by MainLayout from TenantAccent.ColorFor(tenant code). It is a
   recognition cue for operators who switch tenants, not a status colour, so it is deliberately a
   thin strip plus a dot rather than a background wash: the navy gradient stays the brand, and the
   accent never competes with MudBlazor's semantic colours (error/warning/success). */
.autohr-appbar--tenant {
  border-bottom: 3px solid var(--hr-tenant-accent, transparent) !important;
}

.autohr-tenant-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--hr-tenant-accent, currentColor);
  vertical-align: middle;
  /* Halo keeps the dot visible when a hue lands close to the app bar's navy. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.autohr-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  cursor: pointer;
  user-select: none;
  color: inherit;
  text-decoration: none;
}

  .autohr-brand:hover {
    text-decoration: none;
  }

.autohr-brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--hr-accent-600);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.autohr-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.autohr-brand-name {
  font-size: var(--hr-fs-lg);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.autohr-brand-tenant {
  font-size: var(--hr-fs-xs);
  font-weight: 500;
  opacity: 0.75;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .autohr-brand-tenant {
    display: none;
  }
}

/* Search field inside the dark app bar */
.autohr-appbar-search {
  flex: 0 1 460px;
  max-width: 460px;
  margin-left: 20px;
}

  .autohr-appbar-search .mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(255, 255, 255, 0.22) !important;
  }

  .autohr-appbar-search .mud-input {
    color: rgba(255, 255, 255, 0.92) !important;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
  }

  .autohr-appbar-search .mud-input-adornment .mud-icon-root,
  .autohr-appbar-search .mud-icon-button {
    color: rgba(255, 255, 255, 0.70) !important;
  }

  .autohr-appbar-search input::placeholder {
    color: rgba(255, 255, 255, 0.65);
    opacity: 1;
  }

/* Signed-in user chip in the app bar */
.autohr-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border-radius: 20px;
  cursor: pointer;
  color: var(--hr-text-inv);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

  .autohr-user-chip:hover {
    background: rgba(255, 255, 255, 0.18);
  }

.autohr-user-avatar {
  background: var(--hr-accent-600) !important;
  color: #fff !important;
  font-size: var(--hr-fs-xs) !important;
  font-weight: 700 !important;
}

.autohr-user-name {
  font-size: var(--hr-fs-sm);
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Drawer / navigation ---------- */
.autohr-drawer {
  border-right: 1px solid var(--mud-palette-divider);
}

  .autohr-drawer .mud-nav-link {
    border-radius: 8px;
    margin: 1px 8px;
    font-weight: 500;
  }

    .autohr-drawer .mud-nav-link.active {
      background: var(--hr-primary-050);
      color: var(--hr-primary-700);
      font-weight: 650;
      box-shadow: inset 3px 0 0 var(--hr-primary-700);
    }

[data-theme="dark"] .autohr-drawer .mud-nav-link.active {
  color: #9cc3e5;
  box-shadow: inset 3px 0 0 #5b93c4;
}

.autohr-drawer .mud-nav-group > .mud-nav-link {
  font-size: var(--hr-fs-sm);
}

.autohr-nav-section {
  font-size: var(--hr-fs-xs);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--mud-palette-text-disabled);
  padding: 16px 20px 4px;
}

/* ---------- Main content ---------- */
.autohr-main-content {
  min-height: calc(100vh - var(--mud-appbar-height));
  background-color: var(--mud-palette-background);
}

.autohr-page-container {
  padding: 24px 26px 48px;
}

.autohr-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.autohr-page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--mud-palette-text-primary);
}

.autohr-page-subtitle {
  font-size: 0.95rem;
  color: var(--mud-palette-text-secondary);
}

.autohr-card {
  border: 1px solid var(--mud-palette-divider);
  border-radius: 12px;
  background-color: var(--mud-palette-surface);
}

.autohr-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.autohr-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.autohr-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 960px) {
  .autohr-form-grid,
  .autohr-form-grid-3 {
    grid-template-columns: 1fr;
  }

  .autohr-page-container {
    padding: 16px;
  }

  .autohr-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Tenant logo uploaded in the admin app (replaces the default "A" mark). */
.autohr-brand-logo-img {
  height: 32px;
  max-width: 140px;
  object-fit: contain;
  display: block;
}
