:root {
  /* Light palette — slate + indigo, matched to the mobile app theme. */
  --bg: #f1f5f9;
  /* app background (slate-100) */
  --surface: #ffffff;
  /* cards, sidebar */
  --surface-2: #f8fafc;
  /* inputs, subtle panels (slate-50) */
  --border: #e2e8f0;
  /* slate-200 */
  --border-strong: #cbd5e1;
  /* slate-300 */
  --text: #0f172a;
  /* slate-900 */
  --muted: #64748b;
  /* slate-500 */
  --primary: #4f46e5;
  /* indigo-600 */
  --primary-600: #4338ca;
  /* indigo-700 */
  --primary-soft: #eef2ff;
  /* indigo-50 */
  --danger-soft: #fee2e2;
  /* red-100 */
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --info: #0ea5e9;
  --info-soft: #e0f2fe;
  --danger: #dc2626;
  --text-faint: #94a3b8;
  /* slate-400 */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 4px 12px rgba(15, 23, 42, .10), 0 2px 4px rgba(15, 23, 42, .06);
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must win over component display rules (e.g. .login-wrap{display:grid}). */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #e0e7ff 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
}

.muted {
  color: var(--muted);
}

.tiny {
  font-size: 12px;
}

.center {
  text-align: center;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.grow {
  flex: 1;
}

.hidden {
  display: none !important;
}

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn-danger {
  background: transparent;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, .08);
  border-color: #fca5a5;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.brand h1 {
  font-size: 24px;
  margin: 0;
  font-weight: 800;
}

.brand p {
  margin: 2px 0 0;
}

.brand-center {
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: contain;
}

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

.field>span {
  font-weight: 600;
}

input,
select,
textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: .15s;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

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

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

/* ---------- App shell: sidebar (desktop) + main ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 264px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 18px;
}

.side-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex: none;
}

.side-brand-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.side-brand-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 11px 10px;
  border-radius: 11px;
  color: var(--muted);
  font: inherit;
}

.nav-item ion-icon {
  font-size: 20px;
  flex: none;
}

.nav-label {
  font-size: 15px;
  font-weight: 600;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft, #eef2ff);
  color: var(--primary);
}

.nav-item.active .nav-label {
  font-weight: 700;
}

.side-spacer {
  flex: 1;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 10px;
}

.user-card .avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 14px;
}

.user-meta {
  min-width: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn,
.logout-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 11px;
  border-radius: 12px;
  width: 100%;
}

.logout-btn ion-icon,
.logout-pill ion-icon {
  font-size: 18px;
}

.logout-btn:hover {
  background: rgba(220, 38, 38, .06);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

#screenTitle {
  font-size: 18px;
  margin: 0;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  display: none;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.logout-pill {
  width: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--danger-soft, #fee2e2);
  border-color: transparent;
  font-size: 13px;
  display: none;
}

.icon-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
}

.icon-btn:active {
  transform: scale(.94);
}

.badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge.admin {
  color: #b45309;
  border-color: #fde68a;
  background: #fef3c7;
}

.badge.employee {
  color: #0369a1;
  border-color: #bae6fd;
  background: #e0f2fe;
}

/* ---------- Bottom tab bar (mobile only) ---------- */
.tabbar {
  display: none;
}

.tabbar button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
}

.tabbar button .ic {
  font-size: 22px;
  line-height: 1;
}

.tabbar button.active {
  color: var(--primary);
}

