:root {
  --hr-bg: #ffffff;
  --hr-card: #ffffff;
  --hr-border: #e5e7eb;
  --hr-text: #1f2d2a;
  --hr-muted: #6b7280;
  --hr-accent: #4563c0;
  --hr-accent-hover: #3450a8;
  --hr-accent-soft: rgba(69, 99, 192, 0.1);
  --hr-gradient: linear-gradient(135deg, #5b7ad4 0%, #4563c0 48%, #3450a8 100%);
  --hr-radius: 16px;
  --hr-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --status-p: #16a34a;
  --status-l: #d97706;
  --status-c: #2563eb;
  --status-h: #94a3b8;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --hr-bg: #0f1419;
  --hr-card: #171e28;
  --hr-border: #2a3544;
  --hr-text: #e8eef7;
  --hr-muted: #94a3b8;
  --hr-accent: #6b8adf;
  --hr-accent-hover: #8aa3e8;
  --hr-accent-soft: rgba(107, 138, 223, 0.16);
  --hr-gradient: linear-gradient(135deg, #5b7ad4 0%, #4563c0 48%, #3450a8 100%);
  --hr-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --bg: #0f1419;
  --card: #171e28;
  --card-border: #2a3544;
  --card-hover: #1e2836;
  --border: #2a3544;
  --muted: #94a3b8;
  --text: #e8eef7;
  --accent: #6b8adf;
  --accent-2: #8aa3e8;
  --accent-soft: rgba(107, 138, 223, 0.16);
  --az-sidebar-bg: #121820;
  --az-sidebar-border: #243041;
  --az-content-bg: #0f1419;
  --az-topbar-bg: var(--hr-gradient);
}

* { box-sizing: border-box; }

body.hr-app {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  background: var(--hr-bg);
  color: var(--hr-text);
}

.hr-nav {
  background: var(--hr-card);
  border-bottom: 1px solid var(--hr-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hr-nav-brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--hr-text);
  text-decoration: none;
}

.hr-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.hr-nav-links a {
  color: var(--hr-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}

.hr-nav-links a:hover,
.hr-nav-links a.active {
  color: var(--hr-accent);
  background: var(--accent-soft, var(--hr-accent-soft));
}

.hr-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.hr-page-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}

.hr-page-sub {
  color: var(--hr-muted);
  margin: 0 0 24px;
}

.hr-card {
  background: var(--hr-card);
  border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius);
  box-shadow: var(--hr-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.hr-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.hr-stat {
  background: var(--hr-card);
  border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius);
  padding: 16px;
}

.hr-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--hr-accent);
}

.hr-stat-label {
  font-size: 13px;
  color: var(--hr-muted);
  margin-top: 4px;
}

/* Embedded timesheet app (index.html?hrEmbed=1) on the employee dashboard */
.hr-timesheet-embed {
  padding: 12px;
  overflow: hidden;
}

.hr-timesheet-embed h2 {
  padding: 8px 8px 0;
}

.hr-timesheet-iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 900px;
}

.hr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.hr-btn-primary {
  background: var(--hr-gradient);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(69, 99, 192, 0.28);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    opacity 0.16s ease,
    filter 0.16s ease;
}

.hr-btn-primary:hover:not(:disabled):not(.is-loading) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(69, 99, 192, 0.38);
  opacity: 1;
  filter: brightness(1.03);
}

.hr-btn-primary:active:not(:disabled):not(.is-loading) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(69, 99, 192, 0.24);
  filter: brightness(0.98);
}

.hr-btn-primary:focus-visible {
  outline: 2px solid rgba(69, 99, 192, 0.55);
  outline-offset: 2px;
}

/* Backward-compatible alias for explicit save buttons */
.hr-btn-save {
  position: relative;
  overflow: hidden;
}

.hr-btn.is-loading {
  cursor: wait;
  opacity: 0.94;
  pointer-events: none;
  transform: none;
}

.hr-btn-primary.is-loading {
  box-shadow: 0 2px 10px rgba(99, 132, 214, 0.22);
}

.hr-btn-primary.is-loading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 35%;
  background: rgba(255, 255, 255, 0.75);
  animation: hr-btn-save-progress 1.1s ease-in-out infinite;
}

.hr-btn-secondary.is-loading::after,
.hr-btn-ghost.is-loading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 35%;
  background: rgba(99, 132, 214, 0.55);
  animation: hr-btn-save-progress 1.1s ease-in-out infinite;
}

.hr-btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hr-btn-spin 0.7s linear infinite;
  flex-shrink: 0;
}

.hr-btn-secondary .hr-btn-spinner,
.hr-btn-ghost .hr-btn-spinner {
  border-color: rgba(15, 23, 42, 0.15);
  border-top-color: var(--hr-accent);
}

.hr-btn.is-loading .hr-btn-spinner {
  display: inline-block;
}

@keyframes hr-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes hr-btn-save-progress {
  0% {
    transform: translateX(-120%);
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(320%);
    opacity: 0.35;
  }
}

.hr-btn-secondary {
  background: #f1f5f9;
  color: var(--hr-text);
  border: 1px solid var(--hr-border);
}

.hr-btn-ghost {
  background: transparent;
  color: var(--hr-muted);
  border: 1px solid var(--hr-border);
}

