/* ===================================================
   משולח - עיצוב ראשי
   =================================================== */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@400;500;700;900&family=Heebo:wght@300;400;500;700&display=swap');

:root {
  --navy: #1E3A5F;
  --navy-light: #2A5080;
  --navy-dark: #122540;
  --gold: #C9A84C;
  --gold-light: #E8C86A;
  --gold-dark: #A07830;
  --white: #FFFFFF;
  --off-white: #F7F5F0;
  --gray: #8A8A8A;
  --light-gray: #E8E5DF;
  --mid-gray: #C4C0B8;
  --success: #2D7D46;
  --danger: #B83232;
  --info: #1A5C8A;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Heebo', Arial, sans-serif;
  background: var(--off-white);
  color: var(--navy);
  direction: rtl;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── HEADER ── */
.site-header {
  background: var(--navy);
  color: white;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: white;
}
.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.logo-text { line-height: 1.15; }
.logo-title { font-family: 'Frank Ruhl Libre', serif; font-size: 17px; font-weight: 700; }
.logo-sub { font-size: 11px; color: var(--gold-light); letter-spacing: 0.4px; }

.main-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav-link {
  background: transparent; border: none; color: rgba(255,255,255,0.8);
  padding: 7px 11px; border-radius: 7px; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
  font-family: 'Heebo', Arial, sans-serif;
}
.nav-link:hover, .nav-link.active {
  background: rgba(201,168,76,0.18); color: var(--gold-light);
}
.nav-btn {
  background: var(--gold); color: white; border: none;
  padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background 0.2s;
  font-family: 'Heebo', Arial, sans-serif;
}
.nav-btn:hover { background: var(--gold-dark); }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1); border: none; color: white;
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  font-family: 'Heebo', Arial, sans-serif; font-size: 13px;
  transition: background 0.2s;
}
.user-btn:hover { background: rgba(255,255,255,0.18); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold); display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; color: white;
}
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: white; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
  border: 1px solid var(--light-gray); min-width: 160px;
  display: none; overflow: hidden; z-index: 200;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: right;
  padding: 11px 16px; background: none; border: none;
  font-size: 14px; color: var(--navy); cursor: pointer;
  text-decoration: none; font-family: 'Heebo', Arial, sans-serif;
  transition: background 0.15s;
}
.dropdown a:hover, .dropdown button:hover { background: var(--off-white); }
.dropdown .danger { color: var(--danger); }
.dropdown hr { border: none; border-top: 1px solid var(--light-gray); margin: 0; }

/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 30px 20px; }
.container-sm { max-width: 540px; margin: 0 auto; padding: 40px 20px; }
.container-md { max-width: 820px; margin: 0 auto; padding: 30px 20px; }

