:root {
  color-scheme: dark;
  --bg: #070f1e;
  --bg-deep: #050b16;
  --bg-2: #0a1426;
  --surface: #0d1729;
  --surface-soft: #0a1324;
  --surface-muted: #101c31;
  --surface-raised: #111d33;
  --panel: rgba(13, 23, 41, 0.94);
  --panel-strong: rgba(17, 29, 51, 0.97);
  --text: #eef5ff;
  --text-strong: #ffffff;
  --muted: #9aa8bd;
  --muted-2: #718097;
  --border: #263550;
  --border-strong: #344766;
  --brand: #38c7f4;
  --brand-2: #57daf5;
  --brand-dark: #06101e;
  --brand-soft: rgba(56, 199, 244, 0.12);
  --danger: #ff6b7a;
  --warning: #f7c76b;
  --success: #49d39a;
  --info: #57daf5;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.22);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar: 304px;
  --sidebar-collapsed: 90px;
  --content-max: 1480px;
  --z-topbar: 20;
  --z-nav: 30;
  --z-fab: 40;
  --z-sheet: 50;
  --z-modal: 60;
  --z-camera: 70;
  --z-toast: 80;
  --z-banner: 9000;

  /* ── Text alias vars (used in sidebar + print styles) ── */
  --text-bold:   #ffffff;
  --text-muted:  #9aa8bd;
  --text-soft:   rgba(180, 200, 230, 0.72);
  --card:        #0d1729;
  --depth:       0;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 4%, rgba(56, 199, 244, .11), transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(87, 218, 245, .055), transparent 26%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 48%, #06101e 100%);
  color: var(--text);
  font-family: "Cairo", Tahoma, Arial, system-ui, sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
.avatar-button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.avatar-button:focus-visible {
  outline: 3px solid rgba(56, 199, 244, .35);
  outline-offset: 2px;
}

img { max-width: 100%; }

.hidden { display: none !important; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  transition: grid-template-columns .22s ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100svh;
  padding: 18px 14px;
  background: rgba(6, 13, 26, .92);
  border-inline-start: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  backdrop-filter: blur(16px);
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.sidebar::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.permissions-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sidebar::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.permissions-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.sidebar-overlay,
.sidebar-close,
.mobile-menu { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 29, 51, .96), rgba(10, 19, 36, .96));
}

.brand img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 16px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(56, 199, 244, .08);
}

.brand strong {
  display: block;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
  white-space: nowrap;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.nav {
  display: grid;
  gap: 14px;
  padding-bottom: 74px;
}

.nav-group {
  display: grid;
  gap: 7px;
}

.nav-group p {
  margin: 0 12px 2px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}

.nav button {
  position: relative;
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 12px 14px;
  text-align: right;
  color: #dfe9f8;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.nav button::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #4a5d78;
  transition: background .16s ease, transform .16s ease;
}

.nav button:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: #fff;
  transform: translateX(-1px);
}

.nav button.is-active {
  border-color: rgba(56, 199, 244, .7);
  background: rgba(12, 52, 78, .62);
  color: #fff;
  font-weight: 900;
  box-shadow: inset -3px 0 0 var(--brand);
}

.nav button.is-active::before {
  background: var(--brand);
  transform: scale(1.15);
}

.collapse-button {
  position: sticky;
  bottom: 0;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 8px;
}

body.sidebar-collapsed .brand div,
body.sidebar-collapsed .nav-group p,
body.sidebar-collapsed .nav button span,
body.sidebar-collapsed .collapse-button {
  display: none;
}

body.sidebar-collapsed .nav button {
  justify-content: center;
  padding-inline: 0;
}

body.sidebar-collapsed .nav button::before {
  width: 13px;
  height: 13px;
}

.main {
  width: 100%;
  min-width: 0;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 104px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(17, 29, 51, .98), rgba(11, 21, 39, .98));
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}

.page-title { min-width: 0; }

.topbar h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.22;
  font-weight: 900;
  letter-spacing: -.02em;
}

.topbar h1::before {
  content: "نظام الحضور - أحلى شباب";
  display: table;
  margin-bottom: 8px;
  padding: 4px 12px;
  border: 1px solid rgba(56, 199, 244, .45);
  border-radius: 999px;
  background: rgba(56, 199, 244, .12);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.user-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 260px;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
}

.user-chip > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-chip {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  max-width: 320px;
  padding: 7px 12px;
  border: 1px solid rgba(56, 199, 244, .26);
  border-radius: 999px;
  background: rgba(56, 199, 244, .08);
  color: #c9f3ff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-chip.is-admin {
  border-color: rgba(73, 211, 154, .34);
  background: rgba(73, 211, 154, .10);
  color: var(--success);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.stack {
  display: grid;
  gap: 20px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

.dashboard-grid .metric { grid-column: span 3; }
.dashboard-grid .panel { min-width: 0; }

.panel,
.metric,
.login-panel,
.person-card,
.profile-card,
.status-location-card,
.address-card,
.photo-box,
.permissions-list,
.calendar-day,
.org-node,
.risk-box,
.empty-box,
.chart,
.table-wrap,
.filters,
.accent-panel,
.punch-hero,
.guidance-panel .steps span {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.panel {
  min-width: 0;
  padding: 24px;
}

.panel > h2,
.profile-card h2 {
  margin: 0 0 18px;
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 800;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.35;
}

.panel-head p,
.panel-head span,
.panel-head strong {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 16%, rgba(56, 199, 244, .09), transparent 34%),
    var(--panel);
}

.metric::after {
  content: "";
  position: absolute;
  inset-inline-end: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(56, 199, 244, .12);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin: 10px 0;
  color: #f7fbff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  font-weight: 900;
}

.button {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 11px 18px;
  color: var(--text);
  background: #0c1729;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.2;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, color .14s ease;
}

.button:hover {
  border-color: rgba(56, 199, 244, .55);
  background: #111f36;
  color: #fff;
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-dark);
  font-weight: 900;
}

.button.primary:hover {
  background: var(--brand-2);
  color: var(--brand-dark);
}

.button.ghost { background: var(--surface-soft); }

.button.danger {
  border-color: rgba(255, 107, 122, .36);
  color: var(--danger);
}

.button.full { width: 100%; }

input,
select,
textarea,
input[type="file"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  padding: 12px 16px;
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: none;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder { color: #6f7e94; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(56, 199, 244, .18);
  box-shadow: 0 0 0 4px rgba(56, 199, 244, .08);
}

select option {
  background: var(--surface-soft);
  color: var(--text);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid,
.filters {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
}

.form-grid > label,
.filters > * { grid-column: span 3; }
.form-grid.compact-form > label { grid-column: span 6; }
.form-grid > .span-2,
.form-grid.compact-form > .span-2 { grid-column: span 12; }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.filters {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
}

.checkbox-row,
.check-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(10, 19, 36, .72);
  color: var(--muted);
}

.checkbox-row input,
.check-row input {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--text);
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b1527;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

td { font-size: 13px; }

td small { color: var(--muted); }

tbody tr:hover { background: rgba(56, 199, 244, .04); }

.empty {
  padding: 26px !important;
  color: var(--muted) !important;
  text-align: center !important;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.person-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.person-card.is-selected {
  border-color: rgba(56, 199, 244, .62);
  background: rgba(56, 199, 244, .075);
}

.select-card {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(5, 11, 22, .78);
  color: var(--muted);
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.select-card input {
  width: auto;
  min-height: auto;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(10, 19, 36, .72);
}

.bulk-bar > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.bulk-bar .button:disabled {
  opacity: .48;
  cursor: not-allowed;
  transform: none;
}

.person-card:hover {
  border-color: rgba(56, 199, 244, .42);
  transform: translateY(-2px);
}

.avatar,
.avatar-button {
  width: 60px;
  height: 60px;
  border-radius: 20px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 28% 24%, rgba(87, 218, 245, .22), transparent 32%),
    linear-gradient(135deg, #182b4b, #0d3550);
  color: #dff8ff;
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(56, 199, 244, .06);
}

.avatar[hidden],
.avatar-wrap [hidden] {
  display: none !important;
}

.avatar.tiny {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 11px;
}

.avatar.large {
  width: 112px;
  height: 112px;
  border-radius: 32px;
  font-size: 30px;
}

.avatar-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.avatar-button .avatar,
.avatar-button img {
  width: 100%;
  height: 100%;
}

.person-main { min-width: 0; }

.person-main h3 {
  margin: 2px 0 4px;
  color: var(--text-strong);
  font-size: 17px;
}

.person-main p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.meta-row,
.chips,
.notice-list,
.punch-actions,
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-row span,
.chip,
.kpi-policy-strip span,
.notice-list span,
.meta-grid span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(10, 19, 36, .72);
  color: var(--muted);
  font-size: 12px;
}

.person-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 180px;
}

.profile-layout,
.editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-card,
.status-location-card,
.address-card,
.photo-box,
.risk-box,
.empty-box,
.accent-panel,
.punch-hero {
  padding: 18px;
}

.profile-card p,
.address-card p,
.empty-box,
.org-node small,
.meta-grid span {
  color: var(--muted);
}

.profile-details,
.meta-grid {
  display: grid;
  gap: 10px;
}

.meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-box {
  display: grid;
  gap: 12px;
  place-items: start;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status.ACTIVE,
.status.APPROVED,
.status.COMPLETED,
.status.PRESENT,
.status.CHECK_IN,
.status.SUCCESS,
.status.RESOLVED,
.status.CLOSED {
  color: var(--success);
  background: rgba(73, 211, 154, .11);
  border-color: rgba(73, 211, 154, .28);
}

.status.PENDING,
.status.ON_LEAVE,
.status.LEAVE,
.status.LATE,
.status.MISSION,
.status.INVITED,
.status.CHECKOUT_REVIEW,
.status.PRESENT_REVIEW,
.status.MEDIUM {
  color: var(--warning);
  background: rgba(247, 199, 107, .11);
  border-color: rgba(247, 199, 107, .28);
}

.status.REJECTED,
.status.ABSENT,
.status.SUSPENDED,
.status.DISABLED,
.status.INACTIVE,
.status.LOCKED,
.status.TERMINATED,
.status.ESCALATED,
.status.HIGH {
  color: var(--danger);
  background: rgba(255, 107, 122, .10);
  border-color: rgba(255, 107, 122, .26);
}

.status.SUBMITTED,
.status.IN_REVIEW,
.status.OPEN,
.status.CHECK_OUT,
.status.READ,
.status.inside_branch,
.status.verified {
  color: var(--brand-2);
  background: rgba(56, 199, 244, .10);
  border-color: rgba(56, 199, 244, .25);
}

.status.LOW {
  color: var(--muted);
  background: rgba(148, 163, 184, .08);
}

.message {
  margin: 0 0 14px;
  padding: 13px 15px;
  border: 1px solid rgba(56, 199, 244, .28);
  border-radius: var(--radius-md);
  background: rgba(56, 199, 244, .08);
  color: #c9f3ff;
}

.message.compact { font-size: 13px; }
.message.error,
.danger-box {
  border-color: rgba(255, 107, 122, .35);
  background: rgba(255, 107, 122, .08);
  color: var(--danger);
}
.message.warning {
  border-color: rgba(247, 199, 107, .32);
  background: rgba(247, 199, 107, .10);
  color: var(--warning);
}

.chart {
  min-height: 240px;
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 12px;
  padding: 18px;
}

.bar {
  min-width: 42px;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.bar-fill {
  width: 28px;
  min-height: 12px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, var(--brand-2), #138fb8);
}

.bar span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-day {
  min-height: 94px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17, 29, 51, .96), rgba(10, 19, 36, .94));
}

.calendar-day strong,
.calendar-day span {
  display: block;
}

.calendar-day span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-day.PRESENT,
.calendar-day.CHECK_IN { border-color: rgba(73, 211, 154, .35); }
.calendar-day.LATE { border-color: rgba(247, 199, 107, .45); }
.calendar-day.ABSENT { border-color: rgba(255, 107, 122, .35); }
.calendar-day.MISSION,
.calendar-day.LEAVE,
.calendar-day.ON_LEAVE { border-color: rgba(56, 199, 244, .35); }

.permissions-list {
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.org-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.org-node {
  padding: 14px;
}

.soft-separator {
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.kpi-page,
.punch-page {
  align-items: stretch;
}

.kpi-policy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.guidance-panel .steps {
  display: grid;
  gap: 10px;
}

.guidance-panel .steps span {
  padding: 12px;
  color: var(--muted);
}

.punch-hero {
  display: grid;
  gap: 16px;
  align-content: start;
  background:
    radial-gradient(circle at 16% 14%, rgba(56, 199, 244, .10), transparent 32%),
    var(--panel);
}

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.5vw, 20px);
  background:
    radial-gradient(circle at 30% 15%, rgba(56, 199, 244, .14), transparent 32%),
    linear-gradient(135deg, var(--bg-deep), var(--bg-2));
}

.login-panel {
  width: min(100%, 430px);
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  overflow: auto;
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--radius-xl);
  background: rgba(13, 23, 41, .96);
}

.login-logo-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: rgba(56, 199, 244, .10);
  border: 1px solid rgba(56, 199, 244, .24);
  box-shadow: 0 18px 38px rgba(56, 199, 244, .10);
}