.hr-form-group {
  margin-bottom: 16px;
}

.hr-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.hr-form-group input,
.hr-form-group select,
.hr-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hr-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.hr-form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.hr-form-section {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hr-muted);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hr-border);
}

.hr-form-section:first-child {
  margin-top: 0;
}

.hr-detail-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0 20px;
  margin-bottom: 8px;
}

.hr-detail-item label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--hr-muted);
  margin-bottom: 4px;
}

.hr-detail-item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.hr-pincode-status {
  font-size: 12px;
  color: var(--hr-muted);
  margin-top: 6px;
  min-height: 18px;
}

.hr-pincode-status--loading {
  color: #6366f1;
}

.hr-pincode-status--success {
  color: #059669;
}

.hr-pincode-status--error {
  color: #b91c1c;
}

.hr-manual-address {
  display: none;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--hr-border);
}

.hr-table-wrap {
  overflow-x: auto;
}

.hr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.hr-table th,
.hr-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hr-border);
  text-align: left;
}

.hr-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hr-muted);
}

.hr-table tbody tr.hr-row-clickable {
  cursor: pointer;
}

.hr-table tbody tr.hr-row-clickable:hover,
.hr-table tbody tr.hr-row-clickable:focus-visible {
  background: rgba(99, 132, 214, 0.06);
  outline: none;
}

.hr-table-link {
  color: var(--hr-accent);
  text-decoration: none;
  font-weight: 600;
}

.hr-table-link:hover {
  text-decoration: underline;
}

.hr-table-input {
  width: 100%;
  border: 1px solid var(--hr-accent);
  border-radius: 4px;
  padding: 4px 6px;
  font: inherit;
  background: var(--hr-surface, #fff);
}

.hr-table td[data-editable] {
  cursor: default;
}

.hr-components-editor {
  margin-top: 4px;
}

.hr-components-editor th,
.hr-components-editor td {
  padding: 6px 10px;
  vertical-align: middle;
}

.hr-components-editor .hr-comp-name-cell {
  min-width: 140px;
}

.hr-components-editor .hr-cell-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
}

.hr-components-editor .hr-comp-label-row {
  font-weight: 500;
  line-height: 1.3;
}

.hr-components-editor .hr-comp-code-row {
  margin-top: 2px;
}

.hr-components-editor .hr-comp-code-row .hr-cell-text {
  font-size: 11px;
  color: var(--hr-muted);
  line-height: 1.2;
}

.hr-components-editor .hr-cell-text {
  flex: 1;
  min-width: 0;
}

.hr-components-editor .hr-cell-edit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--hr-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}

.hr-components-editor tr:hover .hr-cell-edit-btn,
.hr-components-editor .hr-cell-edit-btn:focus-visible {
  opacity: 1;
}

.hr-components-editor .hr-cell-edit-btn:hover {
  background: rgba(99, 132, 214, 0.1);
  color: var(--hr-accent);
}

.hr-components-editor .hr-cell-muted {
  color: var(--hr-muted);
  cursor: default;
}

.hr-components-editor .hr-row-actions {
  width: 36px;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.hr-components-editor .hr-comp-remove {
  opacity: 0;
  min-width: 28px;
  padding: 2px 6px;
  font-size: 16px;
  line-height: 1;
}

.hr-components-editor tr:hover .hr-comp-remove {
  opacity: 1;
}

.hr-components-editor .hr-cell-row.hr-cell-editing {
  padding: 0 2px;
}

.hr-components-editor .hr-cell-row.hr-cell-editing .hr-table-input {
  width: 100%;
}

.hr-edit-hint {
  font-size: 12px;
  color: var(--hr-muted);
  margin: 0 0 6px;
}

.hr-settings-section + .hr-settings-section {
  margin-top: 16px;
}

.hr-comp-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hr-comp-group-card {
  padding: 14px 16px;
  margin: 0;
  background: var(--hr-surface-alt, #f8fafc);
}

.hr-comp-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.hr-comp-group-header-text h4 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
}

.hr-comp-group-header-text .hr-edit-hint {
  margin: 0;
}

.hr-comp-group-card .hr-components-editor {
  margin-top: 0;
  background: var(--hr-card, #fff);
  border-radius: 8px;
}

.hr-comp-group-empty {
  margin: 0;
  padding: 8px 0;
  font-size: 13px;
}

.hr-comp-add {
  margin-top: 8px;
}

.hr-components-editor .hr-cell-readonly .hr-cell-text {
  cursor: default;
}

.hr-components-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.hr-components-header-text h3 {
  font-size: 14px;
  margin: 0 0 4px;
}

.hr-components-header-text .hr-edit-hint {
  margin: 0;
}

.hr-edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--hr-border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--hr-text);
}

.hr-edit-toggle svg {
  flex-shrink: 0;
}

.hr-edit-toggle.is-on {
  border-color: var(--hr-accent);
  background: rgba(99, 132, 214, 0.1);
  color: var(--hr-accent);
}

.hr-edit-toggle.is-off {
  color: var(--hr-muted);
}

.hr-edit-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hr-components-editor:not(.is-editable) .hr-cell-edit-btn,
.hr-components-editor:not(.is-editable) .hr-comp-remove {
  display: none !important;
}

.hr-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--hr-border);
}

.hr-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1;
}

