:root {
  --lm-primary: #2563eb;
  --lm-primary-dark: #1d4ed8;
  --lm-primary-soft: #eff4ff;
  --lm-side: #0f172a;
  --lm-side-2: #1e293b;
  --lm-side-text: #94a3b8;
  --lm-bg: #f4f6fb;
  --lm-card: #ffffff;
  --lm-border: #e5e8ef;
  --lm-text: #1f2937;
  --lm-muted: #6b7280;
  --lm-green: #16a34a;
  --lm-amber: #d97706;
  --lm-red: #dc2626;
  --lm-slate: #64748b;
  --lm-radius: 12px;
  --lm-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}
html, body { height: 100%; }
body { background: var(--lm-bg); color: var(--lm-text); font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 14.5px; }
a { color: var(--lm-primary); text-decoration: none; }
a:hover { color: var(--lm-primary-dark); }

/* ---------- shell ---------- */
.lm-shell { display: flex; min-height: 100vh; }
.lm-side { width: 248px; flex: 0 0 248px; background: var(--lm-side); color: var(--lm-side-text); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1030; transition: transform .2s; }
.lm-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; font-weight: 700; font-size: 17px; }
.lm-brand .mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b82f6, #6366f1); display: grid; place-items: center; font-size: 17px; }
.lm-brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--lm-side-text); letter-spacing: .02em; }
.lm-nav { padding: 6px 12px; flex: 1; }
.lm-nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 16px 10px 6px; }
.lm-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: #cbd5e1; font-weight: 500; margin-bottom: 2px; }
.lm-nav a i { font-size: 16px; width: 18px; text-align: center; color: var(--lm-side-text); }
.lm-nav a:hover { background: var(--lm-side-2); color: #fff; }
.lm-nav a.active { background: var(--lm-primary); color: #fff; }
.lm-nav a.active i { color: #fff; }
.lm-side-foot { padding: 14px 20px; border-top: 1px solid #1e293b; font-size: 12.5px; }
.lm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lm-top { height: 62px; background: var(--lm-card); border-bottom: 1px solid var(--lm-border); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 1020; }
.lm-top h1 { font-size: 17px; font-weight: 650; margin: 0; }
.lm-top .clock { color: var(--lm-muted); font-size: 13px; }
.lm-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lm-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--lm-primary-soft); color: var(--lm-primary); display: grid; place-items: center; font-weight: 700; }
.lm-content { padding: 24px; flex: 1; }
.lm-burger { display: none; border: 0; background: none; font-size: 22px; padding: 4px 6px; }
.lm-overlay { display: none; }
@media (max-width: 991.98px) {
  .lm-side { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  body.nav-open .lm-side { transform: none; }
  body.nav-open .lm-overlay { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1025; }
  .lm-burger { display: inline-block; }
  .lm-content { padding: 16px; }
  .lm-top { padding: 0 16px; }
  .lm-top .clock { display: none; }
}

/* ---------- cards ---------- */
.lm-card { background: var(--lm-card); border: 1px solid var(--lm-border); border-radius: var(--lm-radius); box-shadow: var(--lm-shadow); }
.lm-card > .hd { padding: 14px 18px; border-bottom: 1px solid var(--lm-border); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lm-card > .hd h2 { font-size: 15px; font-weight: 650; margin: 0; }
.lm-card > .bd { padding: 18px; }
.lm-stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.lm-stat .ic { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; flex: 0 0 44px; }
.lm-stat .v { font-size: 25px; font-weight: 700; line-height: 1.1; }
.lm-stat .l { color: var(--lm-muted); font-size: 13px; }
.ic-blue { background: #eff4ff; color: #2563eb; } .ic-green { background: #ecfdf3; color: #16a34a; }
.ic-amber { background: #fffbeb; color: #d97706; } .ic-red { background: #fef2f2; color: #dc2626; }
.ic-slate { background: #f1f5f9; color: #475569; } .ic-violet { background: #f5f3ff; color: #7c3aed; }

/* ---------- tables ---------- */
.lm-table { width: 100%; margin: 0; }
.lm-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--lm-muted); font-weight: 600; background: #f9fafb; padding: 10px 14px; border-bottom: 1px solid var(--lm-border); white-space: nowrap; }
.lm-table td { padding: 11px 14px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; }
.lm-table tr:last-child td { border-bottom: 0; }
.lm-table tbody tr:hover { background: #fafbff; }
.lm-empty { padding: 40px 20px; text-align: center; color: var(--lm-muted); }
.lm-empty i { font-size: 34px; display: block; margin-bottom: 8px; color: #cbd5e1; }
.person { display: flex; align-items: center; gap: 10px; }
.person .av { width: 34px; height: 34px; border-radius: 50%; background: #e0e7ff; color: #4338ca; font-weight: 700; display: grid; place-items: center; font-size: 13px; flex: 0 0 34px; }
.person .nm { font-weight: 600; color: var(--lm-text); }
.person small { display: block; color: var(--lm-muted); }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-present { background: #ecfdf3; color: #15803d; } .pill-late { background: #fffbeb; color: #b45309; }
.pill-absent { background: #fef2f2; color: #b91c1c; } .pill-off { background: #f1f5f9; color: #475569; }
.pill-pending { background: #eff4ff; color: #1d4ed8; } .pill-rejected { background: #fef2f2; color: #b91c1c; }
.pill-accepted { background: #ecfdf3; color: #15803d; } .pill-inactive { background: #f1f5f9; color: #64748b; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: #475569; }
.tag-in { background: #ecfdf3; color: #15803d; } .tag-out { background: #eff4ff; color: #1d4ed8; } .tag-warn { background: #fffbeb; color: #b45309; }

/* ---------- forms ---------- */
.form-label { font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 5px; }
.form-control, .form-select { border-color: #d6dae3; border-radius: 8px; font-size: 14px; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: #93b4f8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.btn { border-radius: 8px; font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--lm-primary); border-color: var(--lm-primary); }
.btn-primary:hover { background: var(--lm-primary-dark); border-color: var(--lm-primary-dark); }
.form-text { font-size: 12.5px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .f { min-width: 150px; }
.filters .form-label { font-size: 12px; margin-bottom: 3px; color: var(--lm-muted); }
.daychips { display: flex; flex-wrap: wrap; gap: 6px; }
.daychips input { display: none; }
.daychips label { border: 1px solid #d6dae3; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 13px; user-select: none; }
.daychips input:checked + label { background: var(--lm-primary); border-color: var(--lm-primary); color: #fff; }

/* ---------- misc ---------- */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 21px; font-weight: 700; margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--lm-muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.map { height: 380px; border-radius: 10px; border: 1px solid var(--lm-border); z-index: 0; }
.map-sm { height: 300px; }
.muted { color: var(--lm-muted); }
.bar { height: 8px; border-radius: 99px; background: #eef1f6; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.week-col .stack { width: 26px; height: 120px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; background: #eef1f6; }
.week-col small { color: var(--lm-muted); font-size: 11.5px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--lm-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--lm-muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 500; }
.alert { border-radius: 10px; }

/* ---------- login ---------- */
.lm-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.lm-login .art { background: linear-gradient(145deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.lm-login .art h1 { font-size: 34px; font-weight: 750; line-height: 1.2; max-width: 440px; }
.lm-login .art p { color: #c7d2fe; max-width: 420px; font-size: 15.5px; }
.lm-login .art ul { list-style: none; padding: 0; margin: 26px 0 0; }
.lm-login .art li { margin: 10px 0; color: #e0e7ff; } .lm-login .art li i { margin-right: 10px; color: #93c5fd; }
.lm-login .form-side { display: grid; place-items: center; padding: 32px; background: #fff; }
.lm-login form { width: 100%; max-width: 360px; }
@media (max-width: 860px) { .lm-login { grid-template-columns: 1fr; } .lm-login .art { display: none; } }
