:root {
  --surface-0: #f0f4f8;
  --surface-1: #ffffff;
  --surface-2: #f1f5f9;
  --glass-bg: #ffffff;
  --glass-border: rgba(37, 99, 235, 0.22);
  --text: #334155;
  --text-heading: #1e293b;
  --muted: #64748b;
  --primary: #2563eb;
  --primary2: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-soft: #eff6ff;
  --shadow: 0 4px 24px rgba(37, 99, 235, 0.1);
  --row-bg: #ffffff;
  --row-border: rgba(37, 99, 235, 0.15);
  --input-bg: #ffffff;
  --input-border: rgba(37, 99, 235, 0.25);
  --sidebar-bg: #1e40af;
  --shell-pad: 20px;
  --sidebar-w: 260px;
  --app-base-font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--surface-0);
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 10% 0%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(ellipse 80% 50% at 95% 10%, rgba(29, 78, 216, 0.1), transparent 50%),
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(59, 130, 246, 0.08), transparent 55%),
    linear-gradient(160deg, #f8fafc 0%, #eff6ff 35%, #f0f4f8 70%, #f8fafc 100%);
  z-index: -1;
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: 18px;
}

.app-frame{
  position: fixed;
  left: var(--shell-pad);
  right: var(--shell-pad);
  top: var(--shell-pad);
  bottom: var(--shell-pad);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  overflow: hidden;
}

.main-area{
  display: grid;
  grid-template-rows: 72px 1fr;
  min-width: 0;
  min-height: 0;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: #f0f4f8;
}

.login-body .glass-card,
.login-body .login-card {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #334155;
}

.login-body .subtitle { color: #64748b; }
.login-body .login-form label { color: #64748b; }
.login-body input {
  background: #ffffff;
  color: #334155;
  border-color: rgba(37, 99, 235, 0.25);
}
.login-body .forgot-link { color: #2563eb; }
.login-body .flash-item.error {
  background: #fef2f2;
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}
.login-wrapper { width: min(420px, 92vw); }
.login-card { padding: 2rem; }
.login-card h1 { font-size: 2.1rem; margin-bottom: .4rem; }
.login-card h1.section-serif { font-size: 2rem; color: #1e293b; }
.subtitle { color: var(--muted); margin-bottom: 1.3rem; }
.login-form { display: grid; gap: .7rem; }
.login-form label { font-size: .9rem; color: var(--muted); }
input {
  width: 100%;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 12px;
  padding: .75rem .9rem;
}
input:focus { outline: 2px solid rgba(37, 99, 235, 0.45); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 2.75rem; }
.ghost-icon {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
}
.forgot-link {
  color: var(--primary);
  text-decoration: none;
  margin: .3rem 0 .6rem;
  font-size: .9rem;
}

.btn-primary, .btn-secondary, .menu-btn {
  border: 0;
  padding: .7rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.btn-primary {
  background: linear-gradient(110deg, var(--primary), var(--primary2));
  color: #ffffff;
}
.btn-secondary {
  background: var(--primary-soft);
  border: 1px solid var(--input-border);
  color: var(--text);
}
.btn-primary:hover, .menu-btn:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }
.btn-secondary:hover { background: var(--primary-light); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); color: var(--primary2); }
.btn-primary:active, .btn-secondary:active, .menu-btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary:disabled, .btn-secondary:disabled, .menu-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary.is-on {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35), 0 8px 24px rgba(37, 99, 235, 0.2);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: .8rem 1rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  color: #334155;
  max-width: min(420px, 90vw);
  z-index: 10050;
}
.toast.hidden { display: none; }
.toast.success { border-color: rgba(34, 197, 94, 0.45); background: #052e16; color: #86efac; }
.toast.warn { border-color: rgba(234, 179, 8, 0.45); background: #422006; color: #fcd34d; }

.flash-box { margin-bottom: .9rem; }
.flash-item { padding: .6rem .8rem; border-radius: 10px; margin-bottom: .4rem; font-size: .9rem; }
.flash-item.error { background: rgba(254, 226, 226, 0.9); border: 1px solid rgba(239, 68, 68, 0.35); color: #991b1b; }

.main-header {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.4rem;
  border-bottom: 1px solid var(--glass-border);
  background: var(--surface-1);
}
.header-title { color: var(--text-heading); font-weight: 700; letter-spacing: .2px; }
.brand { display: flex; align-items: center; gap: .6rem; }
.logo-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fef3c7, var(--gold));
}
.clock { font-variant-numeric: tabular-nums; color: var(--muted); }

.sidebar {
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  background: var(--sidebar-bg);
}

.sidebar-top{
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.sidebar-divider{
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.15), transparent);
}

.sidebar-nav{
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  height: calc(100% - 71px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0;
  margin: 0;
  position: relative;
}
.sidebar-logo {
  width: 75px;
  height: 60px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  border: 0;
  padding: 0;
}
.sidebar-brand-text {
  display: block;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .3px;
  color: var(--text-heading);
}
.menu-btn {
  text-align: left;
  background: var(--primary-soft);
  border: 1px solid transparent;
  color: var(--text);
  text-decoration: none;
}
.menu-btn.active {
  background: var(--primary-light);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--primary2);
  font-weight: 700;
}
.menu-btn.logout {
  margin-top: auto;
  background: #fff5f5;
  border-color: rgba(239, 68, 68, 0.25);
  color: #b91c1c;
  box-shadow: none;
}
.menu-btn.logout:hover {
  background: #fee2e2;
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: none;
}

.content {
  padding: 18px var(--shell-pad) 24px;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.page-section {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}
.page-section.active {
  display: flex;
}
#homeSection.page-section.active {
  overflow-y: auto;
  overflow-x: hidden;
}
#checkinSection.page-section.active,
#checkoutSection.page-section.active {
  overflow: hidden;
}
.settings-card{
  max-width: 520px;
  padding: 1.25rem 1.35rem 1.5rem;
}
.settings-subtitle{
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
}
.settings-hint{
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}
.settings-form{ margin-top: 0.25rem; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.actions-inline { display: flex; gap: .7rem; }

.checkin-top{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}
.checkin-title{
  display: grid;
  gap: .6rem;
}
.small-preview{
  width: 260px;
  padding: .7rem;
  background: var(--primary-soft);
  border: 1px solid var(--glass-border) !important;
}
.small-preview .preview-label{
  font-size: .85rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: .5rem;
}
.small-preview img{
  width: 100%;
  border-radius: 14px;
  display: block;
}
.wide-table{
  padding: 1rem;
  background: var(--surface-1);
  border: 1px solid var(--glass-border) !important;
}
.attendance-table-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.5) rgba(15, 23, 42, 0.25);
}

