/* KAYAN HR v1.4.0 - skin. Bootstrap 5.3 (RTL/LTR) loads first from assets/vendor; this file maps the app's own
   classes onto the new look: gradient 56px navbar, white 260px sidebar with a gradient header, Cairo type,
   #f0f2f5 canvas, 15px cards. Nothing here changes behaviour. */
:root {
  --bs-body-font-family: "Cairo", "Segoe UI", Tahoma, "Noto Kufi Arabic", system-ui, Arial, sans-serif;
  --bs-body-font-size: 14px;
  --bs-body-bg: #f0f2f5;
  --bs-body-color: #2b3445;
  --bs-border-color: #e9ecef;
  --k-brand: #1e3c72; --k-brand-d: #16305c; --k-brand-2: #2a5298;
  --k-accent: #667eea; --k-accent-2: #764ba2;
  --k-ok: #12875a; --k-warn: #b86e00; --k-err: #c92a2a; --k-muted: #6b778c; --k-line: #e9ecef;
  --k-radius: 15px;
  --k-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  --k-grad: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  --k-grad-login: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --side-w: 260px; --nav-h: 56px;
}
body { background: var(--bs-body-bg); color: var(--bs-body-color); font-size: var(--bs-body-font-size); }
a { color: var(--k-brand-2); text-decoration: none; }
a:hover { color: var(--k-brand); text-decoration: underline; }
h1 { font-size: 1.35rem; font-weight: 700; margin: .1rem 0 1.1rem; color: var(--k-brand); }
h2 { font-size: 1.05rem; font-weight: 700; margin: .2rem 0 .8rem; color: #24304a; }
h3 { font-size: .95rem; font-weight: 700; margin: 1rem 0 .5rem; color: #24304a; }
.muted { color: var(--k-muted); font-weight: 400; font-size: .85rem; }
.ic { width: 19px; height: 19px; flex-shrink: 0; }

/* ================= navbar (fixed, gradient, centered program title) ================= */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h); width: 100%;
  z-index: 1050;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; margin: 0;
  background: var(--k-grad);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
  color: #fff; flex-wrap: nowrap;
}
.navbar-title {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: #fff; letter-spacing: 0; display: flex; flex-direction: column; align-items: center;
  gap: 1px; line-height: 1.12; max-width: min(46vw, 640px);
  white-space: nowrap; pointer-events: none; text-align: center;
}
.navbar-title .nav-prog { font-size: 20px; font-weight: 800; }
.navbar-title .nav-sub { font-size: 11.5px; font-weight: 400; opacity: .82; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767.98px) {
  .navbar-title .nav-sub { display: none; }
  .navbar-title .nav-prog { font-size: 16px; }
}
.nav-start { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn {
  background: rgba(255, 255, 255, .14); border: 0; color: #fff;
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  font-size: 15px; flex: 0 0 auto; cursor: pointer;
}
.menu-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.navbar-brand {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  color: #fff !important; font-weight: 700; font-size: .95rem; text-decoration: none;
  padding: 0; margin: 0;
}
.navbar-brand:hover { color: #fff !important; text-decoration: none; }
.navbar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inst-logo { max-height: 32px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px; flex: 0 0 auto; }
.nav-icon {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  color: #fff !important; background: rgba(255, 255, 255, .14); border-radius: 8px;
  padding: 7px 11px; font-size: .8rem; font-weight: 600; text-decoration: none; line-height: 1.2;
}
.nav-icon:hover { background: rgba(255, 255, 255, .26); color: #fff !important; text-decoration: none; }
.nav-icon i { font-size: 15px; }
.nav-badge {
  position: absolute; top: -5px; inset-inline-end: -5px;
  background: #dc3545; color: #fff; border-radius: 2rem;
  font-size: 10px; font-weight: 700; padding: 1px 5px; line-height: 1.4;
  box-shadow: 0 0 0 2px rgba(30, 60, 114, .85);
}
.user-btn {
  display: flex; align-items: center; gap: 7px; max-width: 220px;
  background: rgba(255, 255, 255, .14); border: 0; border-radius: 8px;
  color: #fff; padding: 5px 11px; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.user-btn:hover, .user-btn:focus { background: rgba(255, 255, 255, .26); color: #fff; }
.user-btn i.fa-circle-user { font-size: 20px; }
.user-btn .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-menu { border-radius: 10px; border: none; box-shadow: 0 5px 30px rgba(0, 0, 0, .15); padding: 8px 0; }
.dropdown-item { padding: 9px 18px; font-size: .85rem; color: #445; }
.dropdown-item:hover { background: #f0f2f5; color: var(--k-brand); }
.dropdown-divider { border-top: 1px solid #eceff4; margin: 6px 0; }

/* ================= sidebar (fixed, white, gradient header) ================= */
.sidebar {
  position: fixed; top: var(--nav-h); bottom: 0; inset-inline-start: 0;
  width: var(--side-w); background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, .07);
  z-index: 1045; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  transition: inset-inline-start .3s ease;
  padding: 0 0 1rem;
}
.sidebar.collapsed { inset-inline-start: calc(-1 * var(--side-w)); }
.sidebar-overlay { display: none; position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.sidebar-header {
  padding: 20px 16px 18px; background: var(--k-grad); color: #fff; text-align: center;
}
.sidebar-logo {
  width: 74px; height: 74px; margin: 0 auto 12px; border-radius: 14px;
  background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 30px;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: contain; padding: 7px; }
.sidebar-name { font-size: 1rem; font-weight: 700; line-height: 1.35; margin: 0 0 7px; color: #fff; }
.sidebar-role {
  display: inline-block; padding: 3px 13px; border-radius: 2rem;
  font-size: .72rem; font-weight: 700; background: rgba(255, 255, 255, .22); color: #fff;
}
.sidebar-role.admin { background: #dc3545; }
.sidebar-menu { padding: 10px 0; }
.sidebar-menu > a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; color: #555; font-weight: 500; font-size: .9rem;
  border-inline-end: 3px solid transparent; text-decoration: none; transition: all .25s;
}
.sidebar-menu > a i { width: 20px; text-align: center; font-size: 15px; color: #7d8aa3; flex: 0 0 auto; }
.sidebar-menu > a:hover { background: #f0f2f5; color: var(--k-brand); border-inline-end-color: var(--k-brand); text-decoration: none; }
.sidebar-menu > a:hover i { color: var(--k-brand); }
.sidebar-menu > a.active { background: #e8f0fe; color: var(--k-brand); border-inline-end-color: var(--k-brand); font-weight: 700; }
.sidebar-menu > a.active i { color: var(--k-brand); }
.sidebar-menu > a .badge { margin-inline-start: auto; }
.sidebar-menu > a.nav-count { font-size: .82rem; }
.sidebar-menu > a.nav-count > span:not(.badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-arrow { transition: transform .3s; }
.sub-menu { list-style: none; padding: 0; margin: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease; background: #f9f9f9; }
.sub-menu.show { max-height: 500px; }
.sub-menu li a { display: block; padding: 10px 40px; color: #666; text-decoration: none; font-size: 13px; transition: all .3s; }
.sub-menu li a:hover { background: #e8f0fe; color: var(--k-brand); padding-inline-start: 45px; }

/* ================= shell / content ================= */
.shell { margin-inline-start: var(--side-w); margin-top: var(--nav-h); min-height: calc(100vh - var(--nav-h)); transition: margin .3s ease; }
.shell.collapsed { margin-inline-start: 0; }
.content { padding: 20px; max-width: 100%; overflow-x: auto; }
.content-guest { padding: 0; overflow: visible; }
.footer { text-align: center; color: var(--k-muted); font-size: .75rem; padding: 14px; }
body.app .footer { margin-inline-start: var(--side-w); }
@media (max-width: 991.98px) {
  .shell { margin-inline-start: 0; }
  .content { padding: 14px; }
  body.app .footer { margin-inline-start: 0; }
  .navbar { padding: 0 12px; }
  .navbar-title { display: none; }
  .offcanvas-lg.offcanvas-start { --bs-offcanvas-width: var(--side-w); }
  .sidebar, .sidebar.offcanvas-lg { box-shadow: 2px 0 16px rgba(0, 0, 0, .18); top: var(--nav-h) !important; }
}

/* ---- flash ---- */
.flash { border-radius: 10px; border: 1px solid #b6e3cf; background: #e6f6ee; color: #0b6b47; padding: .7rem 1rem; margin-bottom: 1rem; }
.flash.err { background: #fdecec; color: var(--k-err); border-color: #f5c2c2; }
.flash form { margin-inline-start: .6rem; }

/* ---- cards / panels ---- */
.cards { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.4rem; }
.cards > .card { flex: 1 1 180px; min-width: 0; }
.card { background: #fff; border: none; border-radius: var(--k-radius); padding: 1.1rem 1.2rem; box-shadow: var(--k-shadow); text-align: start; position: relative; overflow: hidden; --bs-card-border-width: 0; --bs-card-border-radius: var(--k-radius); margin-bottom: 0; }
.card .num { font-size: 1.9rem; font-weight: 800; color: var(--k-brand); line-height: 1.15; }
.card.ok .num { color: var(--k-ok); }
.card.warn .num { color: var(--k-warn); }
.card > div:last-child { color: var(--k-muted); font-size: .85rem; font-weight: 500; }
.card > div:last-child { margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 2fr; gap: 1.2rem; align-items: start; }
.grid2-1 { display: grid; grid-template-columns: 1fr 2.2fr; gap: 1.2rem; align-items: start; }
@media (max-width: 1100px) { .grid2, .grid2-1 { grid-template-columns: 1fr; } }
.panel { overflow-x: auto; background: #fff; border: none; border-radius: var(--k-radius); box-shadow: var(--k-shadow); padding: 1.15rem 1.25rem; margin-bottom: 1.2rem; }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; margin-bottom: 1rem; border: 1px solid var(--k-line); border-radius: 10px; overflow: hidden; font-size: .87rem; }
.panel .tbl { margin-bottom: .4rem; }
.tbl th, .tbl td { padding: .65rem .85rem; border-bottom: 1px solid #f0f0f0; text-align: start; font-size: .87rem; vertical-align: middle; }
.tbl th { background: #f8f9fa; font-weight: 600; color: #495057; font-size: .8rem; letter-spacing: .2px; white-space: nowrap; border-bottom: 2px solid #dee2e6; }
.tbl tr:last-child td, .tbl tr:last-child th { border-bottom: none; }
.tbl tbody tr:hover td, .tbl tr:hover > td { background-color: #f0f2f5; }
.tbl tr.cur td { background: #fff8e1; }
.tbl .total-row th { background: #eef2fa; }
.att-tbl .st-absent td { background: #fff1f1; }
.att-tbl .st-weekend td { color: var(--k-muted); background: #fafbfd; }
.att-tbl .st-incomplete td { background: #fff8e8; }
.att-tbl .st-open td { background: #f1f6ff; }
.tbl tr.st-incomplete td, .tbl tr.st-incomplete th { background: #fff8e8; }
tr.struck td { text-decoration: line-through; color: var(--k-muted); }
.net { font-weight: 700; color: var(--k-ok); }

/* ---- badges ---- */
.badge { display: inline-block; padding: .32em .75em; border-radius: 8px; font-size: .74rem; font-weight: 600; background: #e9eef8; color: #3b4a66; line-height: 1.35; }
.badge.present, .badge.approved { background: #e1f5ec; color: #0b6b47; }
.badge.absent { background: #fdeaea; color: var(--k-err); }
.badge.weekend, .badge.draft { background: #fdf1de; color: #9a5b00; }
.badge.incomplete { background: #fff0cc; color: #8a5200; }
.badge.open { background: #e3edff; color: #2446b3; }
.badge.pending { background: #edeff4; color: var(--k-muted); }
.badge.overnight { background: #2b3a55; color: #fff; }
.badge.rest { background: #ece7fb; color: #5b3fa8; }
.badge.casual { background: #e0f4fb; color: #0b6a8a; }
.badge.annual { background: #e1f0ff; color: #1d5aa8; }
.badge.sick { background: #fde8f1; color: #a3265f; }
.badge.mission { background: #e8f5e1; color: #3d7a1c; }
.pill.rest-pill { background: #ece7fb; color: #5b3fa8; }

/* ---- buttons ---- */
.btn { --bs-btn-padding-y: .45rem; --bs-btn-padding-x: 1.05rem; --bs-btn-font-size: .85rem; --bs-btn-border-radius: 8px; --bs-btn-bg: #fff; --bs-btn-border-color: #dbe1ea; --bs-btn-color: #3f4c63; --bs-btn-hover-bg: #f0f2f5; --bs-btn-hover-border-color: #c9d1de; --bs-btn-hover-color: var(--k-brand); --bs-btn-active-bg: #e8edf8; --bs-btn-active-color: var(--k-brand); font-family: inherit; font-weight: 600; border-width: 1px; }
.btn:hover { text-decoration: none; }
.btn.primary { --bs-btn-bg: transparent; --bs-btn-border-color: transparent; --bs-btn-color: #fff; --bs-btn-hover-bg: transparent; --bs-btn-hover-border-color: transparent; --bs-btn-hover-color: #fff; --bs-btn-active-bg: transparent; --bs-btn-active-color: #fff; background-image: var(--k-grad); box-shadow: 0 3px 10px rgba(30, 60, 114, .22); }
.btn.primary:hover { background-image: linear-gradient(135deg, #24478a 0%, #3462b0 100%); box-shadow: 0 5px 16px rgba(30, 60, 114, .3); }
.btn.small { --bs-btn-padding-y: .24rem; --bs-btn-padding-x: .65rem; --bs-btn-font-size: .78rem; }
.btn.danger { --bs-btn-color: var(--k-err); --bs-btn-border-color: #f1c1c1; --bs-btn-hover-bg: #fdeaea; --bs-btn-hover-color: var(--k-err); --bs-btn-hover-border-color: #e8a3a3; }
.qa { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---- forms ---- */
.form label { display: block; margin-bottom: .9rem; font-size: .82rem; font-weight: 600; color: #3f4c63; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea, .inline-form input, .inline-form select, input[type=date], input[type=time], input[type=month] {
  display: block; width: 100%; margin-top: .35rem; padding: .52rem .8rem; border: 2px solid #e0e0e0; border-radius: 8px; font-size: .9rem; font-family: inherit; background-color: #fff; color: var(--bs-body-color); }
.form input[type=file] { display: block; width: 100%; margin-top: .35rem; padding: .4rem .6rem; border: 2px solid #e0e0e0; border-radius: 8px; background: #fff; font-size: .85rem; }
.form input:focus, .form select:focus, .form textarea:focus, .inline-form input:focus, .inline-form select:focus { outline: 0; border-color: var(--k-brand); box-shadow: 0 0 0 .2rem rgba(30, 60, 114, .13); }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
@media (max-width: 700px) { .form .row2, .form .row3 { grid-template-columns: 1fr; } }
.form.inline { background: #f6f8fc; padding: .7rem; border-radius: 8px; margin-top: .5rem; border: 1px solid var(--k-line); }
.inline { display: inline; }
.inline-form { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; }
.inline-form label { margin-bottom: 0; }
.inline-form input, .inline-form select { width: auto; }
.chk-group { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: .5rem 0 1rem; }
.chk { display: flex; align-items: center; gap: .35rem; font-weight: 400 !important; margin-bottom: 0 !important; }
.chk input { width: auto !important; margin: 0 !important; }
.inline-edit { display: inline-block; }
.inline-edit summary { cursor: pointer; color: var(--k-brand-2); font-size: .82rem; }
.actions-cell { white-space: normal; }
.panel .tbl td.actions-cell { white-space: normal; }
.act-list { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.act-list > * { margin: 0 !important; }
.act-list > a + a { border-inline-start: none !important; }
.act-list > a + a:not(.btn) { padding-inline-start: .65rem !important; }

/* live device badge (v1.3.1) */
.live-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3em .75em; border-radius: 8px; font-size: .74rem; font-weight: 600; background: #edeff4; color: var(--k-muted); white-space: nowrap; }
.live-badge .lb-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.live-badge.connected { background: #e1f5ec; color: #0b6b47; }
.live-badge.connected .lb-dot { box-shadow: 0 0 0 3px rgba(18, 135, 90, .18); }
.live-badge.disconnected { background: #fdeaea; color: var(--k-err); }
.live-badge.disconnected .lb-dot { box-shadow: 0 0 0 3px rgba(201, 42, 42, .15); }

/* collapsed punch log (v1.3.1) */
details.punch-log { margin-bottom: 1.2rem; }
details.punch-log > summary { cursor: pointer; display: inline-block; padding: .45rem 1rem; border: 1px solid var(--k-line); border-radius: 8px; background: #f8f9fa; font-weight: 600; font-size: .88rem; color: var(--k-brand); }
details.punch-log[open] > summary { margin-bottom: .8rem; }

/* dashboard live refresh (v1.3.1) */
.panel.flash-new { animation: kflash 1.2s ease-in-out 3; }
@keyframes kflash { 0%, 100% { box-shadow: var(--k-shadow); } 50% { box-shadow: 0 0 0 3px rgba(18, 135, 90, .45); } }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; background: #fff; border-radius: var(--k-radius); box-shadow: var(--k-shadow); padding: 15px 20px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .55rem; }
.page-head h1 i { color: var(--k-brand); font-size: 1.1rem; }
.page-head-title .muted { margin: 3px 0 0; font-size: .8rem; }
.content > h1 { background: #fff; border-radius: var(--k-radius); box-shadow: var(--k-shadow); padding: 15px 20px; margin: 0 0 20px; font-size: 1.3rem; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; background: #f1f3f6; border-radius: 8px; padding: 8px 14px; font-size: .82rem; color: #4b5563; font-weight: 600; white-space: nowrap; }
.date-chip i { color: var(--k-brand); font-size: .9rem; }

/* KPI cards (dashboard) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1300px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; gap: 12px; } }
.kpi { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #eef0f4; border-radius: 12px; box-shadow: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04); padding: 16px 18px; min-width: 0; }
.kpi-body { min-width: 0; flex: 1; }
.kpi-label { font-size: .8rem; color: #6b7280; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 1.65rem; font-weight: 800; color: #111827; line-height: 1.3; }
.kpi-value a { color: inherit; text-decoration: none; }
.kpi-value a:hover { color: var(--k-brand); text-decoration: none; }
.kpi-cap { font-size: .7rem; color: #9aa1ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-icon { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; flex: 0 0 auto; }
.kpi-icon.blue { background: #2563eb; } .kpi-icon.green { background: #16a34a; } .kpi-icon.red { background: #dc2626; }
.kpi-icon.amber { background: #f59e0b; } .kpi-icon.orange { background: #d97706; } .kpi-icon.cyan { background: #06b6d4; }
.kpi-icon.slate { background: #64748b; } .kpi-icon.crimson { background: #e11d48; }

/* ---- login / setup ---- */
body.guest { background: var(--k-grad-login); min-height: 100vh; }
body.guest::before { content: ""; position: fixed; inset: 0; background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, .16), transparent 45%), radial-gradient(circle at 85% 85%, rgba(255, 255, 255, .12), transparent 50%); pointer-events: none; }
.guest-lang { position: fixed; top: 16px; inset-inline-end: 18px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .4); border-radius: 2rem; padding: .28rem 1rem; color: #fff; font-size: .82rem; font-weight: 600; z-index: 5; text-decoration: none; }
.guest-lang:hover { background: rgba(255, 255, 255, .28); color: #fff; text-decoration: none; }
body.guest .footer { color: rgba(255, 255, 255, .65); }
body.guest .content-guest > .flash { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 30; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .2); margin: 0; }
.setup-card { max-width: 600px; width: 100%; background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; position: relative; margin: 0; padding: 0; }
.setup-head { background: var(--k-grad-login); padding: 26px 30px 24px; text-align: center; color: #fff; }
.setup-head h1 { font-size: 24px; font-weight: 800; color: #fff; margin: 0 0 4px; }
.setup-head p { margin: 0; font-size: .85rem; opacity: .92; }
.setup-body { padding: 22px 30px 26px; }
.setup-title { margin: 0 0 .2rem; font-size: 1.05rem; color: var(--k-brand); }
.setup-body .btn.primary { width: 100%; padding: .65rem; font-size: .95rem; background-image: var(--k-grad-login); box-shadow: 0 6px 18px rgba(102, 126, 234, .35); }
.setup-body .btn.primary:hover { background-image: linear-gradient(135deg, #7a90ee 0%, #8a5fb5 100%); }

/* login card (UODS look) */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; z-index: 1; }
.login-card { width: 100%; max-width: 450px; background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: hidden; margin: 0; padding: 0; }
.login-header { background: var(--k-grad-login); padding: 34px 30px 30px; text-align: center; color: #fff; }
.login-logo-tile { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: #fff; border: 3px solid rgba(255, 255, 255, .55); box-shadow: 0 8px 22px rgba(0, 0, 0, .18); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-logo-tile img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 10px; display: block; }
.login-header h1 { font-size: 27px; font-weight: 800; margin: 0 0 6px; color: #fff; line-height: 1.25; }
.login-header .login-sub { font-size: .85rem; opacity: .92; margin: 0; }
.login-header .login-inst { font-size: 27px; font-weight: 800; margin: 10px 0 0; line-height: 1.3; color: #fff; overflow-wrap: anywhere; }
@media (max-width: 420px) { .login-header h1, .login-header .login-inst { font-size: 22px; } }
.login-body { padding: 26px 30px 24px; }
.login-body .form label { font-size: .82rem; margin-bottom: .35rem; color: #3f4c63; }
.login-body .form label i { color: #8d97a9; font-size: .78rem; }
.login-body .form .login-field + label { margin-top: 14px; }
.login-body .login-field input { min-height: 46px; }
.login-body .btn.primary { width: 100%; padding: .65rem; font-size: .95rem; background-image: var(--k-grad-login); box-shadow: 0 6px 18px rgba(102, 126, 234, .35); }
.login-body .btn.primary:hover { background-image: linear-gradient(135deg, #7a90ee 0%, #8a5fb5 100%); transform: translateY(-1px); }
.login-field { position: relative; }
.login-field > i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px; color: #9aa4b8; font-size: 15px; pointer-events: none; }
.login-field input { padding-inline-start: 40px !important; }
.login-ver { text-align: center; color: #98a2b3; font-size: .74rem; margin-top: 14px; }

/* ---- payslip ---- */
.payslip { background: #fff; border: none; border-radius: var(--k-radius); padding: 1.7rem 2rem; max-width: 820px; margin: 0 auto; box-shadow: var(--k-shadow); }
.ps-head { display: flex; align-items: center; gap: 1rem; border-bottom: 2px solid var(--k-brand); padding-bottom: .9rem; margin-bottom: .9rem; }
.ps-head img { max-height: 56px; }
.ps-head h2 { margin: 0; color: var(--k-brand); }
.ps-brand { margin-inline-start: auto; font-size: .75rem; color: var(--k-muted); }
.ps-emp { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.5rem; margin-bottom: 1rem; font-size: .88rem; }
.ps-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 700px) { .ps-cols, .ps-emp { grid-template-columns: 1fr; } }
.ps-cols .sub th { background: #eef2fa; }
.ps-net { text-align: center; font-size: 1.1rem; font-weight: 700; margin: 1.1rem 0 .6rem; padding: .8rem; background: #e6f6ee; border-radius: 10px; color: var(--k-ok); }
.ps-net span { font-size: 1.35rem; }
.ps-sign { margin-top: 2rem; color: var(--k-muted); }
code { color: #5b3fc4; }

@media print {
  .navbar, .sidebar, .sidebar-overlay, .no-print, .footer, .guest-lang, .nav-end, .menu-btn { display: none !important; }
  .content, .shell { padding: 0; margin: 0 !important; }
  .payslip { border: none; box-shadow: none; max-width: 100%; }
  body, body.guest { background: #fff !important; }
  body.guest::before { display: none !important; }
}

/* filters in page headers, select arrows */
.page-head form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-head form input, .page-head form select { width: auto !important; margin-top: 0 !important; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23566178' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 14px; padding-inline-end: 2rem !important; }
[dir=rtl] select { background-position: left .7rem center; }
.page-head form input, .page-head form select, .page-head form input[type=search], .page-head form input[type=text] { padding: .45rem .8rem; border: 2px solid #e0e0e0; border-radius: 8px; font-size: .88rem; font-family: inherit; background-color: #fff; color: var(--bs-body-color); }
.page-head form select { padding-inline-end: 2rem; }
@media (max-width: 575.98px) { .navbar-brand span { display: none; } .user-btn .user-name { display: none !important; } .nav-end { gap: 6px; } .navbar { gap: 6px; } .card .num { font-size: 1.5rem; } }
.grid2 > *, .grid2-1 > * { min-width: 0; }
.grid2 .panel .tbl th, .grid2 .panel .tbl td { white-space: normal; }
.content input[type=text], .content input[type=password], .content input[type=number], .content input[type=email], .content input[type=search], .content input:not([type]) { border: 2px solid #e0e0e0; border-radius: 8px; padding: .45rem .8rem; font-family: inherit; font-size: .9rem; background: #fff; }
.content input:focus { outline: 0; border-color: var(--k-brand); box-shadow: 0 0 0 .2rem rgba(30, 60, 114, .13); }

.grid-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
.page-head > div { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tbl td { white-space: normal; }
.tbl td.num, .tbl td .cur { white-space: nowrap; }
.panel .tbl th, .panel .tbl td { white-space: nowrap; }
.panel .tbl td.wrap { white-space: normal; }
.inst-logo { max-width: 170px; object-fit: contain; }
.login-logo { max-width: 70%; object-fit: contain; display: block; margin: 0 auto .5rem; }
.ps-head img { max-width: 160px; object-fit: contain; }
.tbl td > a, .tbl td > form.inline { margin-inline-end: .65rem; vertical-align: middle; }
.tbl td > a + a { padding-inline-start: .65rem; border-inline-start: 1px solid var(--k-line); }
@media (max-width: 575.98px) { .panel .tbl th, .panel .tbl td { padding: .45rem .55rem; font-size: .78rem; } .panel { padding: .9rem; } }

/* devices table: never wider than its panel - fixed layout, cells wrap */
.dev-tbl { table-layout: fixed; }
.dev-tbl th, .dev-tbl td { white-space: normal !important; overflow-wrap: break-word; }
.dev-tbl th:nth-child(1), .dev-tbl td:nth-child(1) { width: 13%; }
.dev-tbl th:nth-child(2), .dev-tbl td:nth-child(2) { width: 12%; }
.dev-tbl th:nth-child(3), .dev-tbl td:nth-child(3) { width: 8%; }
.dev-tbl th:nth-child(4), .dev-tbl td:nth-child(4) { width: 13%; }
.dev-tbl th:nth-child(5), .dev-tbl td:nth-child(5) { width: 13%; }
.dev-tbl th:nth-child(6), .dev-tbl td:nth-child(6) { width: 8%; }
.dev-tbl th:nth-child(7), .dev-tbl td:nth-child(7) { width: 33%; }
.dev-tbl td .badge { margin-top: 2px; }
.dev-tbl td.cell-sync { white-space: nowrap !important; font-size: .8rem; }
.dev-tbl td.cell-state .live-badge { white-space: normal; text-align: start; }
.dev-tbl td.cell-auto { text-align: center; }
.dev-tbl .act-list { justify-content: flex-start; }
.dev-tbl .act-list .btn { white-space: nowrap; }

/* dashboard mini device table: always fits its card */
/* v1.9.8: compact dashboard tables - every header reads on one line and the columns fill the card */
.mini-tbl { table-layout: auto; width: 100%; }
.mini-tbl th, .mini-tbl td { font-size: .82rem; padding: .5rem .6rem; white-space: nowrap; overflow-wrap: normal; }
.mini-tbl th { white-space: nowrap; }
.mini-tbl th.wrap, .mini-tbl td.wrap { white-space: normal; overflow-wrap: break-word; }
.mini-tbl .num { text-align: center; font-variant-numeric: tabular-nums; }
.mini-tbl td.cell-ip { white-space: nowrap; overflow-wrap: normal; font-size: .78rem; }
.dash-dev-tbl th:nth-child(1) { width: 30%; }
.dash-dev-tbl th:nth-child(2) { width: 22%; }
.dash-dev-tbl th:nth-child(3) { width: 22%; }
.dash-dev-tbl th:nth-child(4) { width: 26%; }
.dept-tbl th:nth-child(1) { width: 34%; }
.dept-tbl th:nth-child(n+2) { width: 13.2%; }
.dash-grid { align-items: stretch; }
.dash-grid > .panel { display: flex; flex-direction: column; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-scroll .tbl { margin-bottom: .4rem; }
@media (max-width: 700px) {
  .mini-tbl th, .mini-tbl td { padding: .45rem .45rem; font-size: .78rem; }
}

/* form action row */
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* font-awesome sizing inside panels/tables */
.tbl td i, .panel i { font-size: .9rem; }


/* ================= sidebar groups (v1.4.1) ================= */
.sb-group { margin: 1px 0; }
.sidebar-menu .sb-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px;
  color: #334155; font-size: .95rem; font-weight: 600; text-decoration: none;
  border-inline-end: 3px solid transparent; cursor: pointer;
}
.sidebar-menu .sb-head:hover { background: #f0f2f5; color: var(--k-brand); border-inline-end-color: var(--k-brand); text-decoration: none; }
.sidebar-menu .sb-head > i:first-child { width: 20px; text-align: center; font-size: 15px; color: #7d8aa3; flex: 0 0 auto; }
.sidebar-menu .sb-head:hover > i:first-child, .sb-group.open > .sb-head > i:first-child { color: var(--k-brand); }
.sb-caret { margin-inline-start: auto; font-size: 10px; line-height: 1; color: #94a3b8; transition: transform .2s ease; }
.sb-head[aria-expanded="true"] .sb-caret { transform: rotate(180deg); }
.sb-group.open > .sb-head { color: var(--k-brand); background: #f5f8ff; border-inline-end-color: var(--k-brand); }
.sidebar-menu .sb-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 18px; padding-inline-start: 42px;
  font-size: .88rem; color: #475569; text-decoration: none; border-inline-end: 3px solid transparent;
}
.sidebar-menu a.sb-item:hover { background: #f0f2f5; color: var(--k-brand); border-inline-end-color: var(--k-brand); text-decoration: none; }
.sidebar-menu a.sb-item.active { background: #e8f0fe; color: var(--k-brand); font-weight: 700; border-inline-end-color: var(--k-brand); }
.sidebar-menu .sb-item > i { width: 16px; text-align: center; font-size: 13px; color: #94a3b8; flex: 0 0 auto; }
.sidebar-menu a.sb-item:hover > i, .sidebar-menu a.sb-item.active > i { color: var(--k-brand); }
.sb-item.soon { color: #a7b1c2; cursor: default; }
.sb-item.soon > i { color: #c3ccda; }
.sb-item .soon-chip {
  margin-inline-start: auto; font-size: .66rem; font-weight: 600; line-height: 1.7;
  color: #94a3b8; background: #f1f5f9; border-radius: 8px; padding: 0 7px;
}

/* ================= pager ================= */
.pager { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a.pg-btn, .pager span.pg-cur {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid #e2e8f0; background: #fff; color: #475569;
  font-size: .85rem; text-decoration: none; padding: 0 10px;
}
.pager a.pg-btn:hover { border-color: var(--k-brand); color: var(--k-brand); background: #f5f8ff; text-decoration: none; }
.pager span.pg-cur { background: var(--k-brand); border-color: var(--k-brand); color: #fff; font-weight: 700; }
.pager a.pg-btn.disabled { opacity: .45; pointer-events: none; }
.pager .pg-gap { color: #94a3b8; padding: 0 2px; }
.pager .pg-info { margin-inline-start: auto; color: #94a3b8; font-size: .82rem; }
.pager[data-busy], [data-pager-box][data-busy="1"] .pager { opacity: .55; pointer-events: none; }

/* ================= v1.5.0: users, permissions, audit, backup, settings ================= */
.crumbs { font-size: .82rem; color: #94a3b8; margin: 0; }
.crumbs a { color: #6b778c; }
.crumbs span { margin: 0 4px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.cell-wrap { white-space: normal; word-break: break-word; }
.small { font-size: .8rem; }
.ok-text { color: var(--k-ok); }
.err-text { color: var(--k-err); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600; line-height: 1.7; white-space: nowrap; }
.job-pill { background: #e8f0fe; color: var(--k-brand); }
.admin-pill { background: #1e3c72; color: #fff; }
.ok-pill { background: #e6f6ee; color: var(--k-ok); }
.off-pill { background: #fdecec; color: var(--k-err); }

.sq-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 0; font-size: 12px; color: #fff; cursor: pointer; text-decoration: none; vertical-align: middle; }
.sq-btn.edit { background: #17a2b8; }
.sq-btn.perm { background: #1e3c72; }
.sq-btn.del { background: #dc3545; }
.sq-btn:hover { color: #fff; filter: brightness(1.08); text-decoration: none; }

.users-tbl th, .users-tbl td { padding: 10px 8px; font-size: .86rem; }
.users-tbl td .sq-btn { margin-inline-start: 4px; }

.modal-header { background: var(--k-grad); color: #fff; border-radius: var(--k-radius) var(--k-radius) 0 0; }
.modal-header .modal-title { font-size: 1rem; font-weight: 700; }
.modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.modal-content { border: 0; border-radius: var(--k-radius); box-shadow: 0 18px 50px rgba(15, 23, 42, .28); }
.modal-body .req { color: #dc3545; margin-inline-end: 3px; font-weight: 700; }

/* permissions screen */
.perm-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; background: #fff; border-radius: var(--k-radius); box-shadow: var(--k-shadow); margin-bottom: 16px; }
.perm-chip { padding: 7px 16px; border-radius: 20px; background: #f4f6fa; color: #475569; font-size: .86rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.perm-chip:hover { background: #e8f0fe; color: var(--k-brand); text-decoration: none; }
.perm-chip.active { background: #fff; color: var(--k-brand); border-color: #dbe4f3; box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.perm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; }
.perm-head-title { display: flex; align-items: center; gap: 10px; font-size: 1rem; color: #24304a; flex-wrap: wrap; }
.perm-head-title i { color: var(--k-brand); }
.perm-head-tools { display: flex; align-items: center; gap: 16px; }
.link-ok { color: var(--k-ok); font-weight: 700; font-size: .86rem; }
.link-muted { color: #94a3b8; font-weight: 700; font-size: .86rem; }
.link-ok:hover, .link-muted:hover { text-decoration: none; opacity: .8; }
.perm-mod { padding: 0; overflow: hidden; margin-top: 14px; }
.perm-mod-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; background: #f8fafc; border-bottom: 1px solid #eef2f7; cursor: pointer; flex-wrap: wrap; }
.perm-mod-name { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #24304a; }
.perm-mod-name i { color: var(--k-brand); width: 18px; text-align: center; }
.perm-count { background: var(--k-brand-2); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.perm-mod-tools { display: flex; align-items: center; gap: 14px; }
.perm-caret { color: #94a3b8; font-size: 11px; transition: transform .2s ease; }
.perm-mod-head[aria-expanded="false"] .perm-caret { transform: rotate(-90deg); }
.perm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 18px; padding: 14px 18px 16px; }
@media (max-width: 1200px) { .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .perm-grid { grid-template-columns: 1fr; } }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; font-size: .84rem; color: #334155; cursor: pointer; margin: 0; }
.perm-item:hover { background: #f5f8ff; }
.perm-item input[type=checkbox] { margin-inline-start: auto; width: 17px; height: 17px; accent-color: var(--k-brand-2); flex: 0 0 auto; }
.type-chip { font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: #eef2f7; color: #64748b; white-space: nowrap; }
.type-chip.t-view { background: #e8f0fe; color: #1e3c72; }
.type-chip.t-manage { background: #e6f6ee; color: #12875a; }
.type-chip.t-action { background: #fdf0e3; color: #b86e00; }
.perm-label { flex: 1 1 auto; }
.perm-info { color: #cbd5e1; font-size: 11px; }
.sticky-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-start; padding: 12px 0; }

/* audit log */
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filters .fld { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: .8rem; color: #6b778c; font-weight: 600; }
.filters .fld input, .filters .fld select { min-width: 130px; }
.audit-tbl td { font-size: .84rem; vertical-align: top; }
.audit-tbl tbody tr:nth-child(even) { background: #fafbfd; }

/* notes / panels */
.note { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 10px; font-size: .86rem; margin: 12px 0; }
.note.ok { background: #eef7f2; color: #0f6b48; border: 1px solid #cdeadd; }
.note.err { background: #fdecec; color: #a51f1f; border: 1px solid #f5c2c2; }
.danger-panel { border: 1px solid #f0c9c9; }
.danger-head { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #a51f1f; padding: 14px 18px; background: #fdecec; border-bottom: 1px solid #f5c2c2; margin: -18px -18px 12px; border-radius: var(--k-radius) var(--k-radius) 0 0; }
.danger-panel form { padding: 0 18px 6px; }

/* settings */
.logo-box { display: grid; place-items: center; min-height: 120px; background: #f8fafc; border: 1px dashed #d8e0ec; border-radius: 12px; margin-bottom: 12px; padding: 12px; }
.logo-box img { max-height: 90px; max-width: 100%; object-fit: contain; }
.logo-empty { color: #b6c1d2; font-size: .85rem; display: flex; align-items: center; gap: 8px; }
.inst-preview { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f8fafc; border-radius: 12px; }
.inst-preview img { max-height: 44px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.inst-preview b { display: block; font-size: .95rem; color: #24304a; }
.inst-preview small { display: block; font-size: .78rem; }
.unit-field { display: flex; align-items: center; gap: 8px; }
.unit-field input { max-width: 110px; }
.unit-field span { font-size: .85rem; color: #6b778c; }
.switch-line { display: flex; align-items: center; gap: 9px; flex-direction: row !important; font-weight: 600; }
.switch-line input { width: 18px; height: 18px; accent-color: var(--k-brand-2); }
.status-rows { margin-top: 14px; border-top: 1px solid #eef2f7; padding-top: 10px; }
.status-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: .84rem; border-bottom: 1px dashed #f1f4f9; }
.status-rows > div > span { color: #6b778c; }
.btn-block-save { width: 100%; margin-top: 16px; padding: 12px; font-size: .95rem; }
.btn.ok { background: var(--k-ok); border-color: var(--k-ok); color: #fff; }
.btn.ok:hover { background: #0f6b48; border-color: #0f6b48; color: #fff; }
/* v1.5.4: weekly rest day picker in the employee form */
.fld-block { margin-bottom: .9rem; }
.fld-block .fld-label { display: block; font-size: .82rem; font-weight: 600; color: #3f4c63; }
.daychips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .45rem 0 .3rem; }
.form .daychips label, .daychips label { display: inline-flex; align-items: center; gap: .38rem; margin: 0; padding: .4rem .72rem; border: 2px solid #e0e0e0; border-radius: 9px; background: #fff; font-size: .82rem; font-weight: 600; color: #3f4c63; cursor: pointer; user-select: none; }
.daychips label:hover { border-color: #c8d4e8; }
.daychips label:has(input:checked) { border-color: var(--k-brand); background: #eef3fb; }
.daychips input[type=checkbox] { margin: 0; }
.daychips input:checked + span { color: var(--k-brand); }

/* v1.5.5: permits */
.flash.warn { background: #fff4d6; color: #8a5200; border-color: #f0d68a; }
.lv-neg { color: var(--k-err); font-weight: 700; }
.lv-filter { margin-bottom: .8rem; }
tr.lv-old td { opacity: .62; }
hr { border: 0; border-top: 1px solid #e6eaf2; margin: 1rem 0; }
.lv-filter select { width: 100%; }
.grid2 .panel .tbl td.nw { white-space: nowrap; }

/* v1.5.6 */
.lv-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .8rem 1rem; border-radius: 10px; border: 2px solid var(--k-ok); background: #eaf7f0; margin-bottom: 1rem; }
.lv-switch.off { border-color: #d9534f; background: #fdeeee; }
.lv-switch small { flex-basis: 100%; }
.lv-switch input[type=checkbox] { width: 1.3rem !important; height: 1.3rem !important; margin: 0 0 0 .5rem; vertical-align: middle; }
.lv-switch label.chk { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.05rem; margin: 0; }
.att-search { min-width: 190px; }
.att-summary { margin-bottom: 1rem; }
.att-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; margin: .6rem 0; }
.att-sum-grid > div { background: #f4f6fb; border-radius: 10px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .2rem; }
.att-sum-grid span { font-size: .78rem; color: var(--k-muted); }
.att-sum-grid b { font-size: 1.15rem; }
.att-sum-grid .due { background: #e6f6ee; color: var(--k-ok); }
.run-card { max-width: 620px; margin: 1.5rem auto; padding: 1.4rem 1.8rem; }
.run-card h1 { margin-top: 0; }
.run-card .form label { display: block; margin-bottom: .8rem; }
.run-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.run-actions { display: flex; gap: .6rem; }
.run-types { display: flex; gap: 1.2rem; margin-bottom: .6rem; }
.ps-days-h { margin: 1rem 0 .4rem; font-size: .95rem; }
.ps-days { font-size: .78rem; width: 100%; }
.ps-days th, .ps-days td { padding: .25rem .5rem; text-align: center; }
@media print {
  /* v1.9.5: page margin 0 kills Chrome's own header/footer (date, URL, page x/y); the sheet keeps its own padding */
  @page { size: A4; margin: 0; }
  .payslip { font-size: 11px; }
  .ps-days thead { display: table-header-group; }
  .ps-days tr { page-break-inside: avoid; break-inside: avoid; }
  .ps-days th { background: #eef2fa !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-cols, .ps-net, .ps-emp { break-inside: avoid; }
  .ps-days td, .ps-days th { border-bottom: 1px solid #ccc; }
}

/* v1.5.8: payslip on one A4 page */
.ps-days-wrap { display: none; }
.ps-days { font-size: .82rem; }
.ps-days .nw { white-space: nowrap; }
@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body { height: auto !important; }
  body { padding: 8mm 8mm !important; }
  .content { padding: 0 !important; }
  .payslip { padding: 0 !important; font-size: 11px; page-break-inside: avoid; break-inside: avoid; }
  .payslip h2 { font-size: 15px; }
  .ps-head { padding-bottom: 4px; margin-bottom: 6px; }
  .ps-head img { max-height: 36px; }
  .ps-emp { margin-bottom: 6px; gap: 2px 1rem; font-size: 10px; }
  .ps-cols { gap: 8px; }
  .payslip .tbl th, .payslip .tbl td { padding: 3px 6px !important; font-size: 11px; line-height: 1.25; }
  .ps-net { margin: 6px 0 4px; padding: 4px; font-size: 13px; }
  .ps-days-h { margin: 6px 0 3px; font-size: 11px; }
  .ps-days-screen { display: none !important; }
  .ps-days-wrap { display: grid !important; gap: 8px; grid-template-columns: 1fr 1fr !important; }
  .ps-days th, .ps-days td { padding: 2px 4px !important; font-size: 9.5px !important; line-height: 1.25; }
  .ps-sign { margin-top: 8px; font-size: 10px; }
}

/* v1.5.10: nothing scrolls in print */
@media print {
  html, body, .shell, .content, main, .panel, .payslip { overflow: visible !important; height: auto !important; max-height: none !important; min-height: 0 !important; }
  * { scrollbar-width: none !important; -ms-overflow-style: none !important; }
  *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
  .ps-days td, .ps-days th { white-space: nowrap; }
}

/* v1.8.0: the printed payslip fills the A4 sheet - the daily table grows down to the signature line */
@media print {
  .payslip { display: flex !important; flex-direction: column; min-height: 279mm !important; height: 279mm !important; }
  .ps-days-wrap { flex: 1 1 auto !important; min-height: 0 !important; grid-template-rows: 100% !important; align-items: stretch; }
  .ps-days-wrap > .ps-days { height: 100% !important; }
  .ps-days th, .ps-days td { padding: 2.2mm 2mm !important; font-size: 12px !important; line-height: 1.3; vertical-align: middle; }
  .ps-days th { font-size: 11px !important; white-space: normal !important; }
  .ps-days td.nw, .ps-days td[dir="ltr"] { white-space: nowrap; }
  .ps-sign { margin-top: auto !important; padding-top: 6mm; }
}

/* v1.9.5: no browser header/footer on any printout. Chrome prints the URL and the page number in the
   page margin box, so the page margin is set to zero and the sheet itself carries the white space. */
@media print {
  @page { margin: 0; }
  html { margin: 0 !important; padding: 0 !important; }
  body { margin: 0 !important; padding: 8mm !important; background: #fff !important; }
  .payslip { height: 279mm !important; min-height: 279mm !important; }
}

/* v1.9.7: employee picker - search sits ABOVE a plain native select (no popup, no inner bar) */
.pk-bar { position: relative; display: block; margin: .3rem 0 .35rem; }
.pk-bar i { position: absolute; top: 1.05rem; inset-inline-start: .65rem; color: #94a3b8; font-size: .78rem; pointer-events: none; }
.pk-bar input.pk-search { width: 100%; box-sizing: border-box; padding: .45rem .7rem .45rem 2rem; padding-inline-start: 2rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; font: inherit; font-size: .88rem; font-weight: 400; color: inherit; }
html[dir="rtl"] .pk-bar input.pk-search { padding: .45rem 2rem .45rem .7rem; }
.pk-bar input.pk-search:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.pk-hint { display: block; margin-top: .18rem; font-size: .72rem; font-weight: 400; color: #6b778c; }
.pk-hint.pk-none { color: #b45309; }
.pk-hint.pk-one { color: #15803d; }
label > .pk-bar + select { width: 100%; box-sizing: border-box; }
form.inline .pk-bar { display: inline-block; width: 13rem; max-width: 100%; margin: 0 .3rem 0 0; vertical-align: middle; }
form.inline .pk-bar i { top: 50%; transform: translateY(-50%); }
.actions-cell .pk-bar { width: 13rem; max-width: 100%; }

/* v1.9.7: list search bar - a real field above the table, not inside a dropdown */
.list-search { display: flex; align-items: center; gap: .55rem; background: #fff; border: 1px solid var(--k-line); border-radius: 10px; padding: .35rem .75rem; margin: 0 0 14px; box-shadow: var(--k-shadow); }
.list-search > i { color: #94a3b8; font-size: .85rem; }
.list-search input[type="search"], .list-search input[type="text"] { flex: 1 1 auto; min-width: 6rem; width: auto; margin: 0; border: 0; outline: 0; box-shadow: none; background: transparent; font: inherit; font-size: .92rem; padding: .45rem 0; color: inherit; }
.list-search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.list-search .ls-count { font-size: .76rem; color: #6b778c; white-space: nowrap; }
.list-search .ls-clear { border: 0; background: #eef2f8; color: #475569; border-radius: 6px; font: inherit; font-size: .74rem; padding: .25rem .5rem; cursor: pointer; }
.list-search .ls-clear[hidden] { display: none; }
.list-search:focus-within { border-color: var(--k-brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.tbl tr.ls-hidden { display: none; }

/* v1.9.7: employees status tabs, dashboard attention list, permission holder count */
.tabs { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.tabs .tab { padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid #eef0f4; color: #3b4a66; font-weight: 600; font-size: .86rem; text-decoration: none; }
.tabs .tab.active { background: var(--k-brand); color: #fff; border-color: var(--k-brand); }
.tabs .tab .tab-n { background: rgba(0,0,0,.08); border-radius: 8px; padding: 0 6px; margin-inline-start: 6px; font-size: .76rem; }
.tabs .tab.active .tab-n { background: rgba(255,255,255,.24); }
.attn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attn-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f7f9fc; border: 1px solid #eef0f4; }
.attn-item .attn-t { flex: 1; font-weight: 600; font-size: .88rem; }
.attn-item .attn-n { font-weight: 800; font-variant-numeric: tabular-nums; }
.attn-item.warn { background: #fff8e6; border-color: #fbe7bd; }
.attn-item.bad { background: #fdeaea; border-color: #f8d4d4; }
.attn-item.ok { background: #e9f8f0; border-color: #c8ecdb; }
.attn-item a.btn { color: inherit; }
.money-kpis .kpi-value { font-size: 1.3rem; }
.deact-form input[type=date] { max-width: 148px; padding: 4px 6px; font-size: .8rem; }
.perm-who { display: inline-flex; align-items: center; gap: 3px; background: #eef2f9; color: #4b5a75; border-radius: 8px; padding: 1px 6px; font-size: .72rem; font-weight: 700; cursor: help; }
.perm-who i { font-size: .62rem; opacity: .75; }
.rep-q { min-width: 240px; }

/* v1.9.9: audit trail - the field-by-field diff inside a row */
.audit-tbl td { vertical-align: top; }
.audit-detail > td { background: #f7f9fd; padding: .6rem .8rem 1rem; }
.audit-diff { width: 100%; margin: 0; border: 1px solid #e2e8f2; border-radius: 8px; font-size: .82rem; }
.audit-diff th { background: #eef2fa; font-size: .76rem; }
.audit-diff td, .audit-diff th { padding: .4rem .6rem; }
.audit-diff td.audit-old { color: #9a3412; background: #fff7f3; }
.audit-diff td.audit-new { color: #14532d; background: #f2fbf5; font-weight: 600; }
.cell-wrap { white-space: normal; word-break: break-word; }

/* ---- audit log: wide table that must still fit a laptop screen ---- */
.tbl.audit-tbl { table-layout: fixed; }
.panel .tbl.audit-tbl th, .panel .tbl.audit-tbl td { white-space: normal; }
.audit-tbl td:nth-child(1), .audit-tbl th:nth-child(1) { width: 132px; font-size: .78rem; }
.audit-tbl td:nth-child(2), .audit-tbl th:nth-child(2) { width: 84px; }
.audit-tbl td:nth-child(3), .audit-tbl th:nth-child(3) { width: 118px; }
.audit-tbl td:nth-child(4), .audit-tbl th:nth-child(4) { width: 146px; }
.audit-tbl td:nth-child(6), .audit-tbl th:nth-child(6) { width: 92px; }
.audit-tbl td:nth-child(7), .audit-tbl th:nth-child(7) { width: 84px; }
.audit-tbl td:nth-child(5) { word-break: break-word; }
.audit-diff { table-layout: fixed; }
.audit-diff td:nth-child(1), .audit-diff th:nth-child(1) { width: 34%; }
.audit-diff td, .audit-diff th { white-space: normal; word-break: break-word; }
