/* Admin workspace: fixed navigation and independently scrollable content. */
.admin-dashboard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-topbar {
  position: relative;
  top: auto;
  flex: 0 0 auto;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 16px 18px;
  border-right: 1px solid #dce7df;
  background: #fff;
}

.sidebar-caption {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 2px 8px 25px;
}

.sidebar-logo-frame { position: relative; width: 42px; height: 42px; flex: 0 0 42px; }
.sidebar-company-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: #e4f3eb;
  color: #08624f;
  font: 800 1.15rem "Bricolage Grotesque", "Segoe UI", sans-serif;
}

.sidebar-company-logo { display: block; width: 42px; height: 42px; padding: 3px; border: 1px solid #dcebe1; border-radius: 12px; background: #fff; object-fit: contain; }
.sidebar-company-details { display: grid; min-width: 0; gap: 3px; }
.sidebar-company-details strong { overflow: hidden; color: #173c32; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-company-details > span { color: #83928a; font-size: .72rem; }
.sidebar-logo-action, .sidebar-logo-remove { justify-self: start; padding: 0; border: 0; background: none; color: #087257; cursor: pointer; font: 700 .69rem "Segoe UI", Arial, sans-serif; }
.sidebar-logo-action:hover, .sidebar-logo-remove:hover { color: #034638; text-decoration: underline; }
.sidebar-logo-remove { color: #9b3b32; }
.sidebar-logo-action:disabled, .sidebar-logo-remove:disabled { opacity: .55; cursor: wait; }
.sidebar-logo-message { margin: -15px 8px 14px 61px; color: #8b9891; font-size: .65rem; line-height: 1.4; }
.sidebar-logo-message:empty { display: none; }
.sidebar-logo-message[data-state="success"] { color: #176b50; }
.sidebar-logo-message[data-state="error"] { color: #a33227; }

.sidebar-section-label {
  margin: 9px 10px 9px;
  color: #91a098;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.sidebar-section-label-secondary { margin-top: 27px; }

.admin-navigation { display: grid; gap: 5px; }

.admin-nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #52675d;
  cursor: pointer;
  text-align: left;
  font: 700 .84rem "Segoe UI", Arial, sans-serif;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.admin-nav-button svg { width: 19px; height: 19px; flex: 0 0 19px; }
.admin-nav-button:hover { background: #f1f7f3; color: #075c4b; }
.admin-nav-button.is-active { border-color: #d7ebe0; background: #eaf5ee; color: #075d4b; }
.admin-nav-button:focus-visible { outline: 3px solid #71cda3; outline-offset: 2px; }

.sidebar-support {
  margin: auto 7px 0;
  padding: 15px 10px 0;
  color: #87958e;
  font-size: .72rem;
  line-height: 1.55;
}

.admin-main { min-width: 0; min-height: 0; overflow: auto; }
.admin-content { width: min(1160px, calc(100% - 48px)); margin: 30px auto 58px; }
.admin-view { min-width: 0; animation: admin-view-enter .18s ease-out; }
.admin-view[hidden] { display: none !important; }
.admin-view > .admin-page-heading { margin-top: 2px; }
.admin-view > .admin-card:last-of-type { margin-bottom: 14px; }

@keyframes admin-view-enter {
  from { opacity: .65; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .admin-workspace { grid-template-columns: 214px minmax(0, 1fr); }
  .admin-sidebar { padding-inline: 12px; }
  .admin-content { width: calc(100% - 32px); margin-top: 23px; }
}

@media (max-width: 680px) {
  .admin-dashboard { overflow: hidden; }
  .admin-topbar { gap: 9px; }
  .admin-topbar > .brand-mark { width: 38px; flex: 0 0 38px; }
  .admin-topbar .admin-brand { min-width: 0; }
  .admin-topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-topbar .signed-in-user { order: 3; width: 100%; margin: 0; }
  .admin-topbar .attendance-launch { order: 4; margin-left: 0; }
  .admin-topbar #logout { order: 5; margin-left: auto; }
  .admin-topbar #logout-message { order: 6; }
  .admin-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .admin-sidebar { display: block; overflow: visible; padding: 10px 12px 9px; border-right: 0; border-bottom: 1px solid #dce7df; }
  .sidebar-caption { display: flex; padding: 2px 2px 9px; }
  .sidebar-logo-frame, .sidebar-company-logo, .sidebar-company-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .sidebar-company-mark { border-radius: 10px; font-size: 1rem; }
  .sidebar-company-logo { border-radius: 10px; }
  .sidebar-company-details { display: grid; grid-template-columns:minmax(0,1fr) auto; align-items: center; gap: 2px 8px; flex: 1; }
  .sidebar-company-details strong { grid-column: 1; font-size: .78rem; }
  .sidebar-company-details > span { grid-column: 1; font-size: .66rem; }
  .sidebar-logo-action, .sidebar-logo-remove { grid-column: 2; grid-row: 1 / span 2; }
  .sidebar-logo-message { display: none; }
  .sidebar-section-label, .sidebar-support { display: none; }
  .admin-navigation { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
  .admin-nav-button { justify-content: center; width: auto; min-width: max-content; min-height: 41px; padding: 0 12px; }
  .admin-nav-button svg { width: 17px; height: 17px; }
  .admin-main { overflow: auto; }
  .admin-content { width: calc(100% - 24px); margin: 19px auto 35px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-view { animation: none; }
  .admin-nav-button { transition: none; }
}
