/* Офис BAHUR поверх bumaga.css: раскладка, карточки отделов, переписка. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 18px; height: 18px; flex: none; }
[hidden] { display: none !important; }
.dark { color-scheme: dark; }

.glavnaya { max-width: 1180px; margin: 0 auto; padding: 20px 16px 120px; }
@media (min-width: 768px) { .glavnaya { padding: 28px 32px 48px 108px; } }

.shapka-stroka { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.marka { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; margin-right: auto; }
.priglush { color: var(--muted-fg); font-weight: 500; }
.znak { display: block; width: 72px; height: 72px; border-radius: 999px; box-shadow: 0 8px 20px -10px rgb(30 25 15 / .5); }
.znak.malyj { width: 36px; height: 36px; box-shadow: none; }
.pilyulya { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); font-size: 12px; color: var(--muted-fg); white-space: nowrap; }
.pilyulya .tochka { width: 7px; height: 7px; border-radius: 999px; background: var(--muted-fg); }
.pilyulya.na-svyazi .tochka { background: var(--st-work); }
.pilyulya.net-svyazi .tochka { background: var(--st-error); }
@media (max-width: 520px) { .pilyulya.data { display: none; } }

/* Вход */
.vhod { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.vhod-karta { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.vhod-karta h1 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.03em; line-height: 1; }
.vhod-karta p { margin: 0; color: var(--muted-fg); font-size: 14px; }
.vhod-karta .input { height: 44px; font-size: 15px; color: var(--fg); }
.vhod-karta .btn { height: 44px; justify-content: center; font-size: 15px; }
.oshibka { color: var(--danger) !important; min-height: 1em; }

/* Отделы */
.setka { display: grid; gap: 14px; margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.otdel-karta { display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 150px;
  transition: transform .3s ease-out, box-shadow .3s; }
.otdel-karta:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgb(60 50 30 / .05), 0 18px 36px -16px rgb(60 50 30 / .3); }
@starting-style { .otdel-karta { transform: translateY(8px); opacity: 0; } }
.otdel-verh { display: flex; align-items: center; gap: 10px; }
.znachok { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--muted); font-size: 20px; }
.otdel-imya { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.otdel-chem { color: var(--muted-fg); font-size: 13px; flex: 1; }
.otdel-niz { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-fg); flex-wrap: wrap; }
.metka { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.metka.work { background: var(--st-work); color: #fff; }
.metka.pending { background: var(--st-pending); color: #1d1d1f; }
.metka.error { background: var(--st-error); color: #fff; }
.metka.tihaya { background: var(--muted); color: var(--muted-fg); font-weight: 500; }

/* Переписка */
.chat { display: grid; gap: 16px; margin-top: 20px; }
.lyudi-ryad { display: flex; gap: 6px; overflow-x: auto; padding: 4px; border-radius: 999px; background: var(--muted); width: fit-content; max-width: 100%; scrollbar-width: none; }
.lyudi-ryad button { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted-fg); white-space: nowrap; }
.lyudi-ryad button[aria-selected="true"] { background: var(--card); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.lenta { padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 340px; max-height: calc(100vh - 360px); overflow-y: auto; }
@media (max-width: 767px) { .lenta { max-height: none; min-height: 260px; } }
.pusto { margin: auto; text-align: center; color: var(--muted-fg); font-size: 14px; max-width: 360px; }
.pismo { max-width: min(680px, 88%); display: flex; flex-direction: column; gap: 4px; }
@starting-style { .pismo { transform: translateY(6px); opacity: 0; } }
.pismo { transition: transform .3s ease-out, opacity .3s; }
.pismo .kto { font-size: 12px; color: var(--muted-fg); padding: 0 4px; }
.pismo .telo { padding: 11px 14px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pismo.moyo { align-self: flex-end; }
.pismo.moyo .kto { text-align: right; }
.pismo.moyo .telo { background: var(--ink); color: var(--ink-fg); border-bottom-right-radius: 6px; }
.pismo.otdel .telo { background: var(--secondary); border-bottom-left-radius: 6px; }
.pismo.chuzhoe .telo { background: var(--card); border: 1px dashed var(--border); border-bottom-left-radius: 6px; }
.pismo.sistema { align-self: center; max-width: 560px; }
.pismo.sistema .telo { background: transparent; color: var(--muted-fg); font-size: 13px; text-align: center; padding: 2px 8px; }
.pismo .telo a { text-decoration: underline; text-underline-offset: 2px; }
.pismo .podpis { font-size: 11px; color: var(--muted-fg); padding: 0 4px; }
.zhdyot { align-self: flex-start; }

.sostavitel { display: flex; gap: 10px; align-items: flex-end; padding: 10px; }
.sostavitel textarea { flex: 1; resize: none; min-height: 44px; max-height: 220px; padding: 11px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--border); color: var(--fg); font: inherit; line-height: 1.4; }
.sostavitel textarea:focus { outline: none; border-color: color-mix(in srgb, var(--ink) 30%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.sostavitel .btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
.sostavitel .btn:disabled { opacity: .4; }
.podskazka { font-size: 12px; color: var(--muted-fg); padding: 0 6px; }
.preduprezhdenie { padding: 12px 16px; border-radius: 16px; background: var(--st-pending); color: #1d1d1f; font-size: 13px; }

/* Сотрудники */
.spisok-lyudej { display: grid; gap: 14px; margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.gruppa { padding: 16px; }
.gruppa h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.chelovek { display: flex; flex-direction: column; padding: 9px 10px; border-radius: 12px; }
.chelovek:hover { background: var(--accent); }
.chelovek b { font-weight: 600; font-size: 14px; }
.chelovek span { font-size: 12px; color: var(--muted-fg); }

.rail .tema-knopka, .dock .tema-knopka { cursor: pointer; }
