/* Модуль контроля посещаемости */

/* Токены модуля опираются на переменные темы ЦИОТ (base/theme.css),
   поэтому модуль поддерживает светлую и тёмную темы. */
.attendance-module,
.attendance-starosta-body,
.att-modal,
.att-starosta-modal,
.att-toast,
.att-starosta-toast {
  --att-primary: #00469a;
  --att-primary-strong: #00469a;
  --att-primary-strong-hover: #003679;
  --att-primary-light: #6290e1;
  --att-primary-bg: #dceffe;
  --att-red: #dc2626;
  --att-red-bg: #fee2e2;
  --att-green: #16a34a;
  --att-green-bg: #dcfce7;
  --att-warning: #d97706;
  --att-warning-bg: #fef3c7;
  --att-excused: #0284c7;
  --att-excused-bg: #e0f2fe;
  --att-muted: #64748b;
  --att-border: #e2e8f0;
  --att-surface: #ffffff;
  --att-surface-soft: #f8fafc;
  --att-surface-muted: #f1f5f9;
  --att-surface-hover: #e2e8f0;
  --att-text: #0f172a;
  --att-toast-bg: #0f172a;
  --att-toast-color: #ffffff;
  --att-overlay: rgba(15, 23, 42, 0.55);
  --att-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  --att-radius: 10px;
}

[data-bs-theme="dark"] .attendance-module,
[data-bs-theme="dark"] .attendance-starosta-body,
[data-bs-theme="dark"] .att-modal,
[data-bs-theme="dark"] .att-starosta-modal,
[data-bs-theme="dark"] .att-toast,
[data-bs-theme="dark"] .att-starosta-toast {
  --att-primary: #7aa7ea;
  --att-primary-strong: #2563eb;
  --att-primary-strong-hover: #1d4ed8;
  --att-primary-light: #3b82f6;
  --att-primary-bg: rgba(59, 130, 246, 0.16);
  --att-red: #f87171;
  --att-red-bg: rgba(220, 38, 38, 0.18);
  --att-green: #4ade80;
  --att-green-bg: rgba(22, 163, 74, 0.18);
  --att-warning: #fbbf24;
  --att-warning-bg: rgba(217, 119, 6, 0.2);
  --att-excused: #38bdf8;
  --att-excused-bg: rgba(2, 132, 199, 0.2);
  --att-muted: #9ca3af;
  --att-border: #2d3748;
  --att-surface: #1a2029;
  --att-surface-soft: #161c24;
  --att-surface-muted: #1e2530;
  --att-surface-hover: #2d3748;
  --att-text: #e9ecef;
  --att-toast-bg: #1e2530;
  --att-toast-color: #e9ecef;
  --att-overlay: rgba(0, 0, 0, 0.65);
  --att-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.att-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.att-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--att-border);
  border-radius: 7px;
  color: var(--att-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--att-surface);
}

.att-subnav a.active,
.att-subnav a:hover {
  color: var(--att-primary);
  border-color: var(--att-primary-light);
  background: var(--att-primary-bg);
}

.att-panel {
  background: var(--att-surface);
  border: 1px solid var(--att-border);
  border-radius: var(--att-radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--att-shadow);
}

.att-toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.att-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.att-label {
  font-size: 12px;
  color: var(--att-muted);
  font-weight: 600;
}

.att-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--att-surface-muted);
  color: var(--att-muted);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  border: 1px solid transparent;
}

.att-pill.active {
  background: var(--att-primary-strong);
  color: #fff;
}

.att-pill:hover:not(.active) {
  background: var(--att-surface-hover);
}

.att-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--att-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--att-surface);
  color: var(--att-text);
}

.att-input::placeholder {
  color: var(--att-muted);
  opacity: 1;
}

.att-input:focus {
  outline: none;
  border-color: var(--att-primary-light);
  box-shadow: 0 0 0 3px var(--att-primary-bg);
}