.login-logo-mark img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.login-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 22px;
  background: var(--brand);
  color: var(--brand-dark);
  font-weight: 900;
}

.login-panel h1 {
  margin: 0 0 18px;
  color: var(--text-strong);
  text-align: center;
  font-size: clamp(26px, 5vw, 34px);
}

.login-panel p {
  margin: 0 0 16px;
  color: var(--muted);
}

.login-password-field {
  position: relative;
  display: block;
}

.login-password-field input {
  padding-inline-end: 82px;
}

.login-panel .password-toggle,
.gate .password-toggle {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 32px;
  border: 1px solid rgba(56, 199, 244, .34);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(8, 18, 34, .92);
  color: var(--text-strong, #e5f3ff);
  font: inherit;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.login-panel .password-toggle[aria-pressed="true"],
.gate .password-toggle[aria-pressed="true"] {
  background: rgba(34, 211, 238, .16);
  color: var(--brand, #22d3ee);
}

@media (max-height: 720px) {
  .login-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 10px;
  }

  .login-panel {
    display: grid;
    gap: 10px;
  }

  .login-panel p,
  .login-help-note {
    font-size: 13px;
    line-height: 1.55;
  }
}

/* Large tablets and small laptops */
@media (max-width: 1180px) {
  :root { --sidebar: 292px; }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-menu,
  .sidebar-close { display: inline-flex; }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(3, 7, 18, .68);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: auto;
    inset-inline-end: auto;
    right: 0;
    left: auto;
    width: min(92vw, 344px);
    height: 100dvh;
    transform: translateX(110%);
    transition: transform .22s ease;
    z-index: 50;
    box-shadow: -22px 0 60px rgba(0, 0, 0, .34);
  }

  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar .nav button.is-active { scroll-margin-block: 90px; }
  body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }

  .sidebar-close {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
  }

  body.sidebar-collapsed .brand div,
  body.sidebar-collapsed .nav-group p,
  body.sidebar-collapsed .nav button span,
  body.sidebar-collapsed .collapse-button {
    display: initial;
  }

  body.sidebar-collapsed .nav button {
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .collapse-button { display: none; }

  .main { padding: 18px; }
  .topbar { position: relative; min-height: auto; align-items: flex-start; }
  .dashboard-grid .metric { grid-column: span 6; }
  .span-3,
  .span-4,
  .span-5,
  .span-6 { grid-column: span 6; }
  .span-7,
  .span-8 { grid-column: 1 / -1; }
}

/* Tablets */
@media (max-width: 900px) {
  .main { padding: 14px; }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
  }

  .topbar .toolbar {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
  }

  .user-chip,
  .role-chip { max-width: 100%; }

  .grid,
  .form-grid,
  .filters {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dashboard-grid .metric,
  .span-2,
  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8,
  .span-12,
  .panel,
  .metric {
    grid-column: 1 / -1;
  }

  .form-grid > label,
  .form-grid.compact-form > label,
  .filters > * {
    grid-column: span 3;
  }

  .profile-layout,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    display: grid;
  }

  .panel-head .toolbar {
    justify-content: flex-start;
  }

  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Phones */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 18, .72);
  backdrop-filter: blur(12px);
}

.confirm-modal {
  width: min(100%, 470px);
  padding: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.confirm-modal .form-actions { justify-content: flex-start; }

@media (max-width: 640px) {
  body { line-height: 1.6; }
  .main { padding: 10px; }

  .topbar {
    margin-bottom: 12px;
    padding: 13px;
    border-radius: 18px;
  }

  .topbar h1 { font-size: 21px; }
  .topbar h1::before { margin-bottom: 6px; }
  .topbar p { font-size: 12px; }

  .button {
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 12px;
  }

  .toolbar,
  .form-actions,
  .person-actions,
  .profile-actions,
  .punch-actions {
    width: 100%;
    gap: 8px;
  }

  .toolbar .role-chip { flex: 1 1 100%; justify-content: center; }

  .toolbar .button,
  .form-actions .button,
  .person-actions .button,
  .profile-actions .button,
  .punch-actions .button {
    flex: 1 1 auto;
  }

  .panel,
  .metric,
  .profile-card,
  .status-location-card,
  .address-card,
  .photo-box,
  .risk-box,
  .empty-box,
  .accent-panel,
  .punch-hero {
    padding: 14px;
    border-radius: 18px;
  }

  .grid,
  .form-grid,
  .filters {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-grid > label,
  .form-grid.compact-form > label,
  .filters > *,
  .form-grid > .span-2,
  .form-grid.compact-form > .span-2 {
    grid-column: 1 / -1;
  }

  .filters { padding: 12px; }
  input, select, textarea { min-height: 46px; }

  .people-grid { grid-template-columns: 1fr; }

  .person-card {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px;
    border-radius: 18px;
  }

  .avatar,
  .avatar-button {
    width: 54px;
    height: 54px;
    border-radius: 18px;
  }

  .avatar.large {
    width: 96px;
    height: 96px;
    border-radius: 26px;
  }

  .meta-row span,
  .chip,
  .notice-list span,
  .meta-grid span {
    max-width: 100%;
  }

  .meta-grid { grid-template-columns: 1fr; }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .calendar-day { min-height: 82px; }

  .chart {
    min-height: 190px;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .bar { min-width: 46px; }

  .table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table { min-width: 0; }
  thead { display: none; }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
  }

  td {
    display: grid;
    grid-template-columns: minmax(95px, 38%) minmax(0, 1fr);
    gap: 10px;
    min-height: 38px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(38, 53, 80, .75);
    text-align: right;
    word-break: break-word;
  }

  td:last-child { border-bottom: 0; }

  td::before {
    content: attr(data-label);
    color: var(--muted-2);
    font-weight: 900;
  }

  td.empty {
    display: block;
    text-align: center !important;
  }

  td.empty::before { content: none; }
}

/* Small phones */
@media (max-width: 420px) {
  .main { padding: 8px; }
  .topbar { grid-template-columns: 1fr; }
  .mobile-menu { width: 100%; }
  .toolbar .button,
  .form-actions .button,
  .person-actions .button,
  .profile-actions .button,
  .punch-actions .button {
    flex-basis: 100%;
  }
  .person-card { grid-template-columns: 1fr; }
  .person-card .avatar-button { justify-self: start; }
  .calendar-grid { grid-template-columns: 1fr; }
  td { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}



/* Phase 2 audit implementation: attendance filters, progressive tables, route access diagnostics */
.attendance-filters {
  margin-top: 12px;
  background: rgba(56, 199, 244, .045);
  border: 1px solid rgba(56, 199, 244, .14);
}

.table-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 19, 36, .72);
  color: var(--muted);
  font-size: 13px;
}

.table-summary strong { color: var(--text); }

.load-more-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed rgba(56, 199, 244, .24);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(56, 199, 244, .035);
}

.scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scope-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scope-list.matched span,
.scope-list.all-scopes span {
  border-color: rgba(56, 199, 244, .24);
  color: var(--text);
  background: rgba(56, 199, 244, .075);
}

.route-access-table td:first-child small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
}

@media (max-width: 640px) {
  .table-summary,
  .load-more-row {
    align-items: stretch;
    justify-content: flex-start;
  }
  .load-more-row .button { width: 100%; }
  .scope-list span { max-width: 100%; overflow-wrap: anywhere; }
}

@media print {
  body {
    background: #fff !important;
    color: #111827 !important;
  }
  .sidebar,
  .topbar,
  .sidebar-overlay,
  .message,
  .button {
    display: none !important;
  }
  .app-shell { display: block; }
  .main { max-width: none; padding: 0; }
  .panel,
  .table-wrap,
  .metric {
    background: #fff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
  }
  table { min-width: 0; }
}

/* Smart integration phase */
.selfie-box {
  display: grid;
  gap: .75rem;
  padding: .85rem;
  border: 1px dashed rgba(56, 199, 244, .35);
  border-radius: 18px;
  background: rgba(56, 199, 244, .06);
}
.selfie-preview {
  min-height: 110px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
  overflow: hidden;
}
.selfie-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: inherit;
}
.camera-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 7, 18, .82);
  backdrop-filter: blur(14px);
}
.camera-card {
  width: min(520px, 100%);
  padding: 1rem;
  border: 1px solid rgba(56,199,244,.28);
  border-radius: 24px;
  background: var(--panel, #0d1729);
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.camera-card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
  background: #000;
  margin: .75rem 0;
}
.heatmap-card {
  position: relative;
  min-height: 330px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 30%, rgba(56,199,244,.18), transparent 28%),
    radial-gradient(circle at 80% 70%, rgba(87,218,245,.10), transparent 30%),
    linear-gradient(145deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid rgba(56,199,244,.18);
}
.heat-dot {
  position: absolute;
  right: var(--x);
  top: var(--y);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38c7f4;
  box-shadow: 0 0 0 10px rgba(56,199,244,.18), 0 0 38px rgba(56,199,244,.72);
  animation: heatPulse 1.8s ease-in-out infinite;
}
@keyframes heatPulse {
  0%, 100% { transform: scale(.88); opacity: .75; }
  50% { transform: scale(1.12); opacity: 1; }
}
.integration-grid, .smart-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
@media (max-width: 640px) {
  .camera-card { border-radius: 18px; padding: .75rem; }
  .camera-card video { border-radius: 14px; }
  .heatmap-card { min-height: 240px; }
  .selfie-preview { min-height: 88px; }
}

/* Fix 2026-04-27: keep menu recovery available after collapsing sidebar */
.nav-fab {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 80;
  display: none;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 33, 57, .98), rgba(8, 20, 38, .98));
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 900;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.nav-fab:hover,
.nav-fab:focus-visible {
  border-color: rgba(56, 199, 244, .75);
  box-shadow: 0 18px 45px rgba(14, 165, 233, .18);
}

