/* Utility row and message drawer.
 *
 * Deliberately a separate file from sidebar.css rather than appended to it.
 * Static files are uploaded to S3 with `max-age=94608000` and served under a
 * stable name -- S3Boto3Storage does not hash filenames -- so editing a CSS file
 * that has already been deployed leaves CloudFront serving the cached copy.
 * That is exactly what happened when this was appended to sidebar.css: the
 * sidebar kept its styling and everything added here arrived unstyled.
 *
 * A new file has a name that was never cached, so it takes effect immediately.
 * The underlying trap remains for any future edit to either file -- see the PR
 * for the durable fix. */

/* ---------------------------------------------------------------------------
   Utility row (includes/_topbar.html)
   --------------------------------------------------------------------------- */

.app-topbar {
  min-height: 76px;
  background: #fff;
  border-bottom: 1px solid #e8ecf3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  flex-wrap: wrap;
}

.app-topbar__field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.app-topbar__field--grow {
  flex: 1;
}

.app-topbar__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #8291a5;
  margin: 0;
}

.app-topbar__control {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d7dde7;
  border-radius: 10px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  background: #fff;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.app-topbar__control--search {
  background: #f8fafc;
  font-weight: 400;
  color: #8291a5;
}

.app-topbar__control--search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 12.5px;
  color: #101828;
}

.app-topbar__marker {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2563eb;
  flex: none;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.app-topbar__icon-button {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #d7dde7;
  background: #fff;
  color: #5b6b82;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-topbar__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 11px;
  font-weight: 700;
  background: #d0342c;
  color: #fff;
  border-radius: 999px;
  padding: 0 5px;
}

.app-topbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
}

.app-topbar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #16253d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.app-topbar__username {
  font-size: 12.5px;
  font-weight: 600;
}

.app-topbar__caret {
  color: #8291a5;
  font-size: 12px;
}

.app-topbar__tasks {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d7dde7;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #344054;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.app-topbar__tasks-count {
  font-size: 12px;
  font-weight: 700;
  background: #fff2c6;
  color: #8a6100;
  border-radius: 999px;
  padding: 1px 6px;
}

/* ---------------------------------------------------------------------------
   Issue reporter (includes/_issue_reporter.html)
   --------------------------------------------------------------------------- */

/* The toggle is pinned over the bottom of the page, so reserve room for it
   below the content -- otherwise it covers the last table rows, pagination and
   form buttons. 44px toggle plus breathing room. `.app-main` is the content
   column in base.html, base_hr_ui.html and the SPA's AppShell alike. */
body:has(> .issue-reporter) .app-main {
  padding-bottom: 64px;
}

/* Pinned bottom-left. */
.issue-reporter {
  position: fixed;
  left: 24px;
  bottom: 0;
  width: 322px;
  max-width: calc(100vw - 48px);
  z-index: 1030;
  display: flex;
  flex-direction: column;
}

.issue-reporter__toggle {
  width: 100%;
  height: 44px;
  background: #344054;
  color: #fff;
  border: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -2px 6px rgba(16, 24, 40, 0.06), 0 -10px 24px rgba(52, 64, 84, 0.24);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
}

.issue-reporter__panel:not([hidden]) + .issue-reporter__toggle {
  border-radius: 0;
}

.issue-reporter__panel {
  background: #fff;
  border: 1px solid #e8ecf3;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -10px 24px rgba(16, 24, 40, 0.1);
}

.issue-reporter__form {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px;
}

.issue-reporter__label {
  font-size: 12px;
  font-weight: 600;
  color: #344054;
}

.issue-reporter__input {
  width: 100%;
  /* Set explicitly: base_hr_ui.html does not load Bootstrap's global reset. */
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13px;
  color: #101828;
  background: #fff;
  border: 1px solid #d7dde7;
  border-radius: 8px;
  padding: 6px 9px;
  margin-bottom: 4px;
}

.issue-reporter__input:focus {
  outline: 0;
  border-color: #344054;
  box-shadow: 0 0 0 3px rgba(52, 64, 84, 0.12);
}

.issue-reporter__textarea {
  resize: vertical;
}

.issue-reporter__submit {
  align-self: flex-start;
  margin-top: 4px;
  background: #344054;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

.issue-reporter__submit:disabled {
  opacity: 0.6;
}

.issue-reporter__status:empty {
  display: none;
}

.issue-reporter__status {
  margin: 0;
  font-size: 12px;
  color: #027a48;
}

.issue-reporter__status--error {
  color: #d0342c;
}

/* The bell's list: the latest notifications, read or not, each with an eye
   that toggles it read / unread. Drawn by both the server top bar and the
   hr-ui shell, so the classes live here. */
.app-notifications {
  width: min(24rem, calc(100vw - 2rem));
  max-height: 28rem;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.app-notifications__item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 13px;
  color: #5b6b82;
}

.app-notifications__item + .app-notifications__item {
  border-top: 1px solid #e8ecf3;
}

.app-notifications__item--new {
  color: #101828;
  font-weight: 600;
}

.app-notifications__text {
  flex: 1;
  min-width: 0;
}

.app-notifications__time {
  font-size: 11px;
  font-weight: 400;
  color: #8291a5;
}

.app-notifications__eye {
  border: 0;
  background: none;
  padding: 0.1rem 0.3rem;
  color: #5b6b82;
  border-radius: 4px;
}

.app-notifications__eye:hover {
  background: #eef1f5;
  color: #101828;
}