#attendanceSection .attendance-table-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.attendance-table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.attendance-table-wrap::-webkit-scrollbar-track {
  background: var(--primary-soft);
  border-radius: 8px;
}
.attendance-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.45);
  border-radius: 8px;
  border: 2px solid var(--primary-soft);
}
.attendance-table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(185, 28, 28, 0.55);
}
.attendance-table {
  min-height: min-content;
}

.attendance-table.logs-table {
  width: max-content;
  min-width: 100%;
}

.attendance-table.logs-table.table.big {
  padding: 0.75rem 0.85rem;
}

.attendance-table.logs-table .table-body {
  gap: 0.55rem;
  padding: 0.5rem 0.15rem 0.15rem;
  min-width: max-content;
}

/* 14 columns: Name, Emp ID, Date, Shift + 8 time cols + Total Hours + Status */
.attendance-table.logs-table .logs-head,
.attendance-table.logs-table .logs-row {
  grid-template-columns:
    minmax(7rem, 9rem)
    minmax(5.5rem, 6.75rem)
    minmax(5.5rem, 6.5rem)
    minmax(9rem, 10.5rem)
    repeat(8, minmax(5.25rem, 6rem))
    minmax(9rem, 10.5rem)
    minmax(5.5rem, 6.5rem) !important;
  gap: 0.65rem;
  font-size: 0.8rem;
  align-items: center;
}

.attendance-table.logs-table .logs-head {
  padding: 0.55rem 0.9rem;
}

.attendance-table.logs-table .logs-row {
  padding: 0.6rem 0.9rem;
}

.attendance-table.logs-table .logs-head > div {
  white-space: nowrap;
  min-width: max-content;
  overflow: visible;
  line-height: 1.25;
}

.attendance-table.logs-table .logs-row > div {
  white-space: nowrap;
  min-width: 0;
  line-height: 1.25;
}

.attendance-table.logs-table .logs-row > div:last-child {
  display: flex;
  justify-content: center;
  overflow: visible;
}

.attendance-table.logs-table .pill {
  min-width: 0;
  width: auto;
  max-width: 100%;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.attendance-table-wrap .logs-head {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  background: var(--surface-1);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.table{
  padding: .75rem;
}
.table.big{
  padding: .95rem;
}
.table.compact{ padding: .6rem; }
.table-head{
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr .7fr;
  gap: .6rem;
  padding: .65rem .7rem;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--glass-border);
}
.attendance-table .attendance-head {
  grid-template-columns: 1.25fr 1fr .72fr 1.1fr;
  font-size: .95rem;
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 0 0.35rem;
  padding-top: 0.55rem;
  padding-bottom: 0.65rem;
  background: #eff6ff;
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}
.table-head.small{
  grid-template-columns: 1.2fr .8fr .8fr 1.1fr .4fr;
  font-size: .85rem;
}
.table-body{ display: grid; gap: .7rem; padding: .9rem .25rem .25rem; }
.attendance-table .table-body {
  padding-top: 0.25rem;
}
.table-row{
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr .7fr;
  gap: .6rem;
  align-items: center;
  padding: .95rem .85rem;
  border-radius: 16px;
  background: var(--row-bg);
  border: 1px solid var(--row-border);
}
.table-row.checkin-row{
  grid-template-columns: 1.25fr 1fr .72fr 1.1fr;
  column-gap: 1rem;
}
.time-input{
  width: 100%;
  padding: .55rem .65rem;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
}
.table-row.small{
  grid-template-columns: 1.2fr .8fr .8fr 1.1fr .4fr;
  padding: .6rem .6rem;
}
.table-right{ text-align: right; }
.employee-actions-cell{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .55rem;
}
.row-edit-btn{
  padding: .35rem .6rem;
  border-radius: 9px;
  font-size: .78rem;
  line-height: 1;
}

/* Employee list (home) â€” keep Actions closer (not pushed to far right) */
#employeeGrid .table-row,
#homeSection .table-head{
  /* Name | Emp-ID | Designation | Profile Image | Actions */
  grid-template-columns: 1.25fr .95fr .95fr 140px 1.05fr;
  column-gap: .75rem;
}

.employee-avatar-cell{
  display: flex;
  align-items: center;
  justify-content: center;
}

.employee-actions{
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}

.action-btn{
  padding: .32rem .58rem;
  border-radius: 9px;
  font-size: .78rem;
  line-height: 1;
  border: 1px solid var(--input-border);
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
}
.action-btn:hover{ background: var(--primary-soft); }
.action-btn.danger{
  border-color: rgba(239, 68, 68, 0.35);
  background: #fef2f2;
  color: #b91c1c;
}
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: .38rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--row-border);
  background: var(--surface-1);
  font-size: .9rem;
  color: var(--text);
}
.pill.good{ border-color: rgba(37, 99, 235, 0.45); background: var(--primary-light); color: #1d4ed8; }
.pill.warn{ border-color: rgba(234, 179, 8, 0.4); background: #fffbeb; color: #b45309; }
.pill.bad{ border-color: rgba(239, 68, 68, 0.5); background: #fef2f2; color: #b91c1c; }
.pill.muted{ border-color: var(--row-border); background: #f1f5f9; color: var(--muted); }
.profile-dot{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--glass-border);
  background: var(--primary-soft);
}
.edit-btn{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
}
.edit-btn.is-save{
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--primary-light);
}
.remarks-input{
  width: 100%;
  padding: .55rem .65rem;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
}
.remarks-cell{
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}
.remarks-cell .remarks-input{
  flex: 1;
  min-width: 0;
}
.time-readonly{
  width: fit-content;
  min-width: 110px;
  max-width: 125px;
  padding: .5rem .6rem;
  border-radius: 12px;
  border: 1px solid var(--row-border);
  background: var(--primary-soft);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  user-select: none;
  pointer-events: none;
}
.remarks-readonly{
  flex: 1;
  padding: .55rem .65rem;
  border-radius: 12px;
  border: 1px solid var(--row-border);
  background: var(--primary-soft);
  color: var(--text);
  min-height: 2.25rem;
}
.btn-remarks-save{
  flex-shrink: 0;
  padding: .5rem .85rem;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.4);
  background: var(--primary-light);
  color: var(--primary2);
  font-weight: 700;
  cursor: pointer;
}
.btn-remarks-save:disabled{
  opacity: .45;
  cursor: not-allowed;
}

.camera-layout {
  display: grid;
  grid-template-columns: 1.3fr .9fr;
  gap: 1rem;
}
.camera-card, .list-card { padding: .9rem; }
.list-card{ background: var(--surface-1); border: 1px solid var(--glass-border) !important; }
.camera-card img, .camera-card video { width: 100%; border-radius: 14px; }
.list-card ul { list-style: none; margin-top: .6rem; display: grid; gap: .45rem; }
.list-card li {
  background: var(--row-bg);
  border: 1px solid var(--row-border);
  border-radius: 10px;
  padding: .6rem .75rem;
  color: var(--text);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 1rem;
}
.modal.hidden { display: none !important; }
body.modal-open { overflow: hidden; }
.modal-content {
  width: min(580px, 92vw);
  padding: 1.1rem;
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #334155;
  border-radius: 16px;
}
.modal-register {
  width: min(760px, 96vw);
  max-height: min(92vh, 920px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}
.modal-close-btn{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.modal-close-btn:hover{
  border-color: rgba(37, 99, 235, 0.45);
  background: var(--primary-soft);
}
.modal-content form { display: grid; gap: .85rem; }
.employee-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  align-items: stretch;
}
.employee-form-grid > div {
  display: grid;
  gap: 0.35rem;
}
.employee-form-grid .field-full {
  grid-column: 1 / -1;
}
.employee-form-grid label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.employee-form-grid textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  resize: vertical;
  min-height: 4.5rem;
  font-family: inherit;
}
.capture-section {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--glass-border);
}
.capture-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.25rem 0 0.5rem;
}
.capture-box { display: grid; gap: .6rem; }
.capture-box img { width: 100%; border-radius: 12px; }
.capture-status {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
}
.capture-status.success {
  background: rgba(6, 46, 22, 0.92);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #86efac;
}
.capture-status.warn {
  background: rgba(66, 32, 6, 0.92);
  border: 1px solid rgba(234, 179, 8, 0.45);
  color: #fcd34d;
}
.modal-actions { display: flex; justify-content: flex-end; gap: .55rem; margin-top: .5rem; }
.hidden { display: none; }

