/* ===== RTL base ===== */
.rtl { direction: rtl; text-align: right; }
.rtl .card,
.rtl .table,
.rtl .table th,
.rtl .table td { direction: rtl; text-align: right; }

body { font-family: "Segoe UI", Arial, sans-serif; }
.table th, .table td { white-space: nowrap; }

/* ===== page container ===== */
.container-fluid {
  width: 100%;
  max-width: 100%;
}

/* ===== SideBar ===== */
.sidebar {
  position: fixed; top: 0; right: 0;
  width: 240px; height: 100vh;
  background: #1a2e4a;
  display: flex; flex-direction: column;
  transition: width 0.25s ease;
  overflow: hidden; z-index: 1040;
  box-shadow: -3px 0 12px rgba(0,0,0,0.18);
}
.sidebar.collapsed { width: 60px; }

.main-content {
  margin-right: 240px;
  padding: 0.75rem 1.25rem 0.5rem;
  transition: margin-right 0.25s ease;
  box-sizing: border-box;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-content::-webkit-scrollbar { display: none; }
.main-content { -ms-overflow-style: none; scrollbar-width: none; }
.main-content.sidebar-collapsed { margin-right: 60px; }

.sidebar-brand-row {
  display: flex; align-items: center;
  padding: 14px 12px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  white-space: nowrap; overflow: hidden; gap: 6px;
}

.sidebar-brand-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; overflow: hidden; flex-shrink: 0;
}

.sidebar-brand-link img {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 6px;
}

.sidebar-brand-text {
  color: #fff; font-size: 1.15rem; font-weight: 700; letter-spacing: 1px;
  transition: opacity 0.2s, width 0.2s;
}
.sidebar.collapsed .sidebar-brand-text { opacity: 0; width: 0; overflow: hidden; }

