:root {
  --bg: #f7f4ee;
  --bg-alt: #efe7d9;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --surface-soft: #faf7f1;
  --text: #1d2530;
  --muted: #697381;
  --line: #e3d8c7;
  --brand: #0f3d66;
  --brand-soft: #215a8d;
  --accent: #b68a45;
  --accent-soft: #d9bf8a;
  --danger: #b4233a;
  --success: #1f7f56;
  --shadow: 0 22px 50px rgba(19, 34, 48, 0.12);
  --shadow-soft: 0 12px 28px rgba(19, 34, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 10% -10%, #fff4dc 0%, transparent 36%),
    radial-gradient(circle at 90% 0%, #d8ebff 0%, transparent 32%),
    linear-gradient(140deg, var(--bg) 0%, var(--bg-alt) 100%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.01em;
}

a,
button,
input,
select {
  transition: all 180ms ease;
}

.bg-shape {
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.42;
}

.bg-shape-one {
  width: 320px;
  height: 320px;
  background: #c9e6ff;
  left: -90px;
  top: -100px;
}

.bg-shape-two {
  width: 380px;
  height: 380px;
  background: #f2ddae;
  right: -140px;
  bottom: -160px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 10;
  width: calc(100vw - 44px);
  max-width: none;
  margin: 16px 22px;
  padding: 14px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(110deg, #fff, #fffcf6);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand h1 {
  font-size: 1.15rem;
}

.brand p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.brand-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(140deg, var(--brand), #1f6aa8);
  box-shadow: 0 8px 18px rgba(15, 61, 102, 0.28);
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

nav form {
  margin: 0;
}

nav a {
  text-decoration: none;
  color: #405167;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 9px 13px;
  border-radius: 10px;
}

nav a:hover,
nav a.active {
  color: #0c3556;
  background: linear-gradient(135deg, rgba(203, 226, 247, 0.72), rgba(250, 242, 225, 0.84));
}

.nav-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  color: #405167;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 9px 13px;
  border-radius: 10px;
}

.nav-btn:hover {
  color: #0c3556;
  background: linear-gradient(135deg, rgba(203, 226, 247, 0.72), rgba(250, 242, 225, 0.84));
}

.nav-btn-logout {
  color: #a94442;
}

.nav-btn-logout:hover {
  color: #7a2020;
  background: linear-gradient(135deg, rgba(247, 210, 210, 0.72), rgba(250, 230, 225, 0.84));
}

.user-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid #d7cab6;
  background: #fff8ed;
  color: #6e5330;
  font-size: 0.8rem;
  font-weight: 800;
}

/* ====== Anlik cevrimici kullanicilar (presence) ====== */
.presence {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(182, 138, 69, 0.32);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(217, 191, 138, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(255, 252, 246, 0.95), rgba(248, 240, 224, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 6px 18px rgba(40, 30, 12, 0.07);
  animation: presenceFade 420ms ease both;
}

@keyframes presenceFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.presence-beacon {
  position: relative;
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #1f9d6b;
  box-shadow: 0 0 0 0 rgba(31, 157, 107, 0.55);
  animation: beaconPulse 2.1s ease-out infinite;
}

@keyframes beaconPulse {
  0% { box-shadow: 0 0 0 0 rgba(31, 157, 107, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(31, 157, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 157, 107, 0); }
}

.presence-stack {
  display: inline-flex;
  align-items: center;
}

.presence-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  margin-left: -10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  cursor: default;
  user-select: none;
  /* altin halka + yumusak govde golgesi, beyaz ara cizgi */
  box-shadow:
    0 0 0 2px #fffaf0,
    0 0 0 3.5px rgba(182, 138, 69, 0.78),
    0 6px 14px rgba(30, 22, 8, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1.2), box-shadow 220ms ease;
  animation: avatarPop 460ms cubic-bezier(0.2, 0.8, 0.2, 1.3) both;
  animation-delay: calc(var(--i, 0) * 70ms);
  z-index: 1;
}

.presence-avatar:first-child {
  margin-left: 0;
}

@keyframes avatarPop {
  0% { opacity: 0; transform: translateY(6px) scale(0.4); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.presence-avatar:hover {
  transform: translateY(-3px) scale(1.08);
  z-index: 6;
  box-shadow:
    0 0 0 2px #fffaf0,
    0 0 0 4px rgba(182, 138, 69, 1),
    0 12px 22px rgba(30, 22, 8, 0.3);
}

.presence-more {
  background: linear-gradient(140deg, #2b3850, #1d2530) !important;
  color: #e8d9bb;
  font-size: 0.72rem;
}

.presence-tip {
  position: absolute;
  top: calc(100% + 11px);
  left: 50%;
  transform: translateX(-50%) translateY(4px) scale(0.96);
  min-width: max-content;
  padding: 7px 12px;
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(20, 30, 44, 0.97), rgba(13, 20, 30, 0.97));
  border: 1px solid rgba(182, 138, 69, 0.4);
  box-shadow: 0 14px 30px rgba(10, 16, 24, 0.34);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 30;
}

.presence-tip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(20, 30, 44, 0.97);
  border-left: 1px solid rgba(182, 138, 69, 0.4);
  border-top: 1px solid rgba(182, 138, 69, 0.4);
}

.presence-tip strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.presence-tip em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  color: #d9bf8a;
}

.presence-avatar:hover .presence-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.presence-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a6a32;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .presence-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .presence,
  .presence-avatar,
  .presence-beacon { animation: none; }
}

.company-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #b3cde0;
  background: linear-gradient(135deg, #e8f1fa, #dce8f5);
  color: #0c3556;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.page {
  width: calc(100vw - 44px);
  max-width: none;
  margin: 0 22px 34px;
  padding: 14px;
  border: 1px solid #e4d8c5;
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.55), rgba(249, 241, 228, 0.68));
  box-shadow: var(--shadow-soft);
}

.page > section {
  margin-bottom: 14px;
}

.hero,
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin: 26px 0 14px;
  padding: 18px 20px;
  border: 1px solid #e2d8ca;
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.72), rgba(252, 246, 236, 0.84));
  box-shadow: var(--shadow-soft);
}