body.sidebar-collapsed .nav-fab { display: inline-flex; }

@media screen and (min-width: 1181px) {
  body.sidebar-collapsed .collapse-button {
    display: inline-flex !important;
    width: 52px;
    min-height: 52px;
    margin-inline: auto;
    align-items: center;
    justify-content: center;
    font-size: 0;
    border-radius: 18px;
  }

  body.sidebar-collapsed .collapse-button::before {
    content: "☰";
    font-size: 21px;
    line-height: 1;
  }
}

@media (max-width: 1180px) {
  .nav-fab { display: inline-flex; }
  body.nav-open .nav-fab { display: none; }
}

@media print {
  .nav-fab { display: none !important; }
}

/* Avatar + full mobile responsiveness patch — 2026-04-27 */
.user-avatar-editor {
  grid-row: span 4;
  align-content: start;
}

.user-avatar-editor small,
.photo-box small {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

#user-avatar-preview,
#photo-preview {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px dashed rgba(56, 199, 244, .28);
  border-radius: 22px;
  background: rgba(56, 199, 244, .055);
}

input[type="file"] {
  padding-block: 9px;
  cursor: pointer;
}

.panel,
.metric,
.person-card,
.profile-card,
.table-wrap,
.filters,
.editor-grid,
.profile-layout,
.topbar,
.main,
.app-shell {
  max-width: 100%;
}

.person-main,
.panel-head > div,
.page-title,
.user-chip,
.role-chip,
td,
th {
  min-width: 0;
}

.person-cell span,
.meta-row span,
.user-chip > span:last-child,
.role-chip,
.panel-head p,
.topbar p {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .editor-grid .photo-box,
  .editor-grid .user-avatar-editor {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .editor-grid .photo-box {
    place-items: center;
    text-align: center;
  }

  .bulk-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .bulk-bar .check-row,
  .bulk-bar > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .topbar .toolbar .user-chip,
  .topbar .toolbar .role-chip {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .mobile-menu,
  .topbar .toolbar .button {
    width: 100%;
  }

  .panel-head {
    grid-template-columns: 1fr;
  }

  .panel-head .toolbar,
  .toolbar.spaced {
    display: grid;
    grid-template-columns: 1fr;
  }

  .editor-grid,
  .profile-layout {
    gap: 12px;
  }

  .bulk-bar {
    grid-template-columns: 1fr;
  }

  .person-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .person-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .person-actions .status {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .person-cell {
    min-width: 0;
    align-items: flex-start;
  }

  .table-wrap.attendance-table td,
  td {
    grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
  }

  .confirm-modal {
    width: 100%;
    max-height: calc(100dvh - 28px);
    overflow: auto;
  }
}

@media (max-width: 420px) {
  .topbar .toolbar,
  .person-actions {
    grid-template-columns: 1fr;
  }

  .person-card {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .person-card .avatar-button {
    justify-self: center;
  }

  .select-card {
    position: static;
    justify-self: stretch;
    justify-content: center;
    margin-bottom: 6px;
  }

  .avatar.large {
    width: 88px;
    height: 88px;
    border-radius: 24px;
  }
}


/* Simplified employee form + biometric punch */
.biometric-box {
  border: 1px solid rgba(56, 189, 248, .35);
  background: rgba(14, 165, 233, .08);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.biometric-box p { margin: 0; color: var(--muted); line-height: 1.8; }
.editor-grid .message.span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .biometric-box { padding: 12px; }
  .punch-actions .button { width: 100%; }
}


/* Single branch cleanup + live location cards — 2026-04-27 */
.locations-page .accent-panel .toolbar {
  margin-top: 12px;
}

.employee-location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.employee-location-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(7, 17, 33, .66);
  overflow: hidden;
}

.location-card-head {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: right;
  cursor: pointer;
}

.location-card-head strong,
.location-card-head small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.location-card-actions .button {
  flex: 1 1 180px;
}

.location-details {
  border-top: 1px solid var(--border);
  padding: 14px;
  background: rgba(4, 10, 20, .38);
}

.map-line {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.map-line span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(12, 22, 40, .78);
}

.disputes-page textarea {
  min-height: 150px;
}

/* Keep sidebar position stable between page changes */
.sidebar {
  overscroll-behavior: contain;
  scroll-behavior: auto;
}

.nav button.is-active {
  scroll-margin-block: 120px;
}

/* Remove page overflow traps from large panels on mobile */
@media (max-width: 760px) {
  .employee-location-grid {
    grid-template-columns: 1fr;
  }

  .location-card-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .location-card-head .badge,
  .location-card-head .status-badge {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .location-card-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .map-line {
    display: grid;
    grid-template-columns: 1fr;
  }

  .permissions-list,
  .table-wrap,
  .panel {
    max-width: 100%;
  }

  .form-grid.compact-form,
  .form-grid {
    grid-template-columns: 1fr;
  }
}


/* Login + punch layout fixes 20260427-8 */
.forgot-password-btn {
  margin-top: 10px;
}

.login-help-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-left: 52px;
}

.password-eye {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, .72);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

.password-eye:hover {
  border-color: rgba(56, 199, 244, .55);
  background: rgba(17, 31, 54, .92);
  color: var(--brand-2);
}

.password-eye-icon {
  position: relative;
  display: block;
  width: 21px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px / 720px;
}

.password-eye-icon::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.password-eye[aria-pressed="true"] .password-eye-icon::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 5px;
  width: 29px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-42deg);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .72);
}

.address-card,
.punch-hero,
.latest-punches-panel {
  overflow: hidden;
}

.address-card strong {
  display: block;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.address-card .meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-open-btn {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
}

#self-punch-result {
  overflow-wrap: anywhere;
}

#self-punch-result .toolbar {
  align-items: center;
}

.punch-actions .button {
  min-width: 140px;
}

@media (max-width: 980px) {
  .punch-page {
    grid-template-columns: 1fr;
  }
  .punch-page > .panel,
  .punch-page > article {
    grid-column: 1 / -1 !important;
  }
  .address-card .meta-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-panel {
    width: 100%;
    padding: 20px;
  }
  .punch-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .punch-actions .button,
  .forgot-password-btn {
    width: 100%;
  }
}

/* Advanced UI/UX diagnostics and production mobile polish — 2026-04-27 */
.complex-settings-page .compact-address-card,
.diagnostics-page .accent-panel {
  border-color: rgba(56, 189, 248, .35);
}

.diagnostics-page .table-wrap,
.complex-settings-page .table-wrap {
  max-width: 100%;
}

.risk-box .meta-grid,
#settings-gps-result .meta-grid,
#gps-test-result .meta-grid {
  margin-top: 10px;
}

.users-lite-page .panel-head .toolbar,
.diagnostics-page .panel-head .toolbar {
  justify-content: flex-start;
}

@media (max-width: 820px) {
  .panel-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .panel-head .toolbar,
  .topbar .toolbar,
  .form-actions,
  .toolbar.spaced {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .panel-head .toolbar .button,
  .topbar .toolbar .button,
  .form-actions .button,
  .toolbar.spaced .button {
    width: 100%;
    justify-content: center;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table-wrap tbody tr {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(7, 17, 33, .64);
    padding: 10px;
    margin-bottom: 10px;
  }

  .table-wrap tbody td {
    border: 0;
    padding: 9px 4px;
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table-wrap tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }

  .table-wrap tbody td.empty {
    display: block;
    text-align: center;
  }

  .table-wrap tbody td.empty::before {
    content: "";
  }

  .diagnostics-page,
  .complex-settings-page,
  .users-lite-page,
  .punch-page {
    gap: 12px;
  }
}

@media (max-width: 520px) {
  .role-chip,
  .user-chip,
  .status {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }

  .topbar .page-title h1 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .form-grid label,
  label {
    min-width: 0;
  }
}

/* Strong features phase 12 */
.qr-print-card {
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
  padding: 22px;
  border: 1px solid rgba(56, 189, 248, .25);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(14,165,233,.13), rgba(15,23,42,.05));
}
.qr-img {
  width: min(260px, 75vw);
  height: min(260px, 75vw);
  border-radius: 18px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(2, 132, 199, .18);
}
.breakable { overflow-wrap: anywhere; word-break: break-word; }
.stack-list { display: grid; gap: 12px; }
.task-card {
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 18px;
  padding: 14px;
  background: rgba(15, 23, 42, .28);
}
.task-card p { margin: 6px 0 10px; color: var(--muted); }
.big-status { margin: 18px 0; font-size: 1.1rem; }
.manager-dashboard-page .metric-grid,
.monthly-report-page .metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.monthly-report-page input[type="month"] {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .32);
  background: rgba(15, 23, 42, .42);
  color: var(--text);
  padding: 0 12px;
}
.security-log-page small { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .qr-page .panel,
  .demo-page .panel,
  .manager-dashboard-page .panel,
  .monthly-report-page .panel { grid-column: span 12 !important; }
  .qr-print-card { padding: 16px; }
  .monthly-report-page .panel-head,
  .manager-dashboard-page .panel-head { align-items: stretch; }
  .monthly-report-page .toolbar,
  .manager-dashboard-page .toolbar { width: 100%; }
  .monthly-report-page input[type="month"] { width: 100%; }
}

/* 2026 completion pack: executive dashboard, bulk actions, reports, health */
.score-ring {
  min-width: 110px;
  min-height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(56, 199, 244, .42);
  background: radial-gradient(circle, rgba(56,199,244,.22), rgba(17,29,51,.72));
  box-shadow: inset 0 0 28px rgba(56,199,244,.14), 0 18px 40px rgba(0,0,0,.24);
}
.score-ring strong { font-size: 30px; color: var(--brand); line-height: 1; }
.score-ring span { color: var(--muted); font-size: 12px; font-weight: 900; }
.readiness-grid, .mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.readiness-item, .mini-stats > div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(17, 29, 51, .72);
}
.readiness-item strong, .mini-stats strong { display:block; color: var(--text-strong); font-size: 22px; }
.readiness-item span, .readiness-item small, .mini-stats span { display:block; color: var(--muted); margin-top: 4px; }
.readiness-item.ok { border-color: rgba(73, 211, 154, .36); }
.readiness-item.warn { border-color: rgba(247, 199, 107, .42); background: rgba(63, 48, 20, .32); }
.advanced-bulk { align-items: center; gap: 10px; flex-wrap: wrap; }
.advanced-bulk select, .advanced-bulk input { min-height: 42px; border-radius: 13px; }
.request-center-page .table-wrap small, .reports-hub-page .table-wrap small { color: var(--muted); }
@media (max-width: 720px) {
  .score-ring { min-width: 82px; min-height: 82px; }
  .score-ring strong { font-size: 22px; }
  .advanced-bulk select, .advanced-bulk .button { width: 100%; }
}