/* ── CARDS ── */
.card {
  background: white; border-radius: 14px;
  border: 1px solid var(--light-gray); padding: 22px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 19px; font-weight: 700; color: var(--navy);
  margin-bottom: 16px;
}

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; color: var(--gray);
  font-weight: 500; margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--light-gray); border-radius: 8px;
  font-size: 14px; font-family: 'Heebo', Arial, sans-serif;
  color: var(--navy); background: white; direction: rtl;
  transition: border-color 0.2s; outline: none;
}
.form-control:focus { border-color: var(--gold); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* ── BUTTONS ── */
.btn {
  display: inline-block; padding: 10px 22px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none;
  font-family: 'Heebo', Arial, sans-serif;
  transition: all 0.2s; text-align: center;
}
.btn-primary { background: var(--navy); color: white; }
.btn-primary:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: white; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #236038; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #922828; }
.btn-outline {
  background: transparent; color: var(--navy);
  border: 1.5px solid var(--light-gray);
}
.btn-outline:hover { border-color: var(--navy); background: var(--off-white); }
.btn-ghost {
  background: transparent; color: var(--gray);
  border: none; padding: 8px 12px;
}
.btn-ghost:hover { background: var(--light-gray); color: var(--navy); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-green { background: #E8F5EC; color: var(--success); }
.badge-gold { background: #FBF4E3; color: var(--gold-dark); }
.badge-navy { background: #E8EEF5; color: var(--navy); }
.badge-red { background: #FBEBEB; color: var(--danger); }
.badge-gray { background: var(--light-gray); color: var(--gray); }

/* ── STATS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.stat-card {
  background: white; border-radius: 12px;
  border: 1px solid var(--light-gray); padding: 16px 18px;
}
.stat-label { font-size: 12px; color: var(--gray); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-sub { font-size: 12px; color: var(--gray); margin-top: 3px; }

/* ── PROGRESS ── */
.progress-wrap { height: 8px; background: var(--light-gray); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--navy), var(--gold)); transition: width 0.8s ease; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  padding: 10px 14px; text-align: right;
  background: var(--off-white); font-size: 13px;
  font-weight: 600; color: var(--gray);
  border-bottom: 1px solid var(--light-gray);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--light-gray); }
tbody tr:hover { background: var(--off-white); }
tbody tr:last-child td { border-bottom: none; }

/* ── PAGE TITLE ── */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 26px; font-weight: 700; color: var(--navy);
}

/* ── TABS ── */
.tabs {
  display: flex; gap: 4px; background: var(--light-gray);
  padding: 4px; border-radius: 10px; margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1; min-width: 80px; padding: 8px 14px;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: transparent; color: var(--gray); cursor: pointer;
  transition: all 0.2s; font-family: 'Heebo', Arial, sans-serif;
}
.tab-btn.active {
  background: white; color: var(--navy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #E8F5EC; color: var(--success); border: 1px solid #bde4c8; }
.alert-error { background: #FBEBEB; color: var(--danger); border: 1px solid #f0b8b8; }
.alert-info { background: #E8EEF5; color: var(--navy); border: 1px solid #b8cde0; }
.alert-warning { background: #FBF4E3; color: var(--gold-dark); border: 1px solid #e8d098; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--light-gray); margin: 18px 0; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
  color: white; padding: 80px 20px 100px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(201,168,76,0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 40%);
}
.hero-inner { position: relative; max-width: 700px; margin: 0 auto; }
.hero h1 { font-family: 'Frank Ruhl Libre', serif; font-size: 46px; font-weight: 900; margin-bottom: 14px; line-height: 1.2; }
.hero p { font-size: 18px; color: rgba(255,255,255,0.8); margin-bottom: 10px; line-height: 1.6; }
.hero-sub { font-size: 14px; color: rgba(255,255,255,0.5); margin-bottom: 40px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── LOGIN CARD ── */
.auth-card { background: white; border-radius: 16px; padding: 32px; border: 1px solid var(--light-gray); }
.auth-title { font-family: 'Frank Ruhl Libre', serif; font-size: 28px; text-align: center; margin-bottom: 6px; }
.auth-sub { text-align: center; color: var(--gray); margin-bottom: 24px; font-size: 14px; }
.auth-divider { text-align: center; color: var(--gray); font-size: 13px; margin: 16px 0; }

/* ── CONTACT ROW ── */
.contact-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s; border-bottom: 1px solid var(--light-gray);
  text-decoration: none; color: inherit;
}
.contact-row:hover { background: var(--off-white); border-bottom-color: transparent; }
.contact-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.contact-name { font-weight: 600; font-size: 15px; }
.contact-city { font-size: 13px; color: var(--gray); }

/* ── TIMELINE ── */
.timeline-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--light-gray); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }

/* ── MODAL ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white; border-radius: 16px; padding: 28px;
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto; position: relative;
  animation: fadeUp 0.3s ease;
}
.modal-title { font-family: 'Frank Ruhl Libre', serif; font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.modal-close {
  position: absolute; top: 14px; left: 14px;
  background: none; border: none; font-size: 20px;
  color: var(--gray); cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { background: var(--light-gray); }

/* ── PROGRESS STEPS ── */
.steps { display: flex; gap: 6px; margin-bottom: 28px; }
.step { flex: 1; height: 4px; border-radius: 2px; background: var(--light-gray); transition: background 0.3s; }
.step.done { background: var(--navy); }
.step.active { background: var(--gold); }

/* ── FOOT ── */
footer {
  background: var(--navy-dark); color: rgba(255,255,255,0.6);
  padding: 40px 20px 24px; margin-top: 60px;
}
.footer-inner {
  max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px; margin-bottom: 32px;
}
.footer-title { font-family: 'Frank Ruhl Libre', serif; font-size: 17px; color: white; margin-bottom: 8px; }
.footer-link { font-size: 13px; margin-bottom: 6px; cursor: pointer; display: block; color: rgba(255,255,255,0.6); text-decoration: none; }
.footer-link:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 12px; }

/* ── SEARCH BOX ── */
.search-wrap { position: relative; margin-bottom: 16px; }
.search-wrap input { padding-right: 38px; }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--gray); font-size: 16px; pointer-events: none; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed var(--light-gray); border-radius: 10px;
  padding: 28px; text-align: center; cursor: pointer;
  transition: border-color 0.2s; margin-bottom: 12px;
}
.upload-zone:hover { border-color: var(--gold); }
.upload-zone p { font-size: 14px; color: var(--gray); margin-top: 8px; }

/* ── PRICING ── */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; margin-top: 32px;
}
.pricing-card { position: relative; }
.pricing-featured { border: 2px solid var(--gold) !important; }
.pricing-badge {
  position: absolute; top: -12px; right: 50%; transform: translateX(50%);
  background: var(--gold); color: white; padding: 3px 16px;
  border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.price { font-size: 42px; font-weight: 900; color: var(--navy); }
.price span { font-size: 15px; color: var(--gray); font-weight: 400; }
.feature-list { list-style: none; margin: 20px 0 24px; }
.feature-list li { font-size: 14px; padding: 5px 0; display: flex; gap: 8px; align-items: flex-start; }
.feature-list li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.35s ease; }

