:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #102238;
  --muted: #607186;
  --line: #d7e1ec;
  --brand: #075985;
  --brand-dark: #0c3f60;
  --accent: #0f766e;
  --success: #15803d;
  --warning: #a16207;
  --danger: #b42318;
  --soft: #eaf4fa;
  --shadow: 0 12px 28px rgba(16, 34, 56, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.locked .app-header,
body.locked .layout {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  background: #edf3f8;
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  display: grid;
  gap: 0.9rem;
  width: min(500px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 34, 56, 0.16);
  padding: 1.5rem;
}

.login-company-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: 2rem;
  overflow: hidden;
  background: linear-gradient(145deg, #073b5c 0%, #075985 52%, #0f766e 100%);
  color: #fff;
  padding: clamp(2rem, 6vw, 6rem);
}

.login-company-panel::after {
  position: absolute;
  right: -80px;
  bottom: -90px;
  width: 320px;
  height: 320px;
  border: 50px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  content: "";
}

.login-access-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.login-brand {
  display: grid;
  justify-items: start;
  gap: 0.55rem;
  text-align: left;
}

.login-logo {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 1.65rem;
  font-weight: 900;
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-company-panel h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.05;
}

.login-kicker {
  margin: 0;
  color: #99f6e4;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-tagline {
  margin: 0.35rem 0 0;
  border-left: 4px solid #5eead4;
  color: #e6fffb;
  padding-left: 0.75rem;
  font-size: clamp(1rem, 1.7vw, 1.4rem);
  font-weight: 800;
}

.login-company-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 760px;
}

.login-company-details div {
  display: grid;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.75rem;
}

.login-company-details div:first-child {
  grid-column: 1 / -1;
}

.login-company-details span {
  color: #99f6e4;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-company-details strong {
  overflow-wrap: anywhere;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-width: 650px;
}

.login-feature-grid span {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.65rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
}

.login-access-heading h2,
.login-access-heading p {
  margin: 0;
}

.login-access-heading h2 {
  margin-bottom: 0.3rem;
  color: var(--brand-dark);
  font-size: 1.65rem;
}

.login-access-heading > p:last-child {
  color: var(--muted);
  font-size: 0.86rem;
}

.login-switch,
.login-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.login-switch button {
  flex: 1;
  background: #e8edf7;
  color: var(--ink);
}

.login-switch button.active {
  background: var(--brand);
  color: #fff;
}

.login-view {
  display: none;
  gap: 0.9rem;
}

.active-login-view {
  display: grid;
}

.login-error {
  min-height: 1.2rem;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

button,
input,
select {
  font: inherit;
}

button,
.import-btn {
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  padding: 0.72rem 1rem;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(7, 89, 133, 0.18);
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
.import-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(7, 89, 133, 0.25);
}

button.secondary {
  background: #e8edf7;
  color: var(--ink);
}

button.danger {
  background: var(--danger);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(105deg, #073b5c, #075985 58%, #0f766e);
  border-bottom: 3px solid #5eead4;
  color: #fff;
  box-shadow: 0 6px 20px rgba(7, 59, 92, 0.2);
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: #8de5d7;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.database-status {
  margin: 0.35rem 0 0;
  color: #d8f3ee;
  font-size: 0.82rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.import-btn input {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.sidebar,
.workspace,
.form-section,
.photo-card,
.summary-strip {
  background: var(--panel);
  border: 1px solid #e6edf5;
  border-radius: 8px;
  box-shadow: none;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 1rem;
  display: flex;
  max-height: calc(100vh - 2rem);
  flex-direction: column;
  padding: 1rem;
  border-top: 4px solid var(--accent);
}

.sidebar-title,
.toolbar,
.form-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sidebar-employee-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0.65rem 0 0.8rem;
}

.sidebar-company-section {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.company-selector {
  display: grid;
  gap: 0.35rem;
  max-height: 150px;
  margin-top: 0.55rem;
  overflow-y: auto;
}

.company-choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.company-choice.active {
  border-color: var(--accent);
  background: #edf9f6;
  color: var(--ink);
}

.company-choice input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

.company-choice-logo {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: var(--soft);
  color: var(--brand);
  font-size: 0.62rem;
  font-weight: 900;
}

.company-choice-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-data-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sidebar-employee-actions button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.55rem 0.35rem;
  font-size: 0.72rem;
}

.employee-save-actions {
  justify-content: flex-end;
  padding-top: 0.5rem;
}

.employee-editing .employee-save-actions {
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
  padding: 0.75rem;
}

.employee-save-actions button {
  display: inline-flex;
  min-width: 170px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.65rem 0.85rem;
}

.document-section {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #0f766e, #38bdf8) border-box;
  border: 1px solid transparent;
}

.document-completion {
  align-self: start;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.4rem 0.7rem;
}

.document-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.document-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) minmax(360px, auto);
  gap: 0.75rem;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fbff;
  padding: 0.72rem;
}

.document-item.complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.document-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.document-item.complete .document-status-dot {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.document-main {
  display: grid;
  gap: 0.25rem;
}

.document-main strong {
  color: var(--ink);
}

.document-main span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.document-note {
  min-height: 2.2rem;
}

.document-actions {
  display: grid;
  grid-template-columns: 130px auto auto auto;
  gap: 0.45rem;
  align-items: center;
}

.document-upload {
  display: inline-grid;
  min-height: 2.35rem;
  place-items: center;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.document-upload input {
  display: none;
}

.employee-action-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.save-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  display: flex;
  max-width: min(360px, calc(100vw - 2rem));
  align-items: center;
  gap: 0.6rem;
  border: 1px solid #9dd4ad;
  border-radius: 7px;
  background: #f0fbf3;
  box-shadow: 0 14px 32px rgba(16, 34, 56, 0.18);
  color: #166534;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.save-toast[hidden] {
  display: none;
}

.save-toast-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #15803d;
  color: #fff;
}

.sidebar h2,
.form-section h2 {
  margin: 0;
  font-size: 1rem;
}

.dashboard-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
  padding: 1rem;
}