input[type="date"]::-webkit-calendar-picker-indicator{
  filter: none;
  opacity: 0.75;
  cursor: pointer;
}

.section-header h3,
.recent-card h4,
.chart-card h4,
.support-info-card h4,
.support-form-card h4,
.settings-panel h4 {
  color: var(--text-heading);
}

@media (max-width: 700px) {
  .employee-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-frame{
    grid-template-columns: 1fr;
    grid-template-rows: 72px 1fr;
  }
  .sidebar{ display: none; }
  .main-area{ grid-template-rows: 72px 1fr; }
  .camera-layout { grid-template-columns: 1fr; }
  .checkin-top{ flex-direction: column; }
  .small-preview{ width: min(420px, 100%); }
}

/* NSI Dashboard extensions */
.scroll-section.active {
  overflow-y: auto;
  overflow-x: hidden;
}

#adminCenterSection.page-section.active,
#appSettingsSection.page-section.active,
#registerSection.page-section.active {
  width: 100%;
  align-items: stretch;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.stat-card {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.75rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-value.good { color: #2563eb; }
.stat-value.bad { color: #dc2626; }
.stat-value.warn { color: #d97706; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.chart-card {
  padding: 1rem;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}
.chart-card h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-heading);
}
.chart-card canvas { flex: 1; min-height: 180px; }
.chart-sm { max-width: 100%; }

.recent-card { padding: 1rem; margin-bottom: 1rem; }
.recent-card h4 { margin: 0 0 0.75rem; }
.recent-head { grid-template-columns: 1.4fr 1fr 1fr !important; }
.recent-row { grid-template-columns: 1.4fr 1fr 1fr !important; }
.muted-small { color: var(--muted); font-size: 0.82rem; margin-left: 0.35rem; }
.empty-hint { padding: 1rem; color: var(--muted); text-align: center; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.att-date-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.att-view-hint {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 0.75rem;
}

.time-late.lunch-in-late {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(234, 179, 8, 0.22);
  color: #fcd34d;
  font-weight: 700;
  border: 1px solid rgba(234, 179, 8, 0.6);
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.15);
}

.reports-grid-table td .time-late.lunch-in-late {
  background: rgba(234, 179, 8, 0.25);
}

.filter-bar input, .filter-bar select {
  width: auto;
  min-width: 140px;
  flex: 1;
}
.logs-head, .logs-row {
  grid-template-columns: 1fr 0.72fr 0.82fr 0.72fr repeat(8, minmax(3.75rem, 0.68fr)) 0.88fr minmax(4.75rem, 0.88fr) !important;
  font-size: 0.82rem;
}
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 0 1rem;
}

.support-grid,
.support-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.5fr);
  gap: 1rem;
  flex: 1;
  min-height: calc(100vh - 64px - 2rem);
  align-items: stretch;
}

.support-admin-centered {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  flex: 1;
  min-height: calc(100vh - 64px - 2rem);
  padding: 0;
}

.support-info-centered {
  width: 100%;
  max-width: none;
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.support-contact-centered {
  text-align: center;
  align-items: center;
  flex: 1;
  min-height: 0;
}

.support-contact-details-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem 2rem;
  width: 100%;
  justify-items: center;
  margin-bottom: 0.5rem;
}

.support-contact-centered .support-email-list {
  align-items: center;
}

.support-alternate-email-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.support-alternate-email-col .support-guide-link-wrap {
  margin-top: 1.75rem;
  padding-top: 0.35rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.support-contact-centered .support-location-block {
  width: 100%;
  flex: 1;
  min-height: 0;
  text-align: center;
  margin-top: 1.75rem;
}

.support-contact-centered .support-map-wrap {
  min-height: min(520px, calc(100vh - 420px));
}

.support-guide-link-wrap {
  margin: 0;
}

.support-guide-link {
  background: none;
  border: none;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: #f472b6;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .support-guide-link {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    white-space: normal;
    text-align: center;
  }
}

.support-guide-link:hover {
  color: #fca5a5;
}

.support-guide-modal {
  width: min(720px, 94vw);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.support-guide-modal .support-guide-body {
  max-height: calc(88vh - 140px);
  overflow-y: auto;
  padding-right: 0.35rem;
}

.support-info-card,
.support-form-card,
.support-guide-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}

.support-guide-card h4,
.support-info-card h4 {
  margin: 0 0 1rem;
  flex-shrink: 0;
}

.support-guide-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.support-guide-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.support-guide-section {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.support-guide-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.support-guide-section h5 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.support-guide-section p,
.support-guide-section li {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}

.support-guide-section ul {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.support-guide-section li + li {
  margin-top: 0.35rem;
}

.support-guide-section code {
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.support-email-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.support-email-list a,
.support-contact a {
  color: inherit;
  text-decoration: none;
}

.support-email-list a:hover,
.support-contact a:hover {
  color: #93c5fd;
  text-decoration: underline;
}
.support-contact {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
}
.support-contact strong { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.85rem; }

.support-location-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
}

.support-address {
  color: #e5e5e5;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  flex-shrink: 0;
}

.support-map-wrap {
  flex: 1 1 auto;
  min-height: 380px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: #1a1a1a;
  display: flex;
}

.support-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 380px;
  flex: 1;
  border: 0;
}

.support-map-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ef4444;
  text-decoration: none;
  flex-shrink: 0;
}

