@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;600;700;800&display=swap');

:root {
  --primary:       #3D8B7A;
  --primary-dark:  #2D6B5C;
  --primary-light: #5BA898;
  --secondary:     #6B3A2A;
  --accent:        #F4A59A;
  --bg:            #F2F6F5;
  --surface:       #FFFFFF;
  --text-main:     #2C3E35;
  --text-muted:    #7A9088;
  --border:        #D8E8E4;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(61,139,122,0.08);
  --shadow-md:     0 4px 20px rgba(61,139,122,0.15);
  --shadow-lg:     0 8px 32px rgba(61,139,122,0.22);
}

/* ===== BASE ===== */
* { box-sizing: border-box; }

body {
  background: var(--bg);
  font-family: 'Assistant', 'Segoe UI', Arial, sans-serif;
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.6;
}

/* ===== PAGE ANIMATION ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: fadeInUp 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--primary) !important;
  box-shadow: 0 2px 12px rgba(45,107,92,0.30);
  padding: 0 1.5rem;
  min-height: 72px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-logo-wrap {
  background: white;
  border-radius: 10px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.navbar-logo-wrap img {
  height: 52px;
  width: auto;
  object-fit: contain;
  display: block;
}

.navbar-logo-fallback {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

.nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem !important;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  color: white !important;
  background: rgba(255,255,255,0.12);
}

.nav-link.active {
  color: white !important;
  background: rgba(255,255,255,0.20);
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: var(--surface);
  border-radius: 18px;
  border-right: 4px solid var(--primary);
  padding: 16px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.page-header h1 {
  color: var(--primary);
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.3px;
}

/* ===== CARDS ===== */
.card {
  border: 1px solid rgba(61,139,122,0.10);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s, transform 0.25s;
  background: var(--surface);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
}

/* ===== KPI CARDS ===== */
.kpi-card {
  border-radius: 16px;
  padding: 14px 10px;
  color: white;
  text-align: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.25s cubic-bezier(0.22,1,0.36,1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 55%);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.kpi-card:active {
  transform: scale(0.96);
}

.kpi-card .kpi-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}

.kpi-card .kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.92;
  margin-top: 5px;
}

/* ===== BUTTONS ===== */
.btn {
  font-family: 'Assistant', sans-serif;
  font-weight: 600;
  border-radius: 50px;
  letter-spacing: 0.2px;
  font-size: 0.9rem;
  padding: 0.45rem 1.2rem;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
}

.btn:active {
  transform: scale(0.95) !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary-dark);
  color: white;
  box-shadow: 0 2px 8px rgba(61,139,122,0.30);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  border-color: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(61,139,122,0.40);
}

/* כפתור "פנייה חדשה" — בולט, אדום */
.btn-new-inquiry {
  background: linear-gradient(135deg, #E53935, #C62828);
  border: none;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.55rem 1.5rem;
  box-shadow: 0 4px 14px rgba(229,57,53,0.35);
  border-radius: 50px;
}

.btn-new-inquiry:hover {
  background: linear-gradient(135deg, #EF5350, #E53935);
  box-shadow: 0 6px 18px rgba(229,57,53,0.45);
  transform: translateY(-2px);
  color: white;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(61,139,122,0.25);
}

.btn-outline-secondary:hover { transform: translateY(-1px); }
.btn-outline-danger:hover    { transform: translateY(-1px); }

/* ===== STATUS BADGES ===== */
.status-badge {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.80rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-block;
}

.badge-פתוח         { background:#FFF9C4; color:#7B6000; border:1px solid #F9A825; }
.badge-בתהליך       { background:#FFE0B2; color:#7B3900; border:1px solid #EF6C00; }
.badge-קליטה-עתידית { background:#B3E5FC; color:#01478B; border:1px solid #0288D1; }
.badge-קליטה        { background:#C8E6C9; color:#1B5E20; border:1px solid #388E3C; }
.badge-סגור         { background:#FFCDD2; color:#7B0000; border:1px solid #E53935; }
.badge-סגור-קשת     { background:#E1BEE7; color:#4A0072; border:1px solid #8E24AA; }

/* ===== TABLE ===== */
.table th {
  background: var(--primary);
  color: white;
  font-weight: 700;
  border: none;
  font-size: 0.88rem;
  padding: 10px 12px;
}

.table td {
  vertical-align: middle;
  border-color: var(--border);
  padding: 10px 12px;
}

.table tbody tr {
  transition: background 0.18s;
}

.table tbody tr:hover {
  background: #EBF4F2 !important;
  box-shadow: inset 4px 0 0 var(--primary);
}

/* stagger animation */
.table-animated tbody tr {
  opacity: 0;
  animation: fadeInUp 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}
.table-animated tbody tr:nth-child(1)  { animation-delay: 0.04s; }
.table-animated tbody tr:nth-child(2)  { animation-delay: 0.07s; }
.table-animated tbody tr:nth-child(3)  { animation-delay: 0.10s; }
.table-animated tbody tr:nth-child(4)  { animation-delay: 0.13s; }
.table-animated tbody tr:nth-child(5)  { animation-delay: 0.16s; }
.table-animated tbody tr:nth-child(6)  { animation-delay: 0.19s; }
.table-animated tbody tr:nth-child(7)  { animation-delay: 0.22s; }
.table-animated tbody tr:nth-child(8)  { animation-delay: 0.25s; }
.table-animated tbody tr:nth-child(9)  { animation-delay: 0.28s; }
.table-animated tbody tr:nth-child(10) { animation-delay: 0.31s; }
.table-animated tbody tr:nth-child(n+11) { animation-delay: 0.34s; }

/* ===== URGENT ROW ===== */
.urgent-row { background: #FFF3E0 !important; }
.urgent-row td { border-right: 4px solid #FF6F00 !important; }

/* ===== ACTIVITY PANEL (replaces pie chart) ===== */
.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.act-name {
  min-width: 90px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-bar-wrap { flex: 1; }

.act-bar {
  height: 10px;
  border-radius: 6px;
  background: #E8EFED;
  display: flex;
  overflow: hidden;
  gap: 1px;
}

.act-seg {
  height: 100%;
  transition: width 0.7s cubic-bezier(0.22,1,0.36,1);
  min-width: 2px;
}

.seg-open   { background: #F9A825; }
.seg-active { background: #EF6C00; }
.seg-intake { background: #388E3C; }

.act-total {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  min-width: 28px;
  text-align: center;
}

.activity-legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== FORM CONTROLS ===== */
.form-control, .form-select {
  font-family: 'Assistant', sans-serif;
  border-radius: 50px;
  border-color: var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
  padding-right: 1rem;
  padding-left: 1rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61,139,122,0.12);
}

/* ===== NAVBAR TOGGLER ===== */
.navbar-toggler { border-color: rgba(255,255,255,0.4); }
.navbar-toggler-icon { filter: invert(1); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }
