/*
 * Order-sensitive Admin shell corrections.
 *
 * Django loads admin/css/responsive.css after the normal extrastyle block. Keep
 * these rules in a separate stylesheet loaded from base_site.html's responsive
 * block so first-party layout choices win without modifying Django's own assets.
 */

/* Keep the dashboard navigation rows clean instead of inheriting Django's global
   underline treatment for ordinary anchors. Focus remains visible on the row. */
.dashboard .yourhema-admin-app-card a,
.dashboard .yourhema-admin-app-card a:link,
.dashboard .yourhema-admin-app-card a:visited,
.dashboard .yourhema-admin-app-card a:hover,
.dashboard .yourhema-admin-app-card a:focus,
.dashboard .yourhema-admin-app-card a:active,
.dashboard .yourhema-admin-app-card a span,
.dashboard #recent-actions-module a,
.dashboard #recent-actions-module a:link,
.dashboard #recent-actions-module a:visited,
.dashboard #recent-actions-module a:hover,
.dashboard #recent-actions-module a:focus {
  text-decoration: none !important;
}

.dashboard .yourhema-admin-app-card a,
.dashboard .yourhema-admin-app-card a:link,
.dashboard .yourhema-admin-app-card a:visited {
  color: var(--yr-text);
}

.dashboard .yourhema-admin-app-card a:hover,
.dashboard .yourhema-admin-app-card a:focus-visible {
  color: var(--link-fg);
}

.dashboard a.yourhema-ops-card,
.dashboard a.yourhema-ops-card:link,
.dashboard a.yourhema-ops-card:visited,
.dashboard a.yourhema-ops-card:hover,
.dashboard a.yourhema-ops-card:focus,
.dashboard a.yourhema-ops-card:active,
.dashboard a.yourhema-ops-card *,
.dashboard a.yourhema-ops-card:link *,
.dashboard a.yourhema-ops-card:visited *,
.dashboard a.yourhema-ops-card:hover *,
.dashboard a.yourhema-ops-card:focus * {
  text-decoration: none !important;
}

.dashboard a.yourhema-ops-card,
.dashboard a.yourhema-ops-card:link,
.dashboard a.yourhema-ops-card:visited {
  color: var(--yr-text);
}

.dashboard .yourhema-status-pill {
  pointer-events: none;
  text-decoration: none !important;
}


/* Recent actions belongs to the dashboard flow. Match the same width as the
   primary Operations content instead of Django's narrow related-content rail. */
.dashboard #content-related {
  float: none;
  position: static;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0 0 48px;
  padding: 0;
  background: transparent;
}

.dashboard #recent-actions-module {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
}

/* The first path in Django's theme SVG is a full 24x24 square whose fill becomes
   the blue/red tile visible in the screenshots. Hide that backdrop and keep only
   the actual sun/moon/auto glyph. */
#user-tools .theme-toggle {
  margin: 0;
  padding: 5px;
  border: 0;
  background: transparent !important;
  box-shadow: none !important;
}

#user-tools .theme-toggle svg {
  width: 20px;
  height: 20px;
}

#user-tools .theme-toggle svg {
  color: transparent !important;
}

/* Use a single active treatment for Workspace > Operations. The earlier inset
   shadow could read as an extra layer behind the control. */
.yourhema-side-rail-home {
  box-sizing: border-box;
  border-left: 0;
  background: transparent;
  box-shadow: none;
}

.yourhema-side-rail-home:hover,
.yourhema-side-rail-home:focus-visible {
  background: var(--yr-sidebar-raised);
  box-shadow: none;
}

.yourhema-side-rail-home.is-active {
  border-left: 0;
  background: var(--yr-sidebar-raised);
  box-shadow: none;
}

/* Django's responsive stylesheet stacks #header at <=1024px. Restore one compact
   row: menu at the left, brand next, and theme/logout at the far right. */
@media (max-width: 1024px) {
  #header {
    width: 100%;
    height: 68px;
    min-height: 68px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px 14px 8px 54px;
  }

  #branding {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
  }

  #yourhema-brand,
  #yourhema-brand a {
    min-width: 0;
  }

  #yourhema-brand a {
    display: inline-flex;
    align-items: center;
  }

  #user-tools.yourhema-topbar-tools {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
    gap: 5px;
    margin: 0 0 0 auto;
    padding: 0;
    line-height: 1;
    text-align: right;
  }

  .yourhema-staff-identity,
  .yourhema-topbar-links {
    display: none;
  }

  .yourhema-logout-form {
    display: flex;
    align-items: center;
    margin: 0;
  }

  .yourhema-logout-form button {
    min-height: 34px;
    margin: 0 !important;
    padding: 6px 8px;
    border-bottom: 0 !important;
    font-size: 13px;
    line-height: 1;
    text-transform: none;
  }

  #user-tools .theme-toggle {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle {
    position: fixed;
    top: 17px;
    left: 14px;
    z-index: 70;
    width: 34px;
    height: 34px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, .9);
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle:hover {
    background: transparent !important;
    color: #fff;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .58);
    outline-offset: 2px;
  }

  .yourhema-sidebar-toggle::before {
    content: "☰";
    font-size: 34px;
    line-height: 1;
  }

  .main.shifted .yourhema-sidebar-toggle::before {
    content: "×";
    font-size: 34px;
  }

  #main {
    min-height: calc(100vh - 68px);
  }

  #nav-sidebar.yourhema-side-rail {
    top: 68px;
    max-height: calc(100vh - 68px);
  }

  .main.shifted::after {
    top: 68px;
  }
}

@media (max-width: 767px) {
  #header {
    height: 64px;
    min-height: 64px;
    gap: 6px;
    padding: 7px 10px 7px 50px;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle {
    top: 15px;
    left: 10px;
    width: 34px;
    height: 34px;
  }

  .yourhema-sidebar-toggle::before {
    font-size: 34px;
  }

  .main.shifted .yourhema-sidebar-toggle::before {
    font-size: 34px;
  }

  #user-tools.yourhema-topbar-tools {
    gap: 3px;
  }

  #user-tools .theme-toggle {
    width: 30px;
    height: 30px;
    padding: 4px;
  }

  #user-tools .theme-toggle svg {
    width: 19px;
    height: 19px;
  }

  .yourhema-logout-form button {
    min-height: 32px;
    padding: 5px 5px;
    font-size: 13px;
  }

  #main {
    min-height: calc(100vh - 64px);
  }

  #nav-sidebar.yourhema-side-rail {
    top: 64px;
    max-height: calc(100vh - 64px);
  }

  .main.shifted::after {
    top: 64px;
  }

  .dashboard #content-related {
    margin-bottom: 34px;
  }
}

/* --------------------------------------------------------------------------
   2026-09-25 login and header icon refinement
   -------------------------------------------------------------------------- */

/* The logo asset already carries its own rounded-square shape. Keep the artwork
   clean and place all header iconography on the same 24px visual grid. */
.yourhema-mark {
  width: 24px !important;
  height: 24px !important;
  flex: 0 0 24px !important;
  box-sizing: border-box;
  border: 0 !important;
  border-radius: 5px;
}

#user-tools .theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  box-sizing: border-box;
}

#user-tools .theme-toggle svg {
  width: 24px;
  height: 24px;
}

/* Keep the MFA recovery action visually button-like instead of inheriting
   Django's link underline. */
.yourhema-mfa-card a.yourhema-secondary-action,
.yourhema-mfa-card a.yourhema-secondary-action:link,
.yourhema-mfa-card a.yourhema-secondary-action:visited,
.yourhema-mfa-card a.yourhema-secondary-action:hover,
.yourhema-mfa-card a.yourhema-secondary-action:focus,
.yourhema-mfa-card a.yourhema-secondary-action:active {
  text-decoration: none !important;
}

/* Login is intentionally quieter than the authenticated control plane. The
   promotional split-panel content and header branding are removed in the
   template; this leaves one focused, responsive sign-in card. */