/* Enhanced organization hierarchy */
.org-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.org-tree {
  display: block;
}
.org-tree-item {
  position: relative;
  margin-inline-start: calc(var(--depth, 0) * 26px);
}
.org-tree-item + .org-tree-item {
  margin-top: 10px;
}
.org-children {
  position: relative;
  margin-top: 10px;
  padding-inline-start: 18px;
  border-inline-start: 1px dashed var(--border);
}
.org-node.enhanced {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}
.org-node.enhanced span {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.org-node.enhanced em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.org-featured-chart {
  display: grid;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 2px 18px;
}
.org-feature-top {
  min-width: 920px;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(240px, 310px);
  justify-content: center;
  align-items: center;
  gap: 56px;
}
.org-feature-line {
  min-width: 920px;
  width: calc(100% - 80px);
  height: 34px;
  margin: 0 auto -4px;
  border-top: 2px solid rgba(56, 189, 248, .55);
  border-left: 2px solid rgba(56, 189, 248, .35);
  border-right: 2px solid rgba(56, 189, 248, .35);
  border-radius: 18px 18px 0 0;
}
.org-feature-managers {
  min-width: 920px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: start;
}
.org-feature-branch {
  display: grid;
  justify-items: center;
  gap: 10px;
  position: relative;
}
.org-feature-children {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-top: 10px;
  position: relative;
}
.org-feature-children::before {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: 2px;
  height: 10px;
  transform: translateX(50%);
  background: rgba(56, 189, 248, .65);
}
.org-feature-node {
  width: min(100%, 260px);
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, .48);
  background: linear-gradient(180deg, rgba(9, 21, 42, .96), rgba(6, 14, 30, .96));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .12), 0 14px 34px rgba(2, 8, 23, .32);
}
.org-feature-node.is-executive { width: 430px; border-color: rgba(125, 211, 252, .8); box-shadow: 0 0 22px rgba(56, 189, 248, .18); }
.org-feature-node.is-secretary { width: 310px; }
.org-feature-node span { display: grid; gap: 2px; min-width: 0; }
.org-feature-node strong { color: #f8fafc; line-height: 1.5; }
.org-feature-node small { color: #38bdf8; font-weight: 800; line-height: 1.5; }
.org-feature-node em { color: var(--muted); font-size: 11px; font-style: normal; white-space: nowrap; }
.org-fallback-tree {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
@media (max-width: 720px) {
  .org-tree-item { margin-inline-start: calc(var(--depth, 0) * 10px); }
  .org-node.enhanced { align-items: flex-start; }
  .org-node.enhanced em { white-space: normal; }
  .org-feature-top, .org-feature-line, .org-feature-managers { min-width: 760px; }
  .org-feature-top { grid-template-columns: 360px 280px; gap: 24px; }
  .org-feature-node.is-executive { width: 360px; }
}

/* Stability Pack additions */
.password-chip {
  display: inline-flex;
  align-items: center;
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(148, 163, 184, .28);
  color: #dbeafe;
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
}

/* Full Operations Pack additions */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.permission-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 16px;
  background: rgba(15, 23, 42, .38);
}
.permission-check input {
  grid-column: 1;
  grid-row: 1;
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
  accent-color: var(--brand);
}
.permission-check span {
  grid-column: 2;
  min-width: 0;
  text-align: right;
}
.permission-check strong { display: block; color: #e5f1ff; }
.permission-check small {
  display: block;
  color: #8fb0d7;
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
}
.roles-page .table-wrap td strong,
.roles-page .table-wrap td small {
  display: block;
}
.roles-page > .panel.span-5,
.roles-page > .panel.span-7 {
  grid-column: 1 / -1;
}
.roles-page .table-wrap table {
  min-width: 0;
  table-layout: fixed;
}
.roles-page .table-wrap th,
.roles-page .table-wrap td {
  padding: 12px 14px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.roles-page .table-wrap code {
  direction: ltr;
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.role-editor-form {
  align-items: start;
}
.role-editor-tools {
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.role-perm-counter {
  color: #bae6fd;
  font-weight: 800;
  margin-inline-start: auto;
}
.permission-group-list {
  display: grid;
  gap: 12px;
  max-height: min(62vh, 720px);
  overflow: auto;
  padding-inline-end: 6px;
}
.permission-group {
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 16px;
  padding: 12px;
  background: rgba(2, 6, 23, .22);
}
.permission-group h3 {
  margin: 0 0 10px;
  color: #67e8f9;
  font-size: .95rem;
  direction: ltr;
  text-align: left;
}
.roles-page .mini-stats.compact {
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  min-width: min(320px, 100%);
}
@media (max-width: 900px) {
  .roles-page .span-5,
  .roles-page .span-7 {
    grid-column: 1 / -1;
  }
  .permission-group-list {
    max-height: none;
  }
  .role-perm-counter {
    width: 100%;
    margin-inline-start: 0;
  }
}
.matrix-form > label { max-width: 420px; }
.executive-report-page .metric strong { font-size: clamp(1.8rem, 3vw, 3rem); }
.button.small { padding: 7px 10px; font-size: .82rem; min-height: auto; }
.big-number { display: block; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; color: #67e8f9; margin: 8px 0; }

/* Executive Mobile + Secure Gateway Pack */
.employee-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.mini-card{background:rgba(15,23,42,.72);border:1px solid rgba(148,163,184,.22);border-radius:22px;padding:14px;display:grid;gap:12px}.executive-employee-card{grid-template-columns:auto 1fr;align-items:center}.executive-employee-card .mini-card-actions{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.avatar-button{border:0;background:transparent;padding:0;cursor:pointer}.executive-mobile-app .sidebar{display:none}.executive-mobile-app .main{margin-inline-start:0}.executive-mobile-view .person-cell.large{margin-bottom:16px}.urgent-card{border-color:rgba(248,113,113,.45)!important;box-shadow:0 18px 46px rgba(127,29,29,.18)}
@media(max-width:760px){.executive-mobile-view .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.executive-mobile-view .span-6,.executive-mobile-view .span-12{grid-column:1/-1}.employee-card-grid{grid-template-columns:1fr}.executive-employee-card{grid-template-columns:auto 1fr}.executive-employee-card .button{padding:10px 12px}}

/* Smart operations pack */
.mini-input{width:72px;min-width:72px;padding:8px;border-radius:10px;border:1px solid rgba(148,163,184,.35);background:rgba(15,23,42,.06);color:inherit;text-align:center}.urgent-card{border-color:rgba(239,68,68,.45)!important;box-shadow:0 20px 50px rgba(239,68,68,.12)}.accent-panel .quick-action-grid{margin-top:12px}.print-only{display:none}@media print{.sidebar,.topbar,.nav-fab,.button,.employee-bottom-nav{display:none!important}.panel,.employee-card{break-inside:avoid;box-shadow:none!important}}

/* Mobile executive + gateway fix — 2026-04-30 */
.avatar-wrap {
  display:inline-flex;
  width:60px;
  height:60px;
  border-radius:20px;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
}
.avatar-wrap.tiny { width:30px; height:30px; border-radius:10px; }
.avatar-wrap.large { width:112px; height:112px; border-radius:32px; }
.avatar-wrap .avatar { width:100%; height:100%; }
.employee-card-grid { align-items:stretch; }
.executive-mobile-app .sidebar { display:block; }


/* Final system polish: stable headers and collision-free Arabic text. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
}

.topbar h1::before {
  content: "نظام الحضور - أحلى شباب";
  letter-spacing: 0;
}

.panel,
.metric,
.metric-card,
.person-card,
.mini-card,
.profile-card,
.table-wrap,
.filters,
.status-location-card,
.location-card,
.readiness-item,
.message,
.empty-state,
.employee-card-grid,
.executive-mobile-view {
  overflow-wrap: anywhere;
  word-break: normal;
}

.panel-head,
.person-card,
.person-cell,
.toolbar,
.meta-grid,
.metric-grid,
.summary,
.employee-card-grid,
.executive-mobile-view .executive-employee-card,
.mini-card-actions {
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.panel-head > div {
  min-width: min(100%, 260px);
  flex: 1 1 320px;
}

.panel-head .toolbar {
  flex: 0 1 auto;
}

.person-cell > span,
.person-main,
.metric-card,
.mini-card > div,
.executive-mobile-view .executive-employee-card > div:not(.mini-card-actions),
.location-card-head > div,
.readiness-item,
td,
th {
  min-width: 0;
}

.person-cell strong,
.person-cell small,
.panel h2,
.panel p,
.metric-card strong,
.metric-card small,
.mini-card strong,
.mini-card small,
.status,
.badge,
.role-chip,
.user-chip,
.button,
td,
th {
  line-height: 1.45;
}

.status,
.badge,
.role-chip,
.user-chip,
.button,
.chip,
.pill {
  white-space: normal;
}

.button {
  min-width: 0;
  text-align: center;
}

.executive-mobile-view .executive-employee-card {
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 12px;
}

.executive-mobile-view .executive-employee-card strong,
.executive-mobile-view .executive-employee-card small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

@media (max-width: 760px) {
  .topbar {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .topbar,
  .topbar .toolbar,
  .panel-head,
  .toolbar {
    align-items: stretch;
  }

  .topbar .toolbar,
  .panel-head .toolbar,
  .toolbar.spaced {
    width: 100%;
  }
}

/* Sidebar placement fix for RTL responsive layouts. */
@media (max-width: 1180px) {
  .app-shell,
  body.sidebar-collapsed .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: auto !important;
    width: min(92vw, 344px) !important;
    max-width: 344px;
    height: 100dvh !important;
    transform: translateX(110%) !important;
    z-index: 1000;
  }

  body.nav-open .sidebar {
    transform: translateX(0) !important;
  }

  .sidebar-overlay {
    z-index: 999;
  }

  .nav-fab {
    z-index: 1001;
  }
}

@media (min-width: 1181px) {
  .sidebar {
    right: auto;
    left: auto;
    transform: none !important;
  }
}

/* Employee mobile shell fix - 2026-04-30 */
.employee-portal {
  overflow-x: hidden;
}
.employee-shell {
  min-height: 100dvh;
  padding-bottom: 88px;
}
.employee-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 12px clamp(12px, 4vw, 24px);
  background: rgba(2, 6, 23, .92);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  backdrop-filter: blur(16px);
}
.employee-brand,
.employee-user,
.employee-user span {
  min-width: 0;
}
.employee-brand,
.employee-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.employee-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.employee-brand div,
.employee-user > span:not(.avatar-wrap) {
  display: grid;
  gap: 2px;
}
.employee-brand strong,
.employee-user strong {
  overflow: hidden;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.employee-brand span,
.employee-user small {
  color: var(--muted);
  font-size: .78rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.employee-user {
  flex: 0 1 46%;
  justify-content: flex-start;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 999px;
  background: rgba(15, 23, 42, .5);
}
.employee-main {
  width: min(1040px, 100%);
  margin-inline: auto;
  padding: clamp(14px, 4vw, 24px);
}
.employee-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.employee-page-head h1 {
  margin: 0;
  font-size: clamp(1.65rem, 7vw, 2.8rem);
  line-height: 1.15;
}
.employee-page-head p {
  margin: 8px 0 0;
  color: var(--muted);
}
.employee-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
.employee-grid > * {
  grid-column: span 4;
  min-width: 0;
}
.employee-grid > .full,
.employee-grid > .status-strip,
.employee-grid > .quick-action-grid,
.employee-grid > .employee-hero-card {
  grid-column: 1 / -1;
}
.employee-card,
.employee-hero-card,
.status-strip {
  min-width: 0;
  max-width: 100%;
}
.employee-actions-row,
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.employee-actions-row .button,
.quick-action-card {
  width: 100%;
  min-width: 0;
}
.avatar-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;
}
.avatar-fallback,
.avatar-wrap .avatar {
  width: 100%;
  height: 100%;
  border-radius: inherit;
}
.avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(34, 211, 238, .95), rgba(14, 165, 233, .75));
  color: #02111f;
  font-weight: 900;
}
.avatar-fallback[hidden] {
  display: none;
}
.employee-live-alert {
  position: fixed;
  inset-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid rgba(34, 211, 238, .42);
  border-radius: 18px;
  background: rgba(8, 20, 36, .96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .38);
}
.employee-live-alert button {
  border: 0;
  color: #e5f7ff;
}
.employee-live-alert [data-alert-open] {
  display: grid;
  gap: 3px;
  text-align: start;
  background: transparent;
}
.employee-live-alert strong,
.employee-live-alert span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.employee-live-alert span {
  color: #a9c4df;
  font-size: .82rem;
}
.employee-live-alert [data-alert-close] {
  width: 40px;
  border-radius: 14px;
  background: rgba(148, 163, 184, .12);
  font-size: 1.35rem;
}

/* Mobile GPS, notification and executive header corrections - 2026-04-30 */
.employee-live-alert {
  left: 50%;
  right: auto;
  width: min(540px, calc(100vw - 20px));
  transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom));
  animation: employee-alert-in .18s ease-out;
}

@keyframes employee-alert-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 760px) {
  .admin-app .topbar,
  .executive-mobile-app .topbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center !important;
    min-height: auto !important;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 0 0 16px 16px;
    gap: 8px;
  }

  .admin-app .topbar h1,
  .executive-mobile-app .topbar h1 {
    font-size: 22px;
    line-height: 1.2;
  }

  .admin-app .topbar h1::before,
  .executive-mobile-app .topbar h1::before {
    margin-bottom: 4px;
    padding: 3px 9px;
    font-size: 10px;
  }

  .admin-app .topbar p,
  .executive-mobile-app .topbar p {
    display: none;
  }

  .admin-app .topbar .toolbar,
  .executive-mobile-app .topbar .toolbar {
    display: flex;
    grid-column: 1 / -1;
    width: 100%;
    gap: 6px;
  }

  .admin-app .mobile-menu,
  .executive-mobile-app .mobile-menu {
    width: auto;
    min-height: 40px;
    padding: 8px 12px;
  }

  .admin-app .sidebar,
  .executive-mobile-app .sidebar {
    padding: 10px;
  }

  .admin-app .brand,
  .executive-mobile-app .brand {
    min-height: 58px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 16px;
  }

  .admin-app .brand img,
  .executive-mobile-app .brand img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .admin-app .nav,
  .executive-mobile-app .nav {
    gap: 8px;
    padding-bottom: 18px;
  }
}
@media (max-width: 700px) {
  .employee-shell {
    padding-bottom: 96px;
  }
  .employee-topbar {
    min-height: 58px;
    padding: 8px 12px;
  }
  .employee-brand {
    flex: 0 0 auto;
    gap: 8px;
  }
  .employee-brand img,
  .employee-user .avatar-wrap,
  .employee-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 13px;
  }
  .employee-brand strong,
  .employee-user strong {
    font-size: .9rem;
  }
  .employee-brand span,
  .employee-user small {
    display: none;
  }
  .employee-user {
    flex: 1 1 auto;
    max-width: 48%;
    min-height: 46px;
    padding: 5px 8px;
  }
  .employee-main {
    padding: 14px 12px;
  }
  .employee-page-head {
    margin-bottom: 12px;
  }
  .employee-page-head h1 {
    font-size: 1.8rem;
  }
  .employee-page-head p {
    font-size: .92rem;
  }
  .employee-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .employee-grid > * {
    grid-column: 1 / -1;
  }
  .employee-actions-row,
  .quick-action-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .employee-card,
  .employee-hero-card,
  .status-strip {
    overflow: hidden;
  }
}
@media (max-width: 380px) {
  .employee-brand div {
    display: none;
  }
  .employee-user {
    max-width: calc(100% - 54px);
  }
}

