@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Sora:wght@400;600;700&display=swap");

:root {
  color-scheme: light;
  --primary: #1a56db;
  --primary-dark: #1342b0;
  --primary-light: #e8f0fe;
  --success: #0e9f6e;
  --success-light: #def7ec;
  --warning: #e3a008;
  --warning-light: #fdf6b2;
  --danger-token: #e02424;
  --danger-light: #fde8e8;
  --info: #3f83f8;
  --info-light: #e1effe;
  --purple: #7e3af2;
  --purple-light: #edebfe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-w: 256px;
  --topbar-h: 64px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Sora", system-ui, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --bg: var(--gray-50);
  --panel: #ffffff;
  --ink: var(--gray-900);
  --muted: var(--gray-500);
  --line: var(--gray-200);
  --brand: var(--primary);
  --brand-dark: var(--primary-dark);
  --blue: var(--primary);
  --amber: var(--warning);
  --green: var(--success);
  --danger: var(--danger-token);
  --shadow: var(--shadow-md);
  font-family: var(--font);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

.public-shell,
.app-shell {
  min-height: 100vh;
}

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

.brand span,
.avatar,
.app-avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.app-avatar.sm {
  width: 30px;
  height: 30px;
  font-size: 11px;
}

.app-avatar.md {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.app-avatar.lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.hero {
  display: grid;
  gap: 32px;
  padding: clamp(40px, 8vw, 96px) clamp(18px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.92;
  margin: 10px 0 18px;
  letter-spacing: 0;
}

.hero p {
  color: var(--muted);
  max-width: 620px;
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions,
.section-actions,
.form-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-panel {
  display: grid;
  gap: 14px;
  background: #0f172a;
  color: #fff;
  padding: clamp(18px, 4vw, 28px);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn,
.btn {
  border: 0;
  border-radius: var(--radius);
  padding: 11px 16px;
  font-weight: 750;
  min-height: 42px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
}

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

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

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

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

.btn-outline {
  background: #fff;
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.btn-sm {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 12px;
}

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

.primary-btn:hover {
  background: var(--brand-dark);
}

.secondary-btn {
  background: #e6f4f1;
  color: var(--brand-dark);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
}

.danger-btn {
  background: #fee2e2;
  color: var(--danger);
}

.compact {
  padding: 8px 12px;
  min-height: 34px;
  font-size: 13px;
}

.full {
  width: 100%;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card {
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  color: var(--gray-800);
  font-size: 14px;
  font-weight: 800;
}

.card-subtitle {
  color: var(--gray-400);
  font-size: 12px;
}

.card-body {
  padding: 20px;
}

.auth-card {
  display: grid;
  gap: 12px;
  width: min(100%, 440px);
  padding: 24px;
}

.auth-copy {
  margin: 0;
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.6;
}

.password-strength {
  display: block;
  margin-top: -6px;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
}

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

label {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.app-shell {
  display: grid;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

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

.sidebar nav {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: flex-start;
}

.sidebar nav button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  white-space: nowrap;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.sidebar nav button span {
  display: inline-block;
  width: 20px;
  text-align: center;
}

.sidebar nav button strong {
  font: inherit;
}

.sidebar nav button.active {
  color: var(--brand-dark);
  background: #e6f4f1;
}

.workspace {
  padding: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar small,
.stat-card small,
table small,
.report-tile span,
.timeline span,
.timeline small {
  display: block;
  color: var(--muted);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin: 8px 0 18px;
}

.section-header h2,
.panel h3,
.profile-card h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.grid,
.stats-grid,
.employee-grid {
  display: grid;
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.period-banner {
  margin: -4px 0 16px;
  padding: 12px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  line-height: 1.5;
}

.range-card {
  display: grid;
  gap: 10px;
}

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

.range-pill {
  display: grid;
  gap: 3px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: var(--muted);
  text-align: left;
}

.range-pill strong {
  color: var(--ink);
  font-size: 14px;
}

.range-pill small,
.range-modal-header small {
  color: var(--muted);
  line-height: 1.4;
}

.range-pill.active {
  border-color: var(--brand);
  background: #e6f4f1;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.range-pill.active strong {
  color: var(--brand-dark);
}

.range-pill.active small {
  color: #0f766e;
}

.range-pill:hover {
  border-color: var(--brand);
  background: #ffffff;
}

.range-pill.active:hover {
  background: #dff1ee;
}

.range-pill:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.25);
  outline-offset: 2px;
}

.range-pill.active::after {
  content: "Dipakai";
  justify-self: start;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.range-custom {
  display: none;
  grid-template-columns: 170px 170px auto;
  gap: 10px;
  align-items: center;
}

.range-custom.show {
  display: grid;
}

.modal-backdrop {
  display: none;
}

.modal-backdrop.open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.42);
}

.range-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 31;
  width: min(94vw, 620px);
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
  padding: 20px;
}

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

.range-modal-header h3 {
  margin: 0;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 112px;
}

.hero-panel .stat-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.hero-panel .stat-card span,
.hero-panel .stat-card small {
  color: #cbd5e1;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 30px;
  letter-spacing: 0;
}

.stat-card.green strong,
.money {
  color: var(--green);
}

.stat-card.amber strong {
  color: var(--amber);
}

.stat-card.blue strong {
  color: var(--blue);
}

.stat-card.danger strong {
  color: var(--danger);
}

.today-times,
.metric-list,
.detail-grid {
  display: grid;
  gap: 10px;
}

.today-times {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.today-times div,
.metric-list span,
.map-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.today-times div {
  display: grid;
  gap: 6px;
  align-content: center;
  min-width: 0;
}

.today-times strong {
  overflow-wrap: anywhere;
}

.today-times span,
.detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  grid-template-columns: minmax(120px, 0.8fr) 1.2fr;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 850;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.badge-success {
  background: var(--success-light);
  color: #046c4e;
}

.badge-warning {
  background: var(--warning-light);
  color: #723b13;
}

.badge-danger {
  background: var(--danger-light);
  color: #9b1c1c;
}

.badge-info {
  background: var(--info-light);
  color: #1e429f;
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-purple {
  background: var(--purple-light);
  color: #5521b5;
}

.badge-approved,
.badge-active,
.badge-hadir {
  color: #166534;
  background: #dcfce7;
}

.badge-pending {
  color: #92400e;
  background: #fef3c7;
}

.badge-rejected,
.badge-inactive {
  color: #991b1b;
  background: #fee2e2;
}

.badge-flagged {
  color: #1d4ed8;
  background: #dbeafe;
}

.badge-izin,
.badge-sakit,
.badge-cuti {
  color: #6d28d9;
  background: #ede9fe;
}

.badge-libur {
  color: #475569;
  background: #e2e8f0;
}

.badge-alpha {
  color: #991b1b;
  background: #fee2e2;
}

.badge-scheduled,
.badge-today_pending {
  color: #475569;
  background: #e2e8f0;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: #eef2f7;
}

.mini-chart {
  display: flex;
  align-items: end;
  gap: 12px;
  min-height: 170px;
  padding-top: 22px;
}

.bar-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  flex: 1;
}

.bar-item span {
  width: 100%;
  max-width: 42px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #14b8a6, #2563eb);
}

.bar-item small {
  color: var(--muted);
}

.clock-form,
.settings-form,
.employee-form {
  display: grid;
  gap: 12px;
}

.manual-fields {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.auto-attendance-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #eefaf7, #ffffff);
}

.auto-attendance-card span,
.auto-attendance-card small {
  color: var(--muted);
}

.auto-attendance-card strong {
  font-size: 22px;
}

.stacked-panels {
  display: grid;
  gap: 14px;
}

.manual-fields strong {
  color: var(--ink);
}

.manual-fields small,
.helper-text {
  color: var(--muted);
  line-height: 1.5;
}

.camera-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.camera-preview {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #0f172a;
}

.camera-preview.active {
  display: block;
}

.employee-form {
  margin-bottom: 14px;
}

.preview-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.proof-photo,
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #eef2f7;
  border: 1px dashed #b6c2d2;
  text-align: center;
  padding: 18px;
}

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 460px);
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.18);
  padding: 24px;
  z-index: 10;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.18));
  z-index: 9;
}

.drawer-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #eef2f7;
  font-size: 24px;
}

.drawer-bottom-close {
  margin-top: 14px;
}

.asset-warning {
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

.drawer-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.edit-attendance-panel {
  margin-bottom: 14px;
}

.map-card {
  margin-top: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 140px;
  border: 1px dashed #b6c2d2;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.compact-empty {
  min-height: 170px;
}

.employee-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.employee-card,
.report-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.employee-card {
  display: grid;
  gap: 10px;
}

.employee-card h3,
.employee-card p {
  margin: 0;
}

.employee-card p,
.employee-card span {
  color: var(--muted);
}

.employee-card .employee-id {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.approval-row,
.request-row,
.timeline div {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.approval-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row-actions {
  min-width: 260px;
}

.review-note {
  display: block;
  margin-top: 5px;
  color: #b45309;
  font-weight: 750;
}

.admin-attendance-table table {
  min-width: 980px;
}

.report-tile {
  display: grid;
  gap: 8px;
  min-height: 120px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check input {
  width: auto;
}

.profile-card {
  max-width: 680px;
}

@media (max-width: 560px) {
  body {
    padding-bottom: 0;
  }

  .app-shell {
    display: block;
  }

  .mobile-menu-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 18;
    background: rgba(15, 23, 42, 0.42);
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 22px;
    padding: 0;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(82vw, 320px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 20px 0 48px rgba(15, 23, 42, 0.18);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar nav {
    display: grid;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 8px;
    overflow: visible;
    flex: 0;
  }

  .sidebar nav button {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    white-space: normal;
  }

  .sidebar nav button span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    font-size: 18px;
    line-height: 1;
  }

  .sidebar nav button strong {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar > .ghost-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 8px;
    background: #f1f5f9;
  }

  .workspace {
    padding: 16px;
  }

  .public-nav {
    align-items: flex-start;
    gap: 12px;
  }

  .public-nav > div:last-child,
  .topbar,
  .section-header {
    align-items: stretch;
  }

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

  .topbar .primary-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .brand strong {
    white-space: nowrap;
  }

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

  .today-times {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .clock-form {
    gap: 14px;
  }

  .manual-fields {
    padding: 12px;
  }

  .manual-fields strong {
    display: block;
  }

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

  .range-card,
  .range-custom {
    grid-template-columns: 1fr;
  }

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

  .form-actions .primary-btn,
  .form-actions .secondary-btn,
  .form-actions .ghost-btn {
    width: 100%;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .danger-btn {
    min-height: 46px;
  }

  .proof-photo,
  .photo-placeholder,
  .camera-preview {
    aspect-ratio: 3 / 4;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
  }

  td {
    display: grid;
    grid-template-columns: 100px 1fr;
    border: 0;
    padding: 8px;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .app-shell {
    grid-template-columns: 260px 1fr;
  }

  .sidebar {
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 18px;
  }

  .sidebar nav {
    flex-direction: column;
    margin-top: 18px;
    align-items: stretch;
  }

  .workspace {
    padding: 28px;
  }

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

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

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

  .filters {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .settings-form,
  .employee-form {
    grid-template-columns: 220px 1fr;
    align-items: center;
  }

  .settings-form button,
  .employee-form button {
    grid-column: 2;
    width: max-content;
  }
}

/* Final visual overrides: keep this after responsive rules. */
:root {
  --brand-soft: #e7f5f2;
  --soft-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.auth-card,
.panel,
.topbar,
.employee-card,
.report-tile {
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.primary-btn {
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
}

.primary-btn:hover,
.secondary-btn:hover,
.stat-card.clickable:hover {
  transform: translateY(-1px);
}

.secondary-btn,
.sidebar nav button.active {
  background: var(--brand-soft);
}

.sidebar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.sidebar nav button {
  border-radius: 10px;
}

.topbar {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px;
}

.section-actions {
  justify-content: flex-end;
}

.period-banner {
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.range-modal {
  border-radius: 18px;
}

.range-pill,
.today-times div,
.metric-list span,
.map-card,
.manual-fields,
.camera-box {
  border-radius: 12px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}

.stat-card.green::before {
  background: var(--green);
}

.stat-card.amber::before {
  background: var(--amber);
}

.stat-card.blue::before {
  background: var(--blue);
}

.stat-card.danger::before {
  background: var(--danger);
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  border-color: rgba(15, 118, 110, 0.3);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.badge {
  gap: 6px;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.icon-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.featured-camera {
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(135deg, #eefaf7, #ffffff);
}

.featured-camera > div:first-child {
  display: grid;
  gap: 4px;
}

.manual-fields {
  min-width: 0;
  overflow: hidden;
}

.manual-fields input {
  min-width: 0;
}

.proof-photo,
.photo-placeholder,
.camera-preview {
  border-radius: 14px;
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    margin: -6px 0 18px;
  }

  .section-header {
    display: grid;
    gap: 14px;
    align-items: stretch;
  }

  .section-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .section-actions:empty {
    display: none;
  }

  .range-pills,
  .range-custom {
    grid-template-columns: 1fr;
  }

  .range-modal {
    width: min(92vw, 420px);
    max-height: 86vh;
    overflow-y: auto;
    padding: 16px;
  }

  tr {
    border-radius: 14px;
  }

  td:last-child {
    grid-template-columns: 1fr;
  }

  td:last-child::before {
    display: none;
  }

  td .icon-btn {
    width: 100%;
  }

  .row-actions {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .row-actions .icon-btn,
  .row-actions .secondary-btn,
  .row-actions .danger-btn,
  .row-actions .ghost-btn {
    width: 100%;
  }

  .recap-filter-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .note-ellipsis {
    max-width: 100%;
  }
}

/* Claude UI migration: Stage 3-6 dashboard and page polish */
.modern-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.employee-hero {
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 95% 18%, rgba(255, 255, 255, 0.14) 0 96px, transparent 98px),
    linear-gradient(135deg, var(--primary), #1e40af);
}

.hero-status-grid {
  grid-template-columns: repeat(4, minmax(0, 150px));
}

.hero-status-grid div {
  min-width: 0;
}

.hero-status-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-stat-grid.admin-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-metric {
  min-height: 136px;
  cursor: pointer;
}

.admin-dashboard-grid {
  align-items: stretch;
  margin-bottom: 18px;
}

.activity-feed {
  display: grid;
  gap: 0;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-item > span {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-light);
}

.activity-item strong {
  display: block;
  color: var(--gray-900);
  font-size: 13px;
}

.activity-item small {
  display: block;
  color: var(--gray-500);
  font-size: 12px;
}

.compact-table table {
  min-width: 560px;
}

.compact-table td,
.compact-table th {
  padding-top: 12px;
  padding-bottom: 12px;
}

.panel.clock-form,
.preview-panel,
.settings-form,
.calendar-admin,
.profile-card,
.stacked-panels .panel {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.clock-form {
  align-content: start;
}

.camera-box.featured-camera {
  padding: 18px;
  border: 1px solid rgba(26, 86, 219, 0.16);
  background: linear-gradient(135deg, #f8fbff, #eef4ff);
}

.camera-box.featured-camera strong {
  color: var(--gray-900);
  font-family: var(--font-display);
}

.auto-attendance-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--gray-50);
}

.auto-attendance-card span,
.helper-text {
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 650;
}

.auto-attendance-card strong {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 22px;
}

.request-row,
.approval-row,
.report-tile,
.employee-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.request-row,
.approval-row {
  display: grid;
  gap: 7px;
  padding: 14px 0;
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
}

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

.policy-picker,
.weekday-picker {
  display: grid;
  gap: 8px;
}

.policy-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.policy-option input {
  width: auto;
  margin-top: 4px;
}

.policy-option strong,
.policy-option small {
  display: block;
}

.policy-option small {
  color: var(--gray-500);
  font-weight: 600;
}

.alert {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--primary-light);
  color: var(--gray-800);
}

.danger-alert {
  border-left-color: var(--danger);
  background: var(--danger-light);
}

.password-overwrite-form {
  grid-template-columns: 180px 1fr;
}

.password-overwrite-form .alert,
.password-confirm-check,
.password-overwrite-form button {
  grid-column: 1 / -1;
}

.calendar-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.calendar-form input[name="title"],
.calendar-form button {
  grid-column: 1 / -1;
}

.profile-card {
  display: grid;
  max-width: 720px;
  gap: 12px;
  padding: 24px;
}

.profile-card .avatar.large {
  background: linear-gradient(135deg, var(--primary), var(--success));
}

.table-wrap table tbody tr {
  transition: background 0.14s ease;
}

.table-wrap table tbody tr:hover {
  background: #f8fafc;
}

.badge-flagged {
  background: var(--warning-light);
  color: #8a5700;
}

.badge-rejected {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-approved,
.badge-hadir,
.badge-active {
  background: var(--success-light);
  color: var(--success);
}

.badge-pending,
.badge-today_pending,
.badge-scheduled,
.badge-libur {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-izin,
.badge-info {
  background: var(--info-light);
  color: var(--info);
}

.badge-telat,
.badge-sakit,
.badge-warning {
  background: var(--warning-light);
  color: #8a5700;
}

.badge-cuti,
.badge-purple {
  background: var(--purple-light);
  color: var(--purple);
}

@media (max-width: 980px) {
  .employee-stat-grid,
  .employee-stat-grid.admin-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .dashboard-topline {
    display: grid;
  }

  .dashboard-topline .section-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .employee-hero {
    padding: 20px;
  }

  .hero-clock {
    font-size: 42px;
  }

  .hero-status-grid,
  .employee-stat-grid,
  .employee-stat-grid.admin-overview-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-action {
    width: 100%;
  }

  .dashboard-metric {
    min-height: 118px;
  }

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

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

.dashboard-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin: 4px 0 20px;
}

.dashboard-topline h2 {
  margin: 0;
}

.dashboard-topline span,
.card-heading span {
  color: var(--muted);
}

.employee-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border-radius: 18px;
  padding: clamp(22px, 4vw, 34px);
  color: #fff;
  background:
    radial-gradient(circle at 96% 16%, rgba(255, 255, 255, 0.13) 0 100px, transparent 102px),
    linear-gradient(135deg, #2563eb, #1e40af);
  box-shadow: 0 24px 54px rgba(37, 99, 235, 0.2);
}

.employee-hero h1,
.employee-hero p {
  margin: 0;
}

.employee-hero h1 {
  font-size: clamp(22px, 3vw, 30px);
}

.employee-hero p,
.employee-hero small {
  color: rgba(255, 255, 255, 0.82);
}

.hero-clock {
  display: block;
  margin: 22px 0 2px;
  font-size: clamp(42px, 8vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.hero-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 10px;
  margin-top: 22px;
}

.hero-status-grid div {
  display: grid;
  gap: 3px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
}

.hero-status-grid span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-status-grid strong {
  font-size: 18px;
}

.hero-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-action {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 850;
}

.hero-action.primary {
  background: #fff;
  color: #1d4ed8;
}

.hero-action.done {
  opacity: 0.75;
}

.holiday-badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 850;
}

.employee-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 18px;
}

.dashboard-metric {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.dashboard-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.dashboard-metric strong {
  font-size: 28px;
  line-height: 1;
}

.dashboard-metric span,
.dashboard-metric small {
  color: var(--muted);
}

.dashboard-metric.green {
  border-top-color: #10b981;
}

.dashboard-metric.amber {
  border-top-color: #f59e0b;
}

.dashboard-metric.blue {
  border-top-color: #2563eb;
}

.dashboard-metric.purple {
  border-top-color: #8b5cf6;
}

.metric-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 900;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
}

.card-heading,
.history-header,
.history-row,
.log-row {
  display: grid;
  align-items: center;
}

.card-heading {
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

.card-heading h3 {
  margin: 0;
}

.history-header,
.history-row {
  grid-template-columns: 1fr 0.8fr 0.8fr 1fr;
  gap: 10px;
}

.history-header {
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.history-row {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.history-row:hover {
  background: #f8fafc;
}

.recap-table tbody tr[data-action="detail"] {
  cursor: pointer;
}

.recap-table tbody tr[data-action="detail"]:hover {
  background: #f8fafc;
}

.muted-row {
  background: #f8fafc;
  color: var(--muted);
}

.comparison-table table,
.recap-table table {
  min-width: 760px;
}

.comparison-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.seven-day-status {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
}

.day-status-item {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 12px 8px;
  color: var(--ink);
  cursor: help;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.day-status-item:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: var(--shadow-sm);
}

.day-status-item span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  line-height: 1;
}

.day-status-item strong {
  font-size: 13px;
  white-space: nowrap;
}

.day-status-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.day-status-item.hadir span {
  background: var(--primary);
}

.day-status-item.alpha span {
  background: var(--danger);
}

.day-status-item.libur span {
  background: var(--gray-400);
}

.day-status-item.cuti span {
  background: var(--purple);
}

.day-status-item.izin span {
  background: var(--warning);
}

.day-status-item.sakit span {
  background: #f97316;
}

.recap-table table {
  min-width: 920px;
}

.recap-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.recap-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.recap-table td {
  vertical-align: middle;
}

.muted-dash {
  color: #94a3b8;
}

.note-ellipsis {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.recap-filter-bar {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr) repeat(3, max-content);
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.recap-filter-info {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.cell-link {
  border: 0;
  background: transparent;
  color: var(--brand-dark);
  padding: 0;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.side-detail-grid {
  margin-bottom: 14px;
}

.history-row:disabled {
  cursor: default;
  opacity: 1;
}

.timeline-modern {
  display: grid;
  gap: 0;
  padding-left: 8px;
}

.timeline-modern div {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 4px 10px;
  padding: 0 0 20px;
}

.timeline-modern div::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline-modern div:last-child::before {
  display: none;
}

.timeline-modern div > span {
  grid-row: 1 / 3;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 999px;
  background: #cbd5e1;
}

.timeline-modern .done > span {
  background: #10b981;
}

.timeline-modern .active > span {
  background: #2563eb;
}

.timeline-modern small {
  color: var(--muted);
  font-weight: 750;
}

.timeline-modern strong {
  font-weight: 650;
}

.detail-log,
.pay-breakdown,
.calendar-list {
  display: grid;
  gap: 10px;
}

.log-row,
.pay-breakdown,
.calendar-list div {
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.pay-breakdown {
  grid-template-columns: 1fr auto;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-picker label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
}

.weekday-picker input {
  width: auto;
}

.policy-picker {
  display: grid;
  gap: 8px;
}

.policy-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.policy-option input {
  width: auto;
  margin-top: 3px;
}

.policy-option span {
  display: grid;
  gap: 3px;
}

.policy-option small {
  color: var(--muted);
  line-height: 1.35;
}

.gps-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 850;
}

.gps-valid {
  color: #166534;
  background: #dcfce7;
}

.gps-unavailable {
  color: #92400e;
  background: #fef3c7;
}

.gps-suspicious {
  color: #991b1b;
  background: #fee2e2;
}

.calendar-admin,
.calendar-form {
  display: grid;
  gap: 12px;
}

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

.calendar-month div {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.calendar-month .work {
  border-color: rgba(16, 185, 129, 0.3);
  background: #ecfdf5;
}

.calendar-month .off {
  color: var(--muted);
  background: #f1f5f9;
}

@media (max-width: 760px) {
  .dashboard-topline {
    display: grid;
  }

  .hero-status-grid,
  .employee-stat-grid,
  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .history-header {
    display: none;
  }

  .history-row {
    grid-template-columns: 1fr 1fr;
  }

  .hero-actions-row,
  .hero-action {
    width: 100%;
  }
}

/* Claude UI migration: Stage 1 tokens + Stage 2 app layout */
.app-shell {
  min-height: 100vh;
  background: var(--gray-50);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo small {
  display: block;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.logo-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  flex-shrink: 0;
}

.logo-text {
  color: var(--gray-900);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.role-badge {
  margin-left: auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.nav-section {
  display: grid;
  gap: 2px;
}

.nav-section-label {
  display: block;
  padding: 10px 8px 6px;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar nav .nav-item,
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 10px;
  background: transparent;
  color: var(--gray-600);
  font-size: 13.5px;
  font-weight: 750;
  text-align: left;
  transition: all 0.15s ease;
}

.sidebar nav .nav-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.sidebar nav .nav-item.active {
  border-color: rgba(26, 86, 219, 0.12);
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar nav .nav-item span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  color: inherit;
}

.sidebar nav .nav-item strong {
  min-width: 0;
  overflow: hidden;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  border-radius: 999px;
  padding: 1px 6px;
  background: var(--danger);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--gray-100);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--gray-50);
  color: var(--gray-800);
  text-align: left;
}

.user-card span:last-child {
  display: grid;
  min-width: 0;
}

.user-name {
  display: block;
  overflow: hidden;
  color: var(--gray-800);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  display: block;
  overflow: hidden;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  justify-self: stretch;
  min-height: 36px;
  background: #fff;
  border: 1px solid var(--gray-200);
}

.topbar {
  min-height: var(--topbar-h);
  border: 0;
  border-bottom: 1px solid var(--gray-200);
  border-radius: 0;
  box-shadow: none;
  margin: -28px -28px 24px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 12;
}

.topbar > div:first-of-type {
  display: grid;
  gap: 1px;
}

.topbar > div:first-of-type strong {
  color: var(--gray-900);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  padding: 4px 8px;
  background: transparent;
}

.topbar-user:hover {
  background: var(--gray-50);
}

.topbar-name {
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 800;
}

.notif-dot::after {
  display: none;
}

.notif-dot.has-notif::after {
  display: block;
}

@media (min-width: 860px) {
  .app-shell {
    grid-template-columns: var(--sidebar-w) 1fr;
  }

  .sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    gap: 0;
    padding: 0;
    overflow-x: hidden;
  }
}

@media (max-width: 560px) {
  .sidebar {
    gap: 0;
    padding: 0;
  }

  .sidebar-nav {
    display: grid;
    flex: 1;
    padding: 12px;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    margin: -14px -14px 18px;
    padding: 10px 14px;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    width: 100%;
    margin-left: 0;
  }

  .topbar .primary-btn {
    grid-column: auto;
  }

  .topbar-name {
    display: none;
  }
}

/* Mobile hardening: prevent horizontal overflow and keep detail close button visible. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.workspace,
.panel,
.modern-card,
.employee-hero,
.dashboard-metric,
.table-wrap,
.detail-grid,
.drawer,
.range-modal {
  min-width: 0;
}

img,
video,
canvas {
  max-width: 100%;
}

.detail-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 760px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
  }

  .workspace {
    width: 100%;
    max-width: 100vw;
    padding: 12px;
  }

  .topbar {
    width: auto;
    max-width: calc(100vw - 24px);
    margin: -12px 0 14px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .topbar-actions {
    min-width: 0;
  }

  .topbar .primary-btn,
  .topbar-user,
  .icon-btn,
  .menu-toggle {
    min-width: 0;
  }

  .dashboard-topline,
  .section-header,
  .grid,
  .grid.two,
  .grid.three,
  .admin-dashboard-grid,
  .dashboard-summary-grid,
  .settings-layout {
    grid-template-columns: 1fr !important;
    width: 100%;
    max-width: 100%;
  }

  .panel,
  .modern-card,
  .employee-hero,
  .period-banner {
    width: 100%;
    max-width: 100%;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .table-wrap table {
    width: 100%;
    min-width: 0 !important;
  }

  .table-wrap tr {
    width: 100%;
    max-width: 100%;
  }

  .table-wrap td {
    grid-template-columns: minmax(86px, 32%) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .table-wrap td > * {
    min-width: 0;
  }

  .table-wrap td strong,
  .table-wrap td small,
  .table-wrap td span {
    overflow-wrap: anywhere;
  }

  .drawer {
    inset: 0;
    z-index: 60;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    border-left: 0;
    padding: 12px 16px 24px;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: none;
  }

  .drawer-close {
    position: sticky;
    top: 0;
    z-index: 2;
    float: none;
    display: grid;
    place-items: center;
    margin: 0 0 12px auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .drawer .detail-grid,
  .side-detail-grid,
  .detail-modal .detail-grid {
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    gap: 10px 8px;
    width: 100%;
  }

  .drawer .proof-photo,
  .detail-modal .proof-photo {
    max-height: 62vh;
    aspect-ratio: auto;
    object-fit: contain;
    background: var(--gray-100);
  }

  .map-card {
    overflow-wrap: anywhere;
  }

  .range-modal.detail-modal {
    inset: 10px;
    z-index: 60;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 20px);
    overflow-x: hidden;
    overflow-y: auto;
  }

  .range-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -16px -16px 14px;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
  }

  .history-row,
  .approval-actions,
  .row-actions,
  .section-actions,
  .dashboard-topline .section-actions {
    grid-template-columns: 1fr !important;
  }

  .hero-status-grid,
  .employee-stat-grid,
  .employee-stat-grid.admin-overview-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-clock {
    font-size: clamp(36px, 14vw, 48px);
  }
}

/* Employee management and notification center polish. */
.employee-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.employee-meta-list,
.report-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.employee-meta-list span,
.report-summary-grid span {
  min-width: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--gray-50);
}

.employee-meta-list small,
.report-summary-grid small {
  display: block;
  color: var(--gray-500);
  font-size: 11px;
}

.employee-meta-list strong,
.report-summary-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.employee-id.missing {
  color: var(--warning);
  font-weight: 700;
}

.employee-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.employee-location-box {
  display: grid;
  gap: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--gray-50);
}

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

.notification-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.notification-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: #fff;
  color: var(--gray-900);
  text-align: left;
  cursor: pointer;
}

.notification-item:hover,
.notification-item.active {
  border-color: rgba(26, 86, 219, 0.3);
  background: rgba(26, 86, 219, 0.05);
}

.notification-item.unread strong {
  color: var(--primary);
}

.notification-item small,
.notification-item time {
  grid-column: 2;
  color: var(--gray-500);
}

.notification-detail {
  align-self: start;
}

.attention-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--gray-700);
}

.department-list {
  display: grid;
  gap: 10px;
}

.department-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: #fff;
}

.department-row strong,
.department-row small,
.department-row span {
  display: block;
}

.department-row small,
.department-row span {
  color: var(--gray-500);
}

.department-form {
  align-self: start;
}

.proof-tabs-static {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.proof-section {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: #fff;
}

.proof-section.out {
  background: var(--gray-50);
}

.proof-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.proof-section-head small {
  color: var(--gray-500);
  font-weight: 700;
}

.compact-proof-grid {
  grid-template-columns: minmax(88px, 30%) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.compact-proof-grid strong {
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.employee-edit-modal {
  width: min(96vw, 1120px);
  max-height: min(88vh, 860px);
}

.employee-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.employee-edit-form > input[type="hidden"] {
  display: none;
}

.employee-edit-form .employee-location-box {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.employee-edit-form .alert {
  grid-column: 1;
}

.employee-edit-form > .primary-btn {
  grid-column: 2;
  justify-self: start;
}

.location-company-note {
  border: 1px solid rgba(26, 86, 219, 0.16);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--gray-600);
  background: rgba(26, 86, 219, 0.06);
}

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

@media (max-width: 768px) {
  .seven-day-status {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .day-status-item {
    min-width: 78px;
    scroll-snap-align: start;
  }

  .comparison-tools {
    align-items: stretch;
    flex-direction: column;
  }

  body.modal-open {
    overflow: hidden;
  }

  .modal-backdrop.open {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(4px);
  }

  .range-modal.detail-modal {
    position: fixed;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: auto 0 0 !important;
    z-index: 100;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    max-height: 85dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    transform: none !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.18);
  }

  .range-modal.detail-modal .range-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
  }

  .range-modal.detail-modal .detail-log,
  .range-modal.detail-modal .settings-form,
  .range-modal.detail-modal .detail-grid,
  .range-modal.detail-modal .side-detail-grid,
  .range-modal.detail-modal .pay-breakdown {
    max-height: calc(85dvh - 78px);
    overflow-y: auto;
    padding: 16px;
  }

  .range-modal.detail-modal .drawer-close {
    position: static;
    margin: 0;
    flex: 0 0 auto;
  }

  .range-modal.detail-modal.employee-edit-modal {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }

  .range-modal.detail-modal.employee-edit-modal .employee-edit-form {
    max-height: calc(100dvh - 78px);
  }

  .employee-grid,
  .notification-layout,
  .department-layout,
  .form-grid.two-cols,
  .employee-edit-form,
  .custom-location-fields,
  .employee-meta-list,
  .report-summary-grid {
    grid-template-columns: 1fr !important;
  }

  .employee-edit-form .employee-location-box,
  .employee-edit-form .alert,
  .employee-edit-form > .primary-btn {
    grid-column: auto;
    grid-row: auto;
  }

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

  .notification-item,
  .department-row,
  .employee-card {
    width: 100%;
    max-width: 100%;
  }

  .department-row {
    display: grid;
  }
}