.support-map-link:hover { text-decoration: underline; color: #fca5a5; }
select, textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 5rem; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: none;
  flex: 1;
  align-self: stretch;
}

.settings-block {
  width: 100%;
  box-sizing: border-box;
  padding: 1.25rem 1.35rem;
}

.settings-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-block-head h4,
.settings-block > h4.section-serif {
  margin: 0;
}

.btn-add {
  border: none;
  background: var(--primary2);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-add:hover { filter: brightness(1.05); }

.register-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-add-outline {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  white-space: nowrap;
}

.custom-fields-list {
  margin-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
}

.custom-fields-list h5 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.custom-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.custom-field-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.custom-field-meta strong {
  font-size: 0.9rem;
}

.custom-field-meta span {
  font-size: 0.78rem;
  opacity: 0.75;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.settings-table { width: 100%; }

.settings-table-head,
.settings-table-row {
  display: grid;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.5rem;
}

.settings-user-head,
.settings-user-row {
  grid-template-columns: 1.1fr 1.3fr 1fr 1.4fr;
}

.settings-emp-head,
.settings-emp-row {
  grid-template-columns: 1fr 1fr 0.55fr 1.35fr;
}

.settings-table-head {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--glass-border);
}

.settings-table-row {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.92rem;
}

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

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.see-more-btn {
  margin-top: 0.65rem;
  border: none;
  background: transparent;
  color: var(--primary2);
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0;
}

.settings-empty {
  padding: 1rem 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

#adminCenterSection,
#appSettingsSection,
#registerSection {
  width: 100%;
  align-self: stretch;
}

.register-stack {
  flex: 1;
  min-height: calc(100vh - 64px - 2rem);
}

.register-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.register-table {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.register-table .settings-table-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

#adminCenterSection .settings-form,
#appSettingsSection .settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 480px;
  margin-top: 0.5rem;
}

.settings-form label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-heading);
}

.settings-form-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.shift-mgmt-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(220, 38, 38, 0.2);
}

.shift-mgmt-head {
  margin-bottom: 0.75rem;
}

.shift-mgmt-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.shift-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shift-list-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--row-bg);
  border: 1px solid var(--row-border);
}

.shift-list-name {
  font-weight: 600;
  color: var(--text-heading);
}

.shift-list-time {
  font-size: 0.88rem;
  color: var(--muted);
}

.profile-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--glass-border);
}

.profile-placeholder {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  font-weight: 700;
  font-size: 0.85rem;
}

.modal-register-lg {
  max-width: min(720px, 96vw);
}

.employee-form-simple {
  grid-template-columns: 1fr 1fr;
}

.shift-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.view-detail-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.view-detail-body p { margin: 0; }

.view-photo {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 0.5rem;
}

.photo-preview img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.5rem;
}

.sidebar-company {
  padding: 0.35rem 0.5rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  font-family: "Inter", sans-serif;
}

.sidebar-company.hidden { display: none; }

.settings-panel { padding: 1.15rem; }
.settings-panel h4 { margin: 0 0 0.85rem; }
.system-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.status-tile {
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--primary-soft);
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.status-tile span { font-size: 0.82rem; color: var(--muted); }
.status-tile strong { font-size: 1rem; color: var(--text-heading); }
.status-ok { color: #15803d !important; }
.status-bad { color: #dc2626 !important; }

.employee-mini-head, .employee-mini-row {
  grid-template-columns: 1.2fr 0.8fr 1fr !important;
}
.employee-mini-table { margin-top: 1rem; }
.menu-btn.kiosk-link {
  text-decoration: none;
  display: block;
  text-align: left;
  border: 1px dashed rgba(37, 99, 235, 0.4);
  background: var(--surface-1);
}

/* Kiosk â€” portrait touch UI for Raspberry Pi + USB webcam */
.kiosk-body.kiosk-portrait {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: #f4f6f8;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.kiosk-body.kiosk-portrait .bg-gradient { display: none; }

.kiosk-screen {
  width: 100%;
  max-width: 820px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 2px solid #1a1a1a;
  border-right: 2px solid #1a1a1a;
  box-sizing: border-box;
}

.kiosk-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 2px solid #1a1a1a;
  font-weight: 700;
  font-size: 1.05rem;
  color: #111;
  flex-shrink: 0;
}

.kiosk-topbar-date,
.kiosk-topbar-time {
  font-variant-numeric: tabular-nums;
}

.kiosk-camera-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 38vh;
  margin: 0.75rem 0.85rem 0.5rem;
  border: 2px solid #1a1a1a;
  border-radius: 4px;
  background: #000;
  overflow: hidden;
}

.kiosk-camera-wrap video {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
  background: #111;
}

.kiosk-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.45rem;
  padding: 1rem;
  z-index: 2;
}

.kiosk-overlay.hidden { display: none; }
.kiosk-overlay.success { box-shadow: inset 0 0 0 3px #22c55e; }
.kiosk-overlay.warn { box-shadow: inset 0 0 0 3px #f59e0b; }
.kiosk-overlay.error { box-shadow: inset 0 0 0 3px #ef4444; }

.kiosk-status-icon {
  font-size: 2.75rem;
  font-weight: 800;
  color: #fff;
}

#kioskStatusText {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
}

#kioskStatusSub {
  color: #cbd5e1;
  white-space: pre-line;
  font-size: 0.95rem;
}

.kiosk-scan-ring {
  position: absolute;
  inset: 12%;
  border: 3px dashed rgba(37, 99, 235, 0.85);
  border-radius: 8px;
  pointer-events: none;
  animation: kiosk-pulse 1.2s ease-in-out infinite;
  z-index: 1;
}

.kiosk-scan-ring.hidden { display: none; }

@keyframes kiosk-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}

.kiosk-status-line {
  margin: 0.35rem 1rem 0.65rem;
  padding: 0.55rem 0.25rem 0.65rem;
  border-bottom: 2px solid #1a1a1a;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  min-height: 2.4rem;
  flex-shrink: 0;
}

.kiosk-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 0 0.85rem 0.75rem;
  flex-shrink: 0;
}