/* v1.3.4 — executive live presence, risk scoring, decisions and monthly PDF */
.live-map-board{
  position:relative; min-height:420px; overflow:hidden; border-radius:28px;
  background:
    radial-gradient(circle at 18% 22%, rgba(34,197,94,.18), transparent 18%),
    radial-gradient(circle at 70% 35%, rgba(59,130,246,.16), transparent 20%),
    linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,41,59,.88));
  border:1px solid rgba(148,163,184,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.live-map-board::before{content:"";position:absolute;inset:20px;border:1px dashed rgba(226,232,240,.22);border-radius:24px;background-image:linear-gradient(rgba(255,255,255,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.06) 1px,transparent 1px);background-size:52px 52px;opacity:.65}
.map-pin{position:absolute;left:var(--x);top:var(--y);transform:translate(-50%,-50%);display:grid;gap:4px;min-width:160px;max-width:220px;padding:10px 12px;border-radius:18px;background:rgba(255,255,255,.94);color:#0f172a;text-decoration:none;box-shadow:0 18px 45px rgba(0,0,0,.28);border:1px solid rgba(15,23,42,.08);z-index:1}
.map-pin::before{content:"";position:absolute;left:50%;bottom:-9px;transform:translateX(-50%) rotate(45deg);width:18px;height:18px;background:inherit;border-right:1px solid rgba(15,23,42,.08);border-bottom:1px solid rgba(15,23,42,.08)}
.map-pin strong,.map-pin span{position:relative;z-index:1}.map-pin span{font-size:12px;color:#475569}.map-pin.risk-HIGH{border-color:#ef4444}.map-pin.risk-MEDIUM{border-color:#f97316}.map-pin.risk-LOW{border-color:#eab308}.map-pin.risk-CLEAR{border-color:#22c55e}
.danger-soft{background:rgba(239,68,68,.12)!important;color:#991b1b!important;border-color:rgba(239,68,68,.25)!important}.decision-card.is-acknowledged{border-color:rgba(34,197,94,.35)}
@media print{.sidebar,.topbar,.executive-topbar,.button,.toolbar,.nav-section,.admin-shell>aside{display:none!important}.main,.content,.executive-main{margin:0!important;padding:0!important;max-width:none!important}.panel,.employee-card{box-shadow:none!important;border:1px solid #ddd!important;break-inside:avoid}.print-area{display:block!important}body{background:#fff!important;color:#111!important}}

/* ========================================================================== 
   EXECUTIVE PORTAL STYLES 
   ========================================================================== */

.executive-portal-app {
  min-height: 100vh;
  background: var(--bg);
}

.executive-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.executive-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  background: rgba(7, 15, 30, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.executive-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.executive-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  border: 1px solid var(--border-strong);
}

.executive-brand strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: var(--text-strong);
  line-height: 1.2;
}

.executive-brand span {
  display: block;
  font-size: 11px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.executive-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.executive-tabs::-webkit-scrollbar { display: none; }

.executive-tabs button {
  white-space: nowrap;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.executive-tabs button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.executive-tabs button.is-active {
  background: linear-gradient(135deg, var(--brand), #1A6EFF);
  color: #031022;
  font-weight: 900;
  box-shadow: 0 4px 16px rgba(0, 194, 255, 0.32);
}

.executive-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.executive-main {
  flex: 1;
  padding: clamp(18px,2.5vw,32px) clamp(14px,2.5vw,24px);
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.executive-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.executive-page-head h1 {
  margin: 8px 0 0;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 900;
  color: var(--text-strong);
}

.panel-kicker {
  font-size: 12px;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.executive-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: 40px;
  background: linear-gradient(135deg, var(--surface-raised) 0%, var(--bg-deep) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.score-ring {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border: 6px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
}

.score-ring strong {
  font-size: 28px;
  font-weight: 900;
  color: var(--brand);
}

.score-ring span {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.executive-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.exec-metric {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 20px;
  transition: transform 0.2s ease;
}

.exec-metric:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
}

.executive-focus-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.executive-employee-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: all 0.2s ease;
}

.executive-employee-card:hover {
  background: var(--surface-raised);
  border-color: var(--brand);
}

.mini-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}

.mini-card-actions .button {
  white-space: nowrap;
  width: 100%;
  justify-content: center;
}

.admin-app .topbar {
  min-height: 88px;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(13, 23, 41, 0.98), rgba(7, 15, 30, 0.98));
  border-bottom: 1px solid var(--border-strong);
}

.admin-app .toolbar {
  gap: 14px;
}

.admin-app .user-chip {
  background: var(--surface-raised);
  border-color: var(--brand);
}

.executive-login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, rgba(56, 199, 244, 0.1), transparent), var(--bg-deep);
  padding: clamp(10px, 2.5vw, 20px);
}

.executive-login-panel {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  overflow: auto;
  padding: clamp(18px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: clamp(12px, 2.2vh, 20px);
}

.login-mark {
  width: 56px;
  height: 56px;
  background: var(--brand);
  color: #000;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 10px;
}

@media (max-width: 1024px) {
  .executive-topbar { flex-direction: column; align-items: flex-start; gap: 16px; }
  .executive-user { width: 100%; justify-content: space-between; }
  .executive-tabs { width: 100%; }
}

@media (max-width: 768px) {
  .executive-hero { flex-direction: column; text-align: center; }
  .executive-focus-grid .span-7,
  .executive-focus-grid .span-5,
  .executive-focus-grid .span-4 {
    grid-column: span 12;
  }
}

.executive-filters {
  grid-column: span 12;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.executive-list-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.executive-detail-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.employee-detail-hero {
  background: linear-gradient(135deg, var(--surface-raised) 0%, var(--bg-deep) 100%);
  padding: 32px;
  border: 1px solid var(--border-strong);
}

.person-cell.large {
  display: flex;
  align-items: center;
  gap: 20px;
}

.person-cell.large strong {
  display: block;
  font-size: 24px;
  font-weight: 900;
}

.person-cell.large small {
  font-size: 14px;
  color: var(--muted);
}

.admin-app .sidebar {
  background: rgba(6, 13, 26, 0.96);
  backdrop-filter: blur(24px);
  border-inline-start: 1px solid var(--border-strong);
}

.admin-app .nav button:hover {
  background: rgba(56, 199, 244, 0.1);
  border-color: var(--brand);
  color: var(--brand);
}

.admin-app .nav button.is-active {
  background: linear-gradient(90deg, rgba(56, 199, 244, 0.15), transparent);
  border-right: 4px solid var(--brand);
  color: var(--brand);
}

/* Comprehensive Mobile Responsiveness Pack */
@media (max-width: 640px) {
  .admin-app .topbar {
    flex-direction: column;
    min-height: auto;
    padding: 12px;
    gap: 12px;
  }
  
  .admin-app .toolbar {
    width: 100%;
    justify-content: space-around;
    gap: 8px;
  }
  
  .admin-app .user-chip span,
  .admin-app .role-chip {
    display: none !important;
  }
  
  .admin-app .user-chip {
    padding: 4px;
    border-radius: 50%;
    max-width: none;
  }
  
  .executive-employee-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
  }
  
  .executive-employee-card > div:not(.mini-card-actions) {
    width: 100%;
  }
  
  .mini-card-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    min-width: 0;
    gap: 10px;
    margin-top: 10px;
  }
  
  .mini-card-actions .button {
    flex: 1 1 calc(50% - 5px);
    min-width: 120px;
    white-space: nowrap;
  }
  
  .mini-card-actions .status {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* Global System Polish & Consistency */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(140px, 20vw, 240px), 1fr));
  gap: 16px;
  margin-top: 20px;
}

.panel-head {
  flex-wrap: wrap;
  gap: 16px;
}

.panel-head > div {
  flex: 1 1 300px;
}

@media (max-width: 480px) {
  .panel {
    padding: 16px;
  }
  
  .metric {
    min-height: 120px;
    padding: 14px;
  }
  
  .metric strong {
    font-size: 24px;
  }
  
  .topbar h1 {
    font-size: 22px;
  }
}

/* Final Precision Layout Fixes */
.employee-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
}

@media (max-width: 1200px) {
  .employee-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .employee-card-grid {
    grid-template-columns: 1fr !important;
  }
  
  .executive-employee-card {
    flex-direction: column !important;
    height: auto !important;
  }
  
  .mini-card-actions {
    width: 100% !important;
    min-width: 0 !important;
    flex-direction: row !important;
  }
}

.admin-app .user-chip {
  min-height: 44px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-app .user-chip .avatar {
  flex-shrink: 0;
}

/* Final Refinement */
.admin-app .user-chip {
  border-radius: 999px !important;
  padding: 6px 12px !important;
  min-width: auto !important;
}

.executive-employee-card {
  max-width: 100%;
  overflow: visible !important;
}

.executive-employee-card .mini-card-actions {
  flex-shrink: 0 !important;
  margin-inline-start: auto;
}

/* Final Fix for Score Ring Size and Stretching */
.score-ring {
  flex: 0 0 100px !important; /* Prevent stretching and fix width */
  width: 100px !important;
  height: 100px !important;
  border-width: 4px !important;
}

.score-ring strong {
  font-size: 20px !important;
}

/* Sidebar & Header Refactor for Mobile */
.sidebar-account-section {
  padding: 16px;
  margin: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.sidebar-account-section .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sidebar-account-section .user-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-bold);
}

.sidebar-account-section .user-info small {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
}

.sidebar-account-section .account-actions {
  display: flex;
  gap: 8px;
}

.sidebar-account-section .account-actions button {
  flex: 1;
  font-size: 12px;
  padding: 8px 4px;
  border-radius: 10px;
}

.compact-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-user-info strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
  color: var(--text-bold);
}

.compact-user-info small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-group.portal-links {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
}

@media (max-width: 900px) {
  .mobile-hidden { display: none !important; }
  .topbar { min-height: 70px !important; padding: 10px 15px !important; }
  .main { padding: 12px !important; }
}

@media (min-width: 901px) {
  .desktop-hidden { display: none !important; }
}

/* Sidebar Logout Styling */
.logout-group {
  margin-top: 30px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 107, 122, 0.15);
}

.logout-item {
  width: 100%;
  text-align: right;
  padding: 14px 20px;
  color: #ff6b7a !important;
  font-weight: 700;
  background: rgba(255, 107, 122, 0.03);
  border: none;
  cursor: pointer;
  display: block;
  transition: all 0.2s ease;
  border-radius: 12px;
}

.logout-item:active {
  background: rgba(255, 107, 122, 0.1);
  transform: scale(0.98);
}

.user-info[data-route] {
  cursor: pointer;
  transition: opacity 0.2s;
}

.user-info[data-route]:active {
  opacity: 0.7;
}

/* Redesigned Executive Cards */
.executive-employee-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px !important;
  background: linear-gradient(180deg, rgba(17, 29, 51, 0.4), rgba(13, 23, 41, 0.6)) !important;
  border: 1px solid rgba(56, 199, 244, 0.15) !important;
  border-radius: 28px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
}

.executive-employee-card .card-main {
  display: flex;
  align-items: center;
  gap: 20px;
}

.executive-employee-card .avatar-side {
  position: relative;
  flex-shrink: 0;
}

.executive-employee-card .avatar-side .person-avatar.large {
  width: 84px !important;
  height: 84px !important;
  border: 3px solid rgba(56, 199, 244, 0.3) !important;
  box-shadow: 0 0 15px rgba(56, 199, 244, 0.1);
}

.executive-employee-card .status-badge-inline {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.executive-employee-card .info-side {
  flex: 1;
}

.executive-employee-card .emp-name {
  display: block;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-bold);
  line-height: 1.2;
}

.executive-employee-card .emp-job-title {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  opacity: 0.8;
}

.executive-employee-card .card-actions-row {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.executive-employee-card .card-actions-row button {
  flex: 1;
  padding: 12px 6px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 14px;
}

/* Executive Detail Page Styling */
.executive-detail-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 10px 0 25px;
  padding: 24px;
  background: rgba(56, 199, 244, 0.04);
  border-radius: 28px;
  border: 1px solid rgba(56, 199, 244, 0.1);
}

.detail-avatar-side {
  position: relative;
  flex-shrink: 0;
}

.detail-avatar-side .person-avatar.large {
  width: 100px !important;
  height: 100px !important;
  border: 4px solid var(--brand) !important;
  box-shadow: 0 0 20px rgba(56, 199, 244, 0.2);
}

.detail-status-badge {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  transform-origin: center;
  scale: 1.1;
}

.detail-name {
  font-size: 28px !important;
  font-weight: 900 !important;
  color: var(--text-bold);
  margin: 0 0 6px 0 !important;
  line-height: 1.1;
}

.detail-job-title {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 15px;
  opacity: 0.8;
}

.detail-meta-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.tag.success { background: rgba(56, 199, 244, 0.1); color: var(--brand); border: 1px solid rgba(56, 199, 244, 0.2); }
.tag.warning { background: rgba(255, 171, 0, 0.1); color: #ffab00; border: 1px solid rgba(255, 171, 0, 0.2); }
.tag.danger { background: rgba(255, 82, 82, 0.1); color: #ff5252; border: 1px solid rgba(255, 82, 82, 0.2); }

@media (max-width: 600px) {
  .executive-detail-header { flex-direction: column; text-align: center; gap: 20px; }
  .detail-meta-tags { justify-content: center; }
}

/* Vertical Profile Card Styling */
.executive-employee-card {
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 28px 16px !important;
  min-height: 320px;
  justify-content: space-between;
}

.card-avatar-box {
  position: relative;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
}

.card-avatar-box .person-avatar.large {
  width: 90px !important;
  height: 90px !important;
  border-color: var(--brand) !important;
}

.status-badge-floating {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  scale: 1.1;
}

.card-info-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.card-info-box .emp-name {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: var(--text-bold);
  line-height: 1.3;
}

.card-info-box .emp-job-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.employee-card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 24px !important;
  padding: 10px;
}

/* Corner Status Badge */
.executive-employee-card {
  position: relative !important;
}

.card-status-corner {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  transform: scale(0.9);
  transform-origin: top left;
}

/* Redesigned Employee Directory Cards */
.executive-person-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-soft) !important;
  border: 1px solid var(--border) !important;
  border-radius: 28px !important;
  padding: 0 !important;
  overflow: hidden;
  transition: all 0.25s ease;
  position: relative;
  min-height: 440px;
}