.hr-filter-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hr-muted);
}

.hr-filter-bar input,
.hr-filter-bar select {
  padding: 8px 10px;
  border: 1px solid var(--hr-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--hr-text);
}

.hr-filter-bar input:focus,
.hr-filter-bar select:focus {
  outline: none;
  border-color: var(--hr-accent);
  box-shadow: 0 0 0 2px rgba(99, 132, 214, 0.2);
}

.hr-filter-clear {
  flex-shrink: 0;
  margin-bottom: 1px;
}

.hr-th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.hr-th-sortable:hover {
  color: var(--hr-text);
}

.hr-th-sortable.is-sorted {
  color: var(--hr-accent);
}

.hr-sort-icon {
  display: inline-block;
  font-size: 10px;
  margin-left: 2px;
  vertical-align: middle;
  color: var(--hr-accent);
}

.hr-sort-icon-idle {
  color: var(--hr-border);
  font-size: 9px;
}

.hr-th-sortable:hover .hr-sort-icon-idle {
  color: var(--hr-muted);
}

.hr-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.hr-table-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hr-table .hr-row-actions {
  white-space: nowrap;
}

.hr-table .hr-row-actions > * + * {
  margin-left: 10px;
}

.hr-bulk-icon,
.hr-bulk-delete {
  padding: 8px;
  min-width: 38px;
  min-height: 38px;
}

.hr-bulk-icon svg,
.hr-bulk-delete svg {
  display: block;
  flex-shrink: 0;
}

.hr-bulk-delete {
  color: #b91c1c;
  border-color: #fecaca;
}

.hr-bulk-delete:hover {
  background: #fef2f2;
  color: #991b1b;
}

.hr-th-check,
.hr-td-check {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.hr-row-check {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--hr-accent);
}

.hr-table tbody tr.is-selected {
  background: rgba(99, 132, 214, 0.08);
}

.hr-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--hr-accent);
  cursor: pointer;
  text-decoration: underline;
}

.hr-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.hr-badge-internal { background: #dbeafe; color: #1d4ed8; }
.hr-badge-client { background: #dcfce7; color: #15803d; }

.hr-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--hr-muted);
}

.hr-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(420px, calc(100vw - 48px));
  background: #0f172a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.hr-toast.show { display: block; }

.hr-toast-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.hr-toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.hr-toast-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.hr-toast-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.status-p { color: var(--status-p); font-weight: 700; }
.status-l { color: var(--status-l); font-weight: 700; }
.status-c { color: var(--status-c); font-weight: 700; }
.status-h { color: var(--status-h); font-weight: 700; }

.hr-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(4px, 0.5vw, 8px);
  padding: 2px 0 4px;
  max-width: 560px;
}

.hr-cal-head {
  font-size: 10px;
  font-weight: 600;
  color: var(--hr-muted);
  text-align: center;
  padding: 2px;
}

.hr-cal-day {
  aspect-ratio: unset;
  min-height: clamp(48px, 3.2vw, 58px);
  height: clamp(48px, 3.2vw, 58px);
  border: 1px solid var(--hr-border);
  border-radius: 7px;
  position: relative;
  cursor: pointer;
  font-size: 12px;
  background: #fff;
  padding: 4px 2px 6px;
}

.hr-cal-day:hover { border-color: var(--hr-accent); }
.hr-cal-day.today { border-color: var(--hr-accent); box-shadow: 0 0 0 2px rgba(99, 132, 214, 0.2); }
.hr-cal-day.selected { background: rgba(99, 132, 214, 0.08); }
.hr-cal-day.empty { background: transparent; border: none; cursor: default; }
.hr-cal-day .day-num {
  position: absolute;
  top: 5px;
  left: 6px;
  font-weight: 600;
  font-size: 11px;
}
.hr-cal-day .day-status {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  margin-top: 0;
}

@media (max-width: 640px) {
  .hr-calendar-grid {
    max-width: none;
    gap: 3px;
  }

  .hr-cal-day {
    min-height: clamp(36px, 10vw, 44px);
    height: clamp(36px, 10vw, 44px);
  }
}

.hr-attendance-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.hr-attendance-toolbar .hr-view-toggle,
.hr-attendance-toolbar .hr-edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--hr-border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--hr-text);
}

.hr-attendance-toolbar .hr-view-toggle.is-active,
.hr-attendance-toolbar .hr-edit-toggle.is-on {
  border-color: var(--hr-accent);
  background: rgba(99, 132, 214, 0.1);
  color: var(--hr-accent);
}

.hr-attendance-toolbar .hr-edit-toggle.is-off {
  color: var(--hr-muted);
}

.hr-attendance-toolbar .hr-edit-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hr-cal-day.is-selected {
  border-color: var(--hr-accent);
  box-shadow: 0 0 0 2px rgba(99, 132, 214, 0.2);
}

.hr-cal-day.has-hr-override::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

.hr-cal-day.hr-readonly {
  cursor: default;
}

.hr-cal-day.hr-editable {
  cursor: pointer;
}

.hr-attendance-layout {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.hr-attendance-layout.is-sheet-view {
  grid-template-columns: 1fr;
}

.hr-attendance-layout.is-sheet-view #dayDetailPanel {
  display: none !important;
}