.att-input-sm {
  width: auto;
  min-width: 120px;
  padding: 5px 8px;
  font-size: 12px;
}

.att-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 6px;
  border: 1px solid var(--att-border);
  background: var(--att-surface);
  color: var(--att-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.att-btn:hover {
  background: var(--att-primary-bg);
  border-color: var(--att-primary-light);
}

.att-btn-primary {
  background: var(--att-primary-strong);
  border-color: var(--att-primary-strong);
  color: #fff;
}

.att-btn-primary:hover {
  background: var(--att-primary-strong-hover);
  border-color: var(--att-primary-strong-hover);
  color: #fff;
}

.att-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.att-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.att-kpi {
  background: var(--att-surface);
  border: 1px solid var(--att-border);
  border-left: 4px solid var(--att-primary);
  border-radius: var(--att-radius);
  padding: 15px 17px;
  box-shadow: var(--att-shadow);
}

.att-kpi.green { border-left-color: var(--att-green); }
.att-kpi.blue { border-left-color: var(--att-excused); }
.att-kpi.red { border-left-color: var(--att-red); }

.att-kpi-label {
  font-size: 12px;
  color: var(--att-muted);
  font-weight: 500;
}

.att-kpi-value {
  font-size: 27px;
  font-weight: 700;
  margin: 4px 0;
  color: var(--att-text);
}

.att-kpi-sub {
  font-size: 11px;
  color: var(--att-muted);
}

.att-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 900px) {
  .att-charts-grid {
    grid-template-columns: 1fr;
  }
}

.att-chart {
  background: var(--att-surface);
  border: 1px solid var(--att-border);
  border-radius: var(--att-radius);
  padding: 17px;
  box-shadow: var(--att-shadow);
  color: var(--att-text);
}

.att-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 160px;
  padding: 20px 10px 10px;
  border-bottom: 1px solid var(--att-border);
}

.att-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.att-bar {
  width: 100%;
  max-width: 38px;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  background: var(--att-primary);
}

.att-bar.low { background: var(--att-red); }
.att-bar-value { font-size: 11px; font-weight: 700; color: var(--att-text); }
.att-bar-label { font-size: 11px; color: var(--att-muted); }

.att-progress-row { margin-bottom: 14px; }
.att-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--att-text);
}
.att-progress-track {
  height: 10px;
  background: var(--att-surface-muted);
  border-radius: 5px;
  overflow: hidden;
}
.att-progress-fill {
  height: 100%;
  background: var(--att-primary);
  border-radius: 5px;
}

.att-table-wrap {
  background: var(--att-surface);
  border: 1px solid var(--att-border);
  border-radius: var(--att-radius);
  overflow-x: auto;
}

.att-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
  color: var(--att-text);
}

.att-table th {
  background: var(--att-surface-soft);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--att-muted);
  border-bottom: 2px solid var(--att-border);
  font-size: 12px;
}

.att-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--att-border);
  vertical-align: middle;
}

.att-table tbody tr:hover { background: var(--att-surface-soft); }

.att-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.att-badge-ok { background: var(--att-green-bg); color: var(--att-green); }
.att-badge-empty { background: var(--att-red-bg); color: var(--att-red); }
.att-badge-faculty {
  background: var(--att-primary-bg);
  color: var(--att-primary);
  border-radius: 4px;
  padding: 2px 6px;
}

.att-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.att-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 3000;
  background: var(--att-toast-bg);
  color: var(--att-toast-color);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  border-left: 4px solid var(--att-green);
  display: none;
  max-width: 360px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}
.att-toast.error { border-left-color: var(--att-red); }

.att-modal {
  position: fixed;
  inset: 0;
  background: var(--att-overlay);
  z-index: 2500;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.att-modal.open { display: flex; }
.att-modal-box {
  background: var(--att-surface);
  color: var(--att-text);
  border-radius: 12px;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  margin: auto;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}

/* Блокировка прокрутки страницы под открытым окном */
body.att-modal-open {
  overflow: hidden;
}
.att-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--att-primary);
  margin-bottom: 10px;
}

