/* ============================================================
   ZENITH — общие компоненты тестового макета.
   Дополняет style-mono.css. Не переопределяет существующие стили.
   ============================================================ */

[data-zenith-header] {
  position: sticky; top: 0; z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.zh-bar { padding: .75rem 0; }
.zh-container {
  max-width: 1280px; margin: 0 auto; padding: 0 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 1.25rem;
}

/* Brand */
.zh-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  text-decoration: none; color: var(--black);
}
.zh-brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--black); color: var(--white);
  font-family: var(--font-mono); font-weight: 700; font-size: 1rem;
  letter-spacing: 0;
  border-radius: 2px;
  position: relative;
}
.zh-brand-mark::after {
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 8px; height: 8px; background: var(--accent);
}
.zh-brand-text {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 1.1rem; letter-spacing: .14em;
}
.zh-brand-tag { margin-left: .25rem; font-size: .65rem; }

/* Nav */
.zh-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .15rem;
}
.zh-nav-link {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem .75rem;
  text-decoration: none;
  color: var(--gray-700);
  font-size: .85rem; font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.zh-nav-link:hover { color: var(--black); border-bottom-color: var(--gray-400); }
.zh-nav-link.is-active {
  color: var(--black);
  border-bottom-color: var(--accent);
  font-weight: 700;
}
.zh-nav-link i { font-size: .85rem; opacity: .85; }

/* Actions */
.zh-actions { display: flex; align-items: center; gap: .65rem; }
.zh-icon-btn {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--white); color: var(--gray-800);
  border: 1px solid var(--gray-300);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.zh-icon-btn:hover { background: var(--gray-100); color: var(--black); }
.zh-bell-dot {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--accent); color: var(--white);
  font-family: var(--font-mono); font-size: .65rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--white);
  border-radius: 999px;
}

/* Role picker */
.zh-role-picker { position: relative; }
.zh-role-current {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .35rem .65rem .35rem .35rem;
  background: var(--white); color: var(--black);
  border: 1px solid var(--gray-300); cursor: pointer;
  transition: all var(--transition-fast);
}
.zh-role-current:hover { background: var(--gray-100); }
.zh-avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--black); color: var(--white);
  font-family: var(--font-mono); font-weight: 700; font-size: .75rem;
  border-radius: 999px;
}
.zh-role-meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.zh-role-name { font-size: .85rem; font-weight: 600; }
.zh-role-sub  { font-size: .7rem; color: var(--gray-600); }
.zh-role-current i { font-size: .7rem; color: var(--gray-600); }

.zh-role-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  z-index: 1100;
}
.zh-role-menu-title {
  font-family: var(--font-mono); text-transform: uppercase;
  font-size: .7rem; letter-spacing: .08em;
  color: var(--gray-600);
  padding: .35rem .5rem .5rem;
}
.zh-role-option {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  background: none; border: none; cursor: pointer;
  padding: .55rem .65rem;
  color: var(--black); font-size: .9rem; text-align: left;
  transition: background var(--transition-fast);
}
.zh-role-option:hover { background: var(--gray-100); }
.zh-role-option.is-active { background: var(--accent-soft); color: var(--accent-active); font-weight: 600; }
.zh-role-option i { width: 18px; text-align: center; }
.zh-role-menu-foot {
  border-top: 1px solid var(--gray-200); margin-top: .35rem; padding-top: .35rem;
}
.zh-reset {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  background: none; border: none; cursor: pointer;
  padding: .55rem .65rem; color: var(--gray-700); font-size: .8rem;
  transition: color var(--transition-fast);
}
.zh-reset:hover { color: var(--accent); }

/* Notifications drawer */
.zh-notifications {
  position: absolute; right: 1.25rem; top: calc(100% + 6px);
  width: min(380px, calc(100vw - 2rem));
  background: var(--white);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-lg);
  z-index: 1099;
  max-height: 70vh; overflow: auto;
}
.zh-notifications-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: .08em; font-size: .8rem;
}
.zh-notifications-close {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--gray-600);
}
.zh-notifications-close:hover { color: var(--black); }
.zh-notification {
  display: flex; gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}