/* ── CONTACTS LAYOUT ── */
.contacts-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.contacts-layout--split { grid-template-columns: 300px 1fr; }
.mobile-back-btn { display: none; }

/* ── HEADER RIGHT (logo + hamburger) ── */
.header-right {
  display: flex; align-items: center; gap: 10px;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 7px; width: 42px; height: 42px; padding: 0;
  background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.4);
  border-radius: 9px; cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.hamburger:hover { background: rgba(255,255,255,0.3); }
.hamburger span {
  display: block; width: 24px; height: 3.5px;
  background: white; border-radius: 3px;
}

/* Admin nav button */
.nav-link-admin {
  color: var(--gold-light) !important; border: 1px solid rgba(201,168,76,0.4);
  border-radius: 7px;
}
.nav-link-admin:hover { background: rgba(201,168,76,0.18) !important; }

/* ── RESPONSIVE ── */
@media (max-width: 820px) {
  /* Show hamburger, hide desktop nav */
  .hamburger { display: flex !important; }
  .main-nav { display: none !important; }

  /* Header sizing */
  .header-inner { height: 54px; }
  .logo-sub { display: none; }

  /* Layout */
  .container { padding: 16px 12px; }
  .container-sm { padding: 24px 14px; }
  .container-md { padding: 16px 12px; }
  .card { padding: 14px; border-radius: 10px; }

  /* Hero */
  .hero { padding: 50px 16px 60px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }
  .hero-sub { font-size: 13px; margin-bottom: 28px; }
  .hero-btns .btn { padding: 10px 18px; font-size: 13px; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .stat-value { font-size: 20px; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .page-title { font-size: 20px; }

  /* Tables — scroll on mobile */
  .table-wrap { -webkit-overflow-scrolling: touch; overflow-x: auto; }
  table { font-size: 13px; min-width: 0; }
  thead th { padding: 8px 10px; font-size: 11px; }
  tbody td { padding: 9px 10px; }

  /* Contacts layout — always single column on mobile */
  .contacts-layout--split { grid-template-columns: 1fr; }
  /* When viewing a contact detail on mobile: hide the list, show back button */
  .contacts-layout--split .contacts-list-panel { display: none; }
  .mobile-back-btn {
    display: flex; align-items: center; gap: 6px;
    color: var(--navy); font-weight: 700; font-size: 14px;
    text-decoration: none; padding: 10px 0 14px;
    border-bottom: 1px solid var(--light-gray); margin-bottom: 12px;
  }

  /* Reduce large headings inside cards on mobile */
  .card h2 { font-size: 18px !important; }
  .card h3 { font-size: 16px !important; }

  /* Safety: prevent any element from blowing out the viewport */
  html { overflow-x: hidden; }

  /* Grid */
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 10px; }

  /* Tabs */
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding: 3px; }
  .tab-btn { min-width: 72px; font-size: 12px; padding: 6px 10px; flex-shrink: 0; }

  /* Modal */
  .modal { padding: 20px 16px; border-radius: 14px; margin: 0; max-height: 92vh; }
  .modal-backdrop { padding: 12px 8px; align-items: flex-end; }

  /* Card title */
  .card-title { font-size: 16px; }

  /* Footer */
  footer { padding: 30px 14px 20px; margin-top: 40px; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }

  /* Misc */
  .btn { font-size: 13px; padding: 9px 16px; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .steps { gap: 4px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 16px; }
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .header-inner { padding: 0 12px; }
  .logo-title { font-size: 15px; }
  /* Full-width modal on tiny screens */
  .modal-backdrop { padding: 0; }
  .modal { border-radius: 14px 14px 0 0; max-height: 94vh; }
  /* Tighter card padding */
  .card { padding: 12px; }
  /* Smaller buttons */
  .btn { font-size: 12px; padding: 8px 12px; }
}


/* ── BAR CHART ── */
.bar-chart-wrap { height: 28px; display: flex; border-radius: 6px; overflow: hidden; gap: 2px; margin: 10px 0; }
.bar-segment { height: 100%; transition: width 0.6s ease; min-width: 3px; }
.bar-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.bar-legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.bar-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.goal-pie { width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0; }

/* ── NOTE BOX ── */
.note-box {
  background: var(--off-white); border-radius: 8px; padding: 12px 14px;
  border-right: 3px solid var(--gold); font-size: 14px; line-height: 1.6;
  margin-bottom: 12px;
}
.note-box-label { font-size: 11px; color: var(--gray); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; }
