/* ==========================================================================
   سامانه مدیریت حقوق و دستمزد — بهبود پلیمر آرمان توس
   Design tokens: deep charcoal-navy + polymer teal + restrained gold accent
   ========================================================================== */

@font-face {
  font-family: 'CompanyFont';
  src: url('/fonts/font.woff2') format('woff2'),
       url('/fonts/font.woff') format('woff');
  font-weight: 300 700;
  font-display: swap;
}

/* فونت Vazirmatn به‌صورت کامل محلی (بدون هیچ وابستگی به Google Fonts یا سرویس خارجی دیگر) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/vendor/vazirmatn/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/vendor/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/vendor/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/vendor/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/vendor/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/vendor/vazirmatn/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  /* رنگ‌ها */
  --bg: #F5F7F9;
  --surface: #FFFFFF;
  --surface-alt: #EEF2F4;
  --ink: #10151C;
  --ink-soft: #5B6472;
  --ink-faint: #8A93A1;
  --sidebar-bg: #0E131A;
  --sidebar-bg-alt: #161D27;
  --accent: #0E7C86;
  --accent-dark: #0B646C;
  --accent-soft: #E3F3F2;
  --gold: #C9A227;
  --gold-soft: #F8F0DA;
  --danger: #D64545;
  --danger-soft: #FBEAEA;
  --success: #1F9D64;
  --success-soft: #E7F7EF;
  --border: #E4E9ED;
  --border-strong: #D3DAE1;
  --shadow-sm: 0 1px 2px rgba(16, 21, 28, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 21, 28, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 21, 28, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'CompanyFont', 'Vazirmatn', 'Tahoma', sans-serif;
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}

body { direction: rtl; }

input, select, button, textarea {
  font-family: inherit;
  direction: rtl;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

/* ==========================================================================
   ورود — صحنه انیمیشنی پلیمر
   ========================================================================== */

.login-body {
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 30% 20%, #16202A 0%, #0E131A 60%, #0A0D12 100%);
}

.login-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.polymer-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, black 0%, transparent 75%);
}

.polymer-blob {
  position: absolute;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform, border-radius;
  animation: blobMorph 16s var(--ease) infinite;
}

.polymer-blob--one {
  width: 620px;
  height: 620px;
  top: -180px;
  right: -160px;
  background: conic-gradient(from 120deg, var(--accent), #1FB5A8, var(--accent-dark), var(--accent));
  animation-duration: 18s;
}

.polymer-blob--two {
  width: 480px;
  height: 480px;
  bottom: -160px;
  left: -140px;
  background: conic-gradient(from 300deg, var(--gold), #8A6E12, var(--accent-dark), var(--gold));
  opacity: 0.35;
  animation-duration: 22s;
  animation-delay: -6s;
}

@keyframes blobMorph {
  0%   { border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%; transform: rotate(0deg) scale(1); }
  33%  { border-radius: 60% 40% 35% 65% / 55% 65% 35% 45%; transform: rotate(120deg) scale(1.08); }
  66%  { border-radius: 35% 65% 55% 45% / 40% 35% 65% 60%; transform: rotate(240deg) scale(0.96); }
  100% { border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%; transform: rotate(360deg) scale(1); }
}

.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 44px 36px 32px;
  box-shadow: var(--shadow-lg);
  animation: cardRise 0.7s var(--ease) both;
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo { width: 56px; height: 56px; object-fit: contain; margin-bottom: 12px; }
.login-brand h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-brand p { margin: 0; color: var(--ink-soft); font-size: 13px; }

.login-form { display: flex; flex-direction: column; gap: 22px; }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  animation: shake 0.4s var(--ease);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
}

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn-login:hover { background: var(--accent-dark); box-shadow: 0 10px 24px rgba(14, 124, 134, 0.3); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.btn-login i { transition: transform 0.25s var(--ease); }
.btn-login:hover i { transform: translateX(-3px); }

.login-footnote {
  text-align: center;
  margin: 24px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* ==========================================================================
   فیلدهای شناور (Floating Labels)
   ========================================================================== */

.field-group {
  position: relative;
}

.field-input {
  width: 100%;
  background: var(--surface-alt);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 18px 16px 8px;
  font-size: 14.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  appearance: none;
}

.login-card .field-input { padding-right: 44px; }

.field-input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field-label {
  position: absolute;
  right: 16px;
  top: 18px;
  font-size: 14.5px;
  color: var(--ink-faint);
  pointer-events: none;
  transform-origin: right top;
  transition: transform 0.18s var(--ease), color 0.18s var(--ease), top 0.18s var(--ease);
}

.login-card .field-label { right: 44px; }

.field-input:focus + .field-label,
.field-input:not(:placeholder-shown) + .field-label {
  top: 7px;
  transform: scale(0.76);
  color: var(--accent);
}

.field-group--select .field-label,
.field-label--static {
  top: 7px;
  transform: scale(0.76);
  color: var(--ink-faint);
}

.field-group--select .field-input:focus ~ .field-label { color: var(--accent); }

.field-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  font-size: 14px;
  pointer-events: none;
}

.field-toggle-pass {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px;
}

.field-error {
  display: block;
  min-height: 16px;
  color: var(--danger);
  font-size: 11.5px;
  margin-top: 4px;
  padding-right: 4px;
}

select.field-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235B6472' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
}

/* إخفاء الأسهم الافتراضية لحقول الأرقام لعرض أنيق */
.field-input[type="number"]::-webkit-inner-spin-button,
.field-input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
}