.zh-notification.is-unread { background: var(--accent-soft); }
.zh-notification-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--gray-100); color: var(--gray-800);
}
.zh-notification.is-unread .zh-notification-icon { background: var(--accent); color: var(--white); }
.zh-notification-title { font-weight: 600; font-size: .9rem; }
.zh-notification-text  { color: var(--gray-700); font-size: .85rem; margin: .15rem 0 .25rem; }
.zh-notification-time  { color: var(--gray-500); font-size: .75rem; font-family: var(--font-mono); }
.zh-empty {
  padding: 2rem; text-align: center;
  color: var(--gray-500);
}

/* Mobile burger */
.zh-burger {
  display: none;
  background: none; border: 1px solid var(--gray-300);
  width: 38px; height: 38px;
  cursor: pointer; color: var(--black);
}

@media (max-width: 980px) {
  .zh-container { grid-template-columns: auto auto 1fr; }
  .zh-burger { display: grid; place-items: center; grid-column: 2; }
  .zh-nav {
    grid-column: 1 / -1; order: 3;
    max-height: 0; overflow: hidden;
    transition: max-height var(--transition-normal);
  }
  [data-zenith-header].is-open .zh-nav { max-height: 600px; }
  .zh-nav ul { flex-direction: column; padding: .5rem 0; gap: 0; }
  .zh-nav-link { padding: .65rem 1rem; border-bottom: 1px solid var(--gray-100); border-left: 3px solid transparent; }
  .zh-nav-link.is-active { border-bottom-color: var(--gray-100); border-left-color: var(--accent); }
  .zh-actions { grid-column: 3; justify-self: end; }
  .zh-role-meta { display: none; }
  .zh-brand-tag { display: none; }
}

/* ============================================================
   Toast bus
   ============================================================ */
#zh-toasts {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 9999;
}
.zh-toast {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .9rem;
  background: var(--black); color: var(--white);
  border-left: 3px solid var(--accent);
  font-size: .85rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px); opacity: 0;
  transition: all var(--transition-fast);
}
.zh-toast.is-shown { transform: translateY(0); opacity: 1; }
.zh-toast--success { border-left-color: var(--gray-500); }
.zh-toast--error   { border-left-color: var(--red-600); background: var(--red-700); }

/* ============================================================
   Page shell
   ============================================================ */
.zh-page { background: var(--gray-100); min-height: calc(100vh - 64px); }
.zh-page-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.zh-page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.zh-page-title {
  font-family: var(--font-mono);
  font-size: 1.65rem; text-transform: uppercase; letter-spacing: .04em;
  margin: 0;
}
.zh-page-subtitle { color: var(--gray-600); margin: .25rem 0 0; font-size: .95rem; }
.zh-page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ============================================================
   Card (для виджетов на главной и в кабинете)
   ============================================================ */
.zh-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 1.25rem;
  display: flex; flex-direction: column;
  min-width: 0;
}
.zh-card--accent { border-top: 3px solid var(--accent); }
.zh-card--ink    { background: var(--black); color: var(--white); border-color: var(--black); }
.zh-card--ink .zh-card-title { color: var(--white); }
.zh-card--ink .zh-card-sub   { color: var(--gray-400); }

.zh-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: 1rem;
}
.zh-card-title {
  font-family: var(--font-mono); text-transform: uppercase;
  font-size: .85rem; letter-spacing: .08em; margin: 0;
}
.zh-card-sub { color: var(--gray-600); font-size: .8rem; margin: 0; }
.zh-card-link {
  font-size: .8rem; color: var(--accent); text-decoration: none;
  font-weight: 600;
}
.zh-card-link:hover { text-decoration: underline; }

/* Grid helpers */
.zh-grid { display: grid; gap: 1rem; }
.zh-grid--2 { grid-template-columns: repeat(2, 1fr); }
.zh-grid--3 { grid-template-columns: repeat(3, 1fr); }
.zh-grid--4 { grid-template-columns: repeat(4, 1fr); }
.zh-grid--12 { grid-template-columns: repeat(12, 1fr); }
.zh-col-4  { grid-column: span 4; }
.zh-col-5  { grid-column: span 5; }
.zh-col-6  { grid-column: span 6; }
.zh-col-7  { grid-column: span 7; }
.zh-col-8  { grid-column: span 8; }
.zh-col-12 { grid-column: span 12; }