.tabbar button span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- Mobile overrides ---------- */
@media (max-width: 899px) {
  .shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .top-logo {
    display: block;
  }

  .logout-pill {
    display: flex;
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .page {
    padding-bottom: 84px;
  }

  /* clear the fixed tab bar */
}

/* ---------- Page / cards ---------- */
.page {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 18px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

.card h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.card .sub {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (max-width: 760px) {

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Stats ---------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat .num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat .lbl {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
}

/* ---------- List (tappable rows) ---------- */
.list {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 12px 12px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: var(--surface-2);
}

.list-item:active {
  background: rgba(15, 23, 42, .05);
}

.li-title {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chev {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex: none;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #6366f1);
}

.avatar.lg {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  font-size: 24px;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 700;
  background: var(--surface-2);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-2);
}

td.wrap {
  white-space: normal;
}

/* ---------- Pills ---------- */
.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-block;
}

.pill-office {
  background: rgba(22, 163, 74, .12);
  color: #15803d;
}

.pill-wfh {
  background: rgba(79, 70, 229, .12);
  color: #4338ca;
}

.pill-branch {
  background: rgba(124, 58, 237, .12);
  color: #6d28d9;
}

.pill-intern {
  background: #fef3c7;
  color: #b45309;
}

.pill-employee {
  background: #e0f2fe;
  color: #0369a1;
}

.pill-present {
  background: rgba(22, 163, 74, .12);
  color: #15803d;
}

.pill-pending {
  background: rgba(217, 119, 6, .14);
  color: #b45309;
}

.pill-approved {
  background: rgba(22, 163, 74, .12);
  color: #15803d;
}

.pill-rejected {
  background: rgba(220, 38, 38, .12);
  color: #b91c1c;
}

.pill-active {
  background: rgba(22, 163, 74, .12);
  color: #15803d;
}

.pill-inactive {
  background: rgba(220, 38, 38, .12);
  color: #b91c1c;
}

.pill-leave {
  background: rgba(220, 38, 38, .12);
  color: #b91c1c;
}

.pill-absent {
  background: rgba(220, 38, 38, .16);
  color: #b91c1c;
}

.pill-checkedout {
  background: #e0f2fe;
  color: #0369a1;
}

tr.row-absent td {
  background: rgba(220, 38, 38, .04);
}

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface-2);
}

/* ---------- Calendar ---------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal .dow {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding-bottom: 6px;
}

.cal .cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.cal .cell .d {
  font-weight: 700;
}

.cal .cell.empty {
  background: transparent;
}

/* Day-status colours — matched to the mobile MonthCalendar palette. */
.cell.s-office {
  background: var(--success-soft);
  color: var(--success);
}

.cell.s-present {
  background: var(--success-soft);
  color: var(--success);
}

.cell.s-wfh {
  background: var(--warn-soft);
  color: var(--warn);
}

.cell.s-leave {
  background: var(--info-soft);
  color: var(--info);
}

.cell.s-absent {
  background: var(--danger-soft);
  color: var(--danger);
}

.cell.s-holiday {
  background: var(--surface-2);
  color: var(--text-faint);
}

.cell.s-today {
  background: var(--primary-soft);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.cell.s-upcoming {
  background: transparent;
  color: var(--text-faint);
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

.dot.s-office {
  background: var(--success);
}

.dot.s-wfh {
  background: var(--warn);
}

.dot.s-leave {
  background: var(--info);
}

.dot.s-absent {
  background: var(--danger);
}

.dot.s-holiday {
  background: var(--text-faint);
}

/* ---------- Map ---------- */
.map {
  height: 320px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  z-index: 1;
}

.leaflet-container {
  background: var(--surface-2);
}

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  max-width: 340px;
  font-size: 14px;
  animation: slideIn .2s ease;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warn {
  border-left-color: var(--warn);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ---------- Modal ---------- */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.x-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.cred-box {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 14px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 14px;
}

.cred-box div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.cred-box b {
  color: var(--text);
}

.photo-full {
  max-width: 100%;
  border-radius: 10px;
}

.modal-foot .btn {
  flex: 1;
  justify-content: center;
}

/* On mobile, modals become bottom sheets that slide up. */
@media (max-width: 760px) {
  .modal-back {
    align-items: end;
    padding: 0;
  }

  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    animation: sheetUp .22s ease;
  }

  .modal-foot {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
  }
}

@keyframes sheetUp {
  from {
    transform: translateY(40px);
    opacity: .6;
  }
}

/* ---------- Misc ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
}

.loader {
  text-align: center;
  color: var(--muted);
  padding: 30px;
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form .field {
  flex: 1;
  min-width: 150px;
}

.preview-img {
  width: 90px;
  height: 90px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.cam-video {
  width: 100%;
  max-height: 300px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #000;
  object-fit: cover;
  transform: scaleX(-1);
}

.cam-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  width: auto;
}

.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 14px;
}

.kv .k {
  color: var(--muted);
}

hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ---------- Dashboard (admin overview) ---------- */
.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 2px 0;
}

.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 18px;
  padding: 22px 24px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(79, 70, 229, .25);
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-greeting {
  color: #dbeafe;
  font-size: 14px;
  font-weight: 600;
}

.hero-name {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  margin-top: 2px;
}

.hero-sub {
  color: #c7d2fe;
  font-size: 13px;
  margin-top: 6px;
  font-weight: 500;
}

.hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .18);
  display: grid;
  place-items: center;
  flex: none;
}

.hero-icon ion-icon {
  font-size: 26px;
  color: #fff;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 760px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

.stat-card-ic {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
}

.stat-card-ic ion-icon {
  font-size: 18px;
}

.stat-card .v {
  font-size: 28px;
  font-weight: 800;
  margin-top: 12px;
  line-height: 1;
}

.stat-card .l {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-card .s {
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.kv-big {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.sr-label {
  color: var(--muted);
  font-weight: 600;
}

.sr-value {
  font-size: 18px;
  font-weight: 800;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.recent-item:last-child {
  border-bottom: none;
}

.recent-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-2);
  flex: none;
  cursor: pointer;
}

.recent-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Location status (mark attendance) ---------- */
.loc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 0;
}

.loc-status ion-icon {
  font-size: 18px;
  flex: none;
}

.loc-loading {
  color: var(--muted);
}

.loc-ok {
  color: #15803d;
}

.loc-err {
  color: var(--danger);
}

/* ---------- Too-far-from-office banner ---------- */
.far-banner {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 12px;
  padding: 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.far-title {
  font-weight: 700;
  color: #b45309;
  font-size: 14px;
}

.btn ion-icon {
  font-size: 16px;
}

/* ---------- Charts (monthly summary) ---------- */
.charts-row {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.ring-wrap {
  flex: none;
}

.ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.ring-inner {
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 2px;
}

.ring-pct {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.ring-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 28px;
}

.bar-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.bar-track {
  width: 22px;
  height: 96px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  border-radius: 8px;
  transition: height .25s ease;
}

.bar-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- My Attendance page (mirrors mobile CalendarScreen) ---------- */
.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.month-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
}

.month-btn ion-icon {
  font-size: 20px;
}

.month-btn:disabled {
  cursor: default;
}

.month-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.card-heading {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 16px;
}

/* Two columns on wide screens, stacked on mobile width. */
.sum-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.sum-col {
  flex: 1;
  min-width: 0;
}

@media (max-width: 760px) {
  .sum-grid {
    flex-direction: column;
  }
}

.reg-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mini-stats {
  flex: 1;
  min-width: 220px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-stat {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px;
}

.mini-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.mini-ic ion-icon {
  font-size: 16px;
}

.mini-v {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.mini-l {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}