/* Attendance — светлая админ-панель: белое меню, спокойный синий, мягкие таблицы */
:root {
  --blue: #0a66c2; --blue-h: #0958a8; --blue-bg: #e8f1fb; --blue-ink: #0a58a8;
  --green: #1a7f37; --green-bg: #e6f4ea;
  --red: #c62828;  --amber-bg: #fdf3e1; --amber-ink: #8a5300;
  --ink: #1f2328; --ink2: #3d444d; --muted: #6b7380; --line: #e6e8eb; --line2: #eef0f2;
  --bg: #f7f8fa; --card: #fff;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.att { margin: 0; padding: 0; background: linear-gradient(to right, #fff 239px, var(--line) 239px 240px, var(--bg) 240px); color: var(--ink); display: flex; min-height: 100vh;
  font: 14px/1.5 var(--font); }
a { color: var(--blue); }
a:hover { color: var(--blue-h); }

/* ── боковое меню ─────────────────────────────── */
.att-side { width: 240px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; align-self: flex-start; }
.att-brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.att-logo { width: 36px; height: 36px; border-radius: 9px; background: var(--blue); display: grid; place-items: center; flex: none; }
.att-brand b { font-size: 16px; font-weight: 650; color: var(--ink); }
.att-role { margin: 14px 14px 2px; background: #f1f3f5; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--ink2); }
.att-role .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f97316; margin-right: 8px; vertical-align: middle; }
.att-nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.att-nav .nav-h { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); padding: 14px 10px 6px; }
.att-nav .nav-link-a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; color: var(--ink2);
  text-decoration: none; margin-bottom: 2px; }