.executive-person-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.executive-person-card .card-selection {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.executive-person-card .card-header {
  padding: 30px 20px 15px;
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, rgba(56, 199, 244, 0.08), transparent);
}

.executive-person-card .avatar-wrapper {
  position: relative;
  cursor: pointer;
}

.executive-person-card .avatar-wrapper .person-avatar.large {
  width: 96px !important;
  height: 96px !important;
  border: 4px solid var(--brand) !important;
  box-shadow: 0 0 20px rgba(56, 199, 244, 0.2);
}

.executive-person-card .status-badge-corner {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  scale: 1.05;
}

.executive-person-card .card-body {
  padding: 0 24px 24px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.executive-person-card .emp-name {
  font-size: 21px !important;
  font-weight: 900 !important;
  margin-bottom: 6px !important;
  color: var(--text-bold);
  line-height: 1.2;
}

.executive-person-card .emp-job {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 600;
  opacity: 0.8;
}

.executive-person-card .emp-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: right;
  margin-top: auto;
}

.executive-person-card .detail-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.executive-person-card .detail-item.full {
  grid-column: span 2;
}

.executive-person-card .detail-item span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  opacity: 0.6;
}

.executive-person-card .detail-item strong {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.executive-person-card .card-footer-actions {
  display: flex;
  padding: 18px 24px;
  gap: 10px;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid var(--border);
}

.executive-person-card .card-footer-actions button {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 4px;
  border-radius: 12px;
}

.people-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 30px !important;
  padding: 15px 0;
}

/* Request Center Modern Cards */
.request-card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  gap: 24px !important;
  margin-top: 24px;
}

.request-card {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--border) !important;
  border-radius: 24px !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.request-card.is-pending {
  background: linear-gradient(145deg, rgba(56, 199, 244, 0.05), transparent) !important;
  border-color: rgba(56, 199, 244, 0.3) !important;
  box-shadow: 0 8px 20px rgba(56, 199, 244, 0.05);
}

.request-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.request-card .requester-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.request-card .requester-info strong {
  display: block;
  font-size: 15px;
  color: var(--text-bold);
}

.request-card .requester-info small {
  font-size: 12px;
  color: var(--brand);
  font-weight: 700;
}

.request-card .card-body {
  flex: 1;
  margin-bottom: 24px;
}

.request-card .card-body h3 {
  font-size: 18px !important;
  margin-bottom: 10px !important;
  color: var(--text-soft);
}

.request-card .request-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.request-card .workflow-hint {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  font-size: 11px;
  font-style: italic;
  color: var(--text-soft);
}

.request-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.request-card .selection-area {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.request-card .action-buttons {
  display: flex;
  gap: 10px;
}

.request-card .action-buttons button {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
}

.request-card .decision-made {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--brand);
  font-weight: 800;
  background: rgba(56, 199, 244, 0.05);
  padding: 10px;
  border-radius: 12px;
}