.hero h2,
.section-heading h2 {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.16;
}

.eyebrow {
  margin: 0 0 6px;
  color: #715321;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.72rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
  max-width: 72ch;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--surface-strong), var(--surface-soft));
  box-shadow: var(--shadow-soft);
}

.hero .btn,
.section-heading .btn {
  align-self: center;
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.payroll-stats {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -36px -36px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 217, 166, 0.45), transparent 66%);
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.stat-card h3 {
  margin-top: 10px;
  font-size: 2.05rem;
  color: var(--brand);
}

.quick-links {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.quick-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e0d4c2;
}

.quick-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.24), transparent 58%);
  opacity: 0;
}

.quick-card p {
  color: var(--muted);
}

.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.quick-card:hover::before {
  opacity: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
  box-shadow: 0 9px 18px rgba(18, 69, 111, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn-ghost {
  color: #4a5e74;
  border-color: #d8ccbb;
  background: linear-gradient(135deg, #f8f5ef, #ede5d8);
  box-shadow: none;
}

.notice {
  margin: 12px 0;
  border-radius: 11px;
  padding: 12px 14px;
  font-weight: 700;
}

.notice-success {
  color: #114d37;
  border: 1px solid #b8ead0;
  background: linear-gradient(135deg, #dcf7ea, #e8fff5);
}

.notice-error {
  color: #7c1d2e;
  border: 1px solid #f6c7d0;
  background: linear-gradient(135deg, #ffe7ec, #fff5f7);
}

/* --- Payroll table section (sticky wrapper) --- */
.payroll-table-section {
  position: sticky;
  top: 80px;
  z-index: 8;
  display: flex;
  flex-direction: column;
}

/* --- Payroll search bar --- */
.payroll-search-bar {
  margin-bottom: 0 !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 14px 20px;
  border-bottom: none;
  box-shadow: none;
  position: relative;
  z-index: 2;
}
.payroll-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  background: #fff;
  border: 1.5px solid #e0d6c8;
  border-radius: 10px;
  padding: 8px 14px;
  transition: border-color .2s;
}
.payroll-search-inner:focus-within {
  border-color: #b08d57;
}
.payroll-search-inner svg {
  flex-shrink: 0;
  color: #a09080;
}
.payroll-search-inner input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.92rem;
  width: 100%;
  padding: 0;
}
.payroll-search-inner input::placeholder {
  color: #b0a090;
}

.table-wrap {
  overflow: auto;
  max-width: calc(100vw - 32px);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  border-top: none;
  margin-top: -1px;
  -ms-overflow-style: auto;
  scrollbar-width: thin;
  position: relative;
  z-index: 1;
}

#payrollTable thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fcf8f1;
}

.table-wrap::-webkit-scrollbar:vertical {
  width: 0;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  border: 1px solid #d9d9d9;
}

th,
td {
  padding: 6px 2px;
  border-bottom: 1px solid #dddddd;
  border-right: 1px solid #e3e3e3;
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-family: "Manrope", sans-serif;
  font-size: 0.78rem;
}

th:last-child,
td:last-child {
  border-right: none;
}

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

th {
  background: #fcf8f1;
  color: #7b6850;
  font-size: 0.78rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: normal;
  line-height: 1.15;
}

.resizable-table th {
  position: relative;
}

.resizable-table .col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.resizable-table .col-resizer::after {
  content: "";
  position: absolute;
  top: 24%;
  bottom: 24%;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(123, 104, 80, 0.35);
  opacity: 0;
  transition: opacity 120ms ease;
}

.resizable-table th:hover .col-resizer::after,
.resizable-table .col-resizer:hover::after {
  opacity: 1;
}

body.is-col-resizing,
body.is-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

td {
  font-size: 0.78rem;
}

tbody td:first-child {
  text-align: left;
  padding-left: 8px;
}

td strong {
  color: #153e62;
}

tbody tr:hover {
  background: rgba(245, 236, 223, 0.45);
}

tr.payroll-row {
  cursor: pointer;
}

tr.payroll-row.is-selected {
  background: rgba(214, 230, 246, 0.52);
}

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

.chip {
  display: inline-block;
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 5px 9px;
  font-weight: 800;
}

.chip-green {
  color: #176644;
  background: #d8f6e8;
}

.chip-gray {
  color: #4e6173;
  background: #e7edf2;
}

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

.actions form {
  margin: 0;
}

.user-actions {
  align-items: flex-start;
  flex-direction: column;
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--brand);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.btn-link:hover {
  color: #0a2d49;
}

.btn-link.danger {
  color: var(--danger);
}

.form-card {
  padding: 16px;
}

.form-card h3 {
  margin-bottom: 12px;
  color: #1b4164;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.kpi-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.kpi-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-print-action {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 110000;
  display: grid;
  place-items: center;
}

.sheet-modal[hidden] {
  display: none !important;
}

.month-select-modal .sheet-modal-card {
  text-align: center;
}

.month-select-form label {
  display: block;
  text-align: left;
  font-weight: 600;
  color: #6e5634;
  margin-bottom: 10px;
}

.month-select-form input[type="month"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d7c6ae;
  border-radius: 8px;
  font-size: 1rem;
  margin-top: 4px;
}

.month-select-form .sheet-modal-actions {
  justify-content: center;
  margin-top: 16px;
}

.sheet-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 42, 0.38);
}