.hr-attendance-layout.is-sheet-view #attendanceMainCard {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .hr-attendance-layout.is-calendar-view {
    grid-template-columns: 1fr;
  }
}

.hr-day-detail-panel {
  padding: 16px;
}

.hr-day-detail-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.hr-day-detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 14px;
}

.hr-day-detail-grid .label {
  color: var(--hr-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hr-day-detail-grid .value.is-placeholder {
  color: var(--hr-muted);
}

.hr-punch-timeline {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--hr-border);
}

.hr-punch-timeline-item {
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hr-border);
}

.hr-punch-timeline-item:last-child {
  border-bottom: none;
}

.hr-change-log {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--hr-border);
  font-size: 12px;
  color: var(--hr-muted);
}

.hr-change-log-item {
  padding: 4px 0;
}

.hr-attendance-sheet-wrap {
  overflow-x: auto;
}

.hr-attendance-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hr-attendance-sheet th,
.hr-attendance-sheet td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hr-border);
  text-align: left;
  white-space: nowrap;
}

.hr-attendance-sheet th {
  position: sticky;
  top: 0;
  background: var(--hr-surface, #fff);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hr-muted);
  z-index: 1;
}

.hr-attendance-sheet tbody tr:hover {
  background: rgba(99, 132, 214, 0.04);
}

.hr-attendance-sheet td.hr-sheet-wrap-cell {
  white-space: normal;
  min-width: 120px;
  max-width: 280px;
}

.hr-attendance-notice {
  font-size: 13px;
  color: var(--hr-muted);
  margin: 0 0 12px;
}

.hr-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hr-wizard-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.hr-wizard-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--hr-border);
}

.hr-wizard-step.active { background: var(--hr-accent); }
.hr-wizard-step.done { background: #a5b4f3; }

.hr-profile-ring {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hr-profile-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.hr-profile-ring-bg,
.hr-profile-ring-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}

.hr-profile-ring-bg {
  stroke: var(--hr-border, #e5e7eb);
}

.hr-profile-ring-fill {
  stroke: var(--hr-accent, #6384d6);
  transition: stroke-dasharray 0.25s ease;
}

.hr-profile-ring-label {
  position: relative;
  font-size: 9px;
  font-weight: 700;
  color: var(--hr-muted, #64748b);
  line-height: 1;
}

.hr-profile-ring.has-progress .hr-profile-ring-label {
  color: var(--hr-accent, #6384d6);
}

.hr-page-meta,
.hr-status-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hr-status-badges {
  flex-wrap: wrap;
  margin-bottom: 0;
}

.hr-status-badges .hr-badge {
  min-height: 36px;
  padding: 0 12px;
}

.hr-profile-complete-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--hr-accent, #6384d6);
  text-decoration: none;
  white-space: nowrap;
}

.hr-profile-complete-link:hover {
  text-decoration: underline;
}

.hr-portal-header-row {
  margin-bottom: 8px;
}

.hr-portal-header-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.hr-portal-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-soft, rgba(99, 132, 214, 0.12));
  border: 2px solid var(--hr-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hr-portal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hr-portal-avatar-initial {
  font-size: 24px;
  font-weight: 700;
  color: var(--hr-accent);
}

.hr-profile-page-header {
  align-items: flex-start;
  justify-content: space-between;
}

.hr-profile-report-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.hr-profile-page-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hr-profile-report {
  padding: 24px;
}

.hr-employee-summary {
  padding: 24px;
  margin-top: 12px;
}

.hr-employee-summary-grid {
  margin-bottom: 20px;
}

.hr-employee-summary .hr-profile-missing-hint {
  text-align: left;
  margin-top: 0;
}

.hr-employee-summary-attendance {
  border-top: 1px solid var(--hr-border);
  padding-top: 16px;
}

.hr-employee-summary-salary {
  border-top: 1px solid var(--hr-border);
  padding-top: 16px;
  margin-top: 16px;
}

.hr-payslip-preview-body {
  margin-top: 4px;
}

/* Universal standard payslip (HTML preview mirrors PDF) */
.hr-payslip-standard {
  border: 1px solid #d0d5dd;
  padding: 0;
  overflow: hidden;
}

.hr-payslip-company-block {
  text-align: center;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #d0d5dd;
}

.hr-payslip-company-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--hr-text);
}

.hr-payslip-company-address,
.hr-payslip-company-ids {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--hr-muted);
}

.hr-payslip-title-band {
  text-align: center;
  padding: 12px 16px;
  border-bottom: 1px solid #d0d5dd;
  background: #f8fafc;
}

.hr-payslip-title-band h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hr-payslip-title-band p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--hr-muted);
}

.hr-payslip-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid #d0d5dd;
}

.hr-payslip-detail-item {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid #eef0f3;
}

.hr-payslip-detail-item:nth-child(odd) {
  border-right: 1px solid #eef0f3;
}

.hr-payslip-detail-label {
  color: var(--hr-muted);
  min-width: 110px;
  flex-shrink: 0;
}

.hr-payslip-detail-label::after {
  content: ":";
}

.hr-payslip-detail-value {
  font-weight: 600;
  color: var(--hr-text);
  word-break: break-word;
}

.hr-payslip-company {
  font-size: 13px;
  font-weight: 600;
  color: var(--hr-text);
  margin: 0 0 4px;
}