/* HR 092 operations monitors: notifications, live location, unified employee profile, executive command room */
.ops-monitor-page .accent-panel,
.executive-ops-page .accent-panel,
.unified-employee-profile .accent-panel {
  border: 1px solid rgba(96, 165, 250, .24);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, .22), transparent 34%),
    linear-gradient(145deg, rgba(15, 23, 42, .98), rgba(17, 24, 39, .94));
}
.ops-monitor-page .health-strip {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.ops-card {
  position: relative;
  overflow: hidden;
}
.ops-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #38bdf8, #8b5cf6, #22c55e);
  opacity: .85;
}
.unified-profile-metrics {
  margin-top: 1rem;
}
.quick-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.quick-insight-grid > div {
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 18px;
  padding: .85rem;
  background: rgba(15, 23, 42, .62);
}
.quick-insight-grid span,
.quick-insight-grid small {
  display: block;
  color: rgba(226, 232, 240, .74);
  font-size: .78rem;
}
.quick-insight-grid strong {
  display: block;
  margin: .25rem 0;
  font-size: 1rem;
  color: #fff;
}
.employee-unified-hero .person-cell.large {
  align-items: center;
}
.executive-ops-page .executive-employee-card {
  border: 1px solid rgba(59, 130, 246, .18);
  background:
    linear-gradient(160deg, rgba(15, 23, 42, .96), rgba(30, 41, 59, .72));
}
.executive-ops-page .card-actions-row {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}
.executive-ops-page .tag,
.unified-employee-profile .tag {
  display: inline-flex;
  width: fit-content;
  margin-top: .35rem;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  border: 1px solid rgba(148, 163, 184, .25);
}
.executive-ops-page .tag.success { color: #bbf7d0; background: rgba(34, 197, 94, .14); }
.executive-ops-page .tag.warning { color: #fde68a; background: rgba(245, 158, 11, .14); }
.executive-ops-page .tag.danger { color: #fecaca; background: rgba(239, 68, 68, .14); }
@media (max-width: 900px) {
  .quick-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .quick-insight-grid { grid-template-columns: 1fr; }
  .executive-ops-page .card-actions-row .button { width: 100%; }
}

/* 094 workflow/mobile binding polish */
.workflow-automation-strip,
.workflow-automation-page .accent-panel,
.mobile-alignment-page .accent-panel {
  background: linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(168, 85, 247, .12)), var(--card, #101828);
  border: 1px solid rgba(125, 211, 252, .18);
}
.workflow-automation-page .tag,
.mobile-alignment-page .tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border-radius: 999px;
  padding: .22rem .55rem;
  font-size: .78rem;
  margin: .12rem;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
.workflow-automation-page .tag.warning,
.mobile-alignment-page .tag.warning {
  background: rgba(245, 158, 11, .14);
  border-color: rgba(245, 158, 11, .35);
}
.workflow-automation-page .metric-grid,
.mobile-alignment-page .metric-grid,
.workflow-automation-strip .metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
@media (max-width: 720px) {
  .workflow-automation-page .panel,
  .mobile-alignment-page .panel { padding: 14px; }
}

/* v095 KPI workflow + navigation polish */
.kpi-page .accent-panel {
  border: 1px solid rgba(59, 130, 246, 0.32);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.94));
}
.kpi-policy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1rem;
}
.kpi-policy-strip span {
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(15, 23, 42, .62);
  border-radius: 999px;
  padding: .52rem .78rem;
  color: #dbeafe;
  font-size: .88rem;
}
.nested-metrics .metric, .kpi-page .metric {
  min-height: 94px;
  border-color: rgba(96, 165, 250, .24);
}
.kpi-page .notice {
  border-radius: 1rem;
  border: 1px solid rgba(251, 191, 36, .38);
  background: rgba(251, 191, 36, .1);
  color: #fde68a;
  padding: .85rem 1rem;
  line-height: 1.7;
}
.kpi-page .muted, .chip.muted {
  color: #94a3b8;
}
.kpi-page .chip.success {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .12);
  color: #bbf7d0;
}
.sidebar .nav-group, .employee-bottom-nav, .employee-shell .mobile-bottom-nav {
  backdrop-filter: blur(14px);
}
.badge.status-self_submitted { background: rgba(59, 130, 246, .18); color: #bfdbfe; border-color: rgba(59, 130, 246, .28); }
.badge.status-manager_approved { background: rgba(139, 92, 246, .18); color: #ddd6fe; border-color: rgba(139, 92, 246, .28); }
.badge.status-hr_reviewed { background: rgba(14, 165, 233, .18); color: #bae6fd; border-color: rgba(14, 165, 233, .28); }
.badge.status-secretary_reviewed { background: rgba(245, 158, 11, .18); color: #fde68a; border-color: rgba(245, 158, 11, .28); }
.badge.status-executive_approved { background: rgba(34, 197, 94, .18); color: #bbf7d0; border-color: rgba(34, 197, 94, .28); }

/* ============================================================
   HR v099 — UX & Accessibility Enhancements
   ============================================================ */

/* ── Smooth page transitions ── */
.main > * {
  animation: hr-slide-in .28s ease both;
}
@keyframes hr-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading skeleton state ── */
.is-loading .panel,
.is-loading .card {
  pointer-events: none;
}

.skeleton-text {
  display: inline-block;
  height: 1em;
  border-radius: 6px;
  background: linear-gradient(90deg,rgba(38,53,80,.5) 25%,rgba(38,53,80,.8) 50%,rgba(38,53,80,.5) 75%);
  background-size: 200% 100%;
  animation: hr-skeleton 1.6s ease infinite;
}
@keyframes hr-skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state enhancements ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 17px;
}

/* ── Error state ── */
.error-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255,107,122,.1);
  border: 1px solid rgba(255,107,122,.32);
  color: #ffd5da;
  font-size: 14px;
  line-height: 1.65;
}

.success-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(73,211,154,.1);
  border: 1px solid rgba(73,211,154,.32);
  color: #b3f0d6;
  font-size: 14px;
  line-height: 1.65;
}

/* ── Button loading spinner ── */
.button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.button.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% 50% auto auto;
  width: 16px;
  height: 16px;
  margin: -8px -8px 0 0;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hr-spin .7s linear infinite;
}

@keyframes hr-spin {
  to { transform: rotate(360deg); }
}

/* ── Focus visible improvements ── */
:focus-visible {
  outline: 2px solid rgba(56,199,244,.5) !important;
  outline-offset: 3px !important;
}

/* ── Nav active indicator refinement ── */
.nav button.is-active {
  box-shadow: inset -4px 0 0 var(--brand), 0 2px 12px rgba(56,199,244,.12);
}

/* ── Topbar brand label ── */
.topbar h1::before {
  content: "نظام الحضور — أحلى شباب";
  display: table;
  margin-bottom: 8px;
  padding: 4px 13px;
  border: 1px solid rgba(56,199,244,.4);
  border-radius: 999px;
  background: rgba(56,199,244,.1);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  -webkit-text-fill-color: var(--brand);
}

/* ── Panel accent ── */
.accent-panel {
  border-color: rgba(56,199,244,.36) !important;
  background: linear-gradient(135deg,rgba(14,32,58,.98),rgba(10,21,42,.96)) !important;
}

/* ── Mini stats row ── */
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.mini-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}

.mini-stats span {
  color: var(--muted);
  font-size: 11px;
}

.mini-stats strong {
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

/* ── Data grid improvements ── */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 8px;
  margin-top: 10px;
}

.meta-grid span {
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
}

/* ── HR Toast (fallback if v10 not loaded) ── */
.hr-toast {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translate(-50%,-12px);
  width: max-content;
  min-width: min(260px, calc(100vw - 24px));
  max-width: min(90vw, 500px);
  padding: 13px 18px;
  border-radius: 16px;
  background: rgba(10,20,38,.97);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 16px 42px rgba(0,0,0,.36);
  z-index: 100000;
  opacity: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease;
}

.hr-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hr-toast.error { border-color: rgba(255,107,122,.46); }
.hr-toast.ok    { border-color: rgba(73,211,154,.46); }

/* ── Responsive topbar ── */
@media (max-width: 900px) {
  .topbar {
    min-height: auto;
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar h1 { font-size: clamp(20px,6vw,28px); }
  .role-chip, .user-chip { display: none; }
}

/* ── Mobile sidebar overlay ── */
@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.58);
    z-index: 35;
    backdrop-filter: blur(3px);
  }

  .sidebar-close {
    display: flex;
    position: absolute;
    top: 18px;
    inset-inline-end: 14px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    z-index: 50;
  }

  .mobile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
  }
}

/* ════════════════════════════════════════════════════════════
   v101 COMPREHENSIVE UI/UX IMPROVEMENTS
   ════════════════════════════════════════════════════════════ */

/* ── Button ripple effect ── */
.button {
  position: relative;
  overflow: hidden;
}
.button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,.22) 0%, transparent 65%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  border-radius: inherit;
}
.button:active::after { opacity: 1; transition: opacity 0s; }

/* ── Dashboard metric card count-up support ── */
.metric-card {
  transition: transform .2s, box-shadow .2s;
}
.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 72px rgba(0,0,0,.44);
}
.metric-value[data-count] {
  display: inline-block;
}
.metric-value.counting {
  animation: countPulse .3s ease;
}
@keyframes countPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); color: var(--brand); }
  100% { transform: scale(1); }
}

/* ── Sticky table headers ── */
.data-table-wrap { overflow: auto; max-height: 70vh; border-radius: var(--radius-md); }
.data-table thead th,
table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-raised);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border-strong);
  white-space: nowrap;
}
.data-table thead th::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 1px;
  background: var(--brand);
  opacity: .3;
}

/* ── Mobile table improvements ── */
@media (max-width: 640px) {
  .data-table, .data-table thead, .data-table tbody,
  .data-table th, .data-table td, .data-table tr {
    display: block;
  }
  .data-table thead tr { position: absolute; top: -9999px; left: -9999px; }
  .data-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 4px 0;
    background: var(--surface);
  }
  .data-table td {
    border: none;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
  }
  .data-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    min-width: 90px;
    flex-shrink: 0;
  }
}

/* ── Form validation states ── */
.field-wrap {
  position: relative;
}
input.is-valid, select.is-valid, textarea.is-valid {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 3px rgba(73,211,154,.14) !important;
}
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(255,107,122,.14) !important;
  animation: shake .35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.field-error {
  display: block;
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
}
.field-error.visible {
  opacity: 1;
  transform: translateY(0);
}
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Better empty states ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.empty-state::before {
  content: attr(data-icon);
  font-size: 42px;
  line-height: 1;
  opacity: .55;
  display: block;
  margin-bottom: 4px;
}
.empty-state strong {
  color: var(--text);
  font-size: 15px;
  display: block;
}
.empty-state .button { margin-top: 8px; }

/* ── Keyboard shortcut hint badges ── */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
  color: var(--muted);
  font-size: 10px;
  font-family: ui-monospace, 'SF Mono', monospace;
  letter-spacing: .04em;
  line-height: 1.4;
  box-shadow: 0 1px 0 var(--border-strong);
}
.nav-link .kbd {
  margin-inline-start: auto;
  opacity: 0;
  transition: opacity .2s;
}
.nav-link:hover .kbd,
.nav-link:focus .kbd { opacity: 1; }

/* ── Admin sidebar search ── */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 10px;
  padding: 8px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.sidebar-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.sidebar-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
}
.sidebar-search input::placeholder { color: var(--muted); }
.sidebar-search .search-icon { color: var(--muted); font-size: 14px; }

/* ── Page transition ── */
#app, [data-page], main {
  animation: pageFadeIn .22s ease;
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading progress bar ── */
.progress-bar-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 9999;
  transform-origin: left;
  animation: progressIn .8s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes progressIn {
  from { transform: scaleX(0); opacity: 1; }
  85%  { transform: scaleX(.9); opacity: 1; }
  to   { transform: scaleX(1); opacity: 0; }
}