.field-group--readonly .field-input { color: var(--ink-faint); cursor: not-allowed; }

.field-group--penalty .field-input:focus,
.field-group--advance .field-input:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}
.field-group--penalty .field-input:focus + .field-label,
.field-group--advance .field-input:focus + .field-label { color: var(--danger); }

.field-group--bonus .field-input:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}
.field-group--bonus .field-input:focus + .field-label { color: var(--success); }

/* ==========================================================================
   ساختار کلی برنامه
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 264px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-alt) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  padding: 26px 20px;
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}

.sidebar-logo-wrap {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.sidebar-logo { width: 32px; height: 32px; object-fit: contain; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.5; }
.sidebar-brand-text strong { font-size: 13px; }
.sidebar-brand-text span { font-size: 11.5px; color: rgba(255,255,255,0.55); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
  position: relative;
}

.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }

.nav-item.active {
  background: rgba(14, 124, 134, 0.22);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 4px;
  background: var(--gold);
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info { display: flex; flex-direction: column; line-height: 1.4; overflow: hidden; }
.sidebar-user-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 11px; color: rgba(255,255,255,0.5); }

.btn-logout {
  background: rgba(255,255,255,0.06);
  border: none;
  color: rgba(255,255,255,0.7);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  flex-shrink: 0;
}

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

.app-main {
  margin-right: 264px;
  flex: 1;
  padding: 32px 40px 60px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.topbar-title h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.01em; }
.topbar-title p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

.period-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow-sm);
}

.period-picker-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.period-picker-field i { color: var(--accent); font-size: 13px; }

.period-picker select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
}

.period-picker-field:first-child { border-left: 1px solid var(--border); }

.period-picker-wrap {
  display: flex;
  justify-content: center;
  margin-top: -6px;
  margin-bottom: 32px;
  position: relative;
  z-index: 200;
}

.period-picker--lg {
  padding: 6px;
  gap: 6px;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFD 100%);
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(16, 21, 28, 0.05), 0 14px 32px rgba(16, 21, 28, 0.10);
  border-radius: 18px;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
  transform: translateY(-4px);
}

.period-picker--lg:hover {
  box-shadow: 0 6px 14px rgba(16, 21, 28, 0.07), 0 20px 42px rgba(16, 21, 28, 0.14);
  transform: translateY(-6px);
}

.period-picker--lg .period-picker-field {
  padding: 0;
  gap: 0;
}

.period-picker--lg .period-picker-field i {
  display: none;
}

.period-picker--lg select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  min-width: 128px;
  text-align: center;
  background: var(--surface-alt);
  border: 1.5px solid transparent;
  border-radius: 13px;
  padding: 13px 38px 13px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230E7C86' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.period-picker--lg select:hover {
  background-color: var(--accent-soft);
  border-color: var(--border);
}

.period-picker--lg select:focus {
  background-color: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.period-picker-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 6px 0;
}

.period-picker--lg .period-picker-divider {
  margin: 0 2px;
  background: transparent;
}

.settings-period-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 10px;
}

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

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  border: 1.5px solid transparent;
}

.btn-export--excel {
  background: #E7F7EF;
  color: #1F9D64;
  border-color: #CFEEDD;
}
.btn-export--excel:hover { background: #1F9D64; color: #fff; transform: translateY(-1px); }

.btn-export--pdf {
  background: #FBEAEA;
  color: #C0392B;
  border-color: #F5D5D5;
}
.btn-export--pdf:hover { background: #C0392B; color: #fff; transform: translateY(-1px); }

.panel-header-period {
  font-size: 13px;
  color: var(--accent-dark);
  font-weight: 500;
}

.modal-period-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 20px;
}

.no-record-note {
  display: inline-block;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-faint);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 999px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 10px 24px rgba(14,124,134,0.25); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--ink-soft);
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--ink); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-danger:hover { background: #B93636; }

/* ==========================================================================
   کارت‌های آماری
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fadeUp 0.5s var(--ease) both;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-icon--teal { background: var(--accent-soft); color: var(--accent-dark); }
.stat-icon--gold { background: var(--gold-soft); color: #8A6E12; }
.stat-icon--rose { background: #FCE9EC; color: #B23A57; }
.stat-icon--slate { background: var(--surface-alt); color: var(--ink-soft); }

.stat-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat-value { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-size: 12.5px; color: var(--ink-soft); }

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

/* ==========================================================================
   پنل و جدول
   ========================================================================== */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.panel-header h2 { margin: 0; font-size: 16px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 260px;
}

