/* Split from admin.css L40-L922; keep link order in _Layout. */
/* Auth */
.auth-body {
  min-height: 100vh;
  background: #0f0b0a;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 48px;
  color: #fff;
  background:
    radial-gradient(1200px 600px at -10% 10%, rgba(239, 51, 40, 0.35), transparent 55%),
    linear-gradient(160deg, #140000 0%, #2a0d0d 45%, #120808 100%);
}

.auth-visual__glow {
  position: absolute;
  inset: auto -20% -30% auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 51, 40, 0.45), transparent 70%);
  filter: blur(10px);
}

.auth-visual__content {
  position: relative;
  max-width: 420px;
  margin-top: 18vh;
}

.auth-brand {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fecaca;
  margin: 0 0 12px;
}

.auth-visual h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 16px;
}

.auth-lead {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
    #1a1412;
}

.auth-panel__inner {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-kicker {
  margin: 0 0 8px;
  color: var(--hoters-red-deep);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.auth-copy {
  margin: 0 0 24px;
  color: var(--muted);
}

.auth-form .form-field,
.form-panel .form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.92rem;
}

.form-control {
  border-radius: 10px;
  border-color: var(--line);
  padding: 0.7rem 0.85rem;
  min-height: 46px;
}

.form-control:focus {
  border-color: var(--hoters-red);
  box-shadow: 0 0 0 0.2rem rgba(239, 51, 40, 0.15);
}

.btn-primary {
  background: var(--hoters-red);
  border-color: var(--hoters-red);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--hoters-red-deep);
  border-color: var(--hoters-red-deep);
}

.btn-auth {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.auth-errors {
  margin-bottom: 12px;
}

/* App shell */
.app-body { background: var(--bg); height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }

.app-shell {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--nav) minmax(0, 1fr);
}

html.nav-mini .app-shell {
  grid-template-columns: var(--nav-mini) minmax(0, 1fr);
  overflow-x: hidden;
}

.sidebar {
  --sidebar-w: var(--nav);
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border, var(--line));
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  position: relative;
  z-index: 30;
  transition: width 0.18s ease;
  overflow: hidden;
}

html.nav-mini .sidebar { --sidebar-w: var(--nav-mini); }

html.nav-mini .sidebar:not(:hover) {
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;
}

html.nav-mini .sidebar:not(:hover) .sidebar__nav {
  overflow: hidden;
}

html.nav-mini .sidebar:not(:hover) .sidebar__section {
  display: none;
}

html.nav-mini .sidebar:not(:hover) .sidebar__brand,
html.nav-mini .sidebar:not(:hover) .sidebar__link,
html.nav-mini .sidebar:not(:hover) .sidebar__user,
html.nav-mini .sidebar:not(:hover) .btn-logout,
html.nav-mini .sidebar:not(:hover) .sidebar__pin {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

html.nav-mini .sidebar:not(:hover) .sidebar__icon {
  width: var(--nav-mini);
  min-width: 0;
}

html.nav-mini .sidebar:not(:hover) .sidebar__avatar {
  margin-left: auto;
  margin-right: auto;
}

html.nav-mini .sidebar:not(:hover) .sidebar__label { display: none; }

html.nav-mini .sidebar:hover {
  --sidebar-w: var(--nav);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100vh;
  overflow: hidden;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.12);
}

html.nav-mini .sidebar:hover .sidebar__nav {
  overflow: auto;
}

.sidebar__brand,
.sidebar__logo {
  display: none !important;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: 4px;
  scrollbar-gutter: stable;
}

.sidebar__nav.is-scrollable {
  padding-right: 2px;
}

.sidebar__nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}
.sidebar__nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar__section {
  margin: 10px 8px 2px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted, #9aa0aa);
  min-height: 16px;
}

.sidebar__section:first-child {
  margin-top: 4px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #565d67;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__icon {
  width: 22px;
  min-width: 22px;
  height: 18px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1;
}

.sidebar__icon i {
  display: block;
  width: 1em;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1;
}

.sidebar__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 0.8rem;
}

html.nav-mini .sidebar:not(:hover) .sidebar__label { display: none; }
/* section handled above via display:none in mini */