@media (max-width: 980px) {
  .zh-grid--2,
  .zh-grid--3,
  .zh-grid--4,
  .zh-grid--12 { grid-template-columns: 1fr; }
  .zh-col-4, .zh-col-5, .zh-col-6, .zh-col-7, .zh-col-8 { grid-column: span 1; }
}

/* ============================================================
   Schedule list (общий компонент для index + schedule)
   ============================================================ */
.zh-schedule-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1rem; padding: .85rem 0;
  border-top: 1px solid var(--gray-200);
  align-items: center;
}
.zh-schedule-item:first-child { border-top: none; }
.zh-schedule-item.is-now      { background: var(--accent-soft); margin: 0 -1rem; padding: .85rem 1rem; border-top: none; border-left: 3px solid var(--accent); }
.zh-schedule-item.is-done     { opacity: .55; }
.zh-schedule-item.is-replaced { border-left: 3px solid var(--accent); padding-left: 1rem; }
.zh-schedule-time {
  font-family: var(--font-mono); font-weight: 700; font-size: .85rem;
  color: var(--black);
}
.zh-schedule-subject { font-weight: 600; font-size: .95rem; }
.zh-schedule-meta {
  color: var(--gray-600); font-size: .8rem;
  display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .2rem;
}
.zh-schedule-meta i { color: var(--gray-500); margin-right: .25rem; }
.zh-schedule-room {
  font-family: var(--font-mono); font-weight: 700; font-size: 1rem;
  padding: .25rem .55rem;
  background: var(--gray-100); border: 1px solid var(--gray-300);
  color: var(--black);
}
.zh-schedule-item.is-replaced .zh-schedule-room {
  background: var(--accent); color: var(--white); border-color: var(--accent);
}
.zh-schedule-note {
  display: block; font-size: .75rem; color: var(--accent-active); margin-top: .25rem;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em;
}

/* ============================================================
   FAQ
   ============================================================ */
.zh-faq-item {
  border-bottom: 1px solid var(--gray-200);
}
.zh-faq-q {
  width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  padding: 1rem 0; font-size: .95rem; font-weight: 600;
  color: var(--black);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.zh-faq-q i { color: var(--accent); transition: transform var(--transition-fast); flex-shrink: 0; }
.zh-faq-item.is-open .zh-faq-q i { transform: rotate(45deg); }
.zh-faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height var(--transition-normal);
  color: var(--gray-700); font-size: .9rem; line-height: 1.55;
}
.zh-faq-item.is-open .zh-faq-a { max-height: 400px; padding-bottom: 1rem; }

/* ============================================================
   Announcements
   ============================================================ */
.zh-announcement {
  display: grid; grid-template-columns: 70px 1fr;
  gap: 1rem; padding: 1rem 0;
  border-top: 1px solid var(--gray-200);
}
.zh-announcement:first-child { border-top: none; }
.zh-announcement-date {
  font-family: var(--font-mono); font-size: .8rem; color: var(--gray-600);
  border-right: 1px solid var(--gray-200); padding-right: 1rem;
}
.zh-announcement-title {
  font-size: .95rem; font-weight: 600; margin: 0 0 .25rem; display: flex; gap: .5rem; align-items: center;
}
.zh-announcement-body { color: var(--gray-700); font-size: .85rem; line-height: 1.5; }
.zh-announcement-author {
  margin-top: .35rem; font-size: .75rem; color: var(--gray-500);
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em;
}

/* ============================================================
   Empty state
   ============================================================ */
.zh-empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--gray-600);
}
.zh-empty-state i { font-size: 2.5rem; color: var(--gray-400); margin-bottom: .75rem; }
.zh-empty-state strong { display: block; color: var(--gray-800); margin-bottom: .25rem; }


/* ============================================================
   A11Y: focus, motion, contrast
   ============================================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  z-index: 1;
}

.skip-link {
  position: absolute; left: -9999px; top: -9999px;
  background: var(--accent); color: var(--white);
  padding: .5rem 1rem;
  font-family: var(--font-mono); font-size: .8rem;
  text-decoration: none; z-index: 9999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --gray-200: #999;
    --gray-300: #777;
    --gray-600: #333;
  }
}

.zh-hero .btn-ghost-accent,
[data-on-dark] .btn-ghost-accent { color: var(--white); border-color: var(--white); }
.zh-hero .btn-ghost-accent:hover { background: var(--white); color: var(--black); }