.hr-payslip-header {
  font-size: 14px;
  margin: 0 0 4px;
}

.hr-payslip-meta {
  font-size: 13px;
  color: var(--hr-muted);
  margin: 0 0 12px;
}

.hr-payslip-estimate-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  vertical-align: middle;
}

.hr-payslip-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

.hr-payslip-table {
  margin: 0;
  min-width: 520px;
  border-radius: 0;
}

.hr-payslip-table thead th {
  background: #f0f2f5;
  font-size: 12px;
}

.hr-payslip-table tfoot td {
  background: #f8fafc;
  font-size: 12px;
}

.hr-payslip-table .hr-payslip-num {
  text-align: right;
  white-space: nowrap;
}

.hr-payslip-net {
  padding: 12px 16px;
  background: #eef6ee;
  border-top: 1px solid #d0d5dd;
  border-bottom: 1px solid #d0d5dd;
}

.hr-payslip-net-amount {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--hr-text);
}

.hr-payslip-words {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--hr-muted);
}

.hr-payslip-employer {
  padding: 12px 16px;
  border-bottom: 1px solid #d0d5dd;
}

.hr-payslip-employer-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.hr-payslip-employer-title span {
  font-weight: 400;
  color: var(--hr-muted);
}

.hr-payslip-employer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hr-payslip-employer-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  padding: 3px 0;
}

.hr-payslip-ctc {
  margin-top: 4px;
  padding-top: 6px !important;
  border-top: 1px dashed #d0d5dd;
  font-weight: 700;
}

.hr-payslip-footer {
  margin: 0;
  padding: 10px 16px;
  font-size: 11px;
  color: var(--hr-muted);
  text-align: center;
}

@media (max-width: 560px) {
  .hr-payslip-detail-grid {
    grid-template-columns: 1fr;
  }

  .hr-payslip-detail-item:nth-child(odd) {
    border-right: none;
  }
}

.hr-employee-summary-stats {
  margin-bottom: 0;
}

/* Company profile page — compact stats + 2-column detail sections */
.hr-company-profile {
  padding: 16px 20px;
}

.hr-company-profile .hr-company-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hr-border);
}

.hr-company-profile .hr-company-stats .hr-stat {
  padding: 8px 10px;
  border: none;
  background: var(--hr-surface-alt, #f8fafc);
  border-radius: 8px;
}

.hr-company-profile .hr-stat-clickable {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.hr-company-profile .hr-stat-clickable:hover,
.hr-company-profile .hr-stat-clickable:focus-visible {
  background: rgba(99, 132, 214, 0.08);
  outline: 2px solid var(--hr-accent);
  outline-offset: 2px;
}

.hr-company-profile .hr-stat-value {
  font-size: 18px;
  line-height: 1.2;
}

.hr-company-profile .hr-stat-label {
  font-size: 11px;
  margin-top: 2px;
}

.hr-company-profile-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 28px;
}

.hr-company-profile-section .hr-form-section {
  margin: 10px 0 6px;
  padding-bottom: 4px;
  font-size: 11px;
}

.hr-company-profile-section .hr-form-section:first-child {
  margin-top: 0;
}

.hr-company-profile-section .hr-detail-form-grid {
  gap: 2px 14px;
  margin-bottom: 0;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.hr-company-profile-section .hr-detail-item {
  margin-bottom: 6px;
}

.hr-company-profile-section .hr-detail-item label {
  font-size: 11px;
  margin-bottom: 1px;
}

.hr-company-profile-section .hr-detail-item p {
  font-size: 13px;
  line-height: 1.35;
}

@media (max-width: 768px) {
  .hr-company-profile .hr-company-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hr-company-profile-sections {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.hr-employee-profile-expand {
  margin-top: 16px;
}

.hr-employee-profile-expand-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--hr-accent);
  list-style: none;
  user-select: none;
}

.hr-employee-profile-expand-summary::-webkit-details-marker {
  display: none;
}

.hr-employee-profile-expand-summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.hr-employee-profile-expand[open] .hr-employee-profile-expand-summary::before {
  transform: rotate(90deg);
}

.hr-employee-profile-expand #empFullProfile {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hr-border);
}

.hr-profile-missing-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--hr-muted);
  text-align: center;
}

.hr-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--hr-border);
  background: var(--hr-card, #fff);
  color: var(--hr-accent);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.hr-icon-btn:hover {
  background: var(--accent-soft, rgba(99, 132, 214, 0.12));
  border-color: var(--hr-accent);
}

.hr-portal-role-line {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--hr-text);
}

.hr-portal-header-main .hr-page-sub {
  margin-bottom: 0;
}