.search-box i { color: var(--ink-faint); font-size: 13px; }
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  width: 100%;
  color: var(--ink);
}

.table-wrap { overflow-x: auto; position: relative; min-height: 200px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.data-table thead th {
  text-align: right;
  padding: 14px 24px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 12.5px;
  background: var(--surface-alt);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr {
  animation: rowIn 0.35s var(--ease) both;
  transition: background 0.15s var(--ease);
}
.data-table tbody tr:hover { background: var(--surface-alt); }

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

.employee-name-cell { display: flex; align-items: center; gap: 10px; }
.employee-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge--married { background: #FCE9EC; color: #B23A57; }
.badge--single { background: var(--surface-alt); color: var(--ink-soft); }

.net-salary-cell { font-weight: 700; color: var(--accent-dark); }

.row-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s var(--ease);
  font-size: 13px;
}
.icon-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-btn.icon-btn--danger:hover { background: var(--danger); border-color: var(--danger); }
.icon-btn.icon-btn--payslip:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.icon-btn.icon-btn--disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
a.icon-btn { text-decoration: none; }

/* Skeleton / Empty state */

.table-skeleton { padding: 8px 24px; display: none; }
.table-skeleton.active { display: block; }
.skeleton-row {
  height: 52px;
  border-radius: 10px;
  margin: 10px 0;
  background: linear-gradient(90deg, var(--surface-alt) 25%, #E4E9ED 37%, var(--surface-alt) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 20px;
  text-align: center;
  color: var(--ink-soft);
}
.empty-state[hidden] { display: none; }
.empty-state i { font-size: 34px; color: var(--ink-faint); margin-bottom: 14px; }
.empty-state h3 { margin: 0 0 6px; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 0; font-size: 13px; max-width: 320px; }

/* ==========================================================================
   مودال
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 19, 26, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
  padding: 20px;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1040px;
  max-height: 96vh;
  overflow-y: auto;
  padding: 30px 36px 34px;
  box-shadow: var(--shadow-lg);
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.32s var(--ease), opacity 0.32s var(--ease);

  /* اسکرول‌بار اختصاصی به‌جای ظاهر پیش‌فرض مرورگر */
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.modal::-webkit-scrollbar {
  width: 7px;
}
.modal::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.modal::-webkit-scrollbar-track {
  background: transparent;
}
.modal::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 10px;
}
.modal::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent);
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal--sm { max-width: 400px; text-align: center; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-header h2 { margin: 0; font-size: 17px; }

.modal-close {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: none;
  background: var(--surface-alt);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }

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

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

@media (max-width: 900px) {
  .form-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

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

.field-group--marriage {
  animation: fieldReveal 0.3s var(--ease) both;
}

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

.salary-preview {
  margin-top: 24px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.salary-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
}

.salary-preview-row strong { color: var(--ink); font-weight: 600; }

.salary-preview-row--final {
  border-top: 1px dashed var(--border-strong);
  padding-top: 10px;
  font-size: 14.5px;
}
.salary-preview-row--final span { color: var(--ink); font-weight: 600; }
.salary-preview-row--final strong { color: var(--accent-dark); font-size: 17px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
}
.modal-footer--center { justify-content: center; }

.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin: 0 auto 16px;
}
.modal--sm h3 { margin: 0 0 8px; }
.modal--sm p { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

/* ==========================================================================
   تنظیمات
   ========================================================================== */

.settings-panel { padding: 30px; overflow: visible; }
.settings-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 14.5px;
  margin: 0 0 18px;
  color: var(--ink);
}
.settings-section-title:not(:first-child) { margin-top: 34px; }
.settings-section-title i { color: var(--accent); }

/* ==========================================================================
   نوتیفیکیشن (Toast)
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 700;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s var(--ease) both;
  min-width: 240px;
}

.toast.toast--success i { color: #5FE0A8; }
.toast.toast--error i { color: #FF8B8B; }

.toast.toast--out { animation: toastOut 0.3s var(--ease) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

/* ==========================================================================
   لودینگ
   ========================================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   واکنش‌گرا (Responsive)
   ========================================================================== */

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

@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .app-main { margin-right: 220px; padding: 24px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    width: 72px;
    padding: 20px 10px;
    align-items: center;
  }
  .sidebar-brand-text, .sidebar-user-info, .nav-item span { display: none; }
  .sidebar-brand { justify-content: center; }
  .nav-item { justify-content: center; }
  .app-main { margin-right: 72px; padding: 20px 16px 50px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .panel-header { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; }
  .modal { padding: 22px 18px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 22px 24px; }
}

/* ==========================================================================
   پرتال شخصی مرخصی کارمند — موبایل‌فرندلی
   ========================================================================== */

.leave-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #F5F7F9 0%, #EEF2F4 100%);
  position: relative;
  overflow-x: hidden;
}

.leave-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.leave-blob {
  position: absolute;
  filter: blur(70px);
  opacity: 0.18;
  animation: blobMorph 20s var(--ease) infinite;
}

.leave-blob--one {
  width: 420px; height: 420px;
  top: -120px; right: -120px;
  background: conic-gradient(from 120deg, var(--accent), #1FB5A8, var(--accent-dark));
}

.leave-blob--two {
  width: 360px; height: 360px;
  bottom: -100px; left: -100px;
  background: conic-gradient(from 300deg, var(--gold), #8A6E12);
  animation-delay: -8s;
}

.leave-wrap {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.leave-header {
  text-align: center;
  margin-bottom: 22px;
}

.leave-logo { width: 48px; height: 48px; object-fit: contain; margin-bottom: 10px; }
.leave-header h1 { font-size: 18px; margin: 0 0 4px; }
.leave-header p { margin: 0; color: var(--ink-soft); font-size: 12.5px; }

.leave-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s var(--ease) both;
}

.leave-card--welcome {
  display: flex;
  align-items: center;
  gap: 14px;
}

.leave-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}

.leave-welcome-text h2 { margin: 0 0 2px; font-size: 15.5px; }
.leave-welcome-text p { margin: 0; color: var(--ink-soft); font-size: 12.5px; }

.leave-balance-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--sidebar-bg-alt) 100%);
  border: none;
  color: #fff;
}