/* ── Improved print styles ── */
@media print {
  :root {
    --text-bold: #000;
    --text-muted: #555;
    --text-soft: #777;
    --text: #111;
    --bg: #fff;
    --bg-2: #fff;
    --surface: #f8f8f8;
    --border: #ccc;
    --brand: #0066cc;
    --success: #1a7a4a;
    --danger: #c0392b;
    --warning: #b7770d;
    --muted: #666;
  }
  .sidebar, .topbar, .bottom-nav, .fab, .toast-container,
  .button:not(.print-visible), .modal-overlay, .sheet-overlay { display: none !important; }
  .content-area, main, #app { margin: 0 !important; padding: 0 !important; }
  .panel, .employee-card, .metric-card { break-inside: avoid; page-break-inside: avoid; }
  table { border-collapse: collapse; width: 100%; }
  th, td { border: 1px solid #ccc; padding: 8px 10px; color: #111; font-size: 12px; }
  thead th { background: #eee !important; }
  a::after { content: " (" attr(href) ")"; font-size: 10px; color: #555; }
  @page { margin: 1.8cm 1.5cm; }
}

/* ── Scroll to top button ── */
.scroll-top {
  position: fixed;
  bottom: 96px;
  inset-inline-end: 20px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  z-index: var(--z-fab);
  box-shadow: var(--shadow-soft);
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }

/* ── Improved tooltip ── */
[data-tip] {
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.9);
  white-space: nowrap;
  background: rgba(15,23,42,.96);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s, transform .18s;
  z-index: 999;
  max-width: 220px;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Column sort indicator ── */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]::after {
  content: ' ⇅';
  opacity: .35;
  font-size: .85em;
}
th[data-sort="asc"]::after  { content: ' ↑'; opacity: 1; color: var(--brand); }
th[data-sort="desc"]::after { content: ' ↓'; opacity: 1; color: var(--brand); }

/* ── Status badge improvements ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 7px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Skeleton loading improvements ── */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-raised) 25%,
    var(--surface-soft) 37%,
    var(--surface-raised) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 10px;
}
@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 7px; }
.skeleton-text.wide  { width: 75%; }
.skeleton-text.short { width: 40%; }
.skeleton-circle { border-radius: 50%; }

/* ── Focus-visible only (accessibility) ── */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Smooth scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* ── Panel header with action ── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-header h2, .panel-header h3 { margin: 0; }

/* ── Data table row hover ── */
.data-table tbody tr {
  transition: background .15s;
}
.data-table tbody tr:hover {
  background: var(--surface-soft);
}
.data-table tbody tr:active {
  background: var(--surface-raised);
}

/* ── Number formatting in tables ── */
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }

/* ── Alert banners v2 ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid;
  animation: alertSlideIn .25s ease;
}
@keyframes alertSlideIn {
  from { opacity:0; transform: translateY(-8px); }
  to   { opacity:1; transform: translateY(0); }
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert.info    { background: rgba(87,218,245,.08); border-color: rgba(87,218,245,.25); color: #90e8ff; }
.alert.success { background: rgba(73,211,154,.08); border-color: rgba(73,211,154,.25); color: #6fffb8; }
.alert.warning { background: rgba(247,199,107,.08); border-color: rgba(247,199,107,.25); color: #ffd97a; }
.alert.danger  { background: rgba(255,107,122,.08); border-color: rgba(255,107,122,.25); color: #ff9aa5; }

/* Live location mobile polish */
.live-location-section .employee-list {
  display: grid;
  gap: 12px;
}

.live-location-request-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px !important;
  align-items: stretch !important;
  padding: 14px !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, rgba(7, 22, 43, .96), rgba(5, 14, 30, .98)) !important;
  border: 1px solid rgba(0, 194, 255, .22) !important;
}

.live-location-request-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}

.live-location-request-card span,
.live-location-request-card small {
  display: block;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.55;
}

.live-location-request-card .list-item-side {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px !important;
  width: 100%;
}

.live-location-request-card .button,
.live-location-request-card button {
  width: 100%;
  min-height: 42px;
  border-radius: 13px !important;
}

.location-fast-note {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, .22);
  background: rgba(8, 47, 73, .34);
  color: #dff7ff;
}

.location-fast-note span {
  color: rgba(223, 247, 255, .78);
  line-height: 1.6;
}

.executive-location-card {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(34, 211, 238, .25);
  background: linear-gradient(145deg, rgba(8, 47, 73, .42), rgba(15, 23, 42, .82));
}

.executive-location-card > div:first-child {
  display: grid;
  gap: 4px;
}

.executive-location-card span,
.executive-location-card small {
  color: rgba(226, 242, 255, .74);
}

.executive-location-card strong {
  color: #f8fbff;
  font-size: clamp(17px, 4vw, 22px);
  line-height: 1.35;
}

.executive-location-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.executive-location-meta span {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .72);
  border: 1px solid rgba(148, 163, 184, .16);
  word-break: break-word;
}

@media (max-width: 640px) {
  .executive-location-meta {
    grid-template-columns: 1fr;
  }
}

/* v114 profile, executive cards, and live location polish */
.password-change-card {
  border-color: rgba(0, 194, 255, .28) !important;
  background: linear-gradient(160deg, rgba(11, 28, 58, .94), rgba(7, 15, 35, .98)) !important;
  box-shadow: 0 18px 52px rgba(0, 0, 0, .24) !important;
}
.password-change-card .employee-form-grid {
  gap: 12px !important;
}
.password-change-card label {
  display: grid !important;
  gap: 8px !important;
  padding: 12px !important;
  border: 1px solid rgba(148, 163, 184, .18) !important;
  border-radius: 16px !important;
  background: rgba(2, 6, 23, .34) !important;
}
.password-change-card input {
  min-height: 48px !important;
  font-size: 16px !important;
}
.password-change-card .button.full {
  min-height: 50px !important;
}

.employee-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)) !important;
  gap: 16px !important;
}
.executive-employee-card {
  min-height: 286px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-content: start !important;
  justify-items: center !important;
  gap: 12px !important;
  padding: 18px !important;
  text-align: center !important;
  overflow: hidden !important;
}
.executive-employee-card .avatar-button,
.executive-employee-card .card-avatar-box {
  width: 74px !important;
  height: 74px !important;
  display: grid !important;
  place-items: center !important;
}
.executive-employee-card .avatar.large,
.executive-employee-card .person-avatar.large {
  width: 68px !important;
  height: 68px !important;
  border-radius: 18px !important;
}
.executive-employee-card .employee-card-main,
.executive-employee-card .card-info-box {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  gap: 6px !important;
}
.executive-employee-card strong,
.executive-employee-card .emp-name {
  font-size: 16px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}
.executive-employee-card small,
.executive-employee-card .risk-line,
.executive-employee-card .emp-job-title {
  line-height: 1.5 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  color: rgba(211, 226, 246, .82) !important;
}
.executive-employee-card .mini-card-actions,
.executive-employee-card .card-actions-row {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}
.executive-employee-card .button {
  width: 100% !important;
  min-height: 40px !important;
  justify-content: center !important;
}

.live-location-alert-backdrop {
  background: rgba(3, 7, 18, .74) !important;
  backdrop-filter: blur(10px) !important;
}
.live-location-alert-modal {
  width: min(370px, calc(100vw - 32px)) !important;
  max-height: min(78vh, 620px) !important;
  display: grid !important;
  justify-items: center !important;
  gap: 14px !important;
  padding: 24px !important;
  text-align: center !important;
  border: 1px solid rgba(0, 194, 255, .34) !important;
  background: linear-gradient(160deg, rgba(10, 25, 52, .97), rgba(6, 14, 32, .99)) !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42), 0 0 0 1px rgba(0, 194, 255, .08) !important;
}
.live-location-alert-icon {
  width: 56px !important;
  height: 56px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 18px !important;
  background: rgba(0, 194, 255, .14) !important;
  border: 1px solid rgba(0, 194, 255, .38) !important;
  font-size: 28px !important;
}
.live-location-alert-copy {
  display: grid !important;
  gap: 8px !important;
}
.live-location-alert-copy h2 {
  margin: 0 !important;
  font-size: clamp(24px, 7vw, 34px) !important;
  line-height: 1.25 !important;
}
.live-location-alert-copy p {
  margin: 0 !important;
  color: #c9d8ee !important;
  line-height: 1.75 !important;
}
.live-location-alert-actions {
  width: 100% !important;
  display: grid !important;
}
.live-location-alert-actions .button {
  width: 100% !important;
  min-height: 50px !important;
}

@media (max-width: 640px) {
  .employee-card-grid {
    grid-template-columns: 1fr !important;
  }
  .executive-employee-card {
    min-height: 0 !important;
    padding: 16px !important;
  }
}

/* v115 cross-portal UX tightening */
.main {
  padding-top: clamp(12px, 1.6vw, 18px) !important;
}
.topbar {
  min-height: 0 !important;
  padding: 10px 14px !important;
  margin-bottom: 12px !important;
  align-items: center !important;
}
.topbar .page-title h1,
.page-title h1 {
  font-size: clamp(26px, 3.2vw, 42px) !important;
  line-height: 1.08 !important;
  margin: 0 !important;
}
.topbar .page-title p,
.page-title p {
  margin-top: 6px !important;
  line-height: 1.35 !important;
}
.main > .message,
.executive-main > .message {
  width: min(100%, 760px) !important;
  padding: 10px 14px !important;
  min-height: 0 !important;
  margin: 0 0 10px !important;
  border-radius: 14px !important;
  line-height: 1.55 !important;
}
.main > .grid,
.main > .stack {
  margin-top: 8px !important;
}
.executive-topbar {
  min-height: 0 !important;
  padding: 10px 16px !important;
  align-items: center !important;
}
.executive-brand img {
  width: 46px !important;
  height: 46px !important;
}
.executive-tabs {
  gap: 8px !important;
}
.executive-tabs button {
  min-height: 38px !important;
  padding: 8px 14px !important;
}
.executive-user .button,
.executive-user .user-chip {
  min-height: 36px !important;
}
.executive-main {
  padding-block: 16px !important;
}
.executive-page-head {
  margin-bottom: 14px !important;
  padding-bottom: 12px !important;
  align-items: center !important;
}
.executive-page-head h1 {
  font-size: clamp(24px, 3.3vw, 34px) !important;
  margin-top: 6px !important;
}
.executive-hero.panel {
  min-height: 0 !important;
  padding: clamp(18px, 2.4vw, 26px) !important;
  margin-bottom: 16px !important;
}
.executive-metric-grid,
.metric-grid {
  margin-top: 12px !important;
  margin-bottom: 16px !important;
}
.live-location-card-list {
  gap: 10px !important;
}
.live-location-request-card {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  padding: 14px !important;
}
.live-location-request-card strong {
  font-size: clamp(16px, 4vw, 19px) !important;
}
.live-location-request-card .button {
  min-width: 132px !important;
  min-height: 42px !important;
}
@media (max-width: 760px) {
  .topbar {
    padding: 10px !important;
  }
  .executive-topbar {
    gap: 10px !important;
    padding: 10px !important;
  }
  .executive-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }
  .executive-page-head {
    display: grid !important;
    gap: 10px !important;
    text-align: center !important;
    justify-items: center !important;
  }
  .live-location-request-card {
    grid-template-columns: 1fr !important;
    text-align: center !important;
  }
  .live-location-request-card .list-item-side,
  .live-location-request-card .button {
    width: 100% !important;
  }
}