.hr-photo-upload-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.hr-photo-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--accent-soft, rgba(99, 132, 214, 0.12));
  border: 2px solid var(--hr-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hr-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hr-photo-preview-initial {
  font-size: 32px;
  font-weight: 700;
  color: var(--hr-accent);
}

.hr-photo-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.hr-photo-hint {
  font-size: 13px;
  color: var(--hr-muted);
  margin: 0;
}

.hr-salary-readonly {
  background: var(--hr-surface-alt, #f8fafc);
  color: var(--hr-muted);
}

.hr-input-copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.hr-input-copy-row input {
  flex: 1;
  min-width: 0;
}

.hr-portal-password-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  background: var(--hr-surface-alt, #f8fafc);
  color: var(--hr-muted);
  border: 1px solid var(--hr-border, #e2e8f0);
}

.hr-portal-password-status[data-status="pending"] {
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.hr-portal-password-status[data-status="active"] {
  color: #15803d;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}

/* Employee dashboard — punch & actions */
.hr-emp-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .hr-emp-top-grid { grid-template-columns: 1fr; }
}

.hr-emp-punch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hr-btn-punch-in {
  background: linear-gradient(120deg, #16a34a, #15803d);
  color: #fff;
  min-width: 120px;
}

.hr-btn-punch-out {
  background: #f1f5f9;
  color: var(--hr-text);
  border: 1px solid var(--hr-border);
  min-width: 120px;
}

.hr-btn-punch-in:disabled,
.hr-btn-punch-out:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hr-punch-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.hr-punch-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hr-punch-badge.in {
  background: #dcfce7;
  color: #166534;
}

.hr-punch-badge.out {
  background: #fee2e2;
  color: #b91c1c;
}

.hr-hours-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hr-hours-item label {
  display: block;
  font-size: 12px;
  color: var(--hr-muted);
  margin-bottom: 4px;
}

.hr-hours-item strong {
  font-size: 18px;
}

.hr-shift-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.hr-shift-list span:first-child {
  color: var(--hr-muted);
  min-width: 90px;
  display: inline-block;
}

.hr-emp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.hr-emp-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .hr-emp-layout { grid-template-columns: 1fr; }
}

.hr-day-panel {
  font-size: 14px;
}

.hr-day-panel dt {
  color: var(--hr-muted);
  font-size: 12px;
  margin-top: 10px;
}

.hr-day-panel dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.hr-timeline {
  margin-top: 8px;
  font-size: 13px;
  color: var(--hr-muted);
}

.hr-timeline-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--hr-border);
}

.hr-timeline-item:last-child {
  border-bottom: none;
}

@media (max-width: 640px) {
  .hr-main { padding: 16px 12px 32px; }
  .hr-page-title { font-size: 22px; }
}

/* ── Azure-style app shell ── */
:root {
  --az-topbar-h: 48px;
  --az-sidebar-w: 220px;
  --az-sidebar-bg: #ffffff;
  --az-sidebar-border: #e8eef8;
  --az-topbar-bg: var(--hr-gradient);
  --az-topbar-text: #ffffff;
  --az-content-bg: #ffffff;
}

body.az-shell-active {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

body.az-shell-active .main-navbar,
body.az-shell-active .top-nav,
body.az-shell-active header.navbar,
body.az-shell-active header.topbar,
body.az-shell-active .top-bar,
body.az-shell-active .hr-nav {
  display: none !important;
}

.az-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.az-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--az-topbar-h);
  padding: 0 16px;
  background: var(--az-topbar-bg);
  color: var(--az-topbar-text);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(52, 80, 168, 0.22);
}

.az-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.az-topbar-menu {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
}

.az-topbar-menu:hover {
  background: rgba(255, 255, 255, 0.12);
}

.az-topbar-brand {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.az-topbar-search-wrap {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}

.az-topbar-search {
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--hr-text);
}

.az-topbar-public-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.az-topbar-nav-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
}

.az-topbar-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.az-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.az-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.az-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
}

.az-theme-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.az-theme-toggle svg {
  display: block;
  width: 14px;
  height: 14px;
}

.az-theme-toggle .az-theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .az-theme-toggle .az-theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .az-theme-toggle .az-theme-icon-sun {
  display: block;
}

html[data-theme="dark"] .az-topbar-search {
  background: rgba(15, 20, 25, 0.92);
  color: #e8eef7;
}

.az-notif-wrap {
  position: relative;
}

.az-notif-back {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.az-notif-back:hover {
  background: rgba(255, 255, 255, 0.25);
}

.az-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.az-notif-btn:hover,
.az-notif-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.25);
}

.az-notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #b91c1c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.az-notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  display: none;
  flex-direction: column;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  z-index: 80;
  overflow: hidden;
}

.az-notif-panel.is-open {
  display: flex;
}

.az-notif-panel-head,
.az-notif-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.az-notif-panel-foot {
  border-bottom: none;
  border-top: 1px solid #e2e8f0;
  justify-content: center;
}

.az-notif-panel-head strong {
  font-size: 13px;
}