.sheet-modal-card {
  position: relative;
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid #d7c6ae;
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 20px 42px rgba(18, 35, 55, 0.24);
  padding: 14px;
}

.sheet-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sheet-modal-head h3 {
  margin: 2px 0 0;
  color: #184364;
}

.sheet-modal-body {
  margin-top: 8px;
}

.sheet-preview-table {
  width: 100%;
  border-collapse: collapse;
}

.sheet-preview-table th,
.sheet-preview-table td {
  border: 1px solid #ddd2c2;
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.sheet-preview-table th {
  background: #f6efe3;
  color: #6e5634;
  position: sticky;
  top: 0;
}

.sheet-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* --- Liste Düzenle Modal --- */
.liste-duzenle-card {
  width: min(1600px, calc(100vw - 28px)) !important;
  max-height: calc(100vh - 36px);
}

.liste-duzenle-body {
  padding: 0;
}

.liste-duzenle-scroll {
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.liste-duzenle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
}

.liste-duzenle-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5efe6;
}

.liste-duzenle-table th {
  padding: 7px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #d7c6ae;
  color: #0f3d66;
  font-size: 0.72rem;
}

.liste-duzenle-table th.r,
.liste-duzenle-table td.r {
  text-align: right;
}

.liste-duzenle-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e8dfd2;
}

.liste-duzenle-table tbody tr:hover {
  background: #faf5ed;
}

.liste-duzenle-table tbody tr:nth-child(even) {
  background: #fdfbf7;
}

.liste-duzenle-table tbody tr:nth-child(even):hover {
  background: #f7f1e7;
}

.kpi-strip h3 {
  color: #0f3d66;
  margin-top: 4px;
}

.payroll-sticky-stack {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding-bottom: 2px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid #daccb7;
  border-radius: 10px;
  background: #fffdfa;
  padding: 10px;
  color: #24303f;
  font: inherit;
}

input:focus,
select:focus {
  outline: none;
  border-color: #bb8f45;
  box-shadow: 0 0 0 4px rgba(182, 138, 69, 0.15);
}

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

.benefit-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.benefit-cell {
  position: relative;
  min-width: 0;
  overflow: visible;
  z-index: 1;
}

.fillable-cell {
  padding-right: 12px;
  cursor: cell;
}

/* ── Employees page sticky table section (mirrors payroll) ── */
.employees-table-section {
  position: sticky;
  top: 80px;
  z-index: 8;
  display: flex;
  flex-direction: column;
}

.employees-search-bar {
  margin-bottom: 0 !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  padding: 14px 20px;
  border-bottom: none;
  box-shadow: none;
  position: relative;
  z-index: 2;
}