.kiosk-pad-btn {
  min-height: 88px;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  background: #fff;
  color: #111;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem;
  transition: background 120ms ease, transform 80ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.kiosk-pad-btn[hidden],
.kiosk-pad-btn.kiosk-btn-hidden {
  display: none !important;
}

.kiosk-pad-btn:active:not(:disabled) { transform: scale(0.97); }
.kiosk-pad-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.kiosk-pad-btn.active {
  background: #3d1515;
  box-shadow: inset 0 0 0 2px #b91c1c;
}

.kiosk-abbr {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.kiosk-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kiosk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem 1rem;
  border-top: 2px solid #1a1a1a;
  flex-shrink: 0;
}

.kiosk-register-btn {
  flex: 1;
  min-height: 48px;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
}

.kiosk-server-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #64748b;
  background: #94a3b8;
  flex-shrink: 0;
}

.kiosk-server-dot.online {
  background: #22c55e;
  border-color: #16a34a;
}

.kiosk-server-dot.offline {
  background: #ef4444;
  border-color: #dc2626;
}

/* Legacy kiosk styles (dashboard preview links) */
.kiosk-body { min-height: 100vh; display: grid; place-items: center; padding: 12px; }
.kiosk-shell {
  width: min(1024px, 100%);
  min-height: min(600px, 96vh);
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.kiosk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.kiosk-brand { display: flex; align-items: center; gap: 0.85rem; }
.kiosk-logo { width: auto; height: 48px; max-width: 160px; object-fit: contain; }
.kiosk-brand h1 { font-size: 1.35rem; margin: 0; }
.kiosk-brand p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.kiosk-clock {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-align: right;
}
.kiosk-main {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}
.kiosk-camera {
  position: relative;
  padding: 0.65rem;
  min-height: 320px;
  overflow: hidden;
}
.kiosk-camera video {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  border-radius: 14px;
  background: #000;
}
.kiosk-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.kiosk-prompt { color: var(--muted); font-size: 0.95rem; margin: 0; }
.kiosk-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex: 1;
}
.kiosk-btn {
  min-height: 72px;
  border: 1px solid var(--input-border);
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--text-heading);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.kiosk-btn:active { transform: scale(0.98); }
.kiosk-btn.active {
  background: var(--primary-light);
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  color: var(--primary2);
}

@media (max-width: 1200px) {
  .home-top-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .chart-grid { grid-template-columns: 1fr; }
  .support-grid,
  .support-admin-layout { grid-template-columns: 1fr; }
  .support-admin-centered { padding: 0; }
  .support-contact-details-row { grid-template-columns: 1fr; }
  .kiosk-main { grid-template-columns: 1fr; }
  .logs-head, .logs-row { font-size: 0.75rem; }
  .home-top-row { grid-template-columns: 1fr; }
  .home-lower { grid-template-columns: 1fr; }
  .home-widget-grid { grid-template-columns: 1fr; }
  .navbar-line { width: 40px; }
  .navbar-user-name { display: none; }
}

/* ===== SSEV ERP Layout ===== */
.erp-body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f4f8;
  color: #334155;
  overflow: hidden;
}

.section-serif,
.navbar-title,
.sidebar-link,
.sidebar-signout {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

.erp-app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Blue sidebar */
.erp-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem 1rem;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 45%, #1e40af 100%);
  color: #ffffff;
  box-shadow: 4px 0 24px rgba(37, 99, 235, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-profile-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1rem 0.85rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.04);
}

.sidebar-avatar {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  margin: 0 auto 0.65rem;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  font-family: "Inter", sans-serif;
  overflow: hidden;
  object-fit: cover;
}

.sidebar-profile-name {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

.sidebar-profile-role {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 0.15rem;
  letter-spacing: 0.08em;
  font-family: "Inter", sans-serif;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.sidebar-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.5rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.02em;
}

.sidebar-link:hover {
  color: #fff;
}

.sidebar-link.active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
  position: relative;
}

.sidebar-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.sidebar-link-kiosk {
  opacity: 0.75;
  font-size: 0.95rem;
}

.sidebar-signout {
  margin-top: 0;
  padding: 0.65rem 0.5rem;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}

.sidebar-signout:hover { color: #fff; }

/* Main area */
.erp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f0f4f8;
}

.erp-navbar {
  height: 64px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(37, 99, 235, 0.15);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
}

.navbar-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.navbar-company-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e40af;
  white-space: nowrap;
  line-height: 1.2;
}

.navbar-company-name.hidden { display: none; }

.navbar-logo { height: 40px; width: auto; max-width: 140px; object-fit: contain; }
.login-logo { height: 48px; width: auto; max-width: 180px; object-fit: contain; margin-bottom: 1rem; display: block; }

.navbar-center {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-self: center;
}

.navbar-line {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
}

.navbar-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #1e40af;
  margin: 0;
  white-space: nowrap;
}

.navbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-icon-btn:hover {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.nav-settings-btn .nav-settings-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.nav-settings-btn.active {
  background: rgba(59, 130, 246, 0.18);
  color: #3b82f6;
}

.font-size-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.font-size-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.font-size-head h4 {
  margin: 0;
}

.font-size-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.font-size-slider-wrap {
  width: 100%;
}

.font-size-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.font-size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a2a35 0%, #56566a 100%);
  outline: none;
  cursor: pointer;
}

.font-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.28), 0 2px 10px rgba(59, 130, 246, 0.45);
  cursor: pointer;
}

.font-size-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.28), 0 2px 10px rgba(59, 130, 246, 0.45);
  cursor: pointer;
}

.font-size-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a2a35 0%, #56566a 100%);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.navbar-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

.erp-content {
  flex: 1;
  overflow: hidden;
  padding: 0.85rem 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
}

.erp-content .page-section {
  flex: 1;
  min-height: 0;
}

/* Widget cards */
.widget-card {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.06), 0 1px 3px rgba(37, 99, 235, 0.04);
  padding: 1rem 1.1rem;
  color: #334155;
}

.home-top-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-top-row .widget-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  min-height: 110px;
}

.widget-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  display: grid;
  place-items: center;
}