.sidebar__link:hover {
  background: var(--sidebar-hover, #f7f8fa);
  color: #17191d;
}

.sidebar__link.is-active {
  background: var(--sidebar-active, #17191d);
  color: #fff;
  box-shadow: none;
}

.sidebar__link.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.sidebar__fold {
  margin: 2px 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
}

.sidebar__fold > summary {
  list-style: none;
  cursor: pointer;
  border-radius: 8px;
}

.sidebar__fold > summary::-webkit-details-marker {
  display: none;
}

.sidebar__fold > summary.sidebar__link {
  margin: 0;
  border-radius: 8px;
  background: transparent;
}

.sidebar__fold > summary.sidebar__link.is-active {
  background: var(--sidebar-hover, #f7f8fa);
  color: #17191d;
  box-shadow: inset 3px 0 0 var(--hoters-red);
}

.sidebar__fold[open] > summary.sidebar__link {
  border-bottom: none;
}

.sidebar__chevron {
  margin-left: auto;
  padding-right: 4px;
  font-size: 0.62rem;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.sidebar__fold[open] > summary .sidebar__chevron {
  transform: rotate(180deg);
}

.sidebar__fold-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 1px 0 2px 10px;
  background: transparent;
  border-left: 1px solid var(--sidebar-border, var(--line));
  margin-left: 11px;
}

.sidebar__link--sub {
  min-height: 28px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 8px;
  background: transparent;
}

.sidebar__link--sub .sidebar__icon {
  width: 22px;
  min-width: 22px;
  opacity: 0.9;
}

.sidebar__link--sub .sidebar__label {
  font-size: 0.8rem;
  font-weight: 500;
}

.sidebar__link--sub:hover {
  background: var(--sidebar-hover, #f7f8fa);
}

.sidebar__link--sub.is-active {
  background: var(--sidebar-active, #17191d);
  color: #fff;
  box-shadow: none;
}

.sidebar__fold--nested {
  margin: 0;
  border-radius: 8px;
  background: transparent;
  border: none;
}

.sidebar__fold--nested > summary.sidebar__link--sub {
  min-height: 28px;
}

.sidebar__fold--nested .sidebar__fold-items {
  padding: 1px 0 2px 10px;
  margin-left: 11px;
}

.sidebar__fold--nested .sidebar__link--sub .sidebar__label {
  font-size: 0.8rem;
}

html.nav-mini .sidebar:not(:hover) .sidebar__fold {
  margin: 2px 0;
  background: transparent;
  border-color: transparent;
}

html.nav-mini .sidebar:not(:hover) .sidebar__fold-items,
html.nav-mini .sidebar:not(:hover) .sidebar__chevron {
  display: none;
}

.sidebar__footer {
  border-top: 1px solid var(--sidebar-border, var(--line));
  padding-top: 8px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.impersonation-bar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 16px;
  background: #92400e;
  color: #fffbeb;
  font-size: 0.92rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.impersonation-bar__text {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.impersonation-bar__real {
  opacity: 0.85;
}

.impersonation-bar__form {
  margin: 0;
  flex-shrink: 0;
}

.impersonation-bar .btn-light {
  font-weight: 600;
}

body.is-impersonating .mobile-top {
  top: auto;
}

.sidebar__user {
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.sidebar__avatar,
.person-cell__avatar {
  width: 36px;
  height: 36px;
  margin: 0 4px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #edf0f3;
  color: #495057;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar__user .sidebar__label strong { display: block; font-size: 0.85rem; }
.sidebar__user .sidebar__label small {
  display: block;
  color: var(--sidebar-muted, #9aa0aa);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout,
.sidebar__pin {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--sidebar-border, var(--line));
  border-radius: 10px;
  background: #fff;
  color: #565d67;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}

.btn-logout:hover,
.sidebar__pin:hover {
  background: var(--sidebar-hover, #f7f8fa);
  color: #17191d;
}

html.nav-mini .pin-icon--collapse { display: none; }
html:not(.nav-mini) .pin-icon--expand { display: none; }

.nav-burger,
.nav-backdrop { display: none; }

.app-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  background: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 40;
}

.app-chrome__guide {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  max-width: min(240px, 28vw);
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 999px;
  background: #fffbeb;
  color: #9a3412;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.app-chrome__guide:hover {
  background: #fff7ed;
  border-color: #fdba74;
}

.app-chrome__guide i {
  color: #c45c26;
}

.app-chrome__guide-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-chrome__search {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 640px;
}

.app-chrome__search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 12px;
  min-height: 38px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  background: #f9fafb;
}

.app-chrome__search-field i {
  color: #9ca3af;
  font-size: 0.85rem;
}

.app-chrome__search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 0.92rem;
  padding: 8px 0;
}

.app-chrome__search-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(70vh, 420px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  padding: 8px;
}

.app-chrome__search-group + .app-chrome__search-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
}

.app-chrome__search-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  font-weight: 700;
  padding: 2px 8px 6px;
}

.app-chrome__search-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.app-chrome__search-item:hover {
  background: #f3f4f6;
}

.app-chrome__search-kind {
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #b91c1c;
}

.app-chrome__search-title {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-chrome__search-sub {
  font-size: 0.78rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-chrome__search-empty {
  padding: 14px 10px;
  color: #6b7280;
  font-size: 0.88rem;
}

.app-chrome__user {
  position: relative;
  flex-shrink: 0;
}

.app-chrome:not(:has(.app-chrome__guide)) .app-chrome__user {
  margin-left: auto;
}

.app-chrome__user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  cursor: pointer;
  max-width: 320px;
}

.app-chrome__avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.app-chrome__user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
  line-height: 1.15;
}

.app-chrome__user-text strong {
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.app-chrome__user-text small {
  font-size: 0.72rem;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.app-chrome__caret {
  font-size: 0.7rem;
  color: #9ca3af;
}

.app-chrome__user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 50;
}

.app-chrome__user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.app-chrome__user-item:hover {
  background: #f3f4f6;
}

.app-chrome__user-item.is-danger {
  color: #b91c1c;
}

.app-chrome__user-menu form {
  margin: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 28px 8px;
  flex-shrink: 0;
}

.topbar__title {
  margin: 0;
  font-size: 1.65rem;
}

.topbar__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.content {
  flex: 1;
  min-height: 0;
  padding: 12px 28px 28px;
  overflow: auto;
}

/* Workspace: scroll na całej stronie (sticky taby względem .content) */
.content--workspace {
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.workspace-flash {
  margin: 10px 14px 0;
  flex-shrink: 0;
}