.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; color: rgba(255,255,255,0.75);
  text-decoration: none; font-size: 0.92rem;
  white-space: nowrap; transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active-nav { background: rgba(255,255,255,0.13); color: #fff; font-weight: 600; }
.sidebar-nav i { font-size: 1.15rem; flex-shrink: 0; width: 22px; text-align: center; }

.nav-label { transition: opacity 0.2s; }
.sidebar.collapsed .nav-label { opacity: 0; }

.sidebar-toggle-bar { padding: 4px 0; }

.sidebar-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; width: 100%;
  background: none; border: none;
  color: rgba(255,255,255,0.75); font-size: 0.92rem;
  cursor: pointer; text-align: right; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.sidebar-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-toggle i { font-size: 1.15rem; flex-shrink: 0; width: 22px; text-align: center; }
.sidebar-toggle .toggle-text { transition: opacity 0.2s; white-space: nowrap; }
.sidebar.collapsed .sidebar-toggle .toggle-text { opacity: 0; width: 0; overflow: hidden; }

.sidebar-user {
  padding: 12px 12px 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; overflow: hidden;
}

.sidebar-avatar {
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 50%; background: #2e6dc9; color: #fff;
  font-weight: 700; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase; flex-shrink: 0;
}

.sidebar-user-name {
  color: rgba(255,255,255,0.8); font-size: 0.85rem; flex: 1;
  overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-user-name { opacity: 0; width: 0; }

.sidebar-logout-btn {
  background: none; border: none; color: rgba(255,120,120,0.75);
  cursor: pointer; font-size: 1.1rem; padding: 4px 5px;
  flex-shrink: 0; border-radius: 5px;
  transition: color 0.15s, background 0.15s; margin-right: auto;
}

.sidebar-logout-btn:hover {
  color: #ff8888; background: rgba(255,80,80,0.12);
}

/* sidebar bottom nav */
.sidebar-nav-bottom { padding: 4px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-nav-bottom a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; color: rgba(255,255,255,0.75);
  text-decoration: none; font-size: 0.92rem;
  white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.sidebar-nav-bottom a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav-bottom a.active-nav { background: rgba(255,255,255,0.13); color: #fff; font-weight: 600; }
.sidebar-nav-bottom i { font-size: 1.15rem; flex-shrink: 0; width: 22px; text-align: center; }
.sidebar.collapsed .sidebar-nav-bottom .nav-label { opacity: 0; }

/* nav submenu */
.nav-parent { user-select: none; }

.nav-parent .nav-arrow {
  margin-right: auto;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sidebar.collapsed .nav-arrow {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.nav-parent.open .nav-arrow {
  transform: rotate(180deg);
}

.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.sidebar-submenu.open {
  max-height: 200px;
}

.sidebar.collapsed .sidebar-submenu {
  max-height: 0 !important;
}

.sidebar-submenu a {
  padding-right: 34px !important;
  font-size: 0.86rem;
}

.nav-file-badge {
  display:inline-flex; align-items:center; justify-content:center;
  background:#dc3545; color:#fff; border-radius:999px;
  font-size:10px; font-weight:700; min-width:18px; height:18px;
  padding:0 4px; margin-right:4px; line-height:1;
}

/* ===== sidebar pages: צמצום padding צידי ===== */
.main-content {
  padding-left: 0.6rem !important;
  padding-right: 0.6rem !important;
}

/* ביטול קפיצת תפריט בעליית דף */
body.preload-sidebar .sidebar,
body.preload-sidebar .main-content,
body.preload-sidebar .sidebar-submenu,
body.preload-sidebar .nav-arrow,
body.preload-sidebar .sidebar-toggle .toggle-text,
body.preload-sidebar .sidebar-brand-text,
body.preload-sidebar .sidebar-user-name,
body.preload-sidebar .nav-label {
  transition: none !important;
}

/* ===== header (top right) ===== */
.header-rtl {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* שונה מ-flex-end כדי שייצמד לימין */
  text-align: right;
  width: 100%;
}

/* grid areas: תפריט מצומצם בימין (250px), תוכן רחב בשמאל (1fr) */
@media (min-width: 992px) {
  .dashboard-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-areas: "nav content";
    gap: 24px;
    align-items: stretch;
  }

  .dashboard-content {
    grid-area: content;
  }
  .dashboard-nav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
  }
  .dashboard-nav > .card {
    flex: 1;
  }
}

/* nav card */
.nav-panel .btn {
  padding: 12px 12px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
}
.btn-logout {
  background: transparent;
  border: 1px solid #6c757d;
  color: #dc3545;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 12px;
  min-height: 46px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: .375rem;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}
.btn-logout:hover {
  background: #f8d7da;
  border-color: #dc3545;
  color: #b02a37;
}
/* הפורמה שקופה לגריד — הכפתור בתוכה מתנהג כמו כל שאר הכפתורים */
.nav-panel form {
  display: contents;
}

/* ===== metrics grid (compact tiles) ===== */
.metrics-grid {
  display: grid;
  /* יוצר עמודות שוות שמתאימות את עצמן לרוחב */
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); 
  gap: 12px;
}

.metric-tile {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.2s;
}

.metric-tile:hover {
  transform: translateY(-2px); /* אפקט ריחוף קליל */
  background: #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.metric-tile .label {
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
}

.metric-tile .value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #212529;
}

/* ===== tables (no horizontal scroll by default) ===== */
.table th, .table td { 
  white-space: nowrap; 
  padding: 10px 8px; /* צמצום קל של הריווח הפנימי כדי לפנות מקום לעמודות נוספות */
}

/* ביטול גלילה מיותרת אם יש מקום */
.table-responsive {
  overflow-x: auto;
  border: none;
}
table.dataTable { width: 100% !important; }

/* make DataTables header/filter look RTL-friendly */
.dataTables_wrapper .dataTables_filter{
  float: right !important;
  text-align: right !important;
}
.dataTables_wrapper .dataTables_filter label{
  display:flex;
  align-items:center;
  gap:8px;
  justify-content:flex-start;
}
.dataTables_wrapper .dataTables_filter input{
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 220px;
  max-width: 100%;
}

/* hide DT 'info' space if ever enabled */
.dataTables_wrapper .dataTables_info { display:none; }


/* on mobile: תוכן ראשון, אחר כך ניווט */
@media (max-width: 991.98px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "content"
      "nav";
  }
}

/* clickable table rows */
.table-hover tbody tr:hover {
  background: #f0f0f0;
  cursor: pointer;
}

/* wrapper יציב לטבלאות */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* RTL עוטף, אבל חישוב רוחבים נשאר LTR כדי ש-resize לא "יברח" */
.table-wrap.rtl {
  direction: rtl;
}

.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap.rtl { direction: rtl; }
.table-wrap.rtl th, .table-wrap.rtl td { text-align: right; white-space: nowrap; }


/* אל תתן לטבלה לשנות layout באמצע resize */
table.dataTable {
  table-layout: fixed;
  width: 100% !important;
}

/* משימה באיחור */
.tabulator-row.task-overdue {
  background-color: #f8d7da !important; /* אדום בהיר */
}

/* לא בוצע - בולד */
.tabulator-row.task-pending .tabulator-cell{
  font-weight: 700;
}

/* בוצע / בוטל - קו חוצה */
.tabulator-row.task-done .tabulator-cell{
  text-decoration: line-through;
  opacity: 0.75; /* אופציונלי */
}

/* תיקים - פעיל בולד */
.tabulator-row.case-active .tabulator-cell{
  font-weight: 700;
}

/* תיקים - סגור/מחוק קו חוצה */
.tabulator-row.case-closed .tabulator-cell{
  text-decoration: line-through;
  opacity: 0.75;
}

.case-alert-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#dc3545; /* אדום */
}

.case-ok-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#198754; /* ירוק */
}


@media print {
  @page { size: A4 landscape; margin: 8mm; }

  /* מסתיר כפתורים וחיפושים */
  .btn, .vr, #search-cases, #search-tasks { display: none !important; }
  .modal, .modal-backdrop { display: none !important; }

  /* Tabulator: לא לחתוך בגובה */
  #cases-table, #tasks-table { height: auto !important; }
  .tabulator { height: auto !important; }
  .tabulator-tableholder { height: auto !important; overflow: visible !important; }

  /* ✅ להקטין רק את הטבלאות כדי שלא ייחתכו לרוחב */
  .print-tabulator-wrap{
    transform: scale(0.72);
    transform-origin: top right;
    width: 128%;
  }

  .tabulator { font-size: 11px !important; }
  .tabulator .tabulator-cell { padding: 3px 4px !important; }
  .tabulator .tabulator-header .tabulator-col { white-space: nowrap !important; }
}

/* ===== Global Scrollbar Styling — GURON Luxury ===== */
/* ===== Global Scrollbar Styling — GURON Luxury ===== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #8fa4bb #edf3f8;
}

/* Chrome / Edge / Safari */
*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #f4f8fb 0%, #eaf1f7 100%);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a7b8ca 0%, #7f96ad 100%);
  border-radius: 999px;
  border: 2px solid #edf3f8;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #95aabd 0%, #6f879f 100%);
}

*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #8399ae 0%, #5f768e 100%);
}

*::-webkit-scrollbar-corner {
  background: #edf3f8;
}

