* { box-sizing: border-box; }
body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
  margin: 0;
  direction: rtl;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #111827;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar nav a { color: #d1d5db; margin-inline-start: 16px; }
.topbar nav a:hover { color: #fff; }
.topbar .user-box { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar form { display: inline; }
.topbar button.link-btn {
  background: none; border: none; color: #d1d5db; cursor: pointer; font-size: 14px; padding: 0;
}
.topbar button.link-btn:hover { color: #fff; text-decoration: underline; }

/* תפריט "הגדרות" נפתח - מקבץ מסכי תצורה (חשבונות, קטגוריות, ריבית, משתמשים) תחת כפתור אחד */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown > button {
  background: none; border: none; color: #d1d5db; cursor: pointer; font-size: 14px;
  margin-inline-start: 16px; padding: 0; font-family: inherit;
}
.nav-dropdown > button:hover, .nav-dropdown.open > button { color: #fff; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 24px; inset-inline-start: 0; z-index: 20;
  background: #fff; color: #111827; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  min-width: 180px; padding: 6px; border: 1px solid #e5e7eb;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 8px 10px; border-radius: 6px; color: #111827; font-size: 14px; white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: #f3f4f6; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.container-wide { max-width: 1800px; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { text-align: center; }
.stat .value { font-size: 26px; font-weight: 700; }
.stat .label { color: #6b7280; font-size: 13px; margin-top: 4px; }
.stat.positive .value { color: #059669; }
.stat.negative .value { color: #dc2626; }
.positive { color: #059669; }
.negative { color: #dc2626; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; border-bottom: 1px solid #e5e7eb; text-align: right; }
th { color: #6b7280; font-weight: 600; font-size: 12.5px; text-transform: none; background: #f9fafb; }
tbody tr:hover td { background: #f3f4f6 !important; }
tbody tr:nth-child(even) td { background: #fcfcfd; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.cleared { background: #d1fae5; color: #065f46; }
.badge.cancelled { background: #e5e7eb; color: #4b5563; }
.badge.payable { background: #fee2e2; color: #991b1b; }
.badge.receivable { background: #dbeafe; color: #1e40af; }

.btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.secondary { background: #6b7280; }
.btn.secondary:hover { background: #4b5563; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }

form.form-grid { display: grid; gap: 14px; max-width: 480px; }
label { display: block; font-size: 13px; margin-bottom: 4px; color: #374151; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.error-box { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.warning-box { background: #fef3c7; color: #92400e; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.success-box { background: #d1fae5; color: #065f46; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 6px; font-size: 14px; color: #374151; }
.tabs a.active { background: #111827; color: #fff; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 360px;
}
.login-box h1 { font-size: 20px; margin-bottom: 20px; text-align: center; }

/* ייצוא ל-PDF - נעשה דרך תפריט ההדפסה המובנה של הדפדפן ("שמירה כ-PDF"), לא ספרייה נפרדת.
   כאן רק מגדירים מה מוסתר בהדפסה: ניווט, כפתורי פעולה, שורת הסינון שבכותרת הטבלה. */
.export-buttons { display: inline-flex; gap: 8px; }
@media print {
  .topbar, .tabs, .filter-row, .no-print, .warning-box a, form button, button.btn, a.btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #e5e7eb; }
  .container-wide, .container { max-width: 100%; }
}