.yourhema-admin-login {
  background: var(--yr-shell-bg);
}

.yourhema-admin-login #header {
  display: none;
}

.yourhema-admin-login #main,
.yourhema-admin-login .content {
  min-height: 100vh;
}

.yourhema-admin-login .content {
  display: grid;
  place-items: center;
}

.yourhema-admin-login #content {
  width: min(520px, calc(100% - 32px));
  max-width: none;
  box-sizing: border-box;
  padding: 32px 0;
}

.yourhema-admin-login .yourhema-login-shell {
  width: 100%;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.yourhema-admin-login .yourhema-login-panel {
  width: 100%;
  box-sizing: border-box;
  padding: clamp(28px, 5vw, 36px);
  border: 1px solid var(--yr-border);
  border-radius: 18px;
  background: var(--yr-panel);
  box-shadow: var(--yr-shadow-md);
}

.yourhema-admin-login .yourhema-login-panel h2 {
  margin: 5px 0 9px;
  color: var(--yr-text);
  font-size: clamp(30px, 4vw, 34px);
}

.yourhema-admin-login .yourhema-login-panel-copy {
  margin-bottom: 24px;
  color: var(--yr-muted);
  font-size: 14px;
  line-height: 1.55;
}

.yourhema-admin-login .yourhema-login-panel #login-form {
  margin-top: 18px;
}

.yourhema-admin-login .yourhema-login-panel #login-form .form-row {
  padding-bottom: 18px;
}

.yourhema-admin-login .yourhema-login-panel #login-form .form-row label {
  color: var(--yr-text);
}

.yourhema-admin-login .yourhema-login-panel #login-form input[type="text"],
.yourhema-admin-login .yourhema-login-panel #login-form input[type="password"] {
  min-height: 50px;
  border-color: var(--yr-border-strong);
  background: var(--yr-panel);
  color: var(--yr-text);
}

.yourhema-admin-login .yourhema-login-panel #login-form input[type="text"]:focus,
.yourhema-admin-login .yourhema-login-panel #login-form input[type="password"]:focus {
  border-color: var(--yourhema-accent-deep);
  box-shadow: 0 0 0 3px var(--yr-focus);
}

.yourhema-admin-login .yourhema-login-panel .submit-row {
  margin-top: 20px;
}

.yourhema-admin-login .yourhema-login-panel .submit-row input {
  min-height: 50px;
  background: var(--button-bg);
}

@media (max-width: 1024px) {
  /* Use drawn line geometry instead of font glyphs so menu and close have the
     same visual footprint as the 24px logo and theme artwork. */
  #toggle-nav-sidebar.yourhema-sidebar-toggle {
    width: 38px;
    height: 38px;
    top: 15px;
    left: 12px;
    position: fixed;
    box-sizing: border-box;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle::before,
  #toggle-nav-sidebar.yourhema-sidebar-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: translate(-50%, -50%);
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle::before {
    box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle::after {
    display: none;
  }

  .main.shifted #toggle-nav-sidebar.yourhema-sidebar-toggle::before {
    box-shadow: none;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  .main.shifted #toggle-nav-sidebar.yourhema-sidebar-toggle::after {
    display: block;
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  #user-tools .theme-toggle {
    width: 38px;
    height: 38px;
    padding: 7px;
  }

  #user-tools .theme-toggle svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 767px) {
  .yourhema-admin-login #content {
    width: min(520px, calc(100% - 24px));
    padding: 24px 0 32px;
  }

  .yourhema-admin-login .yourhema-login-panel {
    padding: 24px 20px 28px;
    border-radius: 16px;
  }

  #toggle-nav-sidebar.yourhema-sidebar-toggle {
    width: 38px;
    height: 38px;
    top: 13px;
    left: 8px;
  }

  #user-tools .theme-toggle {
    width: 38px;
    height: 38px;
    padding: 7px;
  }

  #user-tools .theme-toggle svg {
    width: 24px;
    height: 24px;
  }
}