.leave-balance-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--gold);
  flex-shrink: 0;
}

.leave-balance-body { display: flex; flex-direction: column; gap: 4px; }
.leave-balance-label { font-size: 12px; color: rgba(255,255,255,0.65); }
.leave-balance-value { font-size: 22px; font-weight: 700; }

.leave-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px;
  margin: 0 0 16px;
}
.leave-section-title i { color: var(--accent); }

.leave-form { display: flex; flex-direction: column; gap: 18px; }

.leave-type-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.leave-type-option { position: relative; cursor: pointer; }
.leave-type-option input { position: absolute; opacity: 0; pointer-events: none; }

.leave-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: 12px;
  transition: all 0.2s var(--ease);
  text-align: center;
}

.leave-type-card i { font-size: 18px; }

.leave-type-option input:checked + .leave-type-card {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.field-textarea {
  resize: vertical;
  min-height: 70px;
  padding-top: 20px;
  line-height: 1.6;
}

.leave-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--gold-soft);
  color: #8A6E12;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.6;
}

.leave-submit-btn { width: 100%; justify-content: center; padding: 14px; }

.leave-history-list { display: flex; flex-direction: column; gap: 12px; }
.leave-history-empty { text-align: center; color: var(--ink-faint); font-size: 13px; padding: 20px 0; }