.att-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 560px) {
  .att-form-row { grid-template-columns: 1fr; }
}

.att-st-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}

.att-st-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--att-border);
  border-left: 4px solid var(--att-green);
  border-radius: 8px;
  background: var(--att-surface);
  color: var(--att-text);
  cursor: pointer;
}
.att-st-item.absent { border-left-color: var(--att-red); background: var(--att-red-bg); }
.att-st-item.late { border-left-color: var(--att-warning); background: var(--att-warning-bg); }
.att-st-item.excused { border-left-color: var(--att-excused); background: var(--att-excused-bg); }

.att-note-btn {
  background: var(--att-surface-soft);
  border: 1px solid var(--att-border);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 12px;
  cursor: pointer;
  color: var(--att-muted);
}
.att-note-btn.has-note {
  background: var(--att-primary-bg);
  border-color: var(--att-primary-light);
  color: var(--att-primary);
}

.att-drop-zone {
  border: 2px dashed var(--att-primary-light);
  background: var(--att-surface-soft);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  margin: 10px 0;
}
.att-drop-zone:hover { background: var(--att-primary-bg); }

.att-muted { color: var(--att-muted); }
.att-empty {
  text-align: center;
  color: var(--att-muted);
  padding: 22px;
}

/* Отдельный мобильный интерфейс старосты */
.attendance-starosta-body {
  margin: 0;
  background: var(--att-surface-soft);
  color: var(--att-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Golos Text", sans-serif;
  min-height: 100vh;
  padding-bottom: 24px;
}

.attendance-starosta-body * { box-sizing: border-box; }

.att-login-card {
  max-width: 390px;
  margin: 60px auto;
  background: var(--att-surface);
  color: var(--att-text);
  border: 1px solid var(--att-border);
  border-top: 4px solid var(--att-primary-strong);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 70, 154, 0.1);
}
.att-login-card h1 { font-size: 20px; color: var(--att-primary); margin: 0 0 6px; }
.att-login-card p { font-size: 12px; color: var(--att-muted); margin: 0 0 16px; }
.att-login-card label { display: block; font-size: 12px; font-weight: 700; margin: 10px 0 4px; }
.att-login-card input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--att-border);
  border-radius: 7px;
  font-size: 14px;
  background: var(--att-surface);
  color: var(--att-text);
}
.att-login-card input:focus {
  outline: none;
  border-color: var(--att-primary-light);
  box-shadow: 0 0 0 3px var(--att-primary-bg);
}
.att-login-card button {
  width: 100%;
  margin-top: 16px;
  padding: 11px;
  background: var(--att-primary-strong);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.att-login-card button:hover { background: var(--att-primary-strong-hover); }
.att-login-card .att-login-error {
  background: var(--att-red-bg);
  color: var(--att-red);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 10px;
}
.att-login-card .att-login-links {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--att-border);
  text-align: center;
  font-size: 12px;
}
.att-login-card a { color: var(--att-primary); }