.att-nav .nav-link-a:hover { background: #f1f3f5; color: var(--ink); }
.att-nav .nav-link-a.on { background: var(--blue); color: #fff; font-weight: 600; }
.nav-ico { width: 18px; height: 18px; flex: none; }
.att-src { margin: 22px 12px 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.att-src small { color: #9aa1ab; font-size: 12px; }
.dot.ok { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22a35a; margin-right: 8px; }
.att-me { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.att-me .ava { width: 34px; height: 34px; font-size: 13px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.att-me .who { flex: 1; min-width: 0; line-height: 1.3; }
.att-me .who b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-me .who span { font-size: 12px; color: var(--muted); }
.att-me .out { margin: 0; }
.att-out { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 8px; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; cursor: pointer; }
.att-out:hover { color: var(--red); border-color: #f0c9c9; background: #fff7f7; }
.att-out .nav-ico { width: 16px; height: 16px; }

/* ── основная часть ───────────────────────────── */
.att-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-top { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 28px 10px; }
.att-top h1 { font-size: 20px; font-weight: 700; margin: 0 0 2px; color: var(--ink); }
.att-top .crumb { font-size: 13px; color: var(--muted); }
.att-top .crumb .c1 { color: var(--blue); font-weight: 600; }
.att-top .crumb .sep { margin: 0 6px; color: #9aa1ab; }
.att-content { padding: 20px 28px 48px; }
.att-back { text-decoration: none; font-size: 13px; font-weight: 500; }

/* ── карточки ─────────────────────────────────── */
.att-card, .att-filters, .att-box, .att-kpis .kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }

/* фильтры */
.att-filters { padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.att-filters .f { display: flex; flex-direction: column; gap: 5px; min-width: 170px; }
.att-filters label { font-size: 13px; font-weight: 600; color: var(--ink); margin: 0; }
.att-filters .grow { flex: 1; }
.att-filters .btns { display: flex; gap: 8px; }
.att-period { text-align: right; }
.att-period span { display: block; font-weight: 650; color: var(--ink); }
.att-period small { color: var(--muted); font-size: 12px; }

.form-control, .form-select { border-color: #d8dce1; border-radius: 7px; min-height: 36px; font-size: 14px; color: var(--ink); padding-top: 5px; padding-bottom: 5px; }
.form-control:focus, .form-select:focus { border-color: #8bb6e3; box-shadow: 0 0 0 3px rgba(10, 102, 194, .12); }
.btn { border-radius: 7px; font-weight: 600; min-height: 36px; padding: 6px 18px; font-size: 14px; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-primary:hover, .btn-primary:focus { background: var(--blue-h); border-color: var(--blue-h); }
.btn-light-b { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-light-b:hover { background: #f6f7f9; color: var(--ink); }

/* плитки */
.att-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.att-kpis .kpi { padding: 14px 18px; }
.att-kpis .l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink2); }
.att-kpis .v { font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 6px; color: var(--ink); font-variant-numeric: tabular-nums; }
.att-kpis .v small { font-size: 16px; font-weight: 600; color: var(--ink2); }
.att-kpis .kpi.b .v { color: var(--blue); }
.att-kpis .s { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* заголовок над таблицей */
.att-sec { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 2px 0 10px; }
.att-sec h2 { font-size: 16px; font-weight: 700; margin: 0; color: var(--ink); }
.att-sec p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.att-sec .grow { flex: 1; }
.att-search { width: 240px; }

/* таблицы */
.att-box { overflow: hidden; margin-bottom: 18px; }
.att-table { margin: 0; --bs-table-hover-bg: #f7f9fc; }
.att-table th { background: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink2);
  white-space: normal; vertical-align: bottom; line-height: 1.35; border-bottom: 1px solid var(--line); padding: 11px 14px; }
.att-table th.n { max-width: 130px; }
.att-table td { white-space: nowrap; padding: 9px 14px; font-size: 14px; border-color: var(--line2); color: var(--ink); }
.att-table tbody tr:last-child td { border-bottom: 0; }
.att-table .n { text-align: right; font-variant-numeric: tabular-nums; }
.att-table a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(10, 102, 194, .35); }
.att-table a:hover { text-decoration-color: currentColor; }
.att-table .sub { color: var(--muted); }
.js-sortable th { cursor: pointer; user-select: none; }
.js-sortable th:hover { color: var(--ink); }
.js-sortable th.sorted-asc::after { content: " ▲"; color: var(--ink); font-size: 10px; }
.js-sortable th.sorted-desc::after { content: " ▼"; color: var(--ink); font-size: 10px; }
.dim { color: #aab0b8; }
.att-weekend td { background: #fbfcfe !important; }

/* метки */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 6px; line-height: 1.5; }
.pill-blue { background: var(--blue-bg); color: var(--blue-ink); }
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-amber { background: var(--amber-bg); color: var(--amber-ink); }
.pill-gray { background: #f1f3f5; color: var(--ink2); }
.c-bad { color: var(--red); font-weight: 600; }
.c-good { color: var(--green); }

.att-note { font-size: 12px; color: var(--muted); line-height: 1.7; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.att-note b { color: var(--ink); }

/* пагинация */
.att-pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.att-pager .grow { flex: 1; }
.att-pager label { display: flex; align-items: center; gap: 8px; margin: 0; }
.att-pager select { min-height: 30px; padding: 2px 28px 2px 8px; font-size: 13px; width: auto; }
.att-pager .pg { display: flex; gap: 4px; }
.att-pager .pg button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 7px; font-size: 13px; cursor: pointer; }
.att-pager .pg button:hover:not(:disabled) { background: #f3f5f8; }
.att-pager .pg button.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.att-pager .pg button:disabled { color: #b8bec6; cursor: default; }
.att-pager .pg .gap { padding: 0 4px; align-self: center; }

/* ── вход ─────────────────────────────────────── */
body.att-login-body { background: var(--bg); min-height: 100vh; display: grid; place-items: center; margin: 0; padding: 0; font: 15px/1.5 var(--font); color: var(--ink); }
.att-login { width: 100%; max-width: 400px; padding: 20px; }
.att-brand-login { border: 0; padding: 0 0 20px; justify-content: center; }
.att-brand-login span { display: block; font-size: 13px; color: var(--muted); }
.att-login-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.att-login-card h2 { font-size: 20px; font-weight: 700; margin: 0 0 18px; }
.att-login-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 16px; }

@media (max-width: 900px) {
  body.att { display: block; background: var(--bg); }
  .att-side { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .att-src { display: none; }
  .att-top, .att-content { padding-left: 16px; padding-right: 16px; }
}