.leave-history-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.leave-history-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 14px;
}

.leave-history-body { flex: 1; min-width: 0; }
.leave-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.leave-history-top strong { font-size: 13px; }
.leave-history-reason { margin: 4px 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.leave-history-date { font-size: 11px; color: var(--ink-faint); }
.leave-history-note {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* نشان‌های وضعیت مرخصی */
.badge--pending { background: var(--gold-soft); color: #8A6E12; }
.badge--approved { background: var(--success-soft); color: var(--success); }
.badge--rejected { background: var(--danger-soft); color: var(--danger); }

/* ==========================================================================
   پنل مدیریت مرخصی‌ها
   ========================================================================== */

.leave-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.leave-filter-tab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
}

.leave-filter-tab:hover { color: var(--ink); }
.leave-filter-tab.active { background: var(--surface); color: var(--accent-dark); font-weight: 600; box-shadow: var(--shadow-sm); }

.leave-reason-cell { max-width: 220px; white-space: normal; font-size: 12.5px; color: var(--ink-soft); }
.leave-decided-note { font-size: 12px; color: var(--ink-faint); }

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

.balance-edit, .link-copy-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.balance-input {
  width: 70px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  font-family: inherit;
}

.link-input {
  flex: 1;
  min-width: 180px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--ink-soft);
  font-family: monospace;
  direction: ltr;
  text-align: left;
}

@media (max-width: 480px) {
  .leave-type-picker { gap: 6px; }
  .leave-type-card { padding: 10px 4px; font-size: 11px; }
  .leave-type-card i { font-size: 16px; }
}

/* ==========================================================================
   بنر «در حال مرخصی» و حالت غیرفعال فرم
   ========================================================================== */

.leave-active-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--gold) 0%, #B4901F 100%);
  border: none;
  color: #fff;
}

