:root {
  color-scheme: light;
  --teal: #1f6f78;
  --line: #e5e7eb;
  --muted: #6b7280;
  --bg: #f5f6f8;
  --ctl-h: 38px; /* shared height for inputs, selects and buttons so a toolbar row lines up */
}
* { box-sizing: border-box; }

/* Thin, light scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: #dde1e7 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #dde1e7; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #c7cdd6; }
*::-webkit-scrollbar-track { background: transparent; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: #1c2128; }
.hidden { display: none !important; }
button { font-family: inherit; }
.link { background: none; border: none; color: var(--teal); cursor: pointer; padding: 0; font-size: 14px; }

/* Login */
.login-screen { min-height: 100vh; display: grid; place-items: center; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 340px; }
.login-card h1 { font-size: 20px; font-weight: 600; margin: 0 0 18px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 9px; font-size: 15px; }
.login-card button { width: 100%; margin-top: 20px; padding: 11px; border: none; border-radius: 9px; background: var(--teal); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-error { color: #b91c1c; font-size: 13px; margin-top: 10px; min-height: 16px; }

/* Layout */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; transition: grid-template-columns .18s; }
.app.nav-collapsed { grid-template-columns: 66px 1fr; }
/* Teal sidebar: dark brand surface with light text/icons (lucide icons inherit currentColor). */
.sidebar { background: var(--teal); border-right: none; display: flex; flex-direction: column; padding: 16px 0; position: sticky; top: 0; height: 100vh; color: #fff; }
.brand { font-weight: 700; padding: 0 12px 16px 18px; font-size: 17px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; color: #fff; }
.brand-main { min-width: 0; display: inline-flex; align-items: center; gap: 9px; }
.brand-main { cursor: pointer; }
.brand-logo { width: 28px; height: 28px; flex: 0 0 auto; display: block; filter: brightness(0) invert(1); } /* force the logo white on the teal surface */
.brand-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); cursor: pointer; padding: 0; }
.nav-toggle:hover { color: #fff; background: rgba(255,255,255,.18); }
.app.nav-collapsed .brand { justify-content: center; padding: 0 0 16px; }
.app.nav-collapsed .brand-main { justify-content: center; }
.app.nav-collapsed .brand-text { display: none; }
nav { flex: 1; overflow-y: auto; }
/* Accordion nav */
.nav-group-h {
  width: 100%; display: grid; grid-template-columns: 20px 1fr 16px; align-items: center; column-gap: 9px; padding: 10px 16px;
  background: none; border: none; cursor: pointer; color: rgba(255,255,255,.72); font-size: 12px;
  text-transform: uppercase; letter-spacing: .03em; font-weight: 600;
}
.nav-group-h:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-group-h .nav-group-t { min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-h > .lic { justify-self: center; }
.nav-group-h > .lic:last-child { transition: transform .18s; width: 15px; height: 15px; }
.nav-group.open .nav-group-h > .lic:last-child { transform: rotate(180deg); }
.nav-items { display: none; padding-bottom: 4px; }
.nav-group.open .nav-items { display: block; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 22px; color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; cursor: pointer; border-left: 3px solid transparent; }
.nav-dash { width: 12px; color: rgba(255,255,255,.5); text-align: center; }
nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
nav a.active { background: rgba(255,255,255,.18); color: #fff; border-left-color: #fff; font-weight: 600; }
.lic { width: 18px; height: 18px; flex: none; stroke-width: 2; }
.app.nav-collapsed .nav-group-h { grid-template-columns: 1fr; justify-items: center; padding: 10px 0; }
.app.nav-collapsed .nav-group-t, .app.nav-collapsed .nav-group-h > .lic:last-child, .app.nav-collapsed .nav-items, .app.nav-collapsed .sb-footer, .app.nav-collapsed .nav-toggle { display: none; }
.app.nav-collapsed .nav-group-h > .lic:first-child { width: 19px; height: 19px; }

/* Currency picker */
.cur-wrap { position: relative; margin-top: 5px; }
.cur-btn { width: 100%; height: var(--ctl-h); text-align: left; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.cur-caret { margin-left: auto; color: #9ca3af; }
.cur-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.08); z-index: 20; max-height: 260px; overflow: auto; }
.cur-item { padding: 8px 10px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.cur-item:hover { background: #f3f4f6; }
.cur-code { font-weight: 600; flex: none; }
.cur-symbol, .cur-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fi { margin-right: 2px; border-radius: 2px; }
/* Language switcher (sidebar bottom) */
.lang-switch { position: relative; padding: 6px 14px 10px; }
.lang-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font-size: 14px; }
.lang-btn .fi { border-radius: 2px; }
.lang-caret { margin-left: auto; opacity: .8; }
.lang-menu { position: absolute; left: 14px; right: 14px; bottom: calc(100% - 4px); background: #fff; color: #1c2128; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); overflow: hidden; z-index: 30; }
.lang-opt { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-size: 14px; }
.lang-opt:hover, .lang-opt.active { background: #eef6f6; }
.app.nav-collapsed .lang-switch { display: none; }

/* Account card (org name + tariff/balance + footer) at the sidebar bottom */
.sb-account { margin: 4px 14px 14px; padding: 12px 14px 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; }
.app.nav-collapsed .sb-account { display: none; }

.sb-org { color: #fff; font-weight: 600; font-size: 14px; overflow: hidden; white-space: nowrap; display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.sb-org::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex: none; box-shadow: 0 0 0 3px rgba(74,222,128,.18); }
.sb-org:empty { display: none; }
.sb-org-viewport { display: block; min-width: 0; flex: 1; overflow: hidden; }
.sb-org-text { display: inline-block; min-width: max-content; transform: translateX(0); }
.sb-org-text.is-marquee { animation: sb-org-marquee 15s ease-in-out infinite; }
@keyframes sb-org-marquee {
  0%, 28% { transform: translateX(0); }
  58%, 84% { transform: translateX(var(--marquee-shift)); }
  100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) { .sb-org-text.is-marquee { animation: none; } }

/* Tariff + balance rows (label left, value right) */
.sb-meta { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
.sb-meta:empty { display: none; }
.sb-meta .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-meta .row .k { color: rgba(255,255,255,.6); }
.sb-meta .row .v { color: #fff; font-weight: 600; }
.sb-meta .row .v.low { color: #fca5a5; }
.sb-chip { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgba(255,255,255,.16); color: #fff; }

.suspend-panel { max-width: 520px; margin: 48px auto; text-align: center; padding: 32px 28px; background: #fff; border: 1px solid #fde2c8; border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.05); }
.suspend-panel .suspend-ic { width: 56px; height: 56px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff4ec; color: #e8771a; }
.suspend-panel .suspend-ic .lic { width: 28px; height: 28px; }
.suspend-panel h3 { margin: 0 0 10px; font-size: 18px; color: #1f2937; }
.suspend-panel p { margin: 0 0 10px; color: #374151; line-height: 1.55; }
.suspend-panel p.muted { color: #6b7280; font-size: 13px; }

.sb-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.16); font-size: 13px; color: rgba(255,255,255,.78); display: flex; justify-content: space-between; align-items: center; }
.sb-footer .link { color: #fff; font-weight: 600; }
.sb-footer .link:hover { text-decoration: underline; }
.content { padding: 22px 26px; overflow-x: auto; }

/* Headings & toolbar */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 19px; font-weight: 600; margin: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* Search input with a leading lucide icon (replaces the 🔎 emoji) */
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap .lic { position: absolute; left: 10px; width: 16px; height: 16px; color: #9aa3ad; pointer-events: none; }
input.with-search-ic { padding-left: 32px; }
.employee-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -2px 0 12px; }
.filter-chip { height: var(--ctl-h); display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #64748b; }
.filter-chip .lic { width: 15px; height: 15px; flex: none; }
.employee-filter-combo { position: relative; min-width: 142px; max-width: 220px; }
.employee-filter-combo::after { content: ""; position: absolute; right: 0; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid #64748b; border-bottom: 1.5px solid #64748b; transform: translateY(-65%) rotate(45deg); pointer-events: none; }
.filter-chip .mini-filter-input { width: 100%; height: 30px; padding: 0 18px 0 0; border: 0 !important; border-radius: 0; background: transparent; color: #1c2128; font-size: 13px; outline: none; box-shadow: none; }
.mini-filter-input::placeholder { color: #1c2128; opacity: 1; }
.employee-filter-menu { position: absolute; left: -34px; right: -9px; top: calc(100% + 8px); max-height: 230px; overflow: auto; padding: 4px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; box-shadow: 0 10px 24px rgba(15,23,42,.14); z-index: 70; }
.employee-filter-item, .employee-filter-empty { padding: 8px 10px; border-radius: 6px; color: #1c2128; font-size: 13px; cursor: pointer; }
.employee-filter-item:hover, .employee-filter-item.active { background: #e8f3f5; }
.employee-filter-empty { color: var(--muted); cursor: default; }
.table-count { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--ctl-h);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  vertical-align: middle;
}
.btn .lic { width: 15px; height: 15px; }
.btn-icon-only {
  width: var(--ctl-h);
  height: var(--ctl-h);
  padding: 0;
  flex-shrink: 0;
}
.btn-icon-only .lic { width: 16px; height: 16px; }
.btn.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.danger { color: #b91c1c; border-color: #f0caca; }
.btn:hover { filter: brightness(.98); }
.btn-group { display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.btn-group .btn { border: none; border-radius: 0; margin: 0; border-right: 1px solid var(--line); }
.btn-group .btn:last-child { border-right: none; }
.btn-group .btn.primary { background: var(--teal); color: #fff; }
select, input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=email] {
  height: var(--ctl-h); padding: 0 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; background: #fff;
}
label.fld { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label.fld input, label.fld select { width: 100%; margin-top: 5px; color: #1c2128; }
.gender-picker { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 5px; }
.gender-choice, .gender-clear { height: var(--ctl-h); border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #1c2128; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: 14px; }
.gender-choice .lic { width: 17px; height: 17px; }
.gender-choice.active, .gender-clear.active { border-color: var(--teal); background: #e8f3f5; color: var(--teal); font-weight: 600; }
.combo { position: relative; margin-top: 5px; }
.combo input { margin-top: 0 !important; padding-right: 58px; }
.combo::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.combo:has(.combo-clear:not(.hidden))::after { display: none; }
.combo-clear { position: absolute; right: 8px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%); border: 0; border-radius: 999px; background: #eef2f7; color: #64748b; cursor: pointer; font-size: 17px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; z-index: 2; }
.combo-clear:hover { background: #e2e8f0; color: #1c2128; }
.combo-clear.hidden { display: none; }
.combo-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 24px rgba(15,23,42,.14); z-index: 60; padding: 4px; }
.combo-item, .combo-empty { padding: 8px 10px; border-radius: 6px; color: #1c2128; font-size: 14px; cursor: pointer; }
.combo-item { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.combo-item.has-thumb { flex-direction: row; align-items: center; gap: 10px; }
.combo-thumb { width: 42px; height: 42px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; flex: none; }
.combo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.combo-title { color: #1c2128; line-height: 1.25; }
.combo-sub { color: #8a94a3; font-size: 12px; line-height: 1.25; }
.combo-item:hover, .combo-item.active { background: #e8f3f5; }
.combo-empty { color: var(--muted); cursor: default; }
.model-preview { margin-top: 8px; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.model-preview img { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; flex: none; }
.model-preview-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; color: #64748b; font-size: 12px; }
.model-preview-text b { color: #1c2128; font-size: 14px; font-weight: 600; }
.model-badge { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.model-badge img { width: 38px; height: 38px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; flex: none; }
.model-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label.ck { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
/* Brand-tint every checkbox/radio (and range) so they match the teal accent. */
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--teal); }
.date-row { display: flex; gap: 8px; align-items: center; margin-top: 5px; }
.date-row input { flex: 1; margin-top: 0 !important; }
.org-settings-card .date-row { gap: 8px; }
.org-settings-card .date-row .btn-icon-only { flex: none; }
/* Tabbed form (employee modal) */
.employee-form-sticky { position: sticky; top: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 10px 18px; margin: -18px -18px 14px; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 8px 12px -12px rgba(15,23,42,.45); }
.form-tabs { display: flex; gap: 4px; margin: 0; }
.form-tabs .tab-btn { background: none; border: none; padding: 8px 14px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.form-tabs .tab-btn:hover { color: #1c2128; }
.form-tabs .tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }
.employee-save-top { flex: none; margin-bottom: 2px; }

/* Generic card container */
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
/* Realistic mini license-plate badge (blue country strip + number) */
.plate-badge { display: inline-flex; align-items: stretch; height: 24px; border: 1px solid #1c2b46; border-radius: 5px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.14); vertical-align: middle; }
.plate-badge .pb-strip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: #1e3a8a; color: #fff; padding: 0 4px; }
.plate-badge .pb-strip .fi { width: 15px; height: 10px; border-radius: 1px; }
.plate-badge .pb-strip b { font-size: 8px; line-height: 1; letter-spacing: .5px; }
.plate-badge .pb-num { display: inline-flex; align-items: center; padding: 0 9px; font-family: "Segoe UI", Arial, sans-serif; font-weight: 800; letter-spacing: 1px; font-size: 14px; color: #111; }
/* Multi-plate editor rows */
.plate-edit { padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: #fbfcfd; }
.plate-row { display: flex; gap: 8px; align-items: center; }
.plate-row .icon-btn { flex: none; }
.plate-preview { margin-top: 8px; }
.plate-preview .plate-badge { height: 30px; }
.plate-preview .plate-badge .pb-num { font-size: 17px; }
.plate-preview .plate-badge .pb-strip .fi { width: 18px; height: 12px; }
/* Salary: amount input + currency picker side by side */
.money-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 5px; }
.money-row input { flex: 1; margin-top: 0 !important; text-align: right; font-variant-numeric: tabular-nums; }
.money-row .cur-wrap { margin-top: 0; flex: none; width: 150px; }
.money-row .cur-menu { width: 230px; right: 0; left: auto; }
.deputy-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 5px; }
.deputy-row { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) 32px; gap: 8px; align-items: end; }
.deputy-row > input { width: 100%; }
.deputy-row label.fld { margin-bottom: 0; }
.deputy-add-btn { margin: 10px 0 0 auto; }

/* Tables */
table.grid { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.grid th { background: #f3f4f6; font-weight: 600; }
table.grid tr:hover td { background: #fafbfc; }
table.grid td.live-cell { transition: background-color .25s ease; }
table.grid td.live-cell-flash,
table.grid tr:hover td.live-cell-flash { background: #ecfeff; }
.row-actions { display: flex; gap: 6px; justify-content: center; }
/* Fixed, right-aligned actions column with centered icon buttons */
table.grid th.col-actions, table.grid td.col-actions { width: 96px; text-align: center; white-space: nowrap; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: #475569; cursor: pointer; padding: 0;
}
.icon-btn:hover { background: #f3f4f6; color: var(--teal); border-color: #cbd5e1; }
.icon-btn.danger:hover { color: #b91c1c; border-color: #f0caca; background: #fef2f2; }
.icon-btn .lic { width: 15px; height: 15px; }
/* Inline icon buttons that sit next to a full-height input (e.g. date "today") match its height */
.date-row .icon-btn { width: var(--ctl-h); height: var(--ctl-h); }

/* Report table */
.report-wrap { overflow: auto; max-height: calc(100vh - 190px); border: 1px solid var(--line); border-radius: 8px; }
/* Thinner, lighter scrollbars */
.report-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.report-wrap::-webkit-scrollbar-thumb { background: #e2e5ea; border-radius: 8px; }
.report-wrap::-webkit-scrollbar-thumb:hover { background: #cfd4db; }
.report-wrap::-webkit-scrollbar-track { background: #fafbfc; }
.report-wrap { scrollbar-width: thin; scrollbar-color: #e2e5ea #fafbfc; background: #fff; isolation: isolate; }
.report-settings-wrap { position: relative; flex: none; }
.report-settings-menu { position: absolute; right: 0; top: calc(100% + 7px); z-index: 120; width: 360px; max-width: calc(100vw - 32px); padding: 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.18); }
.report-settings-title { margin-bottom: 12px; font-size: 14px; font-weight: 700; }
.report-settings-label { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.report-settings-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-mode-group { display: flex; width: 100%; margin-bottom: 14px; }
.report-mode-group .btn { flex: 1; min-width: 0; padding: 0 8px; font-size: 12px; }
.report-settings-field { margin-bottom: 8px; }
.report-settings-field select { margin-top: 5px; width: 100%; }
.content { scrollbar-width: thin; scrollbar-color: #e2e5ea transparent; }
.content::-webkit-scrollbar { width: 8px; height: 8px; }
.content::-webkit-scrollbar-thumb { background: #e2e5ea; border-radius: 8px; }
.content::-webkit-scrollbar-track { background: transparent; }
table.report { border-collapse: collapse; font-size: 12px; white-space: nowrap; background: #fff; }
table.report th, table.report td { border: 1px solid #dfe3e8; padding: 3px 6px; text-align: center; }
table.report thead th { position: sticky; top: 0; background: #1f6f78; color: #fff; z-index: 3; height: 26px; }
table.report thead tr:nth-child(2) th { top: 27px; }
table.report .sticky-col { position: sticky; background: #fff; background-clip: padding-box; z-index: 2; }
table.report thead .sticky-col { z-index: 5; background: #1f6f78; color: #fff; }
table.report .r-no { left: 0; min-width: 34px; width: 34px; }
table.report .r-photo { left: 34px; min-width: 48px; width: 48px; text-align: center; vertical-align: middle; }
table.report .r-name { left: 82px; min-width: 190px; width: 190px; text-align: left; font-weight: 600; box-shadow: 4px 0 6px rgba(15,23,42,.08); }
table.report.compact-name .r-name { min-width: 145px; width: 145px; max-width: 145px; }
table.report tbody td.r-name::after { content: ''; position: absolute; top: 0; right: -2px; bottom: 0; width: 3px; background: #fff; }
table.report .r-company { min-width: 150px; width: 150px; text-align: left; }
table.report .r-dept { min-width: 130px; width: 130px; text-align: left; }
table.report .r-position { min-width: 140px; width: 140px; text-align: left; }
table.report td.r-company, table.report td.r-dept, table.report td.r-position { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
table.report .report-name-main { overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
table.report .report-name-sub { margin-top: 2px; font-size: 10px; line-height: 1.15; font-weight: 500; color: #64748b; overflow: hidden; text-overflow: ellipsis; }
table.report td.r-no, table.report td.r-photo { font-weight: 600; color: #475569; }
.report-avatar { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; background: #eef2f7; color: #64748b; font-weight: 700; }
table.report td.daycell { cursor: pointer; min-width: 42px; line-height: 1.25; }
table.report td.daycell:hover { outline: 2px solid var(--teal); outline-offset: -2px; }
table.report td.late { color: #d11; font-weight: 600; }
table.report td.total { font-variant-numeric: tabular-nums; min-width: 72px; font-weight: 500; }
table.report.collapsed .detail-col { display: none; }
table.report .days-group { background: #1f6f78; }
table.report td.grp-work { background: #fff; color: #1c2128; }
table.report thead .grp-work { background: #1f6f78; color: #fff; }
table.report .grp-late { background: #fff3c4; color: #8a5d00; }
table.report thead .grp-late { background: #ffd966; color: #6b4700; }
table.report .grp-absence { background: #f9d2d2; color: #b00000; }
table.report thead .grp-absence { background: #d90000; color: #fff; }
table.report .grp-penalty { background: #ead1dc; color: #8f245a; }
table.report thead .grp-penalty { background: #a64d79; color: #fff; }
table.report .grp-salary { background: #d9ead3; color: #237000; }
table.report thead .grp-salary { background: #38761d; color: #fff; }
table.report .two { display: flex; flex-direction: column; line-height: 1.15; }
table.report .total-stack { display: flex; flex-direction: column; line-height: 1.18; }
table.report .total-stack .muted-line { color: #64748b; font-size: 11px; }
table.report .report-group-row td { padding: 6px 10px; text-align: left; background: #edf5f6; color: #164e55; border-color: #cbdfe2; }
table.report .report-group-row[data-level="1"] td { background: #f3f7f8; }
table.report .report-group-row[data-level="2"] td { background: #f8fafb; }
table.report .report-group-fixed { position: sticky; left: 0; z-index: 2; min-width: 272px; max-width: 272px; box-shadow: 4px 0 6px rgba(15,23,42,.08); background-clip: padding-box; }
table.report.compact-name .report-group-fixed { min-width: 227px; max-width: 227px; }
table.report .report-group-fill { position: relative; z-index: 0; }
table.report .report-group-content { display: flex; align-items: baseline; min-width: 0; overflow: hidden; white-space: nowrap; }
table.report .report-group-row[data-level="1"] .report-group-content { margin-left: 16px; }
table.report .report-group-row[data-level="2"] .report-group-content { margin-left: 32px; }
table.report .report-group-label { margin-right: 5px; color: #64748b; font-size: 11px; font-weight: 500; }
table.report .report-group-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 700; }

/* Codes legend */
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; font-size: 12px; color: var(--muted); }
.legend-item, .code-opt { display: inline-flex; align-items: center; gap: 6px; }
.code-box { width: 18px; height: 18px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,.12); color: #0f172a; font-size: 11px; font-weight: 700; font-style: normal; }
.code-picker { position: relative; margin-top: 5px; }
.code-select { width: 100%; height: var(--ctl-h); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; cursor: pointer; font-size: 14px; }
.code-select .code-opt { flex: 1; }
.code-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(15,23,42,.12); z-index: 40; max-height: 260px; overflow: auto; padding: 4px; }
.code-menu .code-opt { display: flex; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.code-menu .code-opt:hover, .code-menu .code-opt.active { background: #eef6f6; }
.code-none { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; color: #64748b; }

/* Analytics */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-width: 140px; flex: 1; }
.stat-val { font-size: 24px; font-weight: 700; color: var(--teal); }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.analytics-block { margin-bottom: 22px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.block-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.finance-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.finance-head .block-title { margin: 0; }
.finance-holder { min-height: 28px; }
.finance-wrap { max-height: 520px; border-radius: 8px; }
.finance-table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.finance-table th, .finance-table td { border: 1px solid #dfe3e8; padding: 6px 8px; text-align: center; }
.finance-table thead th { position: sticky; top: 0; z-index: 2; background: #1f6f78; color: #fff; }
/* Header date/total cells: keep the teal header (the money/total tints below are body-only). */
.finance-table thead th.money-col, .finance-table thead th.total-col { background: #1f6f78; color: #fff; }
.finance-table .text-col { text-align: left; min-width: 140px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.finance-table .money-col { min-width: 105px; text-align: right; font-variant-numeric: tabular-nums; background: #f8fbf4; }
.finance-table .total-col { font-weight: 700; background: #d9ead3; color: #237000; }
.finance-total-row td { font-weight: 700; background: #eef6f6; }
.finance-total-row .money-col { background: #eaf4e4; }
.chart-box { position: relative; height: 320px; }
.chart-box.small { height: 280px; }
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 22px; align-items: start; }
.charts-row .analytics-block { margin-bottom: 0; height: 100%; }
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }

/* Journal accordion (lazy) */
.journal { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.jr-item { border-bottom: 1px solid var(--line); }
.jr-item:last-child { border-bottom: none; }
.jr-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; text-align: left; }
.jr-head:hover { background: #f8f9fa; }
/* Clickable area that expands the group; checkbox + delete are siblings so the header is not a <button> */
.jr-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.jr-toggle > i:first-child { transition: transform .18s; width: 16px; height: 16px; color: var(--muted); flex: none; }
.jr-item.open .jr-toggle > i:first-child { transform: rotate(90deg); }
.jr-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-count { color: var(--muted); font-size: 13px; flex: none; margin-left: auto; }
/* Per-card selection checkbox + delete: hidden until you hover the card (or it is selected) */
.jr-check { width: 17px; height: 17px; flex: none; cursor: pointer; opacity: 0; transition: opacity .15s; accent-color: var(--teal); }
.jr-item:hover .jr-check, .jr-check:checked { opacity: 1; }
.jr-del { flex: none; opacity: 0; transition: opacity .15s; }
.jr-item:hover .jr-del, .jr-item.selected .jr-del { opacity: 1; }
.jr-item.selected { background: #eef6f6; }
.jr-body { display: none; padding: 6px 14px 16px; }
.jr-item.open .jr-body { display: block; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { padding: 9px 16px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 14px; color: #6b7280; }
.tab:hover { color: #374151; }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 600; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; z-index: 1000; }
.modal-box { background: #fff; border-radius: 12px; width: min(560px, 94vw); max-height: 92vh; overflow: auto; }
.modal-box.wide { width: min(940px, 96vw); }
/* Geozone editor (in modal) */
.gz-edit-map { height: min(52vh, 460px); border-radius: 8px; border: 1px solid var(--line); margin-top: 4px; }
.gz-points { max-height: 160px; overflow: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.gz-point-row { display: flex; align-items: center; gap: 6px; }
.gz-point-row input { flex: 1; min-width: 0; }
.gz-point-no { width: 22px; flex: none; text-align: center; color: var(--muted); font-weight: 600; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 17px; }
#modalBody { padding: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.import-box { display: flex; flex-direction: column; gap: 10px; }
.import-textarea {
  width: 100%; min-height: 320px; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre; overflow: auto;
}
.import-file {
  width: 100%; border: 1px dashed var(--line); border-radius: 8px;
  padding: 14px; background: #f8fafc;
}
.import-result {
  min-height: 42px; white-space: pre-wrap; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
  font-size: 13px;
}
.ip-hint { margin-top: 5px; font-size: 12px; }
.ip-hint.ok { color: #15803d; }
.ip-hint.bad { color: #b91c1c; }
.sigur-preview { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sigur-preview:empty { display: none; }
.sigur-preview-table { margin: 0; }
.sigur-preview-table th, .sigur-preview-table td { font-size: 12px; vertical-align: middle; }
.sigur-thumb { width: 42px; height: 42px; border-radius: 6px; object-fit: cover; display: inline-block; }
.row-warn td { background: #fff7ed; color: #9a3412; }

/* Organization hierarchy modal */
.hierarchy-modal { padding: 0 0 4px; }
.hierarchy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; }
.hierarchy-tree-panel, .hierarchy-side { min-width: 0; }
.hierarchy-layout h4 { margin: 0 0 10px; font-size: 14px; }
.h-tree { display: flex; flex-direction: column; gap: 12px; }
.h-org, .h-dept { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.h-org-title, .h-dept-title { display: flex; align-items: center; gap: 8px; padding: 9px 11px; font-weight: 600; background: #f8fafc; }
.h-org-title .lic, .h-dept-title .lic { width: 16px; height: 16px; color: var(--teal); }
.h-dept { margin: 10px; background: #fbfcfd; }
.h-dept-title { background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.h-badge { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: #eef6f6; color: var(--teal); font-size: 12px; font-weight: 500; }
.h-person { margin: 8px 10px 8px calc(10px + var(--level) * 22px); }
.h-person-main { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #dbe3ea; border-radius: 8px; background: #fff; }
.h-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e8f3f5; color: var(--teal); font-weight: 700; flex: none; }
.h-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-meta { color: var(--muted); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-children { border-left: 1px dashed #cbd5e1; margin-left: 22px; padding-left: 2px; }
.h-link-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.h-link-form label.fld { margin-bottom: 0; }
.h-links { display: flex; flex-direction: column; gap: 8px; }
.h-link-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.h-link-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .hierarchy-layout { grid-template-columns: 1fr; }
}

/* Visual org chart */
.orgchart-page {
  height: calc(100vh - 104px);
  min-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(#edf1f5 1px, transparent 1px),
    linear-gradient(90deg, #edf1f5 1px, transparent 1px),
    #fff;
  background-size: 28px 28px;
  position: relative;
}
.orgchart-canvas { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; }
.orgchart-canvas.dragging { cursor: grabbing; }
.orgchart-content { position: absolute; left: 0; top: 0; transform-origin: 0 0; min-width: max-content; min-height: max-content; will-change: transform; }
.orgchart-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
.oc-line { fill: none; stroke: #cbd5e1; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.oc-org { min-width: 960px; margin: 0 0 54px; padding: 0 28px 22px; position: relative; z-index: 1; }
.oc-org-head { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.95); box-shadow: 0 2px 10px rgba(15,23,42,.06); }
.oc-org-head h3 { margin: 0; font-size: 16px; font-weight: 500; }
.oc-org-head .lic { color: var(--teal); }
.oc-top { display: flex; justify-content: center; margin: 0 0 18px; position: relative; }
.oc-top.org-node { margin-top: 0; }
.oc-top.director-node { margin-top: 24px; }
.oc-branch-label { width: fit-content; margin: 0 auto 10px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 600; }
.oc-row { display: flex; justify-content: center; gap: 18px; align-items: flex-start; position: relative; margin-bottom: 22px; }
.oc-card {
  position: relative;
  z-index: 1;
  width: 184px;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce3ea;
  border-radius: 10px;
  background: #fff;
  color: #1c2128;
  text-align: left;
  box-shadow: 0 4px 12px rgba(15,23,42,.08);
  cursor: default;
}
.oc-card:not(.empty)[onclick] { cursor: pointer; }
.oc-card.empty { color: var(--muted); background: #f8fafc; box-shadow: none; }
.oc-photo { width: 42px; height: 42px; border-radius: 9px; overflow: hidden; flex: none; background: #e8f3f5; display: grid; place-items: center; color: var(--teal); font-weight: 800; }
.oc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.oc-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.oc-info strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-info span { font-size: 11px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-info small { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-card-badge { position: absolute; right: 8px; top: 7px; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: var(--teal); font-weight: 700; }
.oc-dept { position: relative; width: 210px; z-index: 1; }
.oc-dept-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--teal); box-shadow: 0 2px 9px rgba(15,23,42,.06); }
.oc-count { padding: 2px 7px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 10px; text-transform: none; white-space: nowrap; }
.oc-dept .oc-card { width: 100%; }
.oc-toggle {
  position: relative;
  z-index: 2;
  width: 22px;
  height: 18px;
  margin: -6px auto 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7dee8;
  border-radius: 5px;
  background: #fff;
  color: #64748b;
  box-shadow: 0 1px 4px rgba(15,23,42,.08);
  cursor: pointer;
}
.oc-toggle .lic { width: 14px; height: 14px; }
.oc-toggle:hover { color: var(--teal); border-color: #b8c7d5; }
.oc-staff { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; position: relative; }
@media (max-width: 760px) {
  .orgchart-page { height: calc(100vh - 112px); min-height: 520px; }
  .oc-row { justify-content: flex-start; }
}

/* Map */
#map { height: calc(100vh - 320px); min-height: 480px; border-radius: 8px; border: 1px solid var(--line); }
#empmap { height: calc(100vh - 170px); min-height: 520px; border-radius: 8px; border: 1px solid var(--line); }

/* Employee map markers (avatar pin) */
.emp-pin-wrap { background: none; border: none; }
.emp-pin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #94a3b8; background: #fff; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.35); position: relative; }
.emp-pin::after { content: ''; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #94a3b8; }
.emp-pin.in { border-color: #16a34a; } .emp-pin.in::after { border-top-color: #16a34a; }
.emp-pin.out { border-color: #dc2626; } .emp-pin.out::after { border-top-color: #dc2626; }
.emp-pin img { width: 100%; height: 100%; object-fit: cover; }
.emp-pin-ph { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-weight: 800; color: #64748b; font-size: 18px; }
/* Popup card */
.emp-pop { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.emp-pop-av { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.emp-pop-name { font-weight: 700; font-size: 14px; }
.emp-pop-sub { color: #64748b; font-size: 12px; margin: 1px 0 4px; }
.emp-pop-line { font-size: 12px; margin-top: 2px; }
.emp-pop-line.muted { color: #64748b; }
.emp-pop-tag { padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.emp-pop-tag.ok { background: #e4f4ea; color: #1a6b3f; }
.emp-pop-tag.bad { background: #fde6e6; color: #9b1c1c; }
.gz-status { font-size: 13px; font-weight: 600; color: var(--teal); padding: 6px 10px; background: #eef6f6; border-radius: 8px; white-space: nowrap; }
.leaflet-tooltip.gz-num { background: var(--teal); color: #fff; border: none; box-shadow: none; font-size: 11px; font-weight: 700; padding: 0 4px; border-radius: 8px; }
.leaflet-tooltip.gz-num::before { display: none; }
/* Permanent name label for saved geozones on the map */
.leaflet-tooltip.gz-label { background: rgba(37,99,235,.92); color: #fff; border: none; box-shadow: 0 1px 4px rgba(0,0,0,.3); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.leaflet-tooltip.gz-label::before { display: none; }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.photo-media { position: relative; height: 150px; background: #eee; }
.photo-media a { display: block; height: 100%; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; background: #eee; }
.photo-empty { height: 100%; display: grid; place-items: center; color: #999; }
.photo-source { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; max-width: calc(100% - 16px); padding: 4px 7px; border-radius: 20px; background: rgba(255,255,255,.9); color: #0f172a; font-size: 11px; font-weight: 600; box-shadow: 0 1px 5px rgba(15,23,42,.18); backdrop-filter: blur(4px); }
.photo-source i { width: 13px; height: 13px; flex: 0 0 auto; }
.photo-source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-overlays { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; pointer-events: none; }
.photo-chip { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 11px; color: #fff; background: rgba(15, 23, 42, .72); backdrop-filter: blur(4px); }
.photo-card .meta { padding: 7px 9px; font-size: 12px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; }
.photo-overlays .badge { padding: 2px 7px; box-shadow: 0 1px 4px rgba(15,23,42,.18); }
.badge.APPROVED { background: #e4f4ea; color: #1a6b3f; }
.badge.PENDING { background: #fff6e0; color: #8a5a00; }
.badge.REJECTED { background: #fde6e6; color: #9b1c1c; }

/* Photo dropzone (employee face photo) */
.photo-drop { position: relative; width: 190px; height: 190px; border: 2px dashed #cbd5e1; border-radius: 12px; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; overflow: hidden; background: #fafbfc; color: #94a3b8; font-size: 12px; padding: 10px; margin: 6px auto 0; outline: none; }
.photo-drop:hover, .photo-drop:focus { border-color: var(--teal); }
.photo-drop.dragover { border-color: var(--teal); background: #eef6f6; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop .hint { z-index: 1; pointer-events: none; line-height: 1.5; white-space: pre-line; }
.photo-drop.has-img .hint { display: none; }
.photo-drop .overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(31,111,120,.5); color: #fff; font-size: 13px; font-weight: 600; z-index: 2; }
.photo-drop:hover .overlay { display: flex; }
.photo-drop .del { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 3; font-size: 15px; line-height: 1; }
.photo-drop.has-img:hover .del { display: flex; }
.photo-actions { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.camera-ov { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: grid; place-items: center; z-index: 3000; padding: 16px; }
.camera-box { width: min(620px, 96vw); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.camera-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.camera-box video { width: 100%; max-height: 68vh; background: #0f172a; display: block; object-fit: contain; }
.camera-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 14px; }
.icon-x { border: none; background: transparent; color: var(--teal); font-size: 24px; cursor: pointer; line-height: 1; }

/* Face cropper */
.cropper-ov { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 3000; }
.cropper-box { background: #fff; border-radius: 12px; padding: 18px; width: min(360px, 94vw); text-align: center; }
.cropper-title { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.cropper-vp { position: relative; margin: 0 auto; overflow: hidden; border-radius: 8px; background: #000; touch-action: none; cursor: grab; }
.cropper-vp:active { cursor: grabbing; }
.cropper-img { position: absolute; top: 0; left: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.cropper-guide { position: absolute; inset: 0; pointer-events: none; }
.cropper-guide::after { content: ''; position: absolute; left: 50%; top: 48%; width: 66%; height: 84%; transform: translate(-50%,-50%); border: 2px dashed rgba(255,255,255,.85); border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0,0,0,.28); }
.cropper-ctrls { display: flex; align-items: center; gap: 10px; margin: 14px 4px; color: #6b7280; }
.cropper-ctrls input[type=range] { flex: 1; }
.cropper-actions { display: flex; gap: 10px; justify-content: flex-end; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1c2128; color: #fff; padding: 11px 18px; border-radius: 9px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 2000; }
.toast.show { opacity: 1; }
.muted { color: var(--muted); font-size: 13px; }

/* Radial menu styles */
.radial-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.radial-menu-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.radial-menu-wrapper {
  transform: scale(0.92);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.radial-menu-overlay.show .radial-menu-wrapper {
  transform: scale(1);
}
.radial-menu-container {
  position: relative;
  width: 520px;
  height: 520px;
  user-select: none;
}
.radial-menu-sector {
  fill: rgba(255, 255, 255, 0.85);
  stroke: rgba(226, 232, 240, 0.85);
  stroke-width: 2;
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease;
}
.radial-menu-sector:hover, .radial-menu-sector.active-selected {
  fill: rgba(238, 246, 246, 0.95);
  stroke: var(--teal);
}
.radial-menu-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.15);
  border: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
}
.radial-menu-logo {
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radial-menu-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.radial-menu-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.radial-menu-active-label {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-top: 4px;
  padding: 0 12px;
}
.radial-item-content {
  position: absolute;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 90px;
  z-index: 5;
  transition: transform 0.2s ease, color 0.2s ease;
}
.radial-item-content i {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  color: #475569;
  transition: transform 0.2s ease, color 0.2s ease;
}
.radial-item-content span {
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  line-height: 1.25;
}
.radial-item-content.active {
  transform: translate(-50%, -50%) scale(1.1);
}
.radial-item-content.active i {
  color: var(--teal);
  transform: scale(1.15);
}
.radial-item-content.active span {
  color: var(--teal);
  font-weight: 600;
}

table.report td.absent {
  background: #fde2e2 !important; /* simple light-red fill (was a diagonal hatch) */
}

table.report td.daycell.not-employed {
  background: #c8ced6 !important;
  color: #64748b !important;
  cursor: default;
}
table.report td.daycell.not-employed:hover { outline: none; }

/* Camera liveness + last-frame thumbnail */
.cam-status { display: inline-flex; align-items: center; }
.cam-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.cam-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.cam-dot.off { background: #9ca3af; }
.cam-thumb { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; display: block; }
.cam-thumb:hover { outline: 2px solid var(--teal); }

/* Fullscreen image viewer (with minimize → picture-in-picture, and close) */
.iv-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.iv-box { background: #111; border-radius: 10px; overflow: hidden; max-width: 94vw; max-height: 94vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.iv-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: #1b1b1b; color: #fff; }
.iv-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-actions { display: flex; gap: 6px; flex: none; }
.iv-actions .icon-btn { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.06); }
.iv-actions .icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.iv-img { max-width: 94vw; max-height: 86vh; object-fit: contain; display: block; }
.iv-overlay.iv-min { inset: auto; right: 18px; bottom: 18px; background: transparent; display: block; }
.iv-overlay.iv-min .iv-box { max-width: 320px; max-height: 240px; }
.iv-overlay.iv-min .iv-img { max-width: 320px; max-height: 200px; }

/* Bridge status banner */
.bridge-status-banner {
  margin-bottom: 16px;
  padding: 10px 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.bridge-status-banner.online {
  background-color: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #166534;
}
.bridge-status-banner.offline {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #991b1b;
}
.bridge-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.bridge-status-banner.online .bridge-indicator {
  background-color: #22c55e;
  animation: pulse-green 2s infinite;
}
.bridge-status-banner.offline .bridge-indicator {
  background-color: #ef4444;
  animation: pulse-red 2s infinite;
}

.bridge-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 4px 0 18px;
}
.bridge-tabs .tab-btn {
  padding: 9px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
}
.bridge-tabs .tab-btn:hover { color: #374151; }
.bridge-tabs .tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 500;
}
.bridge-metric {
  background: #fff;
  border: 1px solid #dfe5ec;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 88px;
}
.bridge-metric.ok { border-left-color: #22c55e; }
.bridge-metric.warn { border-left-color: #f59e0b; }
.bridge-metric.danger { border-left-color: #ef4444; }
.bridge-metric-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}
.bridge-metric-value {
  color: #111827;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 6px;
}
.bridge-metric-sub {
  color: #64748b;
  font-size: 12px;
  margin-top: 4px;
}
.bridge-panel {
  background: #fff;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  overflow: hidden;
}
.bridge-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.bridge-panel-head h3 {
  margin: 0;
  font-size: 16px;
}
.bridge-panel-subtitle {
  padding: 12px 14px 4px;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}
.bridge-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 14px;
}
.bridge-kv {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  min-width: 0;
}
.bridge-kv span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}
.bridge-kv div {
  color: #0f172a;
  font-size: 14px;
  font-weight: 400;
  word-break: break-word;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
}
.bridge-devices-table {
  min-width: 900px;
  margin: 0;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  background: #94a3b8;
}
.status-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.status-dot.muted-dot { background: #94a3b8; }
.bridge-log-box {
  background: #0f172a;
  color: #dbeafe;
  height: min(52vh, 520px);
  overflow: auto;
  padding: 10px 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}
.bridge-log-line {
  display: grid;
  grid-template-columns: 58px 54px 1fr;
  gap: 8px;
  padding: 2px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.bridge-log-line.warn { color: #fde68a; }
.bridge-log-line.error { color: #fecaca; }
.bridge-log-time { color: #94a3b8; }
.bridge-log-level {
  color: #cbd5e1;
  font-weight: 500;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}
