/* Atlas Day 4.9.3 — Knowledge, legal library, Consiliums and Department Schedule Builder. */

.atlas-v49-view {
  background: var(--color-bg-main, #f8fafc);
  bottom: 0;
  color: var(--color-text-primary, #0f172a);
  left: 250px;
  overflow: auto;
  padding: 34px clamp(22px, 4vw, 64px) 72px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 155;
}

.atlas-v49-nav-selected,
.atlas-v49-schedule-tab.selected {
  background: rgba(0, 180, 219, .18) !important;
  box-shadow: inset 3px 0 #00b4db;
}

.atlas-v49-schedule-tab {
  min-width: 142px;
}

.atlas-v49-schedule-tab span,
.atlas-v49-schedule-tab small { display: block; }

.atlas-v49-hero {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto 24px;
  max-width: 1480px;
}

.atlas-v49-hero h1 {
  font: 700 clamp(30px, 4vw, 52px)/1.08 Montserrat, Inter, sans-serif;
  letter-spacing: -.04em;
  margin: 5px 0 8px;
}

.atlas-v49-eyebrow {
  color: #0083b0;
  font: 700 11px/1 Montserrat, sans-serif;
  letter-spacing: .13em;
  margin: 0;
}

.atlas-v49-subtitle {
  color: #64748b;
  font: 400 14px/1.55 Inter, sans-serif;
  margin: 0;
  max-width: 760px;
}

.atlas-v49-close,
.atlas-v49-button,
.atlas-v49-primary,
.atlas-v49-secondary,
.atlas-v49-danger-link {
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font: 650 12px/1 Inter, sans-serif;
  min-height: 40px;
  padding: 10px 14px;
  text-decoration: none;
}

.atlas-v49-close,
.atlas-v49-secondary {
  align-items: center;
  background: #fff;
  border: 1px solid #d8e2ed;
  color: #1e3a5f;
  display: inline-flex;
  justify-content: center;
}

.atlas-v49-primary {
  background: linear-gradient(135deg, #00b4db, #0083b0);
  box-shadow: 0 8px 20px rgba(0, 131, 176, .18);
  color: #fff;
}

.atlas-v49-danger-link {
  background: transparent;
  color: #dc2626;
  min-height: 28px;
  padding: 4px;
}

.atlas-v49-primary:disabled,
.atlas-v49-secondary:disabled { cursor: wait; opacity: .55; }

.atlas-v49-body {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 1480px;
}

.atlas-v49-card,
.atlas-v49-subcard {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  padding: 20px;
}

.atlas-v49-card h2,
.atlas-v49-subcard h3 {
  font-family: Montserrat, Inter, sans-serif;
  margin: 0 0 14px;
}

.atlas-v49-notice {
  align-items: flex-start;
  background: #eafaff;
  border: 1px solid #b9eef7;
  border-radius: 14px;
  color: #164e63;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 16px;
}

.atlas-v49-notice strong { font-size: 13px; }
.atlas-v49-notice span { font-size: 12px; line-height: 1.45; }

.atlas-v49-loading,
.atlas-v49-empty {
  align-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  display: flex;
  font: 500 13px/1.45 Inter, sans-serif;
  justify-content: center;
  min-height: 96px;
  padding: 18px;
  text-align: center;
}

.atlas-v49-loading::before {
  animation: atlas-v49-spin .8s linear infinite;
  border: 2px solid #cdeff6;
  border-radius: 50%;
  border-top-color: #0083b0;
  content: "";
  height: 18px;
  margin-right: 10px;
  width: 18px;
}

@keyframes atlas-v49-spin { to { transform: rotate(360deg); } }

.atlas-v49-search-form {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.atlas-v49-search-form input,
.atlas-v49-legal-form input,
.atlas-v49-legal-form select,
.atlas-v49-legal-form textarea,
.atlas-v49-field input,
.atlas-v49-field textarea,
.atlas-v49-field select,
.atlas-v49-quick-form input,
.atlas-v49-shift-form input,
.atlas-v49-shift-form select,
.atlas-v49-compose textarea {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-sizing: border-box;
  color: #0f172a;
  font: 400 13px/1.4 Inter, sans-serif;
  min-height: 42px;
  padding: 10px 12px;
  width: 100%;
}

.atlas-v49-field textarea,
.atlas-v49-compose textarea,
.atlas-v49-legal-form textarea { min-height: 88px; resize: vertical; }

.atlas-v49-card-description {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
  margin: -6px 0 14px;
}

.atlas-v49-legal-card {
  background: linear-gradient(150deg, #ffffff, #f3fbfd);
  border-color: #cfeaf0;
}

.atlas-v49-legal-source {
  border-left: 4px solid #00b4db;
}

.atlas-v49-official-badge {
  align-items: center;
  display: inline-flex !important;
  gap: 5px;
}

.atlas-v49-official-badge::before {
  background: #10b981;
  border-radius: 50%;
  content: "";
  height: 7px;
  width: 7px;
}

.atlas-v49-legal-form {
  background: #f8fafc;
  border: 1px solid #dbe7eb;
  border-radius: 14px;
  display: grid;
  gap: 11px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  padding: 14px;
}

.atlas-v49-form-title,
.atlas-v49-legal-note,
.atlas-v49-form-status {
  grid-column: 1 / -1;
}

.atlas-v49-form-title {
  font: 600 16px/1.35 Montserrat, Inter, sans-serif;
  margin: 0;
}

.atlas-v49-form-status {
  color: #64748b;
  font-size: 10px;
  line-height: 1.45;
  margin: 0;
}

.atlas-v49-legal-form .atlas-v49-primary {
  align-self: end;
  margin-top: 4px;
  min-height: 42px;
}

/* Единый безопасный интервал между полями и основным действием старых и новых форм. */
.form-card.group-invite-form,
.form-card.reminder-form,
.form-card.document-form {
  column-gap: 16px !important;
  row-gap: 14px !important;
}

.group-quick-grid .form-card > .primary,
.group-invite-form > .primary,
.reminder-form > .primary,
.document-form > .primary,
.atlas-v49-inline-form > .atlas-v49-primary,
.atlas-v49-inline-form > .atlas-v49-secondary {
  margin-top: 4px;
}

/* Старый экран групп содержит пояснение сразу после кнопки: действие и текст всегда разнесены. */
.group-quick-grid .form-card > .primary {
  display: block;
  margin: 14px 0 10px !important;
  width: fit-content;
}

.group-quick-grid .form-card > small {
  display: block;
  line-height: 1.5;
}

.reminder-form > .primary {
  grid-column: 1 / -1;
  justify-self: start;
}

.atlas-v49-search-results { display: grid; gap: 8px; margin-top: 12px; }

.atlas-v49-source-result {
  align-items: center;
  background: #f8fafc;
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 12px;
}

.atlas-v49-source-result strong,
.atlas-v49-source-result span { display: block; }
.atlas-v49-source-result span { color: #64748b; font-size: 10px; margin-top: 4px; }
.atlas-v49-link { color: #006d92; font-size: 12px; font-weight: 700; text-decoration: none; }

.atlas-v49-source-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.atlas-v49-source-card {
  background: linear-gradient(150deg, #f6fdff, #f8fafc);
  border: 1px solid #dbeef3;
  border-radius: 13px;
  color: #0f172a;
  min-height: 120px;
  padding: 15px;
  text-decoration: none;
}

.atlas-v49-source-card strong,
.atlas-v49-source-card span,
.atlas-v49-source-card small { display: block; }
.atlas-v49-source-card span { color: #64748b; font-size: 11px; line-height: 1.45; margin: 7px 0 12px; }
.atlas-v49-source-card small { color: #0083b0; font-weight: 700; }

.atlas-v49-bookmarks { display: grid; gap: 8px; }
.atlas-v49-bookmark { align-items: center; border-bottom: 1px solid #eef2f7; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto auto; padding: 8px 0; }
.atlas-v49-bookmark a { color: #0f3d62; font-size: 12px; font-weight: 700; text-decoration: none; }
.atlas-v49-bookmark small { color: #64748b; font-size: 10px; }

.atlas-v49-split,
.atlas-v49-schedule-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 300px minmax(0, 1fr);
}

.atlas-v49-list-panel,
.atlas-v49-schedule-list { align-self: start; }
.atlas-v49-list-panel > .atlas-v49-card-title { margin-bottom: 18px !important; }
.atlas-v49-card-title,
.atlas-v49-detail-header,
.atlas-v49-schedule-toolbar {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.atlas-v49-schedule-toolbar h2,
.atlas-v49-schedule-toolbar p { margin: 0; }
.atlas-v49-schedule-toolbar p { color: #64748b; font-size: 12px; margin-top: 5px; }

.atlas-v49-inline-form,
.atlas-v49-create-schedule,
.atlas-v49-shift-form {
  display: grid;
  gap: 11px;
}
.atlas-v49-inline-form[hidden],
.atlas-v49-create-schedule[hidden] { display: none; }
.atlas-v49-inline-form { background: #f8fafc; border-radius: 12px; margin-bottom: 14px; padding: 12px; }
.atlas-v49-create-schedule { grid-template-columns: 2fr 1.4fr 1fr 1fr auto; }

.atlas-v49-field { color: #475569; display: grid; font-size: 10px; font-weight: 700; gap: 5px; }

.atlas-v49-list,
.atlas-v49-schedule-list { display: grid; gap: 5px; }

.atlas-v49-list-item,
.atlas-v49-schedule-item {
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: #0f172a;
  display: grid;
  padding: 11px;
  text-align: left;
  width: 100%;
}
.atlas-v49-list-item:hover,
.atlas-v49-list-item.selected,
.atlas-v49-schedule-item:hover,
.atlas-v49-schedule-item.selected { background: #ecf9fc; box-shadow: inset 3px 0 #00b4db; }
.atlas-v49-list-item strong,
.atlas-v49-schedule-item strong { font-size: 12px; }
.atlas-v49-list-item span,
.atlas-v49-schedule-item span { color: #64748b; font-size: 10px; margin-top: 5px; }
.atlas-v49-list-item small,
.atlas-v49-schedule-item small { color: #0083b0; font-size: 9px; margin-top: 5px; }
.atlas-v49-schedule-item { grid-template-columns: 8px 1fr; }
.atlas-v49-schedule-item > i { border-radius: 99px; grid-row: 1 / 4; width: 4px; }

.atlas-v49-detail { min-width: 0; }
.atlas-v49-detail-header h2,
.atlas-v49-detail-header p { margin: 0; }
.atlas-v49-detail-header > div > p:last-child { color: #64748b; font-size: 12px; line-height: 1.5; margin-top: 7px; max-width: 780px; white-space: pre-wrap; }
.atlas-v49-status { border-radius: 999px; font-size: 10px; font-weight: 700; padding: 7px 10px; white-space: nowrap; }
.atlas-v49-status.active { background: #e7f9f1; color: #047857; }
.atlas-v49-status.finalized { background: #eaf4ff; color: #1d4ed8; }
.atlas-v49-status.closed { background: #eef2f7; color: #64748b; }

.atlas-v49-member-row,
.atlas-v49-people,
.atlas-v49-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.atlas-v49-member-chip,
.atlas-v49-person { background: #f1f5f9; border-radius: 999px; color: #334155; font-size: 9px; padding: 7px 10px; }
.atlas-v49-person { align-items: center; border: 1px solid; display: grid; gap: 7px; grid-template-columns: 8px auto; }
.atlas-v49-person i { border-radius: 50%; height: 8px; grid-row: 1 / 3; width: 8px; }
.atlas-v49-person strong,
.atlas-v49-person small { display: block; }
.atlas-v49-person small { color: #64748b; }

.atlas-v49-detail-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.atlas-v49-subcard { background: #fbfdff; box-shadow: none; padding: 14px; }
.atlas-v49-consilium-messages { display: flex; flex-direction: column; gap: 7px; max-height: 420px; overflow-y: auto; }
.atlas-v49-message { align-self: flex-start; background: #eef2f7; border-radius: 12px 12px 12px 4px; max-width: 84%; padding: 9px 11px; }
.atlas-v49-message.mine { align-self: flex-end; background: #dff7fb; border-radius: 12px 12px 4px 12px; }
.atlas-v49-message strong { color: #0083b0; font-size: 9px; }
.atlas-v49-message p { font-size: 12px; margin: 4px 0; white-space: pre-wrap; }
.atlas-v49-message time { color: #94a3b8; font-size: 8px; }
.atlas-v49-compose { align-items: end; display: grid; gap: 8px; grid-template-columns: 1fr auto; margin-top: 10px; }
.atlas-v49-compose textarea { min-height: 48px; }
.atlas-v49-opinion { border-bottom: 1px solid #e2e8f0; padding: 8px 0; }
.atlas-v49-opinion strong { font-size: 10px; }
.atlas-v49-opinion p { font-size: 12px; margin: 5px 0; white-space: pre-wrap; }
.atlas-v49-conclusion { display: grid; gap: 8px; margin-top: 12px; }
.atlas-v49-citations { display: grid; gap: 6px; }
.atlas-v49-citations a { color: #006d92; font-size: 11px; font-weight: 700; }

.atlas-v49-quick-form {
  align-items: center;
  background: #f8fafc;
  border-radius: 12px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) 46px auto;
  margin: 13px 0;
  padding: 10px;
}
.atlas-v49-quick-form input[type="color"] { padding: 3px; }
.atlas-v49-shift-form { background: #f8fafc; border-radius: 14px; grid-template-columns: 1.5fr 1fr .8fr .8fr 1fr 1.5fr auto; margin: 14px 0; padding: 12px; }

.atlas-v49-calendar {
  border-left: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: repeat(7, minmax(105px, 1fr));
  margin-top: 16px;
  min-width: 760px;
  overflow: visible;
}
.atlas-v49-schedule-detail { overflow-x: auto; }
.atlas-v49-weekday { background: #f1f5f9; border-bottom: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; font-size: 9px; padding: 8px; text-align: center; }
.atlas-v49-day { border-bottom: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; min-height: 112px; padding: 7px; }
.atlas-v49-day.muted { background: #f8fafc; }
.atlas-v49-day-number { color: #475569; display: block; font-size: 10px; margin-bottom: 5px; }
.atlas-v49-shift { background: #f8fafc; border-left: 3px solid #00b4db; border-radius: 7px; margin-top: 4px; padding: 6px; position: relative; }
.atlas-v49-shift strong,
.atlas-v49-shift span,
.atlas-v49-shift small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atlas-v49-shift strong { font-size: 9px; padding-right: 12px; }
.atlas-v49-shift span { color: #334155; font-size: 9px; margin-top: 3px; }
.atlas-v49-shift small { color: #64748b; font-size: 8px; margin-top: 3px; }
.atlas-v49-shift-remove { background: transparent; border: 0; color: #ef4444; min-height: 18px; padding: 0; position: absolute; right: 4px; top: 3px; }

@media (max-width: 1080px) {
  .atlas-v49-view { left: 220px; padding: 24px 20px 60px; }
  .atlas-v49-create-schedule { grid-template-columns: 1fr 1fr; }
  .atlas-v49-shift-form { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .atlas-v49-view { left: 0; padding: max(18px, env(safe-area-inset-top)) 12px calc(76px + env(safe-area-inset-bottom)); z-index: 300; }
  .atlas-v49-hero { align-items: center; }
  .atlas-v49-hero h1 { font-size: 29px; }
  .atlas-v49-subtitle { font-size: 12px; }
  .atlas-v49-close { min-width: 78px; padding: 8px; }
  .atlas-v49-search-form,
  .atlas-v49-source-result,
  .atlas-v49-bookmark,
  .atlas-v49-split,
  .atlas-v49-schedule-layout,
  .atlas-v49-detail-grid,
  .atlas-v49-legal-form,
  .atlas-v49-create-schedule,
  .atlas-v49-shift-form { grid-template-columns: 1fr; }
  .atlas-v49-list-panel,
  .atlas-v49-schedule-list { max-height: 280px; overflow-y: auto; }
  .atlas-v49-card { padding: 14px; }
  .atlas-v49-schedule-toolbar { align-items: stretch; flex-direction: column; }
  .atlas-v49-quick-form { grid-template-columns: 1fr 1fr; }
  .atlas-v49-calendar { grid-template-columns: repeat(7, minmax(90px, 1fr)); }
  .atlas-v49-day { min-height: 96px; }
}

.atlas-schedule-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html:has(body.atlas-schedule-printing), body.atlas-schedule-printing { height: auto !important; overflow: visible !important; background: white !important; }
  body.atlas-schedule-printing { margin: 0 !important; padding: 0 !important; display: block !important; }
  body.atlas-schedule-printing > * { display: none !important; }
  body.atlas-schedule-printing > .atlas-schedule-print { display: block !important; color: #000; font: 10pt/1.4 Arial, sans-serif; width: 100%; }
  body.atlas-schedule-printing .atlas-schedule-print, body.atlas-schedule-printing .atlas-schedule-print * { visibility: visible !important; }
  .atlas-schedule-print h1 { font-size: 18pt; margin: 0 0 4mm; overflow-wrap: anywhere; }
  .atlas-schedule-print h2 { font-size: 12pt; margin: 5mm 0 2mm; break-after: avoid; }
  .atlas-schedule-print table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0 0 4mm; }
  .atlas-schedule-print thead { display: table-header-group; }
  .atlas-schedule-print tr { break-inside: avoid; }
  .atlas-schedule-print th, .atlas-schedule-print td { border: 1px solid #777; padding: 2mm; text-align: left; vertical-align: top; white-space: normal; overflow: visible; overflow-wrap: anywhere; height: auto; }
  .atlas-schedule-print table:has(th:nth-child(7)) th:nth-child(1) { width: 10%; }
  .atlas-schedule-print table:has(th:nth-child(7)) th:nth-child(2) { width: 23%; }
  .atlas-schedule-print table:has(th:nth-child(7)) th:nth-child(3) { width: 16%; }
  .atlas-schedule-print table:has(th:nth-child(7)) th:nth-child(4), .atlas-schedule-print table:has(th:nth-child(7)) th:nth-child(5) { width: 7%; }
  body > *:not(.atlas-v49-view) { display: none !important; }
  .atlas-v49-view { inset: 0; overflow: visible; padding: 0; position: static; }
  .atlas-v49-close,
  .atlas-v49-actions,
  .atlas-v49-quick-form,
  .atlas-v49-shift-form,
  .atlas-v49-schedule-list { display: none !important; }
  .atlas-v49-schedule-layout { display: block; }
  .atlas-v49-card { border: 0; box-shadow: none; }
  .atlas-v49-calendar { min-width: 0; }
  .atlas-v49-day { break-inside: avoid; min-height: 90px; }
}
