/* ── מסגרת בסיס משותפת (זהה בעקרונה ל-sm.css / wh/style.css - כל אפליקציה
   מגדירה אותה מקומית, לא חלק מ-admin-assets/admin.css) ──────────────────── */
html, body { overflow-x: hidden; }

.app-navbar {
  background: #1A2332; color: #fff; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 100;
}
.app-navbar .text-muted { color: #8b9ab0 !important; }

.detail-body { padding: 16px 20px; }

.table-wrapper { padding: 16px 20px; }
.wi-table { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.wi-table thead th {
  background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid #e2e8f0;
  padding: 10px 12px; white-space: nowrap;
}
.wi-table tbody td { padding: 10px 12px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.table-empty { text-align: center; padding: 60px 20px; }

.panel-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }

/* מסכי הגדרות/הוספה/ייבוא/מדריך - לא נמתחים על כל רוחב המסך, נשארים בגודל נוח לקריאה */
.settings-content .panel-card,
.guide-wrap .panel-card,
#c-add-panel, #c-import-panel {
  max-width: 650px;
}
.guide-wrap { max-width: 700px; }
.guide-wrap ul { margin-bottom: 0; padding-inline-start: 1.3rem; }
.guide-example {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}
.guide-example-label { font-weight: 700; font-size: 12px; color: #64748b; margin-bottom: 4px; }
.guide-example-box {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: 6px;
  padding: 6px 10px; font-family: monospace; font-size: 13px; text-align: left;
}
.guide-example-result { margin-top: 6px; font-size: 13px; color: #1e293b; }
.panel-header {
  background: #f8fafc; color: #1e293b; font-weight: 700; font-size: 13px;
  padding: 10px 14px; border-bottom: 1px solid #e2e8f0;
}
.panel-body { padding: 12px 14px; }

.badge-status {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.s-done  { background: #d1fae5; color: #065f46; }
.s-blocked { background: #fee2e2; color: #dc2626; }
.s-open  { background: #f1f5f9; color: #475569; }

/* גובה חסום + גלילה פנימית בלבד - כותרות העמודות נשארות קבועות למעלה בזכות
   position:sticky שכבר מוגדר על .st-table thead th (ראה admin-assets/sortable-table.css);
   בלי גובה חסום לקונטיינר אין להם ביחס למה "להידבק" ולא קורה כלום בפועל */
/* overflow-x:hidden בכוונה (לא auto) - עם overflow-y:auto בלבד, כשמופיע פס גלילה
   אנכי הוא "גונב" רוחב מהתוכן אחרי שהטבלה כבר חושבה ל-100% רוחב הקונטיינר המקורי,
   מה שיוצר פס גלילה אופקי מיותר של כמה פיקסלים בלבד למרות שאין תוכן שבאמת גולש */
.table-scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  max-height: calc(100vh - 260px);
}

/* טבלת אנשי קשר/קבוצות: לא נמתחת על כל רוחב המסך - נשארת ברוחב התוכן (bootstrap .table
   כופה width:100% כברירת מחדל, לכן צריך override מפורש) */
.table-scroll-area-auto { display: inline-block; max-width: 100%; }
.st-table-auto { width: auto !important; }

/* עמודת "פרטים" ביומן מכילה טקסט אבחון ארוך (כולל שאילתת Gmail) - חייבת לגלוש לשורה
   חדשה במקום להרחיב את הטבלה כולה ולגרום לגלילה אופקית (nowrap הוא ברירת המחדל
   של הרכיב המשותף לכל התאים - .st-table td, ראה admin-assets/sortable-table.css) */
.log-details-cell {
  display: inline-block;
  white-space: normal;
  word-break: break-word;
  max-width: 480px;
}

/* ── טאבים ראשיים ──────────────────────────────────────────────────────── */
#m2w-tabs .nav-link {
  font-weight: 600;
  color: #495057;
}
#m2w-tabs .nav-link.active {
  color: var(--bs-primary, #0d6efd);
}

/* ── תת-טאבים בתוך "הגדרות" — ניווט צדי ─────────────────────────────────── */
.settings-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.settings-nav {
  flex: 0 0 200px;
  gap: 2px;
}
.settings-nav .nav-link {
  text-align: right;
  border-radius: 8px;
  color: #495057;
  font-weight: 600;
  padding: .55rem .9rem;
}
.settings-nav .nav-link.active {
  background: var(--bs-primary, #0d6efd);
  color: #fff;
}
.settings-content {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 767px) {
  .settings-layout { flex-direction: column; }
  .settings-nav { flex-direction: row !important; flex-wrap: wrap; width: 100%; }
}

/* ── ספירה לאחור לבדיקה האוטומטית הבאה (לוח בקרה) — טבעת התקדמות ויזואלית,
   מתרוקנת ככל שמתקרבים לבדיקה הבאה. conic-gradient מתעדכן ב-JS (Countdown._tick).
   רקע בהיר (panel-card לבן) - צבעים נבחרו לניגודיות על לבן, לא על navbar כהה. */
.countdown-ring {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid rgba(0,0,0,.08);
  background: conic-gradient(#0d6efd 360deg, #cbd5e1 360deg);
}
.countdown-text {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}
/* מצב "בודק כעת" - spinner מבוסס border במקום conic-gradient, כדי שיישאר ברור
   ונראה בכל מצב (הבעיה הקודמת: פס מסתובב שכמעט לא נבדל מהרקע הכהה של ה-navbar) */
.countdown-ring.checking {
  background: transparent;
  border: 3px solid #dbe3ee;
  border-top-color: #0d6efd;
  animation: countdown-spin .8s linear infinite;
}
@keyframes countdown-spin {
  to { transform: rotate(360deg); }
}

/* ── לוח בקרה — כרטיסי סטטיסטיקה ─────────────────────────────────────────── */
.stat-tiles-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.stat-tile {
  position: relative;
  background: #f8fafc;
  border-radius: 8px;
  padding: 14px 16px 14px 20px;
  overflow: hidden;
}
.stat-tile::before {
  content: '';
  position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
  width: 4px;
}
.stat-tile.success::before { background: #059669; }
.stat-tile.danger::before  { background: #dc2626; }
.stat-tile.warning::before { background: #d97706; }
.stat-tile.neutral::before { background: #64748b; }
.stat-tile-value { font-size: 26px; font-weight: 700; color: #1e293b; line-height: 1.2; }
.stat-tile-label { font-size: 12px; font-weight: 600; color: #64748b; margin-top: 2px; }

/* ── תגיות (כתובות/דומיינים מורשים) ──────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f7;
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
  font-size: .85rem;
}
.tag-chip-remove {
  border: 0;
  background: transparent;
  color: #6c757d;
  line-height: 1;
  padding: 0 2px;
  border-radius: 50%;
}
.tag-chip-remove:hover {
  color: #dc3545;
  background: #fff;
}