.dashboard-toolbar h2,
.dashboard-card h3 {
  margin: 0;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(120px, 150px) minmax(220px, 280px);
  gap: 0.75rem;
  align-items: end;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0;
}

.dashboard-metric {
  display: grid;
  min-height: 112px;
  align-content: space-between;
  gap: 0.45rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: #fff;
  padding: 0.85rem;
  box-shadow: 0 14px 0 rgba(16, 34, 56, 0.08), 0 22px 32px rgba(16, 34, 56, 0.12);
  transform: perspective(900px) rotateX(1.5deg);
}

.dashboard-metric span {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-metric strong {
  overflow: hidden;
  font-size: clamp(0.98rem, 1.35vw, 1.32rem);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.72rem;
  font-weight: 800;
}

.metric-blue { background: linear-gradient(135deg, #2563eb, #075985); }
.metric-green { background: linear-gradient(135deg, #16a34a, #0f766e); }
.metric-teal { background: linear-gradient(135deg, #0891b2, #0f766e); }
.metric-red { background: linear-gradient(135deg, #dc2626, #b42318); }
.metric-amber { background: linear-gradient(135deg, #d97706, #a16207); }
.metric-violet { background: linear-gradient(135deg, #7c3aed, #4338ca); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.dashboard-card {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  min-height: 280px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 10px 0 rgba(15, 23, 42, 0.04), 0 16px 28px rgba(16, 34, 56, 0.08);
}

.dashboard-card.wide {
  grid-column: 1 / -1;
}

.dashboard-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e8eef6;
  padding-bottom: 0.75rem;
}

.chart-stack {
  display: grid;
  gap: 0.75rem;
}

.chart-row {
  display: grid;
  gap: 0.3rem;
}

.chart-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.chart-row-top strong {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-row-top span {
  color: var(--brand-dark);
  font-weight: 900;
  white-space: nowrap;
}

.chart-row small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.chart-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, #dbe7f4, #f8fbff);
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.12);
}

.chart-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(15, 23, 42, 0.14);
}

.fill-1 { background: linear-gradient(90deg, #2563eb, #06b6d4); }
.fill-2 { background: linear-gradient(90deg, #16a34a, #84cc16); }
.fill-3 { background: linear-gradient(90deg, #f59e0b, #f97316); }
.fill-4 { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.fill-5 { background: linear-gradient(90deg, #dc2626, #fb7185); }

.graph-card {
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.vertical-chart {
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.2rem;
}

.vertical-bars {
  display: grid;
  grid-auto-columns: minmax(150px, 1fr);
  grid-auto-flow: column;
  gap: 1rem;
  min-height: 300px;
  align-items: end;
}

.bar-group {
  display: grid;
  gap: 0.45rem;
  align-items: end;
  min-height: 285px;
  border: 1px solid #e5edf5;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
  padding: 0.75rem;
  text-align: center;
  box-shadow: inset 0 1px 0 #fff, 0 10px 18px rgba(16, 34, 56, 0.08);
}

.bar-pill-set {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0.42rem;
  height: 190px;
}

.bar-pill-wrap {
  display: grid;
  width: 36px;
  height: 100%;
  align-items: end;
  justify-items: center;
  gap: 0.25rem;
}

.bar-value {
  writing-mode: vertical-rl;
  color: var(--brand-dark);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(180deg);
}

.bar-pill {
  display: block;
  width: 24px;
  min-height: 10px;
  border-radius: 7px 7px 3px 3px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.45), transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--bar-color), #fff 18%), var(--bar-color));
  box-shadow: inset -4px 0 0 rgba(0, 0, 0, 0.12), 0 8px 0 rgba(15, 23, 42, 0.1), 0 12px 18px rgba(15, 23, 42, 0.18);
}

.bar-pill-wrap small,
.bar-group > small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.bar-group > strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.visual-card {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #38bdf8, #22c55e, #f59e0b) border-box;
  border: 1px solid transparent;
}

.donut-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.donut-wrap {
  display: grid;
  place-items: center;
  perspective: 900px;
}

.donut-chart {
  position: relative;
  display: grid;
  width: 174px;
  height: 174px;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 15px 0 rgba(15, 23, 42, 0.1), 0 24px 36px rgba(16, 34, 56, 0.16);
  transform: rotateX(10deg);
}

.donut-chart::before {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff, #eef5fb);
  box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.12);
  content: "";
}

.donut-chart div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.2rem;
  text-align: center;
}

.donut-chart strong {
  color: var(--brand-dark);
  font-size: 0.75rem;
}

.donut-chart span {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
}

.donut-legend {
  display: grid;
  gap: 0.55rem;
}

.donut-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid #e5edf5;
  border-radius: 7px;
  background: #f8fbff;
  padding: 0.55rem;
}

.donut-legend-item span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.donut-legend-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.donut-legend-item small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.alert-card {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff 0%, #fff7ed 100%);
}

.alert-list {
  display: grid;
  gap: 0.75rem;
}

.leave-alert-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) auto;
  gap: 0.75rem;
  align-items: stretch;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff;
  padding: 0.75rem;
  box-shadow: 0 8px 18px rgba(180, 83, 9, 0.08);
}

.leave-alert-item > div {
  display: grid;
  align-content: center;
  gap: 0.25rem;
}

.leave-alert-item strong {
  color: #9a3412;
}

.leave-alert-item span,
.leave-alert-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.leave-alert-item textarea {
  min-height: 112px;
  resize: vertical;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fffbeb;
  color: #422006;
  font-size: 0.78rem;
  line-height: 1.4;
}

.whatsapp-ready-link {
  display: inline-grid;
  min-width: 118px;
  place-items: center;
  align-self: center;
  border-radius: 7px;
  background: #16a34a;
  color: #fff;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.18);
}

.employee-year-snapshot {
  display: grid;
  gap: 0.25rem;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  padding: 0.75rem;
}

.employee-year-snapshot strong {
  color: var(--brand-dark);
}

.employee-year-snapshot span {
  color: var(--ink);
  font-weight: 900;
}

.employee-year-snapshot small {
  color: var(--muted);
  font-weight: 800;
}

.action-card {
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.14), transparent 32%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
}

.action-list {
  display: grid;
  gap: 0.65rem;
}

.action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.75rem;
  align-items: center;
  border: 1px solid #e5edf5;
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  padding: 0.7rem;
  box-shadow: 0 8px 16px rgba(16, 34, 56, 0.06);
}

.action-item span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.action-item strong {
  color: var(--brand-dark);
  font-size: 1.45rem;
}

.action-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.action-red { border-left-color: #dc2626; }
.action-amber { border-left-color: #d97706; }
.action-blue { border-left-color: #2563eb; }
.action-violet { border-left-color: #7c3aed; }
.action-green { border-left-color: #16a34a; }

.count-pill {
  display: inline-grid;
  min-width: 1.65rem;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand);
  font-size: 0.78rem;
  padding: 0.1rem 0.45rem;
}

.search-box,
label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(29, 95, 209, 0.14);
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

.employee-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
}

.employee-item {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0.55rem;
  text-align: left;
}

.employee-item.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #dffaf4, #eef9ff);
  box-shadow: inset 5px 0 0 var(--accent), 0 8px 22px rgba(13, 148, 136, 0.15);
  outline: 2px solid rgba(13, 148, 136, 0.18);
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #dfe8f9;
  color: var(--brand);
  font-weight: 900;
}

.avatar img,
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.employee-name {
  margin: 0;
  font-weight: 800;
}

.employee-meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.workspace {
  min-width: 0;
  overflow: hidden;
}

.selected-employee-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #e6f5f3, #eef6fb);
  border-left: 5px solid var(--accent);
  padding: 0.55rem 0.8rem;
}

.employee-action-state {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.25rem;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.2rem 0.55rem;
}

.selected-employee-banner > span:last-child {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.photo-status {
  min-height: 1.2rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.45rem 0.5rem 0;
  border-bottom: 1px solid #e7eef6;
  background: #fff;
}

.tab {
  min-height: 2.2rem;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  box-shadow: none;
}

.tab:hover,
.tab.active {
  background: #f4f8fc;
  color: var(--brand);
}

.small-action {
  min-height: 2rem;
  padding: 0.35rem 0.6rem;
}

.tab.active {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.panel {
  display: none;
  padding: 0.75rem;
}

.active-panel {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 1.15rem;
  align-items: start;
}

.wide {
  grid-column: 2;
}

.photo-card {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  min-height: 420px;
  padding: 1.1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.photo-card img {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #edf1f8;
  object-fit: cover;
  width: 100%;
}

.photo-helper-card {
  display: grid;
  gap: 0.25rem;
  margin-top: auto;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 0.75rem;
}

.photo-helper-card strong {
  font-size: 0.82rem;
}

.photo-helper-card span {
  color: #475569;
  font-size: 0.75rem;
  line-height: 1.35;
}

.photo-upload {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  padding: 0.7rem;
}

.photo-upload input {
  display: none;
}

.form-section {
  padding: 1rem;
  border-top: 0;
  border-left: 4px solid #38bdf8;
  background: linear-gradient(135deg, #fff 72%, #f0f9ff);
}

.bank-name-field {
  grid-column: span 2;
}

.inline-field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: end;
}

.mini-action {
  min-height: 2.4rem;
  border-radius: 7px;
  padding: 0.45rem 0.75rem;
  white-space: nowrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none;
}

.bank-chooser-card {
  display: grid;
  width: min(760px, 96vw);
  max-height: min(720px, 92vh);
  gap: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
  padding: 1rem;
}

.bank-chooser-list {
  display: grid;
  gap: 0.4rem;
  max-height: 390px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.bank-choice {
  display: flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--text);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.bank-choice:hover {
  border-color: #38bdf8;
  background: #eff6ff;
}

.bank-choice small {
  color: var(--brand);
  font-weight: 800;
}

.add-bank-row {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.form-section:nth-of-type(3n + 2) {
  border-left-color: #2dd4bf;
  background: linear-gradient(135deg, #fff 72%, #f0fdfa);
}

.form-section:nth-of-type(3n + 3) {
  border-left-color: #fbbf24;
  background: linear-gradient(135deg, #fff 72%, #fffbeb);
}

.form-section h2 {
  color: var(--brand-dark);
  letter-spacing: 0.01em;
}

.field-grid label {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.35rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.9rem;
}

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

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.payroll-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.advance-ledger {
  margin-top: 0.9rem;
  overflow-x: auto;
}

.advance-ledger-title {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0.25rem 0 0.5rem;
  text-transform: uppercase;
}

.compact-empty {
  padding: 0.8rem;
}

.attendance-section {
  margin-top: 1rem;
}

.attendance-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.biometric-import-panel {
  display: grid;
  gap: 0.75rem;
  margin: 0.9rem 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
  padding: 0.85rem;
}

.mobile-attendance-panel {
  display: grid;
  gap: 0.75rem;
  margin: 0.9rem 0;
  border: 1px solid #b7e4d5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%);
  padding: 0.85rem;
}

.mobile-attendance-approvals {
  display: grid;
  gap: 0.7rem;
}

.mobile-attendance-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.85rem;
}

.mobile-attendance-request div:first-child {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.mobile-attendance-request strong,
.mobile-attendance-request span,
.mobile-attendance-request small,
.mobile-attendance-request p {
  overflow-wrap: anywhere;
}

.mobile-attendance-request span,
.mobile-attendance-request small {
  color: var(--muted);
}

.mobile-attendance-request p {
  margin: 0.15rem 0;
}

.mobile-attendance-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-attendance-actions button {
  min-width: 92px;
}

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

.biometric-import-head h3 {
  margin: 0;
  color: var(--brand-dark);
}

.biometric-file-btn {
  flex: 0 0 auto;
}

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

.week-holidays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.week-holidays label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbff;
  padding: 0.45rem 0.55rem;
}

.week-holidays input {
  width: auto;
  min-height: auto;
}

.attendance-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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

.calendar-head,
.calendar-cell {
  border-radius: 7px;
  min-height: 4.1rem;
  padding: 0.55rem;
}

.calendar-head {
  display: grid;
  place-items: center;
  min-height: 2.2rem;
  background: #edf2fb;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-cell {
  display: grid;
  align-content: space-between;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.calendar-cell:hover {
  transform: translateY(-1px);
}

.calendar-cell span {
  font-weight: 900;
}

.calendar-cell strong {
  justify-self: end;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.75rem;
}

.calendar-cell.present {
  border-color: #9bd3b2;
  background: #effaf3;
}

.calendar-cell.present strong {
  background: #1f7a43;
  color: #fff;
}

.calendar-cell.absent {
  border-color: #f0a8a3;
  background: #fff3f2;
}

.calendar-cell.absent strong {
  background: #b42318;
  color: #fff;
}

.calendar-cell.halfday {
  border-color: #e4b64f;
  background: #fff9e8;
}

.calendar-cell.halfday strong {
  background: #9a6700;
  color: #fff;
}

.calendar-cell.holiday {
  border-color: #9fbbed;
  background: #f1f6ff;
}

.calendar-cell.holiday strong {
  background: var(--brand);
  color: #fff;
}

.daily-ot-register {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.daily-ot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.daily-ot-heading h3 {
  margin: 0 0 0.2rem;
}

.daily-ot-heading > strong {
  border-radius: 7px;
  background: #e0f2fe;
  color: #075985;
  padding: 0.65rem 0.8rem;
}

.daily-ot-table {
  max-height: 430px;
  overflow: auto;
}

.daily-ot-table table {
  min-width: 780px;
}

.daily-ot-table input {
  min-height: 2.1rem;
}

.daily-ot-table .daily-ot-hours {
  min-width: 90px;
}

.holiday-ot-row {
  background: #fff7d6 !important;
}

.muted-cell {
  background: transparent;
  border: 1px dashed transparent;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(100deg, #f4fafc, #edf8f6);
}

.metric {
  min-width: 140px;
  border: 1px solid #cfe1ea;
  border-left: 4px solid var(--accent);
  border-radius: 7px;
  background: #fff;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 4px 10px rgba(16, 34, 56, 0.05);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.08rem;
}

.balance-text {
  margin: 0.9rem 0 0;
  color: var(--brand);
  font-weight: 800;
}

.report-output {
  margin-top: 1rem;
  overflow: auto;
}

.salary-slip-output {
  margin-top: 1rem;
}

.custom-output {
  margin-top: 1rem;
}

.report-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.6fr);
  gap: 0.75rem;
  min-width: min(100%, 460px);
}

.field-chooser {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbff;
  padding: 0.45rem 0.55rem;
}

.select-all-field {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand);
}

.ot-toggle-field {
  border-color: #bae6fd;
  background: #eff6ff;
  color: var(--brand);
}

.check-field input {
  width: auto;
  min-height: auto;
  accent-color: var(--brand);
}

.custom-actions {
  justify-content: flex-start;
  margin-bottom: 0.8rem;
}

.database-extract-actions,
.database-export-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.database-export-buttons {
  justify-content: flex-start;
  margin: 0.75rem 0;
}

.payslip-save-actions {
  justify-content: flex-end;
}

.payslip-send-panel {
  margin-top: 1rem;
}

.employee-send-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  max-height: 260px;
  overflow: auto;
}

.employee-send-item span {
  display: grid;
  gap: 0.15rem;
}

.employee-send-item small {
  color: var(--muted);
  font-size: 0.76rem;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.action-logo {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
}

.action-logo-img {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
}

.whatsapp-action {
  background: #128c7e;
}

.whatsapp-action:hover {
  background: #0d6f64;
}

.email-action {
  background: #0f766e;
}

.email-action:hover {
  background: #0b5f59;
}

.custom-table {
  min-width: 720px;
}

.compact-controls {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.audit-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.audit-table th,
.audit-table td {
  white-space: nowrap;
}

.audit-warning-row {
  background: #fff7ed;
}

.audit-warning-row td:last-child {
  color: #9a3412;
  font-weight: 900;
}

.amount-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hidden-output-data {
  display: none;
}

.report-card {
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow: hidden;
  border-top: 5px solid var(--accent);
  box-shadow: 0 10px 24px rgba(16, 34, 56, 0.08);
}

.button-link {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
}

.button-link:hover {
  background: var(--brand-dark);
}

.amount-cell {
  color: var(--success);
  font-weight: 900;
  text-align: right;
}

.report-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  border-radius: 7px;
  background: linear-gradient(100deg, #e8f5f3, #edf5fb);
  padding: 0.9rem;
}

.report-head h2 {
  margin: 0 0 0.25rem;
  color: var(--brand-dark);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  border: 1px solid var(--line);
  background: #fff;
}

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

td:not(:first-child):not(:nth-child(2)):not(:nth-child(3)),
th:not(:first-child):not(:nth-child(2)):not(:nth-child(3)) {
  text-align: right;
}

th {
  background: #075985;
  color: #fff;
  font-size: 0.76rem;
  text-transform: uppercase;
}

tbody tr:nth-child(even) {
  background: #f1f8fb;
}

tbody tr:hover {
  background: #e3f4f2;
}

tfoot th,
tfoot td {
  background: #dff3ee;
  color: #0b4f49;
  font-weight: 900;
}

.slip-settings {
  margin-top: 0;
}

.user-settings {
  margin-top: 1rem;
}

.offer-letter-settings {
  margin-top: 1rem;
}

.salary-slip {
  max-width: 980px;
  margin: 0 auto 1rem;
  background: #fff;
  border: 2px solid #1f2937;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.offer-letter {
  width: min(100%, 820px);
  max-width: 820px;
  min-height: 1060px;
  margin: 0 auto 1rem;
  background: #fff;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  color: var(--ink);
  line-height: 1.55;
  overflow: hidden;
}

.offer-letter * {
  box-sizing: border-box;
}

.offer-letter-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: center;
  background: linear-gradient(135deg, #0f766e 0%, #164e63 100%);
  color: #fff;
  padding: 1.35rem 1.6rem;
}

.offer-brand {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  min-width: 0;
}

.offer-letter .slip-logo {
  width: 70px;
  height: 70px;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.offer-letter-header h2,
.offer-letter h1 {
  margin: 0;
}

.offer-letter-header h2 {
  font-size: 1.35rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.offer-letter-header p,
.offer-letter-meta,
.offer-letter-footer span {
  color: var(--muted);
  font-size: 0.9rem;
}

.offer-letter-header p {
  margin: 0.25rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  overflow-wrap: anywhere;
}

.offer-letter-badge {
  display: grid;
  gap: 0.2rem;
  justify-items: end;
  min-width: 130px;
  text-align: right;
}

.offer-letter-badge span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.offer-letter-badge strong {
  color: #fff;
  font-size: 1.1rem;
}

.offer-letter-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.6rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-weight: 800;
}

.offer-intro,
.offer-terms,
.offer-letter > p,
.offer-letter-table,
.offer-info-grid,
.offer-compensation-summary,
.offer-letter-footer {
  margin-left: 1.6rem;
  margin-right: 1.6rem;
}

.offer-intro {
  margin-top: 1.2rem;
}

.offer-intro p,
.offer-letter > p,
.offer-terms li {
  overflow-wrap: anywhere;
}

.offer-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.offer-info-item {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  border: 1px solid #dbe6ef;
  border-radius: 8px;
  background: #f8fbfd;
  padding: 0.7rem 0.8rem;
}

.offer-info-item.wide {
  grid-column: 1 / -1;
}

.offer-info-item span,
.offer-compensation-summary span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.offer-info-item strong,
.offer-compensation-summary strong {
  min-width: 0;
  color: #0f172a;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.offer-compensation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.offer-compensation-summary div {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  border-radius: 8px;
  background: #e7f7f2;
  border: 1px solid #b7e4d5;
  padding: 0.75rem 0.85rem;
}

.offer-letter-table {
  width: calc(100% - 3.2rem) !important;
  min-width: 0;
  max-width: calc(100% - 3.2rem);
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: hidden;
  border-radius: 8px;
}

.offer-letter table {
  min-width: 0;
}

.offer-letter-table th,
.offer-letter-table td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
}

.offer-letter-table th {
  background: #0f766e;
  color: #fff;
  font-size: 0.74rem;
  text-transform: uppercase;
}

.offer-letter-table td {
  color: #1f2937;
}

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

.offer-letter-table tfoot th {
  background: #e0f2fe;
  color: var(--ink);
}

.offer-letter-table.salary td:last-child,
.offer-letter-table.salary th:last-child {
  text-align: right;
}

.offer-terms {
  border-left: 4px solid #0f766e;
  background: #f8fafc;
  padding: 0.85rem 1rem;
}

.offer-terms h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}

.offer-terms ol {
  margin: 0;
  padding-left: 1.25rem;
}

.offer-letter-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.2rem;
  margin-bottom: 1.6rem;
}

.offer-letter-footer div {
  display: grid;
  gap: 0.35rem;
  border-top: 1px solid var(--ink);
  padding-top: 0.65rem;
}

@media (max-width: 760px) {
  .offer-letter-header,
  .offer-brand,
  .offer-letter-meta,
  .offer-info-grid,
  .offer-compensation-summary,
  .offer-letter-footer {
    grid-template-columns: 1fr;
  }

  .offer-letter-badge {
    justify-items: start;
    text-align: left;
  }

  .offer-letter {
    min-height: 0;
  }
}

.salary-slip table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.slip-header {
  display: grid;
  grid-template-columns: 86px 1fr 160px;
  gap: 0.85rem;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.8rem;
}

.slip-logo,
.logo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f6fb;
  color: var(--muted);
  font-weight: 900;
}

.slip-logo {
  width: 74px;
  height: 74px;
}

.slip-logo img,
.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slip-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}

.slip-address,
.slip-contact,
.slip-footer span {
  margin: 0;
  color: var(--muted);
}

.slip-address {
  min-height: 2.4rem;
  line-height: 1.35;
}

.slip-contact {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.slip-title {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.25rem;
  min-height: 72px;
  border-left: 1px solid var(--line);
  padding-left: 0.8rem;
  text-align: center;
}

.slip-title strong {
  font-size: 1.05rem;
}

.slip-info-table,
.slip-summary-table {
  width: 100%;
  margin: 0.8rem 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.slip-info-table th,
.slip-info-table td,
.slip-summary-table th,
.slip-summary-table td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slip-info-table th,
.slip-summary-table th {
  width: 18%;
  background: #f3f6fb;
  color: var(--ink);
  font-size: 0.75rem;
  text-align: left;
  text-transform: uppercase;
}

.slip-info-table td {
  width: 32%;
  font-weight: 700;
}

.slip-section-title {
  margin: 0.65rem 0 0;
  border: 1px solid var(--line);
  background: #f3f6fb;
  color: var(--ink);
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.slip-salary-table {
  width: 100%;
  margin: 0.8rem 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.slip-salary-table th,
.slip-salary-table td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.55rem;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slip-salary-table th {
  background: #eef5f8;
  color: var(--ink);
  font-size: 0.8rem;
  text-align: left;
  text-transform: uppercase;
}

.slip-salary-table th:nth-child(2),
.slip-salary-table th:nth-child(4),
.slip-salary-table td:nth-child(2),
.slip-salary-table td:nth-child(4) {
  text-align: right;
}

.slip-salary-table th:nth-child(1),
.slip-salary-table td:nth-child(1),
.slip-salary-table th:nth-child(3),
.slip-salary-table td:nth-child(3) {
  width: 30%;
}

.slip-salary-table th:nth-child(2),
.slip-salary-table td:nth-child(2),
.slip-salary-table th:nth-child(4),
.slip-salary-table td:nth-child(4) {
  width: 20%;
}

.slip-salary-table tfoot th {
  background: #e0f2fe;
  color: var(--brand);
  font-weight: 900;
}

.slip-summary-table td {
  text-align: right;
}

.slip-summary-table tr:last-child td {
  text-align: left;
}

.slip-summary-table {
  margin-top: 0.85rem;
}

.slip-summary-table .net-row th,
.slip-summary-table .net-row td {
  background: var(--soft);
  color: var(--brand);
  font-size: 1rem;
  font-weight: 900;
}

.slip-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.slip-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  background: #f6f7fb;
}

.slip-preview-overlay[hidden] {
  display: none;
}

.occasion-popup {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 40;
}

.occasion-popup[hidden] {
  display: none;
}

.occasion-card {
  width: min(390px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 34, 56, 0.2);
}

.occasion-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0.75rem;
}

.occasion-head h2,
.occasion-head p {
  margin: 0;
}

.occasion-head h2 {
  font-size: 1rem;
}

.occasion-head p:not(.eyebrow) {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.occasion-window-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.occasion-window-button,
.occasion-close {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: #eef2f6;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
}

.occasion-window-button:hover,
.occasion-close:hover {
  background: #dbeafe;
  color: var(--brand);
}

.occasion-popup.minimized .occasion-card {
  width: 52px;
  min-height: 170px;
  overflow: hidden;
}

.occasion-popup.minimized {
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
}

.occasion-popup.minimized .occasion-head {
  display: grid;
  min-height: 170px;
  align-content: space-between;
  justify-items: center;
  border-bottom: 0;
  padding: 0.55rem 0.35rem;
}

.occasion-popup.minimized .occasion-head > div:first-child {
  display: grid;
  justify-items: center;
}

.occasion-popup.minimized .occasion-head .eyebrow {
  display: none;
}

.occasion-popup.minimized .occasion-head p:not(.eyebrow),
.occasion-popup.minimized .occasion-list {
  display: none;
}

.occasion-popup.minimized .occasion-head h2 {
  max-height: 112px;
  font-size: 0.74rem;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.occasion-popup.minimized .occasion-window-actions {
  display: grid;
  gap: 0.35rem;
}

.occasion-list {
  display: grid;
  gap: 0.75rem;
  padding: 0.65rem;
}

.occasion-group {
  display: grid;
  gap: 0.45rem;
}

.occasion-group > h3 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  color: var(--brand);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  padding: 0 0 0.35rem;
  text-transform: uppercase;
}

.occasion-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.55rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 0.55rem;
}

.occasion-photo {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
}

.occasion-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.occasion-date {
  display: grid;
  place-items: center;
  min-width: 45px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  padding: 0.35rem 0.4rem;
}

.occasion-date strong {
  font-size: 1rem;
  line-height: 1;
}

.occasion-date span {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.occasion-item h3,
.occasion-item p {
  margin: 0;
}

.occasion-item p {
  margin-top: 0.15rem;
  color: var(--muted);
  font-weight: 700;
}

.occasion-item h3 {
  font-size: 0.88rem;
}

.occasion-item p,
.occasion-item .employee-meta {
  font-size: 0.7rem;
}

.preview-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 0.85rem 1rem;
}

.preview-toolbar h2,
.preview-toolbar p {
  margin: 0;
}

.preview-toolbar p {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.preview-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.slip-preview-content {
  width: 210mm;
  min-height: 297mm;
  margin: 1rem auto;
  background: #fff;
  padding: 8mm;
  box-shadow: var(--shadow);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.logo-preview {
  width: 84px;
  height: 84px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .login-screen {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .login-company-panel {
    min-height: auto;
    padding: 2rem;
  }

  .login-access-panel {
    padding: 1.25rem;
  }

  .layout,
  .form-grid,
  .payroll-grid,
  .dashboard-grid,
  .dashboard-filters,
  .biometric-rule-grid,
  .donut-panel,
  .leave-alert-item,
  .document-item,
  .audit-summary {
    grid-template-columns: 1fr;
  }

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

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

  .wide {
    grid-column: auto;
  }

  .bank-name-field {
    grid-column: auto;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 680px) {
  .login-company-details,
  .login-feature-grid {
    grid-template-columns: 1fr;
  }

  .login-company-details div:first-child {
    grid-column: auto;
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-toolbar,
  .dashboard-card-head,
  .biometric-import-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-summary {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .field-grid.compact,
  .summary-strip,
  .attendance-stats,
  .field-chooser,
  .report-controls,
  .document-actions {
    grid-template-columns: 1fr;
  }

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

  .calendar-grid {
    gap: 0.28rem;
  }

  .calendar-head,
  .calendar-cell {
    min-height: 3.1rem;
    padding: 0.35rem;
  }

  .calendar-cell strong {
    padding: 0.12rem 0.35rem;
  }

  .mobile-attendance-request {
    grid-template-columns: 1fr;
  }

  .mobile-attendance-actions {
    justify-content: stretch;
  }

  .mobile-attendance-actions button {
    flex: 1 1 120px;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

  .tabs {
    overflow-x: auto;
  }

  .slip-header {
    grid-template-columns: 1fr;
  }

  .slip-title {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 0.75rem 0 0;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  .app-header,
  .sidebar,
  .tabs,
  .toolbar,
  .slip-settings,
  .user-settings,
  .preview-toolbar,
  #employeePanel,
  #payrollPanel {
    display: none !important;
  }

  body,
  .workspace,
  .panel,
  .report-card {
    background: #fff;
    border: 0;
    box-shadow: none;
  }

  .report-head {
    border: 1px solid #aac4d1;
    background: #eef5f8 !important;
  }

  th {
    background: #d8e9f0 !important;
    color: #102238 !important;
  }

  tbody tr:nth-child(even) {
    background: #f3f8fa !important;
  }

  tfoot th,
  tfoot td {
    background: #dcefe9 !important;
    color: #102238 !important;
  }

  .layout {
    display: block;
    padding: 0;
  }

  #reportsPanel {
    display: block;
  }

  body.printing-slip #reportsPanel {
    display: none;
  }

  body.printing-slip #slipPanel {
    display: block;
  }

  body.printing-preview .app-header,
  body.printing-preview .layout,
  body.printing-preview .login-screen {
    display: none !important;
  }

  body.printing-preview .slip-preview-overlay {
    position: static;
    display: block;
    overflow: visible;
    background: #fff;
  }

  body.printing-preview .slip-preview-content {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  body.printing-slip .salary-slip,
  body.printing-preview .salary-slip {
    width: 190mm;
    max-width: 190mm;
    min-height: auto;
    border: 1px solid #222;
    box-shadow: none;
    margin: 0;
    padding: 5mm;
    font-size: 10px;
    break-after: page;
    page-break-after: always;
  }

  body.printing-slip .salary-slip:last-child,
  body.printing-preview .salary-slip:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  body.printing-slip .slip-header,
  body.printing-preview .slip-header {
    display: grid;
    grid-template-columns: 22mm 1fr 34mm;
    gap: 3mm;
    border: 1px solid #222;
    border-radius: 0;
    padding: 3mm;
    page-break-inside: avoid;
  }

  body.printing-slip .slip-header h2,
  body.printing-preview .slip-header h2 {
    font-size: 15px;
    margin-bottom: 1mm;
  }

  body.printing-slip .slip-logo,
  body.printing-preview .slip-logo {
    width: 19mm;
    height: 19mm;
    border-radius: 0;
  }

  body.printing-slip .slip-address,
  body.printing-preview .slip-address {
    min-height: 10mm;
  }

  body.printing-slip .slip-contact,
  body.printing-preview .slip-contact {
    font-size: 9px;
  }

  body.printing-slip .slip-title,
  body.printing-preview .slip-title {
    min-height: 18mm;
    padding-left: 2mm;
  }

  body.printing-slip .slip-title strong,
  body.printing-preview .slip-title strong {
    font-size: 11px;
  }

  body.printing-slip .slip-info-table,
  body.printing-slip .slip-salary-table,
  body.printing-slip .slip-summary-table,
  body.printing-preview .slip-info-table,
  body.printing-preview .slip-salary-table,
  body.printing-preview .slip-summary-table {
    margin: 2mm 0;
    page-break-inside: avoid;
  }

  body.printing-slip .slip-info-table th,
  body.printing-slip .slip-info-table td,
  body.printing-slip .slip-salary-table th,
  body.printing-slip .slip-salary-table td,
  body.printing-slip .slip-summary-table th,
  body.printing-slip .slip-summary-table td,
  body.printing-preview .slip-info-table th,
  body.printing-preview .slip-info-table td,
  body.printing-preview .slip-salary-table th,
  body.printing-preview .slip-salary-table td,
  body.printing-preview .slip-summary-table th,
  body.printing-preview .slip-summary-table td {
    padding: 1.35mm;
  }

  body.printing-slip th,
  body.printing-slip td,
  body.printing-preview th,
  body.printing-preview td {
    padding: 1.4mm;
    white-space: normal;
  }

  body.printing-slip .salary-slip table,
  body.printing-preview .salary-slip table {
    min-width: 0;
  }

  body.printing-slip .slip-footer,
  body.printing-preview .slip-footer {
    margin-top: 2mm;
    padding-top: 2mm;
  }
}