.leave-active-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.leave-active-body { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.leave-active-body strong { font-size: 14.5px; }

#leaveFormFieldset:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* اطمینان از اندازه مناسب لمسی و بدون زوم خودکار در موبایل (iOS) */
@media (max-width: 600px) {
  .leave-wrap .field-input,
  .leave-wrap select,
  .leave-wrap textarea {
    font-size: 16px;
  }
  .leave-submit-btn {
    min-height: 48px;
    font-size: 15px;
  }
  .leave-type-card {
    min-height: 64px;
    justify-content: center;
  }
  .leave-card { padding: 16px; border-radius: var(--radius-md); }
}

/* ==========================================================================
   انتخابگر تاریخ شمسی (جایگزین input تاریخ میلادی مرورگر)
   ========================================================================== */

.jalali-date-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jalali-date-picker-label {
  font-size: 12px;
  color: var(--ink-soft);
  padding-right: 2px;
}

.jalali-date-picker-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
}

.jalali-date-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235B6472' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 8px center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.jalali-date-select:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ==========================================================================
   گزارش بازه‌ای مرخصی
   ========================================================================== */

.header-actions-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-range-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-range-group {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  gap: 8px;
}

.summary-range-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
  width: 24px;
}

.summary-result-box {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.4s var(--ease) both;
}

.summary-result-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
}

.summary-result-total strong {
  font-size: 18px;
  color: var(--accent-dark);
}

.summary-result-breakdown {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--border-strong);
  padding-top: 10px;
}

/* ==========================================================================
   دراپ‌داون کاملاً سفارشی (بدون ظاهر پیش‌فرض مرورگر) — برای انتخابگر دوره داشبورد
   ========================================================================== */

.custom-select {
  position: relative;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 128px;
  background: var(--surface-alt);
  border: 1.5px solid transparent;
  border-radius: 13px;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.custom-select-trigger:hover {
  background: var(--accent-soft);
}

.custom-select.open .custom-select-trigger {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.custom-select-arrow {
  font-size: 11px;
  color: var(--accent);
  transition: transform 0.25s var(--ease);
}

.custom-select.open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  min-width: 140px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 250;
  animation: customSelectOpen 0.18s var(--ease) both;

  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.custom-select-menu::-webkit-scrollbar {
  width: 7px;
}
.custom-select-menu::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}
.custom-select-menu::-webkit-scrollbar-track {
  background: transparent;
}
.custom-select-menu::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 10px;
}
.custom-select-menu::-webkit-scrollbar-thumb:hover {
  background-color: var(--accent);
}

@keyframes customSelectOpen {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-select-option {
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.custom-select-option:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.custom-select-option.active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ==========================================================================
   دکمه و مودال اطلاعات بانکی
   ========================================================================== */

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

.btn-bank-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease);
}

.btn-bank-info:not(:disabled):hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.btn-bank-info:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-bank-info-status {
  color: var(--success);
  font-size: 11.5px;
}

.modal--bank { max-width: 480px; }

.bank-iban-field {
  margin-bottom: 20px;
}

.bank-iban-label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.bank-iban-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  direction: ltr;
}

.bank-iban-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface);
}

.bank-iban-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.bank-iban-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 14px 12px;
  font-size: 15px;
  font-family: 'DejaVu Sans Mono', monospace, inherit;
  letter-spacing: 1px;
  color: var(--ink);
  direction: ltr;
  min-width: 0;
}

.bank-detected-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  animation: fadeUp 0.35s var(--ease) both;
}

.bank-logo-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.bank-logo-badge--svg {
  padding: 6px;
  box-sizing: border-box;
}

.bank-logo-badge--svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bank-detected-info { display: flex; flex-direction: column; gap: 2px; }
.bank-detected-label { font-size: 11px; color: var(--ink-faint); }
.bank-detected-info strong { font-size: 14px; color: var(--ink); }

.bank-owner-reveal {
  background: var(--ink);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 8px;
  animation: fadeUp 0.4s var(--ease) both;
}

.bank-owner-label {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}

.bank-owner-typewriter {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  min-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  border-left: 2px solid var(--gold);
  padding-left: 4px;
  width: fit-content;
}

/* ==========================================================================
   لیست حقوق‌ها — صفحه قابل‌چاپ و قابل‌ویرایش
   ========================================================================== */

