/* ===== צבעי ליטאי ===== */
:root {
  --primary-green-dark: #2d5f3f;
  --primary-green: #528163;
  --primary-green-light: #8dd1bb;

  --neutral-dark: #2d3436;
  --neutral-medium: #636e72;
  --neutral-light: #b2bec3;
  --neutral-bg: #f5f6fa;

  --status-success: #27ae60;
  --status-warning: #f39c12;
  --status-error: #e74c3c;
  --status-info: #528163;

  --font-primary: 'Assistant', 'Heebo', 'Arial Hebrew', sans-serif;
  --font-numeric: 'Rubik', 'Arial', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--neutral-bg);
  direction: rtl;
  line-height: 1.6;
}

/* ===== כותרת ראשית ===== */
.header {
  background: linear-gradient(135deg, var(--primary-green-dark) 0%, var(--primary-green) 100%);
  color: white;
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.header p {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ===== טאבים ===== */
.tabs {
  background: white;
  display: flex;
  border-bottom: 2px solid var(--neutral-light);
  padding: 0 1rem;
  overflow-x: auto;
}

.tab {
  padding: 0.85rem 1.25rem;
  background: none;
  border: none;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--neutral-medium);
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--primary-green);
  background-color: rgba(82, 129, 99, 0.05);
}

.tab.active {
  color: var(--primary-green-dark);
  border-bottom-color: var(--primary-green);
  font-weight: 600;
}

/* ===== תוכן ===== */
.content {
  max-width: 1300px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s;
}

.tab-content.active {
  display: block;
}

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

/* ===== כרטיסים ===== */
.card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
}

/* ===== כרטיסי סטטיסטיקה ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-top: 4px solid var(--primary-green);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.stat-card h3 {
  color: var(--neutral-medium);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-card .value {
  color: var(--primary-green-dark);
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-numeric);
}

/* ===== כותרת קטע ===== */
.section-title {
  color: var(--primary-green-dark);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

/* ===== אזור העלאת קבצים ===== */
.upload-area {
  background: white;
  border: 2px dashed var(--primary-green-light);
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--primary-green);
  background-color: rgba(82, 129, 99, 0.02);
}

.upload-area.dragover {
  border-color: var(--primary-green-dark);
  background-color: rgba(82, 129, 99, 0.1);
}

.upload-icon {
  font-size: 3rem;
  color: var(--primary-green-light);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.upload-area p {
  color: var(--neutral-medium);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.upload-area small {
  color: var(--neutral-light);
}

/* ===== סרגל פילטרים ===== */
.filter-bar {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.85rem;
  color: var(--neutral-medium);
  font-weight: 500;
}

/* ===== טבלאות ===== */
.table-container {
  background: white;
  border-radius: 8px;
  overflow-x: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--primary-green);
  color: white;
}

th {
  padding: 0.85rem 1rem;
  text-align: right;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

tbody tr:hover {
  background-color: rgba(82, 129, 99, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

.empty-cell {
  text-align: center;
  padding: 2rem !important;
  color: var(--neutral-medium);
}

.amount-cell {
  font-family: var(--font-numeric);
  font-weight: 500;
  color: var(--primary-green-dark);
}

.summary-row {
  background-color: rgba(141, 209, 187, 0.2);
  font-weight: bold;
}

.summary-row td {
  border-bottom: none;
}

/* ===== כפתורים ===== */
.btn {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-green);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-green-dark);
  box-shadow: 0 4px 12px rgba(82, 129, 99, 0.3);
}

.btn-secondary {
  background-color: white;
  color: var(--primary-green);
  border: 2px solid var(--primary-green);
}

.btn-secondary:hover {
  background-color: var(--primary-green);
  color: white;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-danger {
  background-color: var(--status-error);
  color: white;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== סטטוס תגיות ===== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-paid {
  background-color: rgba(39, 174, 96, 0.15);
  color: var(--status-success);
}

.badge-partial {
  background-color: rgba(243, 156, 18, 0.15);
  color: var(--status-warning);
}

.badge-pending {
  background-color: rgba(231, 76, 60, 0.15);
  color: var(--status-error);
}

.badge-received {
  background-color: rgba(82, 129, 99, 0.15);
  color: var(--primary-green);
}

/* ===== מודאלים ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-lg {
  max-width: 700px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  color: var(--primary-green-dark);
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--neutral-medium);
  padding: 0 0.25rem;
}

.modal-close:hover {
  color: var(--status-error);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  justify-content: flex-start;
}

/* ===== טפסים ===== */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--neutral-dark);
}

select, input[type="text"], input[type="number"], input[type="date"], input[type="month"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--neutral-light);
  border-radius: 6px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--neutral-dark);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(82, 129, 99, 0.1);
}

/* Filter bar inputs - auto width */
.filter-bar select, .filter-bar input {
  width: auto;
  min-width: 150px;
}

/* ===== הודעות ===== */
.message {
  padding: 0.85rem 1.25rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeIn 0.3s;
}

.message.success {
  background-color: rgba(39, 174, 96, 0.1);
  color: var(--status-success);
  border-right: 4px solid var(--status-success);
}

.message.error {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--status-error);
  border-right: 4px solid var(--status-error);
}

.message.warning {
  background-color: rgba(243, 156, 18, 0.1);
  color: var(--status-warning);
  border-right: 4px solid var(--status-warning);
}

.message.info {
  background-color: rgba(82, 129, 99, 0.1);
  color: var(--primary-green);
  border-right: 4px solid var(--primary-green);
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--neutral-medium);
}

.spinner {
  border: 3px solid var(--neutral-light);
  border-top: 3px solid var(--primary-green);
  border-radius: 50%;
  width: 35px;
  height: 35px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== פרטי עובד במודאל ===== */
.employee-detail-section {
  margin-bottom: 1.5rem;
}

.employee-detail-section h4 {
  color: var(--primary-green-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-green-light);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-item .label {
  font-size: 0.8rem;
  color: var(--neutral-medium);
}

.detail-item .value {
  font-weight: 600;
  color: var(--neutral-dark);
  font-size: 1rem;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.mini-table th {
  background-color: var(--primary-green-light);
  color: var(--primary-green-dark);
  padding: 0.5rem;
  font-size: 0.8rem;
}

.mini-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
}

/* ===== רספונסיביות ===== */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs {
    padding: 0 0.5rem;
  }

  .tab {
    padding: 0.75rem 0.85rem;
    font-size: 0.85rem;
  }

  .content {
    padding: 0 0.75rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar select, .filter-bar input {
    width: 100%;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.5rem;
  }

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

  .modal-content {
    width: 95%;
  }
}

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

  .header h1 {
    font-size: 1.3rem;
  }
}