.az-notif-mark-all {
  border: none;
  background: transparent;
  color: var(--hr-accent, #6384d6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.az-notif-mark-all:disabled {
  opacity: 0.45;
  cursor: default;
}

.az-notif-panel-body {
  overflow-y: auto;
  flex: 1;
}

.az-notif-empty {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.az-notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.az-notif-item {
  border-bottom: 1px solid #f1f5f9;
}

.az-notif-item.is-unread {
  background: rgba(99, 132, 214, 0.06);
}

.az-notif-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.az-notif-link {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.az-notif-link:hover {
  background: #f8fafc;
}

.az-notif-mark-one {
  flex-shrink: 0;
  align-self: center;
  margin-right: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.az-notif-mark-one:hover {
  border-color: var(--hr-accent, #6384d6);
  color: var(--hr-accent, #6384d6);
  background: #f8fafc;
}

.az-notif-mark-one:disabled {
  opacity: 0.5;
  cursor: default;
}

.az-notif-read-label {
  flex-shrink: 0;
  align-self: center;
  margin-right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.az-notif-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.az-notif-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.az-notif-type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #64748b;
}

.az-notif-msg {
  font-size: 13px;
  line-height: 1.35;
  color: #0f172a;
}

.az-notif-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.az-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hr-accent, #6384d6);
  flex-shrink: 0;
  margin-top: 6px;
}

.az-notif-footer-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--hr-accent, #6384d6);
  text-decoration: none;
}

.az-notif-footer-link:hover {
  text-decoration: underline;
}

.az-notif-page-card {
  padding: 0;
  overflow: hidden;
}

.az-notif-filters {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--hr-border, #e2e8f0);
  padding: 0 8px;
  background: #f8fafc;
}

.az-notif-filter {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.az-notif-filter.is-active {
  color: var(--hr-accent, #6384d6);
  border-bottom-color: var(--hr-accent, #6384d6);
}

.az-notif-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.az-notif-page-item {
  border-bottom: 1px solid #f1f5f9;
}

.az-notif-page-item:last-child {
  border-bottom: none;
}

.az-notif-page-item.is-unread {
  background: rgba(99, 132, 214, 0.06);
}

.az-notif-page-link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.az-notif-page-link:hover {
  background: #f8fafc;
}

.az-notif-page-item .az-notif-mark-one {
  margin-right: 14px;
}

.az-notif-page-item .az-notif-read-label {
  margin-right: 16px;
}

.az-notif-open {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--hr-accent, #6384d6);
  padding-top: 4px;
}

.az-topbar-user {
  font-size: 13px;
  opacity: 0.92;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.az-topbar-signout {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.az-topbar-signout:hover {
  background: rgba(255, 255, 255, 0.25);
}

.az-app-topbar-only .az-layout {
  min-height: calc(100vh - var(--az-topbar-h));
}

.az-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--az-topbar-h));
  position: relative;
}

.az-sidebar {
  width: var(--az-sidebar-w);
  flex-shrink: 0;
  background: var(--az-sidebar-bg);
  border-right: 1px solid var(--az-sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: width 0.2s ease, transform 0.2s ease;
  box-shadow: 1px 0 0 rgba(69, 99, 192, 0.04);
}

.az-sidebar-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid var(--az-sidebar-border);
}

.az-sidebar-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d5dde8;
  border-radius: 4px;
  font-size: 13px;
  background: #fff;
}

.az-nav-section {
  padding: 4px 0 8px;
}

.az-nav-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--az-sidebar-border);
  margin-bottom: 0;
}

.az-nav-list {
  display: flex;
  flex-direction: column;
}

.az-nav-item {
  display: block;
  padding: 10px 16px 10px 13px;
  font-size: 14px;
  color: #334155;
  text-decoration: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--az-sidebar-border);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-left-color 0.15s ease,
    padding-left 0.15s ease;
}

.az-nav-item:last-child {
  border-bottom: none;
}

.az-nav-item:hover {
  background: var(--hr-accent-soft);
  color: var(--hr-accent);
  border-left-color: var(--hr-accent);
  padding-left: 16px;
}

.az-nav-item.active {
  background: linear-gradient(90deg, rgba(69, 99, 192, 0.14), rgba(69, 99, 192, 0.04));
  color: var(--hr-accent-hover);
  border-left-color: var(--hr-accent);
  font-weight: 600;
}

.az-nav-sublist {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-left: 2px solid var(--az-sidebar-border);
  margin: 0 0 0 24px;
  border-bottom: 1px solid var(--az-sidebar-border);
}

.az-nav-subitem {
  display: block;
  padding: 8px 12px 8px 14px;
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--az-sidebar-border);
  margin-left: -2px;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-left-color 0.15s ease,
    padding-left 0.15s ease;
}

.az-nav-subitem:last-child {
  border-bottom: none;
}

.az-nav-subitem:hover {
  background: var(--hr-accent-soft);
  color: var(--hr-accent);
  border-left-color: var(--hr-accent);
  padding-left: 17px;
}

.az-nav-subitem.active {
  background: linear-gradient(90deg, rgba(69, 99, 192, 0.14), rgba(69, 99, 192, 0.04));
  color: var(--hr-accent-hover);
  border-left-color: var(--hr-accent);
  font-weight: 600;
}

.az-sidebar-collapsed .az-sidebar {
  width: 0;
  overflow: hidden;
  border-right: none;
}

.az-content {
  flex: 1;
  min-width: 0;
  background: var(--az-content-bg);
  display: flex;
  flex-direction: column;
  overflow-x: auto;
}

.az-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 24px 0;
  font-size: 13px;
  color: var(--hr-muted);
}

.az-breadcrumb-link {
  color: var(--hr-accent);
  text-decoration: none;
}

.az-breadcrumb-link:hover {
  text-decoration: underline;
}

.az-breadcrumb-sep {
  color: #a19f9d;
  margin: 0 2px;
}

.az-breadcrumb-current {
  color: var(--hr-text);
  font-weight: 500;
}

.az-page-header {
  padding: 8px 24px 0;
}

.az-page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--hr-text);
}

.az-command-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--hr-border);
}