.app-main--distribution { padding-bottom: 60px; }

.distribution-sheet {
  padding: 28px;
}

.distribution-letterhead {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}

.distribution-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.distribution-letterhead-text h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.distribution-letterhead-text p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.distribution-table th,
.distribution-table td {
  white-space: normal;
}

.distribution-iban-cell {
  direction: ltr;
  text-align: center;
  font-family: 'DejaVu Sans Mono', monospace, inherit;
  font-size: 12px;
  color: var(--ink-soft);
}

.distribution-amount-cell {
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.distribution-totals-row {
  background: linear-gradient(180deg, var(--accent-soft) 0%, #EDF6F6 100%);
}

.distribution-totals-row td {
  padding: 14px 10px !important;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-dark);
  text-align: center;
  border-top: 2px solid var(--accent) !important;
}

.distribution-totals-row td:first-child {
  text-align: center;
  color: var(--ink);
  font-size: 13px;
}

.distribution-editable-cell { padding: 8px !important; }

.distribution-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-alt);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.distribution-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.distribution-money-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  overflow: hidden;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.distribution-money-input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.distribution-money-input-wrap .distribution-input {
  border: none;
  background: transparent;
  box-shadow: none !important;
  text-align: center;
}

.distribution-money-suffix {
  flex-shrink: 0;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--ink-faint);
  border-right: 1px solid var(--border);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.distribution-footer-note {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin-top: 60px;
}

.distribution-footer-note p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  font-size: 13px;
  color: var(--ink-soft);
}

/* ==========================================================================
   حالت چاپ — فقط برگه لیست حقوق نمایش داده می‌شود
   ========================================================================== */

@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }

  body {
    background: #fff !important;
  }

  .no-print {
    display: none !important;
  }

  .app-main--distribution {
    margin-right: 0 !important;
    padding: 0 !important;
  }

  .distribution-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .distribution-input {
    border: none !important;
    background: transparent !important;
    padding: 4px !important;
  }

  .data-table th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table-skeleton,
  .toast-container,
  .loading-overlay {
    display: none !important;
  }

  /* فشرده‌سازی برای جا شدن کل برگه (جدول + امضا) در یک صفحه چاپی */
  .distribution-letterhead {
    padding-bottom: 8px !important;
    margin-bottom: 10px !important;
  }

  .distribution-logo { width: 32px !important; height: 32px !important; }
  .distribution-letterhead-text h2 { font-size: 14px !important; margin: 0 0 2px !important; }
  .distribution-letterhead-text p { font-size: 11px !important; }

  .distribution-table th,
  .distribution-table td {
    padding: 6px 8px !important;
    font-size: 10.5px !important;
  }

  .distribution-editable-cell { padding: 3px !important; }

  .distribution-totals-row td {
    padding: 8px !important;
    font-size: 11.5px !important;
  }
  .distribution-input { font-size: 10.5px !important; }

  .distribution-footer-note {
    margin-top: 16px !important;
    page-break-inside: avoid;
  }

  .distribution-footer-note p { font-size: 11px !important; }

  .distribution-sheet {
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   فیلد اضافه‌کاری — تعداد + دراپ‌داون سفارشی واحد (روز/ساعت)
   ========================================================================== */

/* ==========================================================================
   فیلد اضافه‌کاری و متفرقه — تعداد/مبلغ + دراپ‌داون سفارشی (واحد یا علامت)
   با برچسب شناور مثل بقیه فیلدها
   ========================================================================== */

.overtime-field-group,
.misc-field-group {
  position: relative;
}

.overtime-input-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
}

.overtime-amount-input,
.misc-amount-input {
  padding: 13px 14px !important;
}

.overtime-unit-select .custom-select-trigger,
.misc-sign-select .custom-select-trigger {
  min-width: 0;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.misc-sign-select .custom-select-menu {
  min-width: 60px;
}

.overtime-unit-select .custom-select-menu {
  min-width: 100px;
}
