/* Учёт рабочего времени — админ-панель.
   Внутренний рабочий инструмент: спокойная, ясная иерархия данных,
   один акцентный цвет, без анимаций и внешних зависимостей. */

:root {
  color-scheme: light dark;

  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-sunken: #eef0f3;
  --border: #e1e4ea;
  --text: #14181f;
  --text-muted: #64707d;
  --text-faint: #9aa3b0;

  --accent: #2f6fed;
  --accent-hover: #2559c7;
  --accent-contrast: #ffffff;
  --accent-soft: #eaf1ff;

  --success: #16a34a;
  --success-soft: #e7f7ec;
  --warning: #b45309;
  --warning-soft: #fdf1de;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --info: #475569;
  --info-soft: #eef1f5;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(20, 24, 31, .04), 0 2px 10px rgba(20, 24, 31, .05);
  --font: -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-elevated: #171a21;
    --bg-sunken: #0b0d10;
    --border: #262b34;
    --text: #e7e9ee;
    --text-muted: #97a1b0;
    --text-faint: #626b79;

    --accent: #6f9bff;
    --accent-hover: #8bacff;
    --accent-contrast: #0b1220;
    --accent-soft: #17233d;

    --success: #4ade80;
    --success-soft: #10281a;
    --warning: #f5a524;
    --warning-soft: #34240c;
    --danger: #f87171;
    --danger-soft: #331414;
    --info: #a3adba;
    --info-soft: #1c212b;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 12px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 650; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
code, kbd {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ---------- layout ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  flex-shrink: 0;
}

.topnav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.topnav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}
.topnav a:hover { color: var(--text); background: var(--bg-sunken); }
.topnav a.active { color: var(--text); background: var(--accent-soft); }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-header p.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------- primitives ---------- */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.muted { color: var(--text-muted); font-size: 13px; }
.faint { color: var(--text-faint); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .spacer { flex: 1; }

.stat {
  text-align: right;
}
.stat .stat-label { font-size: 12px; color: var(--text-muted); }
.stat .stat-value { font-size: 18px; font-weight: 700; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-sunken); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; padding: 6px 10px; }
.btn-ghost:hover { color: var(--text); background: var(--bg-sunken); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-icon { padding: 6px 9px; }
.btn-block { width: 100%; }

form.inline { display: inline-flex; }

/* ---------- forms ---------- */

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }

input[type=text],
input[type=password],
input[type=number],
input[type=date],
input[type=datetime-local] {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  width: 100%;
}
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--text-faint); }

.field { display: flex; flex-direction: column; gap: 0; }
.field-inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-off { background: var(--info-soft); color: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-elevated); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 650; background: var(--bg-sunken); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-sunken); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { border-top: 1px solid var(--border); border-bottom: none; background: var(--bg-sunken); font-weight: 650; }

/* ---------- employee attendance cards ---------- */

.employee-card { padding: 16px 18px; margin-bottom: 14px; }
.employee-card + .employee-card { margin-top: 14px; }

.employee-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.employee-head .name { font-weight: 650; font-size: 15px; }
.employee-head .rate { color: var(--text-muted); font-size: 13px; }
.employee-head .spacer { flex: 1; }
.employee-head .totals { text-align: right; }
.employee-head .totals .hours { font-size: 13px; color: var(--text-muted); }
.employee-head .totals .pay { font-size: 16px; font-weight: 700; }

.session-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}
.session-grid:last-of-type { border-bottom: none; }
.session-grid .arrow { color: var(--text-faint); font-size: 13px; }
.session-grid .hours {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.session-grid input { font-size: 13.5px; padding: 6px 9px; }
.session-actions { display: flex; gap: 6px; justify-content: flex-end; }

.session-add {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.no-sessions { padding: 10px 0; }

@media (max-width: 720px) {
  .session-grid, .session-add {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .session-grid .arrow { display: none; }
  table { font-size: 13px; }
  th, td { padding: 9px 10px; }
}

/* ---------- misc ---------- */

.invite-code {
  font-family: var(--font-mono);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 12.5px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
