/* ============================================================
   KANBAN BOARD
============================================================ */

/* wrapper — מאפשר גלילה פנימית בלי לגלוש מהמסך */
.kanban-board {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 16px;
}

/* שורת העמודות עצמה */
.kanban-board-inner {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    min-width: 700px;  /* כדי שלא יידחס מדי על מסכים קטנים */
    align-items: start;
}

.kanban-column {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e8edf5;
    box-shadow: 0 2px 8px rgba(15,23,42,.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 11px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-col-label {
    font-weight: 700;
    font-size: 13px;
}

.kanban-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 0 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.kanban-cards-list {
    flex: 1;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 64px;
    transition: background 0.15s;
}

.kanban-cards-list.drag-over {
    background: rgba(99,102,241,.08);
    border-radius: 8px;
    outline: 2px dashed #a5b4fc;
    outline-offset: -2px;
}

.kanban-card {
    background: #fff;
    border: 1px solid #e8edf5;
    border-right: 3px solid var(--k-accent, #94a3b8);
    border-radius: 10px;
    padding: 11px 12px;
    cursor: pointer;
    transition: var(--card-accent-transition);
    user-select: none;
    box-shadow: 0 1px 4px rgba(15,23,42,.05);
}

/* הגבול הימני כאן נושא את צבע הסטטוס, ולכן אסור לצבוע אותו. שלושת
   הצדדים האחרים נצבעים, וזה נקרא כמסגרת אחת כי הרביעי צבוע ממילא. */
.kanban-card:hover {
    border-top-color: var(--card-accent-soft);
    border-bottom-color: var(--card-accent-soft);
    border-left-color: var(--card-accent-soft);
}

.kanban-card[draggable=true] { cursor: grab; }
.kanban-card[draggable=true]:active { cursor: grabbing; }

.kanban-card-title {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 5px;
    line-height: 1.4;
}

.kanban-card-inst {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.kanban-card-amount {
    font-size: 12px;
    font-weight: 700;
    color: var(--k-accent, #4f46e5);
}

.kanban-urgency-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.kanban-card-date {
    font-size: 10px;
    color: #5a6779;
}

.kanban-empty {
    text-align: center;
    padding: 24px 12px;
    font-size: 12px;
    color: #cbd5e1;
}

/* skeleton טעינה */
.kanban-skeleton {
    height: 72px;
    border-radius: 10px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e8edf5 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: kanbanShimmer 1.4s infinite;
}

@keyframes kanbanShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   מיקרו-אינטראקציות (עיצוב בלבד) —
   2: skeleton + count-up · 3: רשימה⇄קנבן · 4: טאבים + ציר-זמן
   כל האנימציות מבוטלות תחת prefers-reduced-motion (בלוק בתחתית הקובץ)
============================================================ */
@keyframes omShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes omSpin { to { transform: rotate(360deg); } }
@keyframes omFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes omPopNode { 0% { transform: scale(0); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes omCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes omBoardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 2 · skeleton על ערכי ה-KPI + סיבוב אייקון רענון */
.stat-value.kpi-skel {
    min-height: 1em;
    border-radius: 6px;
    color: transparent;
    background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%);
    background-size: 200% 100%;
    animation: omShimmer 1.3s ease-in-out infinite;
}
.btn-refresh .refresh-icon.spinning {
    animation: omSpin .8s linear infinite;
    transform-origin: center;
}

/* 3 · מעבר רשימה ⇄ קנבן — כניסת לוח וכרטיסים בהשהיה מדורגת */
.kanban-board-inner { animation: omBoardIn .35s cubic-bezier(.2,.7,.2,1) both; }
.kanban-card { animation: omCardIn .4s cubic-bezier(.2,.7,.2,1) backwards; }
.view-anim-in { animation: omBoardIn .3s cubic-bezier(.2,.7,.2,1) both; }

/* 4 · אינדיקטור-טאב נע */
.drawer-tab-indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    border-radius: 2px;
    pointer-events: none;
    transition: left .28s cubic-bezier(.2,.7,.2,1), width .28s cubic-bezier(.2,.7,.2,1);
}

/* 4 · ציר-זמן נבנה שלב-שלב (נדרך מחדש בכל כניסה לטאב) */
.dz-timeline.dz-animate .dz-tl-node { animation: omPopNode .4s cubic-bezier(.2,.7,.2,1) var(--d, 0s) both; }
.dz-timeline.dz-animate .dz-tl-rail { animation: omFadeUp .3s ease var(--d, 0s) both; }
.dz-timeline.dz-animate .dz-tl-body { animation: omFadeUp .35s ease var(--d, 0s) both; }

/* ============================================================
   לוח גאנט שנתי + ניצול תקציב מצטבר (Annual Budget Gantt)
============================================================ */
.activity-budget-timeline { color: #1e293b; }
.timeline-danger { color: #dc2626; }
.timeline-warning { color: #b45309; }
.timeline-success { color: #047857; }
.timeline-muted { color: #5a6779; font-weight: 400; }

/* --- head: title + year nav --- */
.yv-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.yv-title { font-size: 20px; font-weight: 800; color: #1e293b; }
.yv-yearnav { display: inline-flex; align-items: center; gap: 10px; }
.yv-year { font-size: 18px; font-weight: 800; color: #1e293b; min-width: 60px; text-align: center; }
.gantt2-nav-btn {
    width: 32px; height: 32px; border: 1px solid #e2e8f0; background: #f8fafc;
    border-radius: 8px; cursor: pointer; font-size: 18px; color: #475569; line-height: 1;
}
.gantt2-nav-btn:hover { background: #eef2ff; border-color: #c7d2fe; }

/* --- year gantt table --- */
.ytable-wrap { overflow-x: auto; border: 1px solid #e9eef5; border-radius: 12px; background: #fff; }
.ytable { table-layout: fixed; width: 100%; min-width: 920px; border-collapse: collapse; }
.ytable thead th {
    background: #f8fafc; border-bottom: 1px solid #e9eef5; border-inline-start: 1px solid #eef2f6;
    padding: 9px 6px; font-size: 11px; font-weight: 700; color: #64748b; text-align: center; white-space: nowrap;
}
.ytable thead th.yt-name-h { text-align: start; padding-inline-start: 14px; width: 168px; }
.ytable thead th.yt-status-h { width: 60px; }
.ytable thead th.yt-num-h { width: 108px; }
.ytable thead th.yt-mh { font-size: 10px; }
.ytable thead th.yt-mh.yt-cur { color: #4338ca; background: #eef2ff; }
.ytable tbody tr { border-bottom: 1px solid #f4f6fa; cursor: pointer; transition: background .12s; }
.ytable tbody tr:hover { background: #f8faff; }
.ytable tbody tr:last-child { border-bottom: none; }
.ytable td { padding: 10px 6px; font-size: 13px; vertical-align: middle; }
.yt-name { font-weight: 700; color: #1e293b; padding-inline-start: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-status { text-align: center; }
.yt-st { display: inline-block; width: 38px; height: 18px; border-radius: 5px; }
.yt-st-done { background: #34d399; }
.yt-st-plan { background: #60a5fa; }
.yt-st-over { background: #f87171; }
.yt-num { text-align: center; color: #334155; white-space: nowrap; }
.yt-num.yt-actual { color: #1e293b; font-weight: 600; }
.yt-track { padding: 6px 0; }
.yt-track-inner { position: relative; height: 24px; }
.yt-bar {
    position: absolute; top: 50%; transform: translateY(-50%); height: 22px;
    border-radius: 6px; display: flex; align-items: center; justify-content: flex-end;
    min-width: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .15);
}
.yt-bar-done { background: #10b981; }
.yt-bar-plan { background: #3b82f6; }
.yt-bar-over { background: #ef4444; }
.yt-bar-pct { font-size: 11px; font-weight: 700; color: #fff; padding: 0 8px; white-space: nowrap; }

/* --- legend --- */
.yv-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 12px 2px 4px; font-size: 12px; color: #64748b; }
.yv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.yv-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.yv-done { background: #10b981; }
.yv-plan { background: #3b82f6; }
.yv-over { background: #ef4444; }
.yv-legend-hint { color: #5a6779; }

/* --- bottom: chart + cards --- */
.yv-bottom { display: flex; flex-direction: row-reverse; gap: 16px; align-items: stretch; margin-top: 18px; flex-wrap: wrap; }
.yv-chart-wrap { flex: 1 1 520px; min-width: 0; background: #fff; border: 1px solid #e9eef5; border-radius: 12px; padding: 14px 16px; }
.yv-chart-title { font-size: 15px; font-weight: 700; color: #1e293b; text-align: center; margin-bottom: 8px; }
.yc-stage { position: relative; }
.yc-svg { width: 100%; height: auto; display: block; overflow: visible; }
.yc-grid { stroke: #eef2f6; stroke-width: 1; }
.yc-ylabel { fill: #94a3b8; font-size: 10px; text-anchor: end; }
.yc-xlabel { fill: #94a3b8; font-size: 10px; text-anchor: middle; }
.yc-xcur { fill: #4338ca; font-weight: 700; }
.yc-plan { fill: none; stroke: #94a3b8; stroke-width: 2; stroke-dasharray: 4 4; }
.yc-actual { fill: none; stroke: #2563eb; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.yc-forecast { fill: none; stroke: #2563eb; stroke-width: 2; stroke-dasharray: 5 4; opacity: 0.7; stroke-linejoin: round; }
.yc-area { fill: url(#ycGrad); stroke: none; }
.yc-band { stroke: none; }
.yc-band-under { fill: rgba(16, 185, 129, 0.12); }
.yc-band-over { fill: rgba(239, 68, 68, 0.13); }
.yc-today { stroke: #f59e0b; stroke-width: 1.5; stroke-dasharray: 3 3; opacity: 0.7; }
.yc-todaytag { fill: #b45309; font-size: 10px; font-weight: 700; }
.yc-marker { fill: #2563eb; stroke: #fff; stroke-width: 1.5; }
.yc-marker-plan { fill: #fff; stroke: #2563eb; stroke-width: 1.5; }
.yc-proj-end { fill: #fff; stroke: #2563eb; stroke-width: 1.5; }
.yc-endlabel { fill: #64748b; font-size: 11px; font-weight: 700; }
.yc-projlabel { fill: #2563eb; font-size: 11px; font-weight: 700; }
.yc-varlabel { font-size: 10px; font-weight: 700; }
.yc-pos { fill: #047857; }
.yc-neg { fill: #dc2626; }
.yc-annot { fill: #475569; font-size: 10px; font-weight: 600; }
.yc-annot-line { stroke: #cbd5e1; stroke-width: 1; }
.yc-guide { stroke: #4f46e5; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.yc-hit { fill: transparent; cursor: crosshair; }
.yc-tip {
    position: absolute; top: 6px; transform: translateX(-50%);
    background: #1e293b; color: #fff; border-radius: 8px; padding: 8px 11px;
    font-size: 11.5px; line-height: 1.55; white-space: nowrap; pointer-events: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25); z-index: 5;
}
.yc-tip[hidden] { display: none; }
.yc-tip-m { font-weight: 700; margin-bottom: 3px; }
.yc-tip-k { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.yc-tip-actual { background: #60a5fa; }
.yc-tip-plan { background: #94a3b8; }
.yc-tip-fore { background: #93c5fd; }
.yc-tip-delta { margin-top: 3px; font-weight: 700; }
.yc-tip-delta.timeline-danger { color: #fca5a5; }
.yc-tip-delta.timeline-success { color: #6ee7b7; }
.yc-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; font-size: 12px; color: #64748b; }
.yc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.yc-l { width: 16px; height: 0; border-top-width: 3px; border-top-style: solid; display: inline-block; }
.yc-l-actual { border-top-color: #2563eb; }
.yc-l-forecast { border-top-color: #2563eb; border-top-style: dashed; opacity: 0.7; }
.yc-l-plan { border-top-color: #94a3b8; border-top-style: dashed; }

/* --- summary cards (stacked, right) --- */
.yv-cards { flex: 0 0 220px; display: flex; flex-direction: column; gap: 12px; }
.yv-card { background: #fff; border: 1px solid #e9eef5; border-inline-start: 4px solid #cbd5e1; border-radius: 12px; padding: 14px 16px; }
.yv-card-label { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.yv-card-value { font-size: 21px; font-weight: 800; color: #1e293b; }
.yv-card-blue { border-inline-start-color: #3b82f6; background: #f5f9ff; }
.yv-card-amber { border-inline-start-color: #f59e0b; background: #fffbf3; }
.yv-card-amber .yv-card-value { color: #b45309; }
.yv-card-slate { border-inline-start-color: #64748b; }
.yv-card-green { border-inline-start-color: #10b981; background: #f3fcf7; }
.yv-card-red { border-inline-start-color: #ef4444; background: #fff5f5; }
.yv-status { display: flex; align-items: center; gap: 8px; }
.yv-status-dot { width: 11px; height: 11px; border-radius: 50%; background: #cbd5e1; }
.yv-card-green .yv-status-dot { background: #10b981; }
.yv-card-green .yv-card-value { color: #047857; }
.yv-card-red .yv-status-dot { background: #ef4444; }
.yv-card-red .yv-card-value { color: #dc2626; }

.board-foot { margin-top: 12px; text-align: center; font-size: 12px; color: #5a6779; }

/* --- empty / state --- */
.timeline-empty { text-align: center; padding: 56px 24px; background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; }
.timeline-empty-title { font-size: 18px; font-weight: 700; color: #334155; margin-bottom: 8px; }
.timeline-empty-sub { font-size: 14px; color: #5a6779; }
.timeline-state-msg { padding: 28px; text-align: center; color: #5a6779; font-size: 14px; }

/* --- settings popover (filters/sort) --- */
.timeline-settings-panel {
    position: absolute; margin-top: 6px; inset-inline-start: 0; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    padding: 12px 14px; z-index: 50; min-width: 250px; display: flex; flex-direction: column; gap: 8px;
}
.timeline-settings-panel .form-select { width: 100%; }
.timeline-settings-h { font-size: 12px; font-weight: 700; color: #5a6779; margin-top: 4px; }
.timeline-settings-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; cursor: pointer; }
.timeline-settings-top {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 13px; font-weight: 700; color: #1e293b;
    padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px solid #f1f5f9;
}
.timeline-settings-close {
    border: none; background: #f1f5f9; color: #475569; cursor: pointer;
    width: 24px; height: 24px; border-radius: 6px; font-size: 16px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.timeline-settings-close:hover { background: #e2e8f0; color: #1e293b; }

/* --- insights drawer --- */
.timeline-insights-drawer .drawer-content { padding: 22px 24px; }
.timeline-drawer-summary { padding: 14px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; margin-bottom: 18px; line-height: 1.5; }
.timeline-drawer-summary.timeline-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.timeline-drawer-summary.timeline-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.timeline-drawer-summary.timeline-success { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.timeline-drawer-section { margin-bottom: 20px; }
.timeline-drawer-h { font-size: 13px; font-weight: 700; color: #475569; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; }
.timeline-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 18px; }
.timeline-status-row { display: flex; justify-content: space-between; font-size: 13px; color: #64748b; padding: 4px 0; border-bottom: 1px dashed #f1f5f9; }
.timeline-status-row strong { color: #1e293b; }
.timeline-req-list { list-style: none; padding: 0; margin: 0; }
.timeline-req-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid #f5f7fa; }
.timeline-req-list li span { color: #334155; }
.timeline-req-list li strong { color: #1e293b; white-space: nowrap; }
.timeline-next-card { background: #f8fafc; border: 1px solid #e9eef5; border-radius: 10px; padding: 12px 14px; }
.timeline-next-name { font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.timeline-next-figs { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: #64748b; }
.timeline-next-figs strong { color: #1e293b; }
.timeline-recommendation p { font-size: 14px; line-height: 1.6; color: #334155; background: #f5f7ff; border: 1px solid #e0e7ff; border-radius: 10px; padding: 14px 16px; margin: 0; }

/* --- responsive --- */
@media (max-width: 860px) {
    .yv-cards { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; }
    .yv-card { flex: 1 1 160px; }
}

/* ============================================================
   NOTIFICATION FILTERS & INLINE ACTIONS
============================================================ */
.notif-filter-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.notif-filter-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    color: #4338ca;
}

.notif-filter-btn.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
    font-weight: 600;
}

.notif-inline-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.notif-action-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.notif-action-btn:hover { opacity: 0.85; }

.notif-action-approve {
    background: #d1fae5;
    color: #065f46;
}

.notif-action-reject {
    background: #fee2e2;
    color: #991b1b;
}

.notif-action-view {
    background: #e0e7ff;
    color: #3730a3;
}

/* ============================================================
   VIEW TOGGLE GROUP (רשימה | קנבן)
============================================================ */
.view-toggle-group {
    display: inline-flex;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.view-toggle-btn + .view-toggle-btn {
    border-right: 1.5px solid #e2e8f0;
}

.view-toggle-btn:hover {
    background: rgba(47,79,127,.08);
    color: #2f4f7f;
}

.view-toggle-btn.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.view-toggle-btn.active svg {
    stroke: #fff;
}