.att-starosta-screen {
  max-width: 460px;
  margin: 18px auto;
  background: var(--att-surface);
  color: var(--att-text);
  border: 1px solid var(--att-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}
.att-starosta-header {
  background: linear-gradient(135deg, #00469a, #002d66);
  color: #fff;
  padding: 14px;
}
.att-starosta-header h1 { font-size: 17px; margin: 0; }
.att-starosta-header .att-starosta-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 7px;
  border-radius: 4px;
}
.att-starosta-header .att-starosta-meta {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 4px;
}
.att-starosta-header .att-starosta-bell {
  font-size: 12px;
  margin-top: 4px;
  color: #bbf7d0;
  font-weight: 600;
}
.att-starosta-datebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 0;
  font-size: 12px;
  color: var(--att-muted);
}
.att-starosta-datebar label {
  font-weight: 700;
  white-space: nowrap;
}
.att-starosta-datebar input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--att-border);
  border-radius: 7px;
  font-size: 13px;
  background: var(--att-surface);
  color: var(--att-text);
}
.att-starosta-datebar input:focus {
  outline: none;
  border-color: var(--att-primary-light);
  box-shadow: 0 0 0 3px var(--att-primary-bg);
}
.att-starosta-datebar button {
  padding: 7px 11px;
  border: 1px solid var(--att-border);
  border-radius: 7px;
  background: var(--att-surface);
  color: var(--att-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.att-starosta-datebar button:hover {
  background: var(--att-primary-bg);
  border-color: var(--att-primary-light);
}

.att-starosta-pairs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 8px 6px;
  background: var(--att-surface-soft);
  border-bottom: 1px solid var(--att-border);
}
.att-starosta-pair {
  background: var(--att-surface);
  color: var(--att-text);
  border: 1px solid var(--att-border);
  border-radius: 5px;
  padding: 8px 0;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  user-select: none;
}
.att-starosta-pair.active {
  background: var(--att-primary-strong);
  color: #fff;
  border-color: var(--att-primary-strong);
}
.att-starosta-pair:hover:not(.active) {
  background: var(--att-primary-bg);
  border-color: var(--att-primary-light);
}
.att-starosta-hint {
  padding: 8px 12px 0;
  font-size: 11px;
  color: var(--att-muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.att-starosta-list {
  padding: 10px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.att-starosta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--att-border);
  border-left: 4px solid var(--att-green);
  border-radius: 8px;
  background: var(--att-surface);
  color: var(--att-text);
  cursor: pointer;
  user-select: none;
}
.att-starosta-item.absent { border-left-color: var(--att-red); background: var(--att-red-bg); }
.att-starosta-item.late { border-left-color: var(--att-warning); background: var(--att-warning-bg); }
.att-starosta-item.excused { border-left-color: var(--att-excused); background: var(--att-excused-bg); }
.att-starosta-item .att-starosta-name { font-size: 13px; font-weight: 600; }
.att-starosta-item .att-starosta-note { font-size: 11px; color: var(--att-primary); }
.att-starosta-item .att-starosta-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--att-surface-muted);
  color: var(--att-text);
  min-width: 62px;
  text-align: center;
}
.att-starosta-footer {
  padding: 10px;
  border-top: 1px solid var(--att-border);
  background: var(--att-surface);
}
.att-starosta-footer button {
  width: 100%;
  padding: 11px;
  background: var(--att-primary-strong);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.att-starosta-footer button:hover { background: var(--att-primary-strong-hover); }
.att-starosta-footer button:disabled { opacity: 0.5; cursor: not-allowed; }
.att-starosta-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12px;
}

/* Колокольчик объявлений в шапке старосты */
.att-ann-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  border-radius: 8px;
}
.att-ann-bell:hover { background: var(--att-surface-muted); }
.att-ann-bell-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--att-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
}
.att-ann-bell.has-unread { animation: att-ann-pulse 2.4s ease-in-out infinite; }
@keyframes att-ann-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Блок дисциплины на экране старосты */
.att-starosta-subject {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 14px 0;
  padding: 9px 12px;
  background: var(--att-primary-bg);
  border: 1px solid var(--att-border);
  border-radius: 8px;
}
.att-starosta-subject .att-subject-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--att-muted);
  white-space: nowrap;
}
.att-starosta-subject .att-subject-value {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--att-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-starosta-subject .att-subject-value.empty {
  color: var(--att-muted);
  font-weight: 400;
  font-style: italic;
}
.att-starosta-subject .att-subject-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 3px 5px;
  border-radius: 5px;
  line-height: 1;
}
.att-starosta-subject .att-subject-edit:hover { background: var(--att-surface-hover); }
.att-subject-modal-hint {
  font-size: 11px;
  color: var(--att-muted);
  margin: -4px 0 10px;
}