.widget-body { flex: 1; min-width: 0; }
.widget-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.widget-tag {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
}
.widget-big {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.widget-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.45rem;
}
.widget-counters {
  display: flex;
  gap: 1rem;
}
.widget-counters > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.counter-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
}
.counter-val.counter-blue { color: #2563eb; }
.counter-val.counter-green { color: #16a34a; }
.counter-val.counter-red { color: #dc2626; }
.counter-val.counter-warn { color: #d97706; }
.counter-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
}
.widget-stat-line {
  font-size: 1.1rem;
  color: #475569;
  margin-bottom: 0.2rem;
}
.widget-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}
.widget-sub {
  font-size: 0.82rem;
  color: #94a3b8;
}

.home-lower {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.widget-tall {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 0;
  overflow: hidden;
}

.widget-tall-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.1rem 0.75rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.widget-tall-head svg { color: #2563eb; }

.widget-tall-body {
  flex: 1;
  padding: 0.75rem 1rem;
  overflow-y: auto;
}

.activity-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-name { font-weight: 600; color: #1e293b; }
.activity-meta { color: #94a3b8; font-size: 0.78rem; margin-top: 0.15rem; }

.widget-empty {
  color: #94a3b8;
  font-size: 0.88rem;
  padding: 1rem 0;
}

.home-widget-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.widget-sm {
  display: flex;
  flex-direction: column;
  min-height: 150px;
}

.widget-sm-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.65rem;
}

.widget-sm-body {
  flex: 1;
  font-size: 0.88rem;
  color: #64748b;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.widget-sm-body p { margin: 0; }
.widget-sm-body strong { color: #1e293b; }

.widget-link {
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.widget-link:hover { text-decoration: underline; }

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.quick-btn {
  padding: 0.45rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.quick-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.pill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.pill-btn:hover { background: rgba(37, 99, 235, 0.15); }

/* â€”â€”â€” New dashboard layout (wireframe) â€”â€”â€” */
.dash-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dash-top-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dash-tile,
.dash-panel {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
  color: #334155;
}

.dash-tile-label,
.dash-panel-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.65rem;
}

.dash-tile-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.dash-tile-value-sm {
  font-size: 1.5rem;
}

.dash-tile-counters {
  display: flex;
  gap: 1.25rem;
  justify-content: space-around;
}

.dash-tile-counters > div,
.dash-tile-split > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.dash-counter {
  font-size: 1.45rem;
  font-weight: 700;
}

.dash-counter.dash-blue { color: #2563eb; }
.dash-counter.dash-red { color: #dc2626; }
.dash-counter.dash-warn { color: #d97706; }

.dash-counter-lbl,
.dash-split-lbl {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: capitalize;
}

.erp-body .dash-stats-row-1 .dash-tile-label,
.erp-body .dash-row-2-stats .dash-tile-compact .dash-tile-label,
.erp-body .dash-stats-row-2 .dash-tile-compact .dash-tile-label {
  color: rgba(255, 255, 255, 0.92);
}

.erp-body .dash-stats-row-1 .dash-counter-lbl,
.erp-body .dash-stats-row-1 .dash-split-lbl,
.erp-body .dash-row-2-stats .dash-split-lbl {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.72);
}

.dash-tile-split {
  display: flex;
  gap: 1.5rem;
  justify-content: space-around;
}

.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr 260px;
  gap: 1rem;
  align-items: stretch;
  min-height: 340px;
}

.dash-panel {
  display: flex;
  flex-direction: column;
  min-height: 340px;
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.dash-panel-head-wrap {
  flex-direction: column;
  align-items: flex-start;
}

.dash-panel-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}

.dash-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.dash-select {
  border: 1px solid rgba(37, 99, 235, 0.25);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  color: #334155;
  background: #ffffff;
  min-width: 0;
}

.dash-select-sm {
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
  border-radius: 6px;
  max-width: 5.5rem;
}

.dash-panel-controls .dash-select { flex: 1; min-width: 72px; }
.dash-panel-controls .dash-select-sm { flex: 0 1 auto; min-width: 64px; max-width: 6.5rem; }
.dash-panel-controls #empChartEmployee { flex: 1 1 120px; max-width: none; }
.dash-panel-hint {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.dash-chart-controls .dash-select-sm {
  max-width: 7.5rem;
}

.dash-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 240px;
}

.dash-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.dash-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 1rem;
  margin: 0;
}

.dash-chart-empty.hidden { display: none; }

.dash-activity-panel .dash-panel-title {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dbeafe;
}

.dash-activity-body {
  flex: 1;
  overflow-y: auto;
}

/* Dashboard v2 â€” full-height layout */
#dashboardSection.page-section.active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.5rem 0.45rem;
}

.dash-layout-v2 {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(210px, 34vh) minmax(0, 1fr);
  gap: 1rem;
  height: 100%;
}

.dash-layout-v2 .dash-panel {
  min-height: 0;
}

.dash-stats-grid {
  display: grid;
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
}

.dash-stats-row-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Wireframe layout: mid block fills top row; bottom row = graphs + activity */
.dash-layout-wire {
  gap: 1rem;
  min-height: 0;
}

.dash-mid-block {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 24vw);
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.dash-mid-main {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.45rem;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.dash-row-2-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.dash-row-2-stats .dash-tile-compact {
  min-height: 0;
  height: 100%;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.dash-row-2-stats .dash-tile-compact .dash-tile-label {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.25;
  color: inherit;
}

.dash-row-2-stats .dash-tile-compact .dash-tile-value {
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1.05;
  font-weight: 700;
}

.dash-row-2-stats .dash-tile-compact-break {
  justify-content: center;
}

.dash-row-2-stats .dash-tile-compact-break .dash-tile-label {
  margin-bottom: 0.25rem;
}

.dash-row-2-stats .dash-tile-split-sm {
  gap: 1rem;
  justify-content: center;
  width: 100%;
}

.dash-row-2-stats .dash-tile-compact-break .dash-tile-value-sm {
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 700;
}

.dash-row-2-stats .dash-tile-compact-break .dash-split-lbl {
  font-size: 0.82rem;
  font-weight: 600;
}

.dash-pie-slot {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.75rem;
  min-height: 0;
  height: 100%;
}

.dash-pie-slot .dash-panel-title {
  font-size: 0.88rem;
  margin-bottom: 0.15rem;
  text-align: center;
  flex-shrink: 0;
}

.dash-pie-slot .dash-panel-hint {
  font-size: 0.65rem;
  margin: 0 0 0.25rem;
  text-align: center;
  line-height: 1.25;
  flex-shrink: 0;
}

.dash-pie-slot .dash-chart-wrap-pie {
  flex: 1;
  min-height: 0;
  position: relative;
}

.dash-row-3 {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 24vw);
  gap: 0.45rem;
  align-items: stretch;
}

.dash-graphs-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
}

.dash-graphs-pair .dash-chart-panel {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.75rem;
}

.dash-graphs-pair .dash-panel-head {
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}

.dash-graphs-pair .dash-panel-hint {
  margin: -0.15rem 0 0.35rem;
  flex-shrink: 0;
}

.dash-graphs-pair .dash-chart-wrap {
  flex: 1;
  min-height: 120px;
  position: relative;
}

.dash-graphs-pair .dash-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.dash-row-3 .dash-live-panel {
  height: 100%;
  max-width: none;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.75rem;
  min-height: 0;
}

.dash-row-3 .dash-live-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-height: none;
}

.dash-stats-row-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.dash-stats-row-1 .dash-tile {
  min-height: 0;
  height: 100%;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dash-stats-row-1 .dash-tile-value { font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 700; }
.dash-stats-row-1 .dash-tile-label { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.45rem; line-height: 1.25; }
.dash-stats-row-1 .dash-counter { font-size: clamp(1.65rem, 2.5vw, 2rem); font-weight: 700; }
.dash-stats-row-1 .dash-tile-value-sm { font-size: clamp(1.65rem, 2.5vw, 2rem); font-weight: 700; }
.dash-stats-row-1 .dash-counter-lbl,
.dash-stats-row-1 .dash-split-lbl { font-size: 0.88rem; font-weight: 600; }

.dash-stats-row-2 .dash-tile-compact {
  min-height: 0;
  height: 100%;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.dash-stats-row-2 .dash-tile-compact .dash-tile-value {
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1.05;
  font-weight: 700;
}

.dash-stats-row-2 .dash-tile-compact .dash-tile-value-sm {
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 700;
}

.dash-stats-row-2 .dash-tile-compact .dash-tile-label {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  line-height: 1.25;
  color: inherit;
}

.dash-tile-compact { min-height: 0; height: 100%; padding: 0.65rem 0.75rem; }
.dash-tile-compact .dash-tile-value { font-size: clamp(1.85rem, 3vw, 2.35rem); font-weight: 700; }
.dash-tile-compact .dash-tile-label { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.35rem; }

.dash-top-row .dash-tile { min-height: 96px; padding: 0.85rem 1rem; }

.dash-tile-value.dash-blue { color: #2563eb; }
.dash-tile-value.dash-warn { color: #d97706; }

.dash-body-grid {
  flex: 0 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 0.6rem;
  align-items: start;
}

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

.dash-graphs-row {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: min(320px, calc(100vh - 360px));
  display: grid;
  grid-template-columns: 1fr 1fr 200px;
  gap: 0.6rem;
  align-items: stretch;
}

.dash-graphs-row .dash-chart-panel {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.85rem;
}

.dash-graphs-row .dash-panel-title {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.dash-graphs-row .dash-chart-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}

.dash-graphs-row .dash-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.dash-chart-wrap-pie { max-height: none; }

.dash-live-panel {
  min-height: 0;
  height: auto;
  align-self: start;
  padding: 0.65rem 0.75rem;
  max-width: 210px;
}

.dash-live-head {
  margin-bottom: 0;
  padding-bottom: 0;
}

.dash-live-head .dash-panel-title {
  font-size: 0.9rem;
  margin: 0;
}

.dash-live-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0.15rem 0 0.35rem;
}

.dash-live-body {
  overflow-y: auto;
  max-height: 240px;
  margin-top: 0;
}

.dash-live-row {
  display: grid;
  grid-template-columns: 2.8rem 1fr;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.4rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.78rem;
}

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

.dash-live-time {
  grid-row: 1 / 3;
  font-weight: 700;
  color: #2563eb;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.dash-live-name {
  font-weight: 600;
  color: #1e293b;
  grid-column: 2;
}

.dash-live-action {
  color: #64748b;
  font-size: 0.72rem;
  grid-column: 2;
}

.dash-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}

.dash-live-dot.active {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  animation: dash-pulse 2s infinite;
}

@keyframes dash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

@media (max-width: 1280px) {
  .dash-layout-v2 {
    grid-template-rows: auto minmax(280px, 1fr);
  }
  .dash-mid-block { grid-template-columns: 1fr; }
  .dash-mid-main { grid-template-rows: auto auto; height: auto; }
  .dash-row-2-stats { min-height: 88px; height: auto; }
  .dash-row-2-stats .dash-tile-compact { min-height: 88px; height: auto; }
  .dash-pie-slot { min-height: 200px; }
  .dash-row-3 { grid-template-columns: 1fr; }
  .dash-graphs-pair { min-height: 260px; }
  .dash-row-3 .dash-live-panel { height: auto; min-height: 200px; }
  .dash-stats-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-row-2-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .dash-stats-row-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-stats-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-graphs-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .dash-stats-row-1,
  .dash-stats-row-2 { grid-template-columns: 1fr; }
}

.dash-summary-panel,
.dash-shift-panel,
.dash-status-panel { min-height: auto; padding: 0.9rem 1rem; }

.dash-summary-list,
.dash-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dash-summary-list li,
.dash-status-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.4rem;
}

.dash-summary-list li:last-child,
.dash-status-list li:last-child { border-bottom: none; }

.dash-blue-text { color: #2563eb; }
.dash-red-text { color: #dc2626; }

.dash-shift-body { display: flex; flex-direction: column; gap: 0.5rem; }
.dash-shift-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}
.dash-shift-row:last-child { border-bottom: none; }
.dash-shift-name { font-weight: 600; color: #334155; }
.dash-shift-stats { color: #64748b; font-size: 0.8rem; }

.dash-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dash-chart-panel { min-height: 0; }
.dash-chart-wrap-pie { max-height: none; }

/* Kiosk monitor page */
.kiosk-monitor-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 900px;
}

.kiosk-monitor-panel { min-height: auto; }

.kiosk-monitor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
}

.kiosk-monitor-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kiosk-mon-lbl { font-size: 0.78rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kiosk-mon-val { font-size: 1.05rem; font-weight: 600; color: #1e293b; }
.kiosk-mon-val.status-ok { color: #16a34a; }
.kiosk-mon-val.status-bad { color: #dc2626; }

.kiosk-last-rec {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.5;
}

.sidebar-link-kiosk { font-size: 0.78rem; opacity: 0.85; margin-top: -0.25rem; }

.reports-layout {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: calc(100vh - 64px - 2rem);
  width: 100%;
}

.reports-card {
  padding: 1.25rem 1.35rem;
}

.reports-card .section-serif {
  margin: 0 0 0.75rem;
}

.reports-hint {
  color: #64748b;
  font-size: 0.82rem;
  margin: 0.75rem 0 0;
}

.reports-filter {
  margin-bottom: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.reports-filter .dash-select {
  min-width: 140px;
}

.reports-result.hidden,
.reports-summary.hidden,
.reports-empty.hidden {
  display: none;
}

.reports-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}

.reports-header-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: #1e293b;
}

.reports-header-period {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2563eb;
}

.reports-table-wrap {
  overflow-x: auto;
  padding: 0;
}

.reports-grid-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.88rem;
  color: #334155;
  background: #ffffff;
}

.reports-grid-table th,
.reports-grid-table td {
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 0.45rem 0.5rem;
  text-align: center;
  vertical-align: middle;
}

.reports-grid-table th {
  font-weight: 600;
  font-size: 0.82rem;
  background: #eff6ff;
  color: #1e40af;
  text-transform: none;
  letter-spacing: 0;
}

.reports-grid-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.reports-grid-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

.reports-summary {
  padding: 1rem 1.25rem;
  display: grid;
  gap: 0.45rem;
  max-width: 360px;
}

.reports-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
  color: #475569;
}

.reports-summary-row strong {
  font-weight: 700;
  color: #2563eb;
}

.reports-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.reports-empty {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
}

.analytics-section {
  margin-top: 0.5rem;
}

.analytics-section .section-serif {
  font-size: 1.25rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.85rem;
  letter-spacing: 0.04em;
}

.section-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.85rem;
}

.erp-content .widget-card.chart-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}
.erp-content .widget-card.chart-card h4 {
  margin: 0 0 0.75rem;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e40af;
}
.erp-content .widget-card.chart-card canvas {
  flex: 1;
  min-height: 180px;
}

/* ===== Blue / White theme overrides ===== */
.section-serif { color: #1e293b; }
.glass-card { background: var(--glass-bg); color: var(--text); }
select, textarea {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
}
select:focus, textarea:focus { outline: 2px solid rgba(37, 99, 235, 0.4); }

.widget-meta, .widget-label, .counter-lbl, .widget-sub,
.dash-counter-lbl, .dash-split-lbl, .dash-live-sub, .reports-hint,
.att-view-hint, .empty-hint { color: #64748b; }

.widget-sm-title, .widget-tall-head, .activity-name,
.dash-live-name, .section-toolbar,
.analytics-section .section-serif, .support-info-card h4 {
  color: #334155;
}

.dash-live-time { color: #2563eb; }

.activity-item { border-bottom-color: rgba(37, 99, 235, 0.12); }
.widget-tall-head { border-bottom-color: #e2e8f0; }

.dash-live-row { border-bottom-color: #e2e8f0; }
.dash-live-action { color: #64748b; }

.filter-bar input[type="search"],
.filter-bar input[type="date"] {
  background: #ffffff;
  color: #334155;
  border-color: rgba(37, 99, 235, 0.25);
}

.modal-overlay { background: rgba(15, 23, 42, 0.45); }
.modal-card {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #334155;
}

.toast { background: #ffffff; border: 1px solid rgba(37, 99, 235, 0.3); color: #334155; }
.toast.success { border-color: rgba(34, 197, 94, 0.5); background: #f0fdf4; color: #166534; }
.toast.warn { border-color: rgba(234, 179, 8, 0.5); background: #fffbeb; color: #92400e; }

.settings-table-head { background: #eff6ff; color: #1e40af; }
.settings-table-row { background: #ffffff; border-color: rgba(37, 99, 235, 0.12); }

#toast { background: #ffffff; color: #334155; border: 1px solid rgba(37, 99, 235, 0.3); }

/* ===== Full blue/white theme â€” every page, every component ===== */
.erp-body,
.erp-body .erp-main,
.erp-body .erp-content {
  background: #f0f4f8;
  color: #334155;
}

.erp-body .erp-sidebar {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 55%, #1e40af 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.erp-body .erp-navbar {
  background: #ffffff;
  border-bottom: 1px solid rgba(37, 99, 235, 0.15);
}

.erp-body .widget-card,
.erp-body .glass-card,
.erp-body .list-card,
.erp-body .filter-bar.widget-card,
.erp-body .dash-tile,
.erp-body .dash-panel,
.erp-body .settings-block,
.erp-body .support-info-card,
.erp-body .support-form-card,
.erp-body .reports-card,
.erp-body .reports-header,
.erp-body .reports-summary,
.erp-body .reports-table-wrap {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: #334155;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.06);
}

.erp-body .page-section.scroll-section.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.erp-body #supportSection.active {
  min-height: calc(100vh - 64px - 1.6rem);
  overflow: hidden;
}

.erp-body #reportsSection.active,
.erp-body #registerSection.active,
.erp-body #adminCenterSection.active,
.erp-body #appSettingsSection.active,
.erp-body #attendanceSection.active {
  min-height: calc(100vh - 64px - 1.6rem);
}

.erp-body .settings-stack {
  flex: 1;
  min-height: calc(100vh - 64px - 2rem);
}

.erp-body label,
.erp-body .login-form label,
.erp-body .settings-form label {
  color: #64748b;
}

.erp-body input,
.erp-body select,
.erp-body textarea,
.erp-body .filter-bar input,
.erp-body .filter-bar select,
.erp-body .dash-select {
  background: #ffffff;
  color: #334155;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.erp-body input::placeholder,
.erp-body textarea::placeholder {
  color: #94a3b8;
}

.erp-body .table-head,
.erp-body .logs-head {
  background: #eff6ff;
  color: #1e40af;
  border-bottom: 1px solid rgba(37, 99, 235, 0.15);
}

.erp-body .attendance-table-wrap .logs-head {
  background: #eff6ff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.1);
}

.erp-body .table-row,
.erp-body .logs-row {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.12);
  color: #334155;
}

.erp-body .btn-secondary {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

.erp-body .btn-primary {
  background: linear-gradient(110deg, #2563eb, #1d4ed8);
  color: #fff;
}

.erp-body .section-serif,
.erp-body h3.section-serif,
.erp-body h4.section-serif {
  color: #1e293b;
}

.erp-body .support-info-card h4,
.erp-body .support-form-card h4,
.erp-body .settings-block-head h4 {
  color: #1e293b;
}

.erp-body .navbar-title { color: #1e40af; }
.erp-body .navbar-user-name { color: #334155; }

.erp-body .sidebar-link.active {
  background: rgba(255, 255, 255, 0.18);
}

.erp-body .sidebar-profile-card {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.erp-body .sidebar-avatar {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.erp-body .pagination-bar,
.erp-body .pagination-bar span {
  color: #64748b;
}

.erp-body .widget-empty,
.erp-body .reports-empty,
.erp-body .empty-hint {
  color: #94a3b8;
}

.erp-body .quick-btn {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.25);
  color: #334155;
}

.erp-body .quick-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.erp-body .btn-add {
  background: linear-gradient(110deg, #2563eb, #1d4ed8);
  color: #fff;
}

.erp-body .see-more-btn {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #2563eb;
}

.erp-body .modal-content,
.erp-body .modal-register {
  background: #ffffff;
  color: #334155;
}

.erp-body .settings-table-row {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.12);
  color: #334155;
}

.erp-body .settings-table-head {
  background: #eff6ff;
  color: #1e40af;
}

.erp-body .reports-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.erp-body .reports-table-wrap {
  flex: 1;
}

.erp-body #reportsResult:not(.hidden) {
  flex: 1;
  display: flex;
  flex-direction: column;
}