.employees-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  background: #fff;
  border: 1.5px solid #e0d6c8;
  border-radius: 10px;
  padding: 8px 14px;
  transition: border-color .2s;
}
.employees-search-inner:focus-within {
  border-color: #b08d57;
}
.employees-search-inner svg {
  flex-shrink: 0;
  color: #999;
}
.employees-search-inner input {
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  flex: 1;
  min-width: 0;
}

#employeesTable thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fcf8f1;
}

.date-fill-cell {
  position: relative;
  cursor: cell;
}

.branch-fill-cell {
  position: relative;
  cursor: cell;
}

.date-fill-cell.is-active {
  outline: 2px solid #1f8a4c;
  outline-offset: -2px;
}

.date-fill-cell .start-date-text {
  display: inline-block;
  min-width: 84px;
}

.fill-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid #ffffff;
  background: #2f6ea4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
  cursor: ns-resize;
  z-index: 3;
  transform: scale(0.95);
}

.fillable-cell:hover .fill-handle,
.fillable-cell:focus-within .fill-handle {
  opacity: 1;
  transform: scale(1);
}

.fillable-cell.fill-drag-source .fill-handle {
  opacity: 1;
  transform: scale(1.05);
}

.fillable-cell.fill-drag-target {
  background: rgba(105, 149, 94, 0.14) !important;
}

.fillable-cell.range-selected {
  background: rgba(52, 128, 84, 0.22) !important;
}

.fillable-cell.range-start {
  box-shadow: inset 2px 0 0 #1f8a4c, inset -2px 0 0 #1f8a4c, inset 0 2px 0 #1f8a4c;
}

.fillable-cell.range-middle {
  box-shadow: inset 2px 0 0 #1f8a4c, inset -2px 0 0 #1f8a4c;
}

.fillable-cell.range-end {
  box-shadow: inset 2px 0 0 #1f8a4c, inset -2px 0 0 #1f8a4c, inset 0 -2px 0 #1f8a4c;
}

.money-col {
  text-align: center;
}

.money-cell {
  text-align: right;
}

.mini-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  background: #1f3042;
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  transition: opacity 130ms ease, transform 130ms ease;
  z-index: 2500;
}

.mini-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f3042;
}

.mini-bubble-deduct {
  background: #7c1d2e;
}

.mini-bubble-deduct::after {
  border-top-color: #7c1d2e;
}

.mini-bubble-info {
  background: #1f3042;
}

.mini-bubble-info::after {
  border-top-color: #1f3042;
}

.missing-days-cell:hover .mini-bubble,
.absenteeism-cell:hover .mini-bubble,
.normal-overtime-cell:hover .mini-bubble,
.holiday-overtime-cell:hover .mini-bubble,
.leave-edit-cell:hover .mini-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.benefit-cell:hover,
.benefit-cell:focus-within {
  z-index: 2000;
}

.benefit-cell.open-popup {
  z-index: 60000 !important;
}

.benefit-amount {
  display: inline;
  min-width: 0;
  padding: 0;
  font-weight: 700;
  font-size: 0.78rem;
}

.benefit-amount.is-on {
  color: #166242;
  background: transparent;
  border: none;
}

.benefit-amount.is-off {
  color: #7a5b2e;
  background: transparent;
  border: none;
}

.benefit-pop {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 60001;
}

.benefit-pop-portaled {
  position: absolute !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: scale(1) !important;
  z-index: 100000 !important;
}

