/* ════════════════════════════════════════════════════════════════════════════
   💰 Finance Module Styles - أنماط إدارة الأموال
   ════════════════════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────────────
   Finance Tabs
   ──────────────────────────────────────────────────────────────────── */
.finance-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border, #e5e7eb);
  padding-bottom: 10px;
}

.finance-tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray, #6b7280);
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  margin-bottom: -12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-tab-btn:hover {
  color: var(--primary, #FF5722);
}

.finance-tab-btn.active {
  color: var(--primary, #FF5722);
  border-bottom-color: var(--primary, #FF5722);
}

.finance-tab-btn i {
  font-size: 1.1rem;
}

/* ────────────────────────────────────────────────────────────────────
   Stats Grid
   ──────────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--white, #ffffff);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-card i {
  font-size: 1.6rem;
  color: var(--primary, #FF5722);
}

.stat-card.warning i {
  color: #f59e0b;
}

.stat-card h4 {
  font-size: 0.9rem;
  color: var(--gray, #6b7280);
  margin: 0 0 5px 0;
}

.stat-card span {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark, #1a1a1a);
}

/* ────────────────────────────────────────────────────────────────────
   Funds Grid
   ──────────────────────────────────────────────────────────────────── */
.funds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.fund-card {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.fund-card.fund-cash {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.fund-card.fund-bank {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.fund-card.fund-total {
  background: linear-gradient(135deg, #FF5722, #ff7961);
}

.fund-card i {
  font-size: 2rem;
}

.fund-card h4 {
  font-size: 0.9rem;
  margin: 0 0 5px 0;
  opacity: 0.9;
}

.fund-card .amount {
  font-size: 1.3rem;
  font-weight: 700;
}

/* ────────────────────────────────────────────────────────────────────
   Purchase Cards
   ──────────────────────────────────────────────────────────────────── */
.purchases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.purchase-card {
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s;
}

.purchase-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.purchase-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.purchase-id {
  font-weight: 700;
  color: var(--primary, #FF5722);
}

.purchase-card .card-body h4 {
  margin: 10px 0;
  font-size: 1.1rem;
}

.purchase-card .card-body p {
  margin: 5px 0;
  color: var(--gray, #6b7280);
  font-size: 0.9rem;
}

.purchase-card .card-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #e5e7eb);
}

/* ─── Discount Type ─── */
.card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.discount-info {
  color: #10b981 !important;
  font-weight: 600;
}

.discount-info i {
  margin-left: 4px;
}

.discount-type-select {
  padding: 4px 8px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--white, #fff);
  margin-right: 8px;
  min-width: 80px;
}

.discount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.discount-amount-display {
  color: #10b981;
  font-size: 0.85rem;
  font-weight: 600;
}

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

.purchases-filter-select {
  padding: 6px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--white, #fff);
}

/* ────────────────────────────────────────────────────────────────────
   Employee Cards
   ──────────────────────────────────────────────────────────────────── */
.employees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.employee-card {
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.employee-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.employee-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
}

.employee-info {
  flex: 1;
}

.employee-info h4 {
  margin: 0 0 5px 0;
  font-size: 1.1rem;
}

.employee-info span {
  display: block;
  font-size: 0.85rem;
  color: var(--gray, #6b7280);
  margin-bottom: 3px;
}

.employee-info .salary {
  font-weight: 600;
  color: var(--primary, #FF5722);
}

/* ────────────────────────────────────────────────────────────────────
   Badges
   ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-success {
  background: #10b981;
  color: white;
}

.badge-warning {
  background: #f59e0b;
  color: white;
}

.badge-secondary {
  background: #6b7280;
  color: white;
}

.badge-info {
  background: #3b82f6;
  color: white;
}

/* ────────────────────────────────────────────────────────────────────
   Payment Progress (for partial payments)
   ──────────────────────────────────────────────────────────────────── */
.payment-progress {
  margin: 8px 0;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.payment-info {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 0.8rem;
}

/* شريط كامل (مدفوع بالكامل) → أخضر */
.progress-bar.progress-bar-complete {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* ────────────────────────────────────────────────────────────────────
   Edit Status Button (زر تعديل حالة الدفع)
   ──────────────────────────────────────────────────────────────────── */
.btn-edit-status {
  background: none;
  border: 1px solid #d1d5db;
  color: #4b5563;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-edit-status:hover {
  border-color: var(--primary, #FF5722);
  color: var(--primary, #FF5722);
  background: rgba(255, 87, 34, 0.05);
}

/* ────────────────────────────────────────────────────────────────────
   Inline Status Editor (محرر حالة الدفع)
   ──────────────────────────────────────────────────────────────────── */
.status-editor {
  width: 100%;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.status-editor-options {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.status-option {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s;
}

.status-option:hover {
  border-color: var(--primary, #FF5722);
  color: var(--primary, #FF5722);
  background: rgba(255, 87, 34, 0.08);
}

.status-option.active {
  background: var(--primary, #FF5722);
  color: white;
  border-color: var(--primary, #FF5722);
  font-weight: 500;
}

.status-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ═══ محرر الدفع الجزئي ═══ */
.partial-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.partial-amount-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: right;
    direction: ltr;
    transition: all 0.2s ease;
}

.partial-amount-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.btn-apply-partial {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ff6b00, #ff8c00);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-apply-partial:hover {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-apply-partial:active {
    transform: translateY(0);
}

.btn-apply-partial i {
    margin-left: 0.25rem;
}

/* ────────────────────────────────────────────────────────────────────
   Payment Summary (in modal)
   ──────────────────────────────────────────────────────────────────── */
.payment-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.95rem;
}

.summary-row.highlight {
  border-top: 1px solid #e5e7eb;
  margin-top: 5px;
  padding-top: 10px;
  color: var(--primary, #FF5722);
  font-weight: 600;
}

/* Small Modal */
.modal-sm .modal-content {
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ────────────────────────────────────────────────────────────────────
   Section Headers
   ──────────────────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 14px 0;
}

.section-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.15rem;
}

/* ────────────────────────────────────────────────────────────────────
   Utility Classes
   ──────────────────────────────────────────────────────────────────── */
.text-center {
  text-align: center;
}

.text-danger {
  color: #ef4444 !important;
}

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: var(--gray, #6b7280);
}

.loading-spinner i {
  margin-left: 10px;
}

/* ────────────────────────────────────────────────────────────────────
   Modal Enhancements
   ──────────────────────────────────────────────────────────────────── */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.15rem;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
  transition: all 0.2s;
}

.btn-close:hover {
  color: #333;
  transform: scale(1.1);
}

/* ────────────────────────────────────────────────────────────────────
   Form Styles
   ──────────────────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #444;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group select,
.form-group textarea {
  padding: 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary, #FF5722);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-section {
  margin: 1.5rem 0;
  padding: 1rem 0;
}

.form-section h4 {
  margin: 0 0 1rem 0;
  color: #555;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.fund-balance-info {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ────────────────────────────────────────────────────────────────────
   Modal Actions
   ──────────────────────────────────────────────────────────────────── */
.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
}

.modal-actions button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.modal-actions .btn-primary {
  background: var(--primary, #FF5722);
  color: white;
}

.modal-actions .btn-primary:hover {
  background: #f4511e;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(255, 87, 34, 0.3);
}

.modal-actions .btn-secondary {
  background: #6b7280;
  color: white;
}

.modal-actions .btn-secondary:hover {
  background: #4b5563;
}

.btn-success,
.modal-actions .btn-success {
  background: #10b981;
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-success:hover,
.modal-actions .btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* ────────────────────────────────────────────────────────────────────
   Modal Large
   ──────────────────────────────────────────────────────────────────── */
.modal-large {
  max-width: 900px;
  width: 90%;
}

.modal-large .modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

/* ────────────────────────────────────────────────────────────────────
   Purchase Items
   ──────────────────────────────────────────────────────────────────── */
.purchase-items-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.purchase-item {
  background: white;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.3s;
}

.purchase-item:hover {
  border-color: var(--primary, #FF5722);
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.1);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.item-number {
  font-weight: bold;
  color: var(--primary, #FF5722);
  font-size: 0.9em;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.btn-icon:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sm.btn-primary {
  background: var(--primary, #FF5722);
  color: white;
}

.btn-sm.btn-primary:hover {
  background: #f4511e;
}

.item-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
}

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

/* ────────────────────────────────────────────────────────────────────
   Purchase Summary
   ──────────────────────────────────────────────────────────────────── */
.purchase-summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: 1rem;
}

.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: space-between;
}

.summary-row input {
  width: 120px;
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  text-align: right;
  font-family: inherit;
  font-size: 1rem;
}

.total-row {
  margin-top: 0.5rem;
  padding-top: 1rem !important;
  border-top: 2px solid white !important;
  font-size: 1.2em;
}

.total-amount {
  color: #FFD700;
  font-size: 1.3em;
}

/* ────────────────────────────────────────────────────────────────────
   Fund Transfer
   ──────────────────────────────────────────────────────────────────── */
.transfer-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  border-radius: 12px;
  border: 2px dashed #9ca3af;
}

.transfer-from,
.transfer-to {
  text-align: center;
}

.transfer-from label,
.transfer-to label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--dark, #1a1a1a);
  font-size: 1rem;
}

.transfer-from select,
.transfer-to select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s;
  background: white;
}

.transfer-from select:focus,
.transfer-to select:focus {
  outline: none;
  border-color: var(--primary, #FF5722);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1);
}

.transfer-arrow {
  color: var(--primary, #FF5722);
  animation: pulse 2s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

.balance-display {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #10b981;
  font-weight: 600;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.balance-display strong {
  color: var(--dark, #1a1a1a);
  margin-bottom: 0.25rem;
}

/* ────────────────────────────────────────────────────────────────────
   Financial Reports
   ──────────────────────────────────────────────────────────────────── */
.reports-section {
  padding: 1rem 0;
}

.date-range-filter {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.report-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.report-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--primary, #FF5722);
}

.report-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.report-card i {
  font-size: 2.5rem;
  color: var(--primary, #FF5722);
}

.report-card.sales::before {
  background: #10b981;
}

.report-card.sales i {
  color: #10b981;
}

.report-card.expenses::before {
  background: #ef4444;
}

.report-card.expenses i {
  color: #ef4444;
}

.report-card.purchases::before {
  background: #f59e0b;
}

.report-card.purchases i {
  color: #f59e0b;
}

.report-card.profit::before {
  background: #3b82f6;
}

.report-card.profit i {
  color: #3b82f6;
}

.report-card.profit.positive::before {
  background: #10b981;
}

.report-card.profit.positive i {
  color: #10b981;
}

.report-card.profit.negative::before {
  background: #ef4444;
}

.report-card.profit.negative i {
  color: #ef4444;
}

.report-card-content {
  flex: 1;
}

.report-card-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  color: #6b7280;
  font-weight: 500;
}

.report-card-content .amount {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--dark, #1a1a1a);
  margin-bottom: 0.25rem;
}

.report-card-content small {
  font-size: 0.8rem;
  color: #9ca3af;
}

.report-details {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-details h4 {
  margin: 0 0 1.5rem 0;
  color: var(--primary, #FF5722);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
}

.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.category-item {
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.category-name {
  font-weight: 600;
  color: var(--dark, #1a1a1a);
  font-size: 1rem;
}

.category-amount {
  font-weight: 700;
  color: var(--primary, #FF5722);
  font-size: 1.1rem;
}

.category-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.category-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #FF5722), #ff7961);
  transition: width 0.5s ease;
}

.category-count {
  font-size: 0.85rem;
  color: #6b7280;
}

/* ────────────────────────────────────────────────────────────────────
   Responsive Design
   ──────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .finance-tabs {
    flex-direction: column;
  }

  .finance-tab-btn {
    margin-bottom: 0;
    border-bottom: none;
    border-right: 3px solid transparent;
  }

  .finance-tab-btn.active {
    border-right-color: var(--primary, #FF5722);
  }

  .stats-grid,
  .funds-grid,
  .purchases-grid,
  .employees-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions button {
    width: 100%;
    justify-content: center;
  }

  .modal-large {
    width: 95%;
  }

  .item-grid {
    grid-template-columns: 1fr;
  }

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

  .summary-row input {
    width: 100px;
    font-size: 0.9rem;
  }

  .transfer-preview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .transfer-arrow {
    transform: rotate(90deg);
  }

  .reports-grid {
    grid-template-columns: 1fr;
  }

  .report-card {
    flex-direction: column;
    text-align: center;
  }

  .report-card i {
    font-size: 2rem;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   FINANCIAL ALERTS SYSTEM
   ════════════════════════════════════════════════════════════════════════════ */

.alerts-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 90%;
  max-width: 700px;
  pointer-events: none;
}

.alert {
  background: white;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideDownAlert 0.4s ease;
  border-right: 5px solid;
  pointer-events: auto;
  position: relative;
  transition: all 0.3s ease;
}

.alert:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

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

.alert.fade-out {
  animation: fadeOutAlert 0.3s ease;
  opacity: 0;
}

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

.alert i.fas {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-message {
  flex: 1;
  font-weight: 500;
  line-height: 1.5;
  color: #333;
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #666;
  transition: all 0.2s;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  transform: rotate(90deg);
}

/* Alert Types */

.alert-warning {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.alert-warning i.fas {
  color: #f59e0b;
}

.alert-danger {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.alert-danger i.fas {
  color: #ef4444;
}

.alert-info {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.alert-info i.fas {
  color: #3b82f6;
}

.alert-success {
  border-color: #10b981;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.alert-success i.fas {
  color: #10b981;
}

/* Responsive Alerts */

@media (max-width: 768px) {
  .alerts-container {
    top: 60px;
    width: 95%;
  }

  .alert {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }

  .alert i.fas {
    font-size: 1.25rem;
  }

  .alert-message {
    font-size: 0.9rem;
  }

  .alert-close {
    width: 28px;
    height: 28px;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   EXPANDABLE SECTIONS
   ════════════════════════════════════════════════════════════════════════════ */

.expandable-section {
  margin: 1.5rem 0;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.expand-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 0.75rem 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #666;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s;
  text-align: right;
}

.expand-toggle:hover {
  color: var(--primary, #FF5722);
}

.expand-toggle i {
  font-size: 0.85rem;
  transition: transform 0.3s;
}

.expand-toggle.expanded {
  color: var(--primary, #FF5722);
}

.expand-content {
  padding-top: 1rem;
  animation: slideDown 0.3s ease;
}

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

.input-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   Enhanced HR Styles
   ═══════════════════════════════════════════════════════════════ */

/* HR Sub-tabs */
.hr-sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border, #e5e7eb);
    padding-bottom: 0;
}

.hr-sub-tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray, #6b7280);
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    white-space: nowrap;
}

.hr-sub-tab-btn:hover {
    color: var(--primary, #FF5722);
}

.hr-sub-tab-btn.active {
    color: var(--primary, #FF5722);
    border-bottom-color: var(--primary, #FF5722);
}

.hr-sub-tab-btn i {
    font-size: 1rem;
}

.hr-sub-content {
    animation: hrFadeIn 0.3s ease;
}

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

/* Quick Check-in Bar */
.hr-quick-checkin-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.hr-quick-checkin-bar select {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}

.hr-quick-checkin-bar .btn-success,
.hr-quick-checkin-bar .btn-danger {
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Active Workers List */
.hr-active-workers {
    margin-bottom: 16px;
}

.hr-active-workers-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hr-active-workers-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hr-active-worker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #166534;
    font-weight: 500;
}

.hr-active-worker-badge .worker-avatar-sm {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #22c55e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
}

/* Chip Divider */
.hr-chip-divider {
    width: 1px;
    height: 20px;
    background: #ddd;
    align-self: center;
    margin: 0 2px;
}

/* Attendance action buttons */
.att-action-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    transition: all 0.2s;
    margin: 0 2px;
}

.att-action-btn-delete {
    background: #fef2f2;
    color: #dc2626;
}

.att-action-btn-delete:hover {
    background: #dc2626;
    color: white;
}

/* Employee Quick View Modal */
.eqv-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.eqv-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #FF5722), #ff7043);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

.eqv-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.eqv-info .eqv-meta {
    font-size: 0.82rem;
    color: #888;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.eqv-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.eqv-stat {
    background: #f8f8f8;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.eqv-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
}

.eqv-stat-label {
    font-size: 0.78rem;
    color: #888;
    margin-top: 2px;
}

.eqv-section {
    margin-bottom: 14px;
}

.eqv-section h5 {
    font-size: 0.9rem;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #555;
}

.eqv-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
}

.eqv-detail-row span:first-child {
    color: #888;
}

.eqv-detail-row span:last-child {
    font-weight: 600;
    color: #333;
}

.eqv-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.eqv-actions button {
    flex: 1;
    min-width: 100px;
    padding: 8px 12px;
    font-size: 0.82rem;
}

.hr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.hr-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid #eee;
    transition: transform 0.2s;
}

.hr-stat-card:hover {
    transform: translateY(-2px);
}

.hr-stat-card.active-stat {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.hr-stat-card.salary-stat {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.hr-stat-card i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.hr-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.hr-stat-label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}

.hr-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.hr-section-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.employee-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ff7043);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Salary Calculator */
.salary-calculator {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #eee;
}

.salary-calculator h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.salary-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 15px;
}

.salary-filters select,
.salary-filters input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}

.salary-result-card {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
}

.salary-result-card h4 {
    margin-bottom: 15px;
    color: var(--primary);
}

.salary-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.salary-result-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
}

.salary-result-item span {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
}

.salary-result-item strong {
    font-size: 1.1rem;
    color: #333;
}

.salary-result-item.highlight {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #22c55e;
}

.salary-result-item.highlight strong {
    color: #16a34a;
}

/* ── حاسبة المعاشات - أزرار الموظفين ── */
.salary-employee-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.salary-emp-chip {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    color: #555;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.salary-emp-chip:hover {
    border-color: var(--primary, #FF5722);
    color: var(--primary, #FF5722);
}

.salary-emp-chip.active {
    background: var(--primary, #FF5722);
    border-color: var(--primary, #FF5722);
    color: white;
}

/* ── أزرار الفترة ── */
.salary-period-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.salary-period-btn {
    padding: 8px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #555;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.salary-period-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.salary-period-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.salary-period-btn i {
    font-size: 0.8rem;
}

/* ── صف التواريخ ── */
.salary-dates-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.salary-date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.salary-date-field label {
    font-size: 0.8rem;
    color: #888;
}

.salary-date-field input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
}

/* Placeholder Section */
.placeholder-section {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* ────────────────────────────────────────────────────────────────────
   HR Filter Bar & Cards (Redesign)
   ──────────────────────────────────────────────────────────────────── */

.hr-filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hr-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.hr-search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.9rem;
}

.hr-search-box input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.hr-search-box input:focus {
    border-color: var(--primary, #FF5722);
    outline: none;
}

.hr-filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hr-chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.hr-chip:hover {
    border-color: var(--primary, #FF5722);
    color: var(--primary, #FF5722);
}

.hr-chip.active {
    background: var(--primary, #FF5722);
    color: white;
    border-color: var(--primary, #FF5722);
}

.hr-chip-success.active {
    background: #16a34a;
    border-color: #16a34a;
}

.hr-chip-warning.active {
    background: #f59e0b;
    border-color: #f59e0b;
}

/* بطاقات الموظفين المحسّنة */
.employee-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
}

.employee-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.employee-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.employee-card-top .employee-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #FF5722), #ff7043);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.employee-card-top .employee-info {
    flex: 1;
    min-width: 0;
}

.employee-card-top .employee-info h4 {
    margin: 0 0 3px 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.hr-role-admin {
    background: #fef3c7;
    color: #92400e;
}

.hr-role-manager {
    background: #dbeafe;
    color: #1d4ed8;
}

.hr-role-cashier {
    background: #ede9fe;
    color: #6d28d9;
}

.hr-role-viewer {
    background: #f0f0f0;
    color: #666;
}

.hr-status-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    flex-shrink: 0;
}

.employee-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 6px 0;
    border-top: 1px solid #f5f5f5;
}

.employee-detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: #777;
}

.employee-detail-item i {
    font-size: 0.75rem;
    color: #bbb;
    width: 14px;
    text-align: center;
}

.employee-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 4px;
}

.hr-card-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.hr-card-btn-edit {
    background: #f0f0f0;
    color: #666;
}

.hr-card-btn-edit:hover {
    background: #3b82f6;
    color: white;
}

.hr-card-btn-delete {
    background: #fef2f2;
    color: #dc2626;
}

.hr-card-btn-delete:hover {
    background: #dc2626;
    color: white;
}

.hr-card-btn-toggle-off {
    background: #fef3c7;
    color: #d97706;
}

.hr-card-btn-toggle-off:hover {
    background: #d97706;
    color: white;
}

.hr-card-btn-toggle-on {
    background: #d1fae5;
    color: #059669;
}

.hr-card-btn-toggle-on:hover {
    background: #059669;
    color: white;
}

.employee-card-disabled {
    opacity: 0.6;
    border-color: #e5e5e5;
    background: #fafafa;
}

.hr-badge-protected {
    font-size: 0.72rem;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hr-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.hr-loading i {
    color: var(--primary, #FF5722);
    margin-left: 8px;
}

.hr-empty {
    text-align: center;
    padding: 40px;
    color: #aaa;
}

.hr-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* أقسام بطاقات HR */
.hr-card-section {
    background: white;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #eee;
    margin-top: 20px;
}

.hr-card-title {
    margin: 0 0 14px 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hr-card-title i {
    color: var(--primary, #FF5722);
}

.hr-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.hr-inline-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    max-width: 160px;
}

.hr-inline-date {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    max-width: 140px;
}

@media (max-width: 768px) {
    .hr-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .salary-dates-row {
        flex-direction: column;
        align-items: stretch;
    }
    .salary-period-btns {
        flex-wrap: wrap;
    }
    .salary-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .hr-section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .hr-filter-bar {
        flex-direction: column;
    }
    .employees-grid {
        grid-template-columns: 1fr;
    }
    .hr-bottom-grid {
        grid-template-columns: 1fr;
    }
    .hr-header-actions {
        flex-wrap: wrap;
    }
    .hr-sub-tabs {
        gap: 2px;
    }
    .hr-sub-tab-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
    .hr-quick-checkin-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .hr-quick-checkin-bar select {
        min-width: 100%;
    }
    .hr-quick-checkin-bar .btn-success,
    .hr-quick-checkin-bar .btn-danger {
        justify-content: center;
    }
    .eqv-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .eqv-actions {
        flex-direction: column;
    }
    .eqv-actions button {
        min-width: 100%;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   💵 Petty Cash - صندوق النثريات
   ════════════════════════════════════════════════════════════════════════════ */

.petty-cash-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.petty-cash-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-right: 4px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.petty-cash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.petty-cash-card.revenue-card {
    border-right-color: #22c55e;
}

.petty-cash-card.revenue-card .pc-card-icon {
    background: #f0fdf4;
    color: #22c55e;
}

.petty-cash-card.expenses-card {
    border-right-color: #ef4444;
}

.petty-cash-card.expenses-card .pc-card-icon {
    background: #fef2f2;
    color: #ef4444;
}

.petty-cash-card.profit-card {
    border-right-color: #3b82f6;
}

.petty-cash-card.profit-card .pc-card-icon {
    background: #eff6ff;
    color: #3b82f6;
}

.petty-cash-card.cash-card {
    border-right-color: #f59e0b;
}

.petty-cash-card.cash-card .pc-card-icon {
    background: #fffbeb;
    color: #f59e0b;
}

.pc-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.pc-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc-card-label {
    font-size: 0.85rem;
    color: #888;
}

.pc-card-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.pc-card-value.positive {
    color: #22c55e;
}

.pc-card-value.negative {
    color: #ef4444;
}

/* Type Badges */
.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.type-badge.withdrawal {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.type-badge.deposit {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Amount colors */
.withdrawal-amount {
    color: #dc2626;
    font-weight: 600;
}

.deposit-amount {
    color: #16a34a;
    font-weight: 600;
}

/* Filters */
.petty-cash-filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.petty-cash-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.petty-cash-filters .filter-group label {
    font-size: 0.8rem;
    color: #888;
}

.petty-cash-filters .filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Radio Group for Modal */
.radio-group {
    display: flex;
    gap: 16px;
    padding: 8px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.radio-label:has(input:checked) {
    border-color: var(--primary, #FF5722);
    background: rgba(255, 87, 34, 0.05);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary, #FF5722);
}

.radio-text {
    font-weight: 600;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .petty-cash-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    .petty-cash-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .petty-cash-summary {
        grid-template-columns: 1fr;
    }
}

/* ─── Badge Danger ─── */
.badge-danger {
  background: #ef4444;
  color: white;
}

/* ─── Modal Item Row ─── */
.item-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.item-row select {
  flex: 2;
  min-width: 140px;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
}

.item-row input[type="number"] {
  flex: 1;
  min-width: 70px;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  text-align: center;
}

.item-row input[readonly] {
  background: #f3f4f6;
  color: var(--primary, #FF5722);
  font-weight: 600;
}

.purchase-item {
  margin-bottom: 10px;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

/* ─── Expandable Sections ─── */
.expandable-section {
  margin: 12px 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.expand-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f9fafb;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: #4b5563;
  font-weight: 500;
  transition: background 0.2s;
}

.expand-toggle:hover {
  background: #f3f4f6;
}

.expand-toggle.expanded {
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.expand-toggle i {
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.expand-content {
  padding: 14px;
}

/* ─── Purchase Summary (totals area) ─── */
.purchase-summary {
  margin: 14px 0;
  padding: 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.summary-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.total-row {
  border-top: 1px solid #fde68a;
  margin-top: 6px;
  padding-top: 8px;
  font-size: 1.1rem;
}

.total-amount {
  color: var(--primary, #FF5722);
  font-size: 1.15rem;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .item-row {
        flex-direction: column;
        gap: 6px;
    }
    .item-row select,
    .item-row input[type="number"] {
        flex: unset;
        width: 100%;
    }
}