/* Модалка объявлений */
.att-ann-list {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.att-ann-item {
  border: 1px solid var(--att-border);
  border-left: 4px solid var(--att-border);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--att-surface);
}
.att-ann-item.unread {
  border-left-color: var(--att-primary-strong);
  background: var(--att-primary-bg);
}
.att-ann-item.read { opacity: 0.75; }
.att-ann-item .att-ann-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--att-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.att-ann-item .att-ann-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: var(--att-primary-strong);
  border-radius: 50%;
  display: inline-block;
}
.att-ann-item .att-ann-body {
  font-size: 12.5px;
  color: var(--att-text);
  margin-top: 5px;
  line-height: 1.45;
}
.att-ann-item .att-ann-meta {
  font-size: 11px;
  color: var(--att-muted);
  margin-top: 6px;
}
.att-ann-item .att-ann-read-btn {
  margin-top: 8px;
  background: none;
  border: 1px solid var(--att-primary);
  color: var(--att-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.att-ann-item .att-ann-read-btn:hover { background: var(--att-primary-bg); }

/* Расписание недели в модале журнала (реестр) */
.att-journal-schedule {
  margin-bottom: 12px;
  padding: 10px;
  background: var(--att-surface-soft);
  border: 1px solid var(--att-border);
  border-radius: 8px;
}
.att-journal-schedule .att-js-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.att-js-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.att-js-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 9px;
  border: 1px solid var(--att-border);
  border-radius: 6px;
  background: var(--att-surface);
  cursor: pointer;
  font-size: 12px;
}
.att-js-row:hover { border-color: var(--att-primary-light); }
.att-js-row.selected {
  border-color: var(--att-primary-strong);
  background: var(--att-primary-bg);
}
.att-js-row.manual { border-left: 3px solid var(--att-warning); }
.att-js-row .att-js-when {
  color: var(--att-muted);
  white-space: nowrap;
  font-size: 11px;
}
.att-js-row .att-js-subject {
  font-weight: 600;
  color: var(--att-text);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Доска объявлений (реестр) */
.att-ann-create { padding-bottom: 4px; }
.att-ann-divider {
  height: 1px;
  background: var(--att-border);
  margin: 14px 0 10px;
}
.att-starosta-links a, .att-starosta-links button {
  background: none;
  border: none;
  color: var(--att-primary);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: 12px;
}
.att-starosta-modal {
  position: fixed;
  inset: 0;
  background: var(--att-overlay);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  z-index: 3000;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.att-starosta-modal.open { display: flex; }
.att-starosta-modal-box {
  background: var(--att-surface);
  color: var(--att-text);
  border-radius: 12px;
  padding: 18px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: auto;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}
.att-starosta-modal-box h3 { margin: 0 0 10px; color: var(--att-primary); font-size: 17px; }
.att-starosta-modal-box input,
.att-starosta-modal-box textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--att-border);
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 10px;
  background: var(--att-surface);
  color: var(--att-text);
}
.att-starosta-modal-box input:focus,
.att-starosta-modal-box textarea:focus {
  outline: none;
  border-color: var(--att-primary-light);
  box-shadow: 0 0 0 3px var(--att-primary-bg);
}
.att-starosta-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.att-starosta-modal-actions button {
  padding: 8px 13px;
  border-radius: 6px;
  border: 1px solid var(--att-border);
  background: var(--att-surface);
  color: var(--att-text);
  cursor: pointer;
  font-weight: 600;
}
.att-starosta-modal-actions button.primary {
  background: var(--att-primary-strong);
  border-color: var(--att-primary-strong);
  color: #fff;
}
.att-starosta-modal-actions button.primary:hover { background: var(--att-primary-strong-hover); }

.att-starosta-modal .att-pill {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--att-surface-muted);
  color: var(--att-muted);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  border: 1px solid transparent;
}
.att-starosta-modal .att-pill:hover { background: var(--att-surface-hover); }