.benefit-cell:hover .toggle-pop,
.benefit-cell:focus-within .toggle-pop {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.benefit-pop-btn {
  border: 1px solid #d8ccbb;
  background: #fffdfa;
  color: #38516b;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.benefit-pop-btn:hover {
  background: #f4ead7;
}

.popup-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.popup-action-row .benefit-pop-btn {
  flex: 1;
}

.popup-delete-btn {
  background: #fff1f3;
  color: #8d2435;
  border-color: #efc5cc;
}

.popup-delete-btn:hover {
  background: #ffe3e8;
}

.missing-days-cell {
  cursor: pointer;
}

.absenteeism-cell {
  cursor: pointer;
}

.advance-cell {
  cursor: pointer;
  text-align: right;
}

.advance-cell .benefit-amount {
  display: inline-block;
  width: 100%;
  text-align: right;
  padding-right: 6px;
}

tr.payroll-row td.advance-cell {
  text-align: right !important;
}

tr.payroll-row td.advance-cell .benefit-amount {
  display: block !important;
  width: 100%;
  text-align: right !important;
  padding-right: 8px;
}

.transport-cell {
  cursor: pointer;
}

.meal-cell {
  cursor: pointer;
}

.normal-overtime-cell,
.holiday-overtime-cell {
  cursor: pointer;
}

.leave-edit-cell {
  cursor: pointer;
}

.missing-days-cell:hover {
  background: rgba(236, 223, 204, 0.26);
}

.absenteeism-cell:hover {
  background: rgba(236, 223, 204, 0.26);
}

.advance-cell:hover {
  background: rgba(236, 223, 204, 0.26);
}

.advance-scope-grid {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.advance-scope-option {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
}

.advance-scope-option input[type="checkbox"],
.advance-scope-option input[type="radio"] {
  width: 14px;
  height: 14px;
}

.inst-count-select {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid #e0d6c8;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  background: #fff;
}

.inst-preview {
  margin-top: 2px;
}

.inst-preview-title {
  font-size: 0.76rem;
  margin-bottom: 4px;
  color: #6b5a45;
}

.inst-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.inst-preview-table td {
  padding: 3px 6px;
  border-bottom: 1px solid #ede6da;
}

.inst-preview-table tr:last-child td {
  border-bottom: none;
}

.inst-month-input {
  width: 110px !important;
  padding: 4px 6px !important;
  border: 1.5px solid #e0d6c8 !important;
  border-radius: 6px !important;
  font: inherit;
  font-size: 0.78rem !important;
  text-align: right;
  background: #fff;
}

.inst-month-input:focus {
  outline: none;
  border-color: #bb8f45 !important;
  box-shadow: 0 0 0 2px rgba(187, 143, 69, 0.12);
}

.inst-preview-sum {
  font-weight: 400;
  font-size: 0.72rem;
  color: #8a7a65;
}

.transport-cell:hover {
  background: rgba(236, 223, 204, 0.26);
}

.meal-cell:hover {
  background: rgba(236, 223, 204, 0.26);
}

.normal-overtime-cell:hover,
.holiday-overtime-cell:hover {
  background: rgba(236, 223, 204, 0.26);
}

.leave-edit-cell:hover {
  background: rgba(236, 223, 204, 0.26);
}

.leave-status.pending {
  color: #8a5b11;
  font-weight: 800;
}

.missing-days-value {
  color: #214363;
  font-weight: 800;
  font-size: 0.78rem;
}

.absenteeism-value {
  color: #214363;
  font-weight: 800;
  font-size: 0.78rem;
}

.missing-days-pop {
  width: max-content;
  min-width: 220px;
  transform: translateY(4px) scale(0.98);
}

.absenteeism-pop {
  width: max-content;
  min-width: 220px;
  transform: translateY(4px) scale(0.98);
}

.advance-pop,
.cash-pop,
.normal-overtime-pop,
.holiday-overtime-pop,
.transport-config-pop,
.meal-config-pop,
.leave-request-pop {
  width: max-content;
  min-width: 220px;
  transform: translateY(4px) scale(0.98);
}

.leave-request-pop {
  width: max-content;
  min-width: 300px;
  max-width: 400px;
}


.benefit-cell.open-popup .missing-days-pop {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.benefit-cell.open-popup .absenteeism-pop {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.benefit-cell.open-popup .advance-pop,
.benefit-cell.open-popup .cash-pop,
.benefit-cell.open-popup .meal-fee-pop,
.benefit-cell.open-popup .tutar-pop,
.benefit-cell.open-popup .maas-pop,
.benefit-cell.open-popup .normal-overtime-pop,
.benefit-cell.open-popup .holiday-overtime-pop,
.benefit-cell.open-popup .transport-config-pop,
.benefit-cell.open-popup .meal-config-pop,
.benefit-cell.open-popup .leave-request-pop {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.anchored-pop::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 16px;
  width: 2px;
  height: 13px;
  background: #cdbb9f;
  border-radius: 2px;
}

.anchored-pop::after {
  content: "";
  position: absolute;
  top: -17px;
  left: 11px;
  width: 12px;
  height: 8px;
  border-left: 2px solid #cdbb9f;
  border-top: 2px solid #cdbb9f;
  border-top-left-radius: 10px;
}

.sick-report-heading {
  font-weight: 600;
  font-size: .85rem;
  margin: 0 0 6px 0;
  color: #38516b;
}

.sick-report-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid #d8ccbb;
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 4px;
  font-size: .8rem;
}

.sick-report-entry span {
  color: #475569;
}

.sick-report-delete-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: .75rem;
  cursor: pointer;
  transition: background 120ms ease;
}

.sick-report-delete-btn:hover {
  background: #dc2626;
}

.sick-leave-pop-card {
  border: 1px solid #d8ccbb;
  border-radius: 12px;
  background: #fffdfa;
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.sick-leave-inner-form {
  display: grid;
  gap: 8px;
}

.sick-leave-inner-form label {
  font-size: 0.78rem;
}

.sick-leave-inner-form input {
  padding: 7px 8px;
}

.missing-days-form {
  display: grid;
  gap: 8px;
  border: 1px solid #d8ccbb;
  border-radius: 12px;
  background: #fffdfa;
  padding: 10px;
  box-shadow: var(--shadow-soft);
  max-height: var(--pop-max-h, none);
  overflow-y: auto;
  scrollbar-width: thin;
}

.missing-days-form label {
  font-size: 0.78rem;
}

.missing-days-form input {
  padding: 7px 8px;
}

.missing-days-total {
  margin: 0;
  font-size: 0.78rem;
  color: #4d6177;
}

.toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 8px;
  border: 1px solid #d8ccbb;
  border-radius: 999px;
  background: #fffaf2;
}

.toggle-check input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.benefit-form .btn {
  padding: 7px 10px;
  font-size: 0.78rem;
}

.search-dropdown {
  position: relative;
  min-width: 320px;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  background: #fffdfa;
  border: 1px solid #daccb7;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
}

.search-result-item {
  width: 100%;
  border: none;
  text-align: left;
  background: transparent;
  padding: 9px 10px;
  cursor: pointer;
}

.search-result-item:hover {
  background: #f5ebda;
}

.form-actions,
.full-row {
  grid-column: 1 / -1;
}

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

.login-card {
  width: min(1280px, 100%);
  padding: 28px;
  border-radius: 22px;
  border-color: #d7c8b2;
  background: linear-gradient(165deg, #fffdf9, #f4ecdf);
}

.login-head {
  margin-bottom: 14px;
}

.login-head h2 {
  margin: 6px 0 8px;
}

.login-card h2 {
  margin: 8px 0;
}

.login-card .muted {
  margin-bottom: 16px;
}

.login-card .form-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.login-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}

.company-panel,
.admin-panel {
  border: 1px solid #ddcfbc;
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.panel-title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #73572c;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.company-login-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 12px;
}

.company-card {
  border: 1px solid #d8c9b2;
  border-radius: 14px;
  background: linear-gradient(160deg, #fffefb, #f6eee2);
  padding: 12px;
  display: grid;
  gap: 8px;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.company-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(44, 62, 80, 0.08);
}

.company-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #1f3b55;
}

.company-card p {
  margin: 0;
  font-size: 0.78rem;
  color: #6f614d;
}

.company-open-btn {
  width: 100%;
  padding: 8px 10px;
}

.company-access-form {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.company-user-form {
  gap: 8px;
}

.company-user-form .form-actions {
  margin-top: 2px;
}

.company-user-form .btn {
  width: 100%;
}

.company-access-form input {
  padding: 8px 10px;
}

.login-card .form-grid.is-locked {
  opacity: 0.6;
}

.login-card .form-actions {
  margin-top: 4px;
}

.login-card label,
.login-card .full-row,
.login-card input,
.login-card .notice,
.login-card .form-actions {
  width: 100%;
  min-width: 0;
}

.login-card .form-actions .btn {
  width: 100%;
}

/* ===== Login Popup Modal ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(20, 30, 48, 0.55);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.login-modal {
  width: min(420px, 100%);
  background: linear-gradient(165deg, #fffdf9, #f4ecdf);
  border: 1px solid #d7c8b2;
  border-radius: 22px;
  padding: 32px 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-modal-head {
  text-align: center;
  margin-bottom: 18px;
}

.login-modal-head h2 {
  margin: 6px 0 0;
  font-size: 1.3rem;
  color: #1f3b55;
}

.login-modal-form {
  display: grid;
  gap: 14px;
}

.login-modal-form label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a4d3a;
}

.login-modal-form input {
  padding: 10px 12px;
  border: 1px solid #cfc0ab;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.2s;
}

.login-modal-form input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-login-submit {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 4px;
}

/* ===== Company Selection ===== */
.company-select-card {
  width: min(860px, 100%);
  text-align: center;
  padding: 36px 32px 28px;
}

.company-select-card .login-head {
  margin-bottom: 24px;
}

.company-select-card .login-head .eyebrow {
  font-size: 0.82rem;
  color: #73572c;
}

.company-select-card .login-head h2 {
  font-size: 1.5rem;
  margin: 6px 0 6px;
  color: #1a2e44;
}

.company-select-card .login-head .muted {
  font-size: 0.85rem;
  color: #7a6c58;
  margin-bottom: 0;
}

.company-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 0;
  justify-items: stretch;
}

.company-select-item {
  position: relative;
  display: flex;
}

.company-select-btn-form {
  display: flex;
  width: 100%;
}

.company-select-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 130px;
  padding: 24px 16px 20px;
  border: 2px solid #e0d5c4;
  border-radius: 18px;
  background: linear-gradient(168deg, #ffffff 0%, #faf5ed 100%);
  cursor: pointer;
  transition: all 200ms ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.company-select-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  opacity: 0;
  transition: opacity 200ms ease;
}

.company-select-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(0,0,0,0.06);
  border-color: #2563eb;
}

.company-select-btn:hover::before {
  opacity: 1;
}

.company-select-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.company-select-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #eef4ff, #dbeafe);
  border-radius: 14px;
  border: 1px solid #c9daf8;
}

