/* === پایه === */
body {
  /* background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); */
  min-height: 100vh;
  font-family: "Vazirmatn", "Tahoma", sans-serif;
}

a {
  text-decoration: none;
}

/* === هدر === */
.header {
  background: linear-gradient(to left, #1e40af, #1e3a8a);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* === کارت‌ها === */
.main-card,
.login-card {
  background: white;
  border-radius: 20px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.login-card {
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  padding: 40px 32px;
  max-width: 420px;
  animation: floatIn 0.6s ease-out;
}

/* === دکمه‌ها === */
.btn-primary {
  background: #3b82f6;
  color: white;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 20px;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}
.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(59, 130, 246, 0.3);
}

.btn-danger {
  background: #ef4444;
  color: white;
  font-weight: 500;
  border-radius: 12px;
  padding: 10px 24px;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 8px 15px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: #10b981;
  color: white;
  font-weight: 500;
  border-radius: 12px;
  padding: 12px 20px;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
  background: #059669;
  box-shadow: 0 8px 15px rgba(16, 185, 129, 0.3);
}

.btn-reset {
  background: #64748b;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 0 6px 12px rgba(100, 116, 139, 0.2);
}
.btn-reset:hover {
  background: #475569;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(100, 116, 139, 0.3);
}

/* دکمه لاگین */
.btn-login {
  width: 100%;
  background: #3b82f6;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 14px 20px;
  border-radius: 16px;
  transition: all 0.3s;
  box-shadow: 0 8px 15px rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-login:hover {
  background: #2563eb;
  transform: translateY(-3px);
  box-shadow: 0 12.5px 25px rgba(59, 130, 246, 0.4);
}
.btn-login:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === ورودی‌ها === */
.input-field {
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: #f8fafc;
}
.input-field:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: left 16px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-left: 44px;
}

/* لاگین */
.input-group {
  position: relative;
  margin-bottom: 20px;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
}

/* === برچسب‌ها === */
.label {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.875rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* === بخش‌های کارت === */
.installment-card,
.filter-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.filter-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* === پنل فیلتر === */
#filterPanel {
  position: absolute;
  top: 70px;
  right: 16px;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: white;
  border-radius: 20px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 24px;
  z-index: 1000;
  display: none;
  border: 1px solid #e2e8f0;
}
#filterPanel.open {
  display: block;
  animation: slideIn 0.3s ease-out;
}

/* === جدول === */
.table-container {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* === عنوان‌ها === */
.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.login-subtitle {
  text-align: center;
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 28px;
}

/* === پیام خطا === */
.error-msg {
  background: #fee2e2;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid #fecaca;
  display: none;
  margin-top: 16px;
}
.error-msg.show {
  display: block;
  animation: shake 0.4s ease-in-out;
}

/* === اسپینر === */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid transparent;
  border-top: 2.5px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* === انیمیشن‌ها === */
@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* === پرینت === */
@media print {
  body * {
    visibility: hidden;
  }
  #printArea,
  #printArea * {
    visibility: visible;
  }
  #printArea {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
  }
  @page {
    size: landscape;
  }
  table {
    width: 100%;
    table-layout: fixed;
  }
  table th:last-child,
  table td:last-child {
    display: none !important;
  }
  body {
    margin: 0;
    padding: 0;
  }
  * {
    box-sizing: border-box;
  }
  #printArea {
    page-break-after: avoid;
    page-break-before: avoid;
    page-break-inside: avoid;
    margin: 0 auto;
  }
  .shadow-lg,
  .main-card,
  .login-card {
    box-shadow: none !important;
  }
  table {
    page-break-after: avoid;
  }
}

.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-box {
  position: absolute;
  right: 0;
  top: 120%;
  min-width: 180px;
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  padding: 10px 14px;
  border-radius: 10px;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tooltip-wrapper:hover .tooltip-box {
  opacity: 1;
  pointer-events: auto;
}

.tooltip-row {
  font-size: 13px;
  color: #374151;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tooltip-row:last-child {
  margin-bottom: 0;
}

.tooltip-title {
  font-weight: bold;
  color: #111827;
  margin-bottom: 8px;
}