.az-cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--hr-border);
  border-radius: 4px;
  background: #fff;
  color: var(--hr-text);
  cursor: pointer;
  text-decoration: none;
}

.az-cmd-btn:hover {
  background: var(--hr-accent-soft);
  border-color: #c5d3f0;
  color: var(--hr-accent);
}

.az-cmd-btn-primary {
  background: var(--hr-gradient);
  border-color: transparent;
  color: #fff;
}

.az-cmd-btn-primary:hover {
  background: var(--hr-gradient);
  border-color: transparent;
  filter: brightness(1.05);
}

.az-page-body {
  flex: 1;
  min-width: 0;
}

.az-page-body .hr-main,
.az-page-body .container,
.az-page-body .welcome-container,
.az-page-body .page,
.az-page-body .admin-main,
.az-page-body .billing-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 16px 24px 32px;
  box-sizing: border-box;
}

.az-page-body .hr-card {
  border-radius: 8px;
  box-shadow: none;
}

.az-page-body .hr-table th {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  font-weight: 600;
  background: #faf9f8;
}

.az-page-body .toolbar {
  top: 0;
}

.az-page-body .public-page,
.az-page-body main.page {
  max-width: none;
  padding: 0;
}

.az-sidebar-backdrop {
  position: fixed;
  inset: 0;
  top: var(--az-topbar-h);
  background: rgba(0, 0, 0, 0.35);
  z-index: 90;
}

@media (max-width: 960px) {
  .az-sidebar {
    position: fixed;
    top: var(--az-topbar-h);
    left: 0;
    bottom: 0;
    z-index: 95;
    transform: translateX(-100%);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
  }

  .az-sidebar-mobile-open .az-sidebar {
    transform: translateX(0);
  }

  .az-topbar-user {
    display: none;
  }

  .az-topbar-public-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .az-breadcrumbs,
  .az-page-header,
  .az-command-bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .az-page-body .hr-main,
  .az-page-body .container,
  .az-page-body .welcome-container,
  .az-page-body .page {
    padding: 12px 16px 24px;
  }
}

/* Shared confirm dialog (confirmAction in hrUi.js) */
.hr-confirm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10010;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hr-confirm-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.hr-confirm-dialog {
  background: var(--hr-card, #fff);
  border-radius: 12px;
  padding: 20px;
  max-width: min(420px, 95vw);
  width: calc(100% - 32px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--hr-border, #e5e7eb);
}

.hr-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hr-confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--hr-text, #111827);
}

.hr-confirm-close {
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--hr-muted, #6b7280);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.hr-confirm-close:hover {
  color: var(--hr-text, #111827);
}

.hr-confirm-message {
  font-size: 14px;
  color: #374151;
  margin: 0 0 16px 0;
  line-height: 1.5;
  white-space: pre-wrap;
}

.hr-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.hr-btn-danger {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.28);
}

.hr-btn-danger:hover:not(:disabled):not(.is-loading) {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.38);
  filter: brightness(1.03);
}

.hr-btn-danger:active:not(:disabled):not(.is-loading) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.24);
}

.hr-btn-danger:focus-visible {
  outline: 2px solid rgba(220, 38, 38, 0.55);
  outline-offset: 2px;
}

/* ── Dark mode shell surfaces ── */
html[data-theme="dark"] body.hr-app,
html[data-theme="dark"] body.az-shell-active {
  background: var(--hr-bg);
  color: var(--hr-text);
}

html[data-theme="dark"] .az-sidebar-search {
  background: #1a2330;
  border-color: #334155;
  color: var(--hr-text);
}

html[data-theme="dark"] .az-nav-item,
html[data-theme="dark"] .az-nav-section-label {
  color: #cbd5e1;
}

html[data-theme="dark"] .az-nav-item {
  color: #e2e8f0;
}

html[data-theme="dark"] .az-nav-subitem {
  color: #94a3b8;
}

html[data-theme="dark"] .az-nav-item:hover,
html[data-theme="dark"] .az-nav-subitem:hover {
  color: var(--hr-accent-hover);
}

html[data-theme="dark"] .hr-card,
html[data-theme="dark"] .hr-stat,
html[data-theme="dark"] .az-cmd-btn {
  background: var(--hr-card);
  border-color: var(--hr-border);
  color: var(--hr-text);
}

html[data-theme="dark"] .az-cmd-btn:hover {
  background: var(--hr-accent-soft);
  border-color: #3d5278;
  color: var(--hr-accent);
}

html[data-theme="dark"] .az-breadcrumb-current,
html[data-theme="dark"] .az-page-title,
html[data-theme="dark"] .hr-page-title {
  color: var(--hr-text);
}

html[data-theme="dark"] .az-notif-panel {
  background: #171e28;
  color: var(--hr-text);
  border-color: #2a3544;
}

html[data-theme="dark"] .az-notif-panel-head,
html[data-theme="dark"] .az-notif-panel-foot {
  background: #121820;
  border-color: #2a3544;
}

html[data-theme="dark"] .az-notif-link:hover {
  background: #1e2836;
}

html[data-theme="dark"] .hr-confirm-dialog {
  background: var(--hr-card);
  border-color: var(--hr-border);
}

html[data-theme="dark"] .hr-confirm-message {
  color: #cbd5e1;
}