.company-select-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2e44;
  letter-spacing: 0.01em;
}

/* Delete button */
.company-delete-form {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.company-delete-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.9);
  color: #b0a090;
  font-size: 0.75rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  padding: 0;
  font-family: inherit;
  opacity: 0;
}

.company-select-item:hover .company-delete-btn {
  opacity: 1;
}

.company-delete-btn:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* Add company trigger */
.company-add-trigger {
  border-style: dashed;
  border-color: #c9bfae;
  background: rgba(255,255,255,0.4);
  min-height: 130px;
}

.company-add-trigger .company-select-icon {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #bbf7d0;
}

.company-add-trigger .company-select-name {
  color: #5a7a5a;
}

.company-add-trigger:hover {
  border-color: #22c55e;
  background: rgba(255,255,255,0.7);
  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.1), 0 4px 12px rgba(0,0,0,0.04);
}

.company-add-trigger:hover::before {
  background: linear-gradient(90deg, #22c55e, #86efac);
  opacity: 1;
}

/* Logout section */
.company-select-card .btn-ghost {
  margin-top: 10px;
}

@media (max-width: 640px) {
  .company-select-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .company-select-card {
    padding: 24px 16px 20px;
  }
  .company-select-btn {
    min-height: 110px;
    padding: 18px 12px 16px;
  }
}

.btn-ghost {
  background: transparent;
  border: 1px solid #bfb19b;
  color: #73572c;
  padding: 8px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  transition: background 0.2s;
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

@media (max-width: 1000px) {
  .stats-grid,
  .payroll-stats,
  .kpi-strip,
  .quick-links,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .hero .btn,
  .section-heading .btn {
    align-self: flex-start;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 1240px) {
  .company-login-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 1000px) {
  .company-login-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    position: static;
    width: calc(100vw - 24px);
    margin: 12px;
  }

  .page {
    width: calc(100vw - 24px);
    margin: 0 12px 20px;
    padding: 12px;
  }



  nav {
    gap: 6px;
  }

  nav a,
  .user-chip {
    font-size: 0.78rem;
  }

  .inline-form {
    flex-wrap: wrap;
  }

  .company-login-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Employee Edit Popup ── */
.emp-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 110000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 25, 40, 0.38);
  backdrop-filter: blur(3px);
}

.emp-edit-modal {
  position: relative;
  width: 94vw;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface-strong, #fff);
  border-radius: 18px;
  box-shadow: 0 28px 64px rgba(15, 25, 40, 0.22);
  animation: rise 0.22s ease-out;
  scrollbar-width: thin;
}

.emp-edit-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--line, #e3d8c7);
}