.att-starosta-modal .att-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid var(--att-border);
  background: var(--att-surface);
  color: var(--att-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.att-starosta-modal .att-btn-primary {
  background: var(--att-primary-strong);
  border-color: var(--att-primary-strong);
  color: #fff;
}
.att-starosta-modal .att-btn-primary:hover { background: var(--att-primary-strong-hover); }

.att-starosta-modal .att-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.att-starosta-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--att-toast-bg);
  color: var(--att-toast-color);
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 12px;
  border-left: 4px solid var(--att-green);
  display: none;
  z-index: 3500;
  max-width: 90vw;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}
.att-starosta-toast.error { border-left-color: var(--att-red); }

/* Вспомогательные классы для разметки, генерируемой из JS и представлений */
.att-text-primary { color: var(--att-primary, #00469a); }
.att-text-danger { color: var(--att-red, #dc2626); }
.att-text-info { color: var(--att-excused, #0284c7); }
.att-text-success { color: var(--att-green, #16a34a); }
.att-text-muted { color: var(--att-muted, #64748b); }
.att-text-right { text-align: right; }

.att-loading-box {
  padding: 16px;
  text-align: center;
  color: var(--att-muted, #64748b);
}

.att-roster-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--att-surface-soft, #f8fafc);
  border-radius: 5px;
  font-size: 12px;
  color: var(--att-text, #0f172a);
}
.att-roster-row.is-archived { opacity: 0.55; }

.att-note-text {
  font-size: 11px;
  color: var(--att-primary, #00469a);
  font-weight: 500;
}

.att-modal-subtitle {
  font-size: 11px;
  color: var(--att-muted, #64748b);
  margin-bottom: 6px;
}

.att-note-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.att-note-actions {
  margin-top: 12px;
}

.att-note-title {
  margin: 0 0 8px;
  color: var(--att-primary, #00469a);
  font-size: 17px;
}

.att-preview-box {
  background: var(--att-surface-soft, #f8fafc);
  border: 1px solid var(--att-border, #e2e8f0);
  border-radius: 6px;
  padding: 10px;
  margin-top: 8px;
}

.att-preview-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--att-primary, #00469a);
  margin-bottom: 6px;
}

.att-preview-list {
  max-height: 160px;
  overflow-y: auto;
  font-size: 11px;
  color: var(--att-text, #0f172a);
}

.att-search-results {
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 10px;
  border: 1px solid var(--att-border, #e2e8f0);
  border-radius: 6px;
  display: none;
  background: var(--att-surface, #fff);
}
.att-search-results.open { display: block; }

.att-search-item {
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--att-border, #e2e8f0);
  color: var(--att-text, #0f172a);
}
.att-search-item:last-child { border-bottom: none; }
.att-search-item:hover { background: var(--att-surface-soft, #f8fafc); }

.att-search-empty {
  padding: 8px;
  font-size: 12px;
  color: var(--att-muted, #64748b);
}

.att-drop-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--att-primary, #00469a);
}

.att-password {
  font-weight: 700;
  color: var(--att-primary, #00469a);
}

.att-note-input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--att-border, #e2e8f0);
  border-radius: 7px;
  font-size: 13px;
  background: var(--att-surface, #fff);
  color: var(--att-text, #0f172a);
}
.att-note-input:focus {
  outline: none;
  border-color: var(--att-primary-light, #6290e1);
  box-shadow: 0 0 0 3px var(--att-primary-bg, #dceffe);
}
.att-note-input::placeholder { color: var(--att-muted, #64748b); opacity: 1; }

/* Ежемесячный отчёт старосты */
.att-report-box {
  max-width: 900px;
}
.att-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.att-report-head h3 { margin: 0; }
.att-report-close {
  background: none;
  border: none;
  color: var(--att-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.att-report-close:hover { color: var(--att-red); }
.att-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--att-border);
  border-radius: 8px;
  background: var(--att-surface-soft);
  font-size: 13px;
}
.att-report-toolbar label { font-weight: 600; color: var(--att-text); }
.att-report-toolbar select {
  width: auto;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--att-border);
  border-radius: 6px;
  background: var(--att-surface);
  color: var(--att-text);
  font-size: 13px;
  font-family: inherit;
}
.att-report-toolbar button {
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--att-border);
  background: var(--att-surface);
  color: var(--att-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.att-report-toolbar button:hover { background: var(--att-surface-hover); }
.att-report-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--att-muted);
}
.att-report-auto { margin-bottom: 6px; }
.att-report-person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}
.att-report-person label {
  font-weight: 600;
  color: var(--att-text);
  white-space: nowrap;
}
.att-report-person input { flex: 1 1 220px; }
.att-report-meta {
  font-size: 12px;
  color: var(--att-muted);
  margin-bottom: 8px;
}
.att-report-summary {
  padding: 9px 11px;
  margin-bottom: 10px;
  border: 1px solid var(--att-border);
  border-left: 3px solid var(--att-primary);
  border-radius: 6px;
  background: var(--att-primary-bg);
  color: var(--att-text);
  font-size: 12.5px;
  line-height: 1.45;
}
.att-report-box h4 {
  margin: 16px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--att-border);
  color: var(--att-primary);
  font-size: 14px;
}
.att-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 8px;
}
.att-report-table th,
.att-report-table td {
  border: 1px solid var(--att-border);
  padding: 7px 9px;
  text-align: left;
  vertical-align: middle;
  color: var(--att-text);
}
.att-report-table th {
  background: var(--att-surface-muted);
  font-size: 12px;
  font-weight: 700;
}
.att-report-table:not(.att-report-events) tr > td:first-child { width: 56%; }
.att-report-table .att-report-value { font-size: 12.5px; }
.att-report-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.att-report-options input[type="radio"],
.att-report-options input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--att-primary-strong);
}
.att-report-box input[type="text"],
.att-report-box textarea {
  width: 100%;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--att-border);
  border-radius: 6px;
  background: var(--att-surface);
  color: var(--att-text);
  font-size: 12.5px;
  font-family: inherit;
  resize: vertical;
}
.att-report-box input[type="text"]:focus,
.att-report-box textarea:focus {
  outline: none;
  border-color: var(--att-primary-light);
  box-shadow: 0 0 0 3px var(--att-primary-bg);
}
.att-report-events td { padding: 5px 6px; }
.att-report-events th:last-child,
.att-report-events td:last-child { text-align: center; }
.att-report-remove-event {
  padding: 3px 7px;
  border: 1px solid var(--att-border);
  border-radius: 5px;
  background: var(--att-surface);
  color: var(--att-red);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.att-report-remove-event:hover { background: var(--att-red-bg); }
.att-report-add-event {
  padding: 6px 11px;
  border: 1px dashed var(--att-primary-light);
  border-radius: 6px;
  background: transparent;
  color: var(--att-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.att-report-add-event:hover { background: var(--att-primary-bg); }
.att-report-empty {
  text-align: center;
  color: var(--att-muted);
  font-style: italic;
}
.att-report-block { margin-bottom: 10px; }
.att-report-caption {
  margin-bottom: 4px;
  color: var(--att-muted);
  font-size: 12px;
}
.att-report-note {
  margin: 14px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--att-surface-muted);
  color: var(--att-muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.att-report-actions {
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: var(--att-surface);
}
@media (max-width: 600px) {
  .att-report-box { padding: 14px 12px; }
  .att-report-table,
  .att-report-table th,
  .att-report-table td { font-size: 11.5px; }
  .att-report-table:not(.att-report-events) tr > td:first-child { width: auto; }
  .att-report-options label { margin-right: 10px; }
  .att-report-status { margin-left: 0; width: 100%; }
  .att-report-actions button { flex: 1 1 auto; }
}