.emp-edit-modal-header h3 {
  font-size: 1.05rem;
  color: var(--brand, #0f3d66);
}

.emp-edit-close-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  color: var(--muted, #697381);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.emp-edit-close-btn:hover {
  background: var(--bg-alt, #efe7d9);
}

.emp-edit-form {
  padding: 16px 24px 20px;
}

.emp-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.emp-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #697381);
}

.emp-edit-grid input,
.emp-edit-grid select {
  padding: 8px 10px;
  border: 1.5px solid var(--line, #e3d8c7);
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  background: var(--surface-soft, #faf7f1);
  color: var(--text, #1d2530);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.emp-edit-grid input:focus,
.emp-edit-grid select:focus {
  outline: none;
  border-color: var(--accent, #b68a45);
  box-shadow: 0 0 0 3px rgba(182, 138, 69, 0.12);
}

.emp-edit-grid input[readonly] {
  background: #f0ebe2;
  color: var(--muted, #697381);
  cursor: default;
}

.emp-edit-grid .full-width {
  grid-column: 1 / -1;
}

.emp-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.emp-edit-actions button {
  padding: 9px 22px;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.emp-edit-actions button[type="submit"] {
  background: var(--brand, #0f3d66);
  color: #fff;
}

.emp-edit-actions button[type="submit"]:hover {
  background: var(--brand-soft, #215a8d);
}

.emp-edit-actions button[type="button"] {
  background: var(--bg-alt, #efe7d9);
  color: var(--text, #1d2530);
}

.emp-edit-actions button[type="button"]:hover {
  background: var(--line, #e3d8c7);
}

.emp-edit-error {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger, #b4233a);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 540px) {
  .emp-edit-grid {
    grid-template-columns: 1fr;
  }
  .emp-edit-modal {
    max-width: 98vw;
    border-radius: 14px;
  }
}

/* ── Column Filter (Excel-like) ── */
.branch-filter-th {
  position: relative;
  white-space: nowrap;
}

.col-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--muted, #697381);
  cursor: pointer;
  border-radius: 5px;
  vertical-align: middle;
  margin-left: 2px;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.col-filter-btn:hover {
  background: rgba(182, 138, 69, 0.15);
  color: var(--accent, #b68a45);
}

.col-filter-btn.is-filtered {
  background: var(--accent, #b68a45);
  color: #fff;
}

.col-filter-dropdown {
  position: fixed;
  z-index: 90000;
  min-width: 190px;
  max-width: 260px;
  background: var(--surface-strong, #fff);
  border: 1px solid var(--line, #e3d8c7);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 25, 40, 0.18);
  padding: 8px 0;
  animation: rise 0.15s ease-out;
}

.col-filter-search {
  padding: 4px 10px 6px;
}

.col-filter-search input {
  width: 100%;
  padding: 6px 8px;
  border: 1.5px solid var(--line, #e3d8c7);
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  background: var(--surface-soft, #faf7f1);
  color: var(--text, #1d2530);
}

.col-filter-search input:focus {
  outline: none;
  border-color: var(--accent, #b68a45);
  box-shadow: 0 0 0 2px rgba(182, 138, 69, 0.12);
}

.col-filter-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 2px 10px;
  scrollbar-width: thin;
}

.col-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text, #1d2530);
  cursor: pointer;
  user-select: none;
}

.col-filter-item:hover {
  color: var(--brand, #0f3d66);
}

.col-filter-item input[type="checkbox"] {
  accent-color: var(--accent, #b68a45);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.col-filter-actions {
  display: flex;
  gap: 6px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--line, #e3d8c7);
  margin-top: 4px;
}

.col-filter-action-btn {
  flex: 1;
  padding: 5px 0;
  border: none;
  border-radius: 7px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-alt, #efe7d9);
  color: var(--text, #1d2530);
  transition: background 0.15s;
}

.col-filter-action-btn:hover {
  background: var(--line, #e3d8c7);
}

.col-filter-action-btn.primary {
  background: var(--brand, #0f3d66);
  color: #fff;
}

.col-filter-action-btn.primary:hover {
  background: var(--brand-soft, #215a8d);
}

/* ── Column Group Toggle (Excel-like) ── */
.col-group-header-row th {
  padding: 0;
  border-bottom: none;
  background: #fcf8f1;
}

.col-group-toggle-th {
  padding: 2px 0 0 !important;
  border-bottom: 2px solid var(--accent, #b68a45) !important;
  position: relative;
}

.col-group-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line, #e3d8c7);
  background: linear-gradient(180deg, #fffdf9, #f4ecdf);
  color: #7b6850;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.col-group-toggle-btn:hover {
  background: linear-gradient(180deg, #fff8ed, #ede0cc);
  color: #5a4a32;
}

.col-group-toggle-btn .col-group-icon {
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

/* Collapsed state */
table.col-group-leave-collapsed .col-group-leave {
  display: none;
}

table.col-group-salary-collapsed .col-group-salary {
  display: none;
}

table.col-group-leave-collapsed .col-group-toggle-th {
  border-bottom-color: var(--muted, #697381) !important;
}

table.col-group-leave-collapsed .col-group-toggle-th {
  padding: 2px 0 0 !important;
}

table.col-group-leave-collapsed .col-group-header-row .col-group-toggle-th {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
}

.col-group-leave,
.col-group-salary {
  transition: opacity 0.12s ease;
}

/* ── Delete Confirm Modal ── */
.delete-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 5, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.delete-confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}
.delete-confirm-box {
  background: #fff;
  border-radius: 20px;
  padding: 36px 34px 28px;
  max-width: 400px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(220, 38, 38, 0.12);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.delete-confirm-overlay.active .delete-confirm-box {
  transform: scale(1) translateY(0);
}
.delete-confirm-icon {
  font-size: 3rem;
  margin-bottom: 10px;
  animation: pulse-warn 1.2s ease-in-out infinite;
}
@keyframes pulse-warn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.delete-confirm-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #dc2626;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.delete-confirm-msg {
  font-size: 0.92rem;
  font-weight: 600;
  color: #4a3520;
  line-height: 1.65;
  margin: 0 0 24px;
  padding: 14px 16px;
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 12px;
}
.delete-confirm-actions {
  display: flex;
  gap: 12px;
}
.delete-confirm-cancel {
  flex: 1;
  padding: 12px 20px;
  border: 1.5px solid #d6cfc4;
  background: #faf7f1;
  color: #5a4a3a;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.delete-confirm-cancel:hover {
  background: #efe7d9;
  border-color: #b8ad9e;
}
.delete-confirm-yes {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.delete-confirm-yes:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}
