﻿/* POPPINS FONT */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    /* GRADIENT DOSIK */
    background: linear-gradient( to bottom, #ffffff 0%, #f5f8ff 40%, #e9f0ff 70%, #d6e4ff 100% );
    background-attachment: fixed;
    overflow-x: hidden;
}

.card,
.table,
.modal-content {
    background-color: #ffffff;
}

.page-wrapper {
    width: 100%;
}

.page-content {
    min-height: calc(100vh - 72px); /* header בלבד */
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 10px;
}

/* ===============================
   DOSIK – GLOBAL TABLE DESIGN
================================ */

.dosik-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
    font-size: 15px;
}

    .dosik-table thead {
        background: linear-gradient(90deg, #1f6fff, #3b82f6); /* גרדיאנט עדין */
    }

        .dosik-table thead th {
            background: transparent; /* חשוב – מבטל פסים */
            color: #ffffff;
            font-weight: 600;
            font-size: 14px;
            padding: 14px 16px;
            border: none; /* בלי קווים בין כותרות */
            text-align: right;
            white-space: nowrap;
            position: relative;
        }

            .dosik-table thead th:not(:last-child)::after {
                content: "";
                position: absolute;
                left: 0;
                top: 25%;
                height: 50%;
                width: 1px;
                background: rgba(255,255,255,0.35);
            }

        /* קו תחתון עדין לכל הכותרת */
        .dosik-table thead tr {
            box-shadow: inset 0 -1px 0 rgba(255,255,255,0.25);
        }


    /* תאים */
    .dosik-table td {
        padding: 14px 16px;
        border-bottom: 1px solid #f0f0f0;
        color: #333;
        vertical-align: middle;
    }

    /* שורות */
    .dosik-table tbody tr {
        transition: background 0.25s ease, transform 0.15s ease;
    }

        .dosik-table tbody tr:hover {
            background: #f4f8ff;
        }

        /* שורה אחרונה */
        .dosik-table tbody tr:last-child td {
            border-bottom: none;
        }

        /* כותרת ניתנת למיון */
    .dosik-table th.sortable {
        cursor: pointer;
        padding-left: 26px; /* מקום לאייקון */
    }

        .dosik-table th.sortable::before {
            content: "↕";
            position: absolute;
            left: 10px;
            font-size: 14px;
            opacity: 0.5;
        }

        /* hover */
        .dosik-table th.sortable:hover::before {
            opacity: 1;
            transform: scale(1.1);
        }

/* ===============================
   STATUS
================================ */

.status-active {
    color: #0f9d3d;
    font-weight: 600;
}

.status-inactive {
    color: #d93025;
    font-weight: 600;
}

/* ===============================
   INPUT בתוך טבלה
================================ */

.dosik-table input.form-control {
    max-width: 130px;
    text-align: center;
    border-radius: 8px;
}

/* ===============================
   MOBILE RESPONSIVE TABLE
================================ */

@media (max-width: 768px) {
    .page-content {
        padding: 16px 16px;
    }

    .dosik-table thead {
        display: none;
    }

    .dosik-table,
    .dosik-table tbody,
    .dosik-table tr,
    .dosik-table td {
        display: block;
        width: 100%;
    }

        .dosik-table tr {
            margin-bottom: 14px;
            border-radius: 12px;
            background: #ffffff;
            box-shadow: 0 4px 14px rgba(0,0,0,0.06);
            padding: 10px;
        }

        .dosik-table td {
            display: flex;
            justify-content: space-between;
            padding: 8px 10px;
            border: none;
            font-size: 14px;
        }

            .dosik-table td::before {
                content: attr(data-label);
                font-weight: 600;
                color: #0d6efd;
            }
}

/* ===============================
   DOSIK – GLOBAL MODAL DESIGN
================================ */

/* רקע כהה עדין מאחורי המודאל */
.modal-backdrop.show {
    background-color: rgba(13, 30, 60, 0.45);
}

/* חלון מודאל */
.modal-content {
    border-radius: 18px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(13, 110, 253, 0.15);
    animation: modalFadeUp 0.35s ease;
}

/* כותרת */
.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 18px 22px;
}

/* כותרת טקסט */
.modal-title {
    font-weight: 700;
    font-size: 18px;
}

/* גוף */
.modal-body {
    padding: 22px;
}

/* פוטר */
.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 16px 22px;
}

/* כפתור סגירה */
.modal-header .btn-close {
    margin: 0;
    position: absolute;
    left: 15px;
    top: 15px;
}

    .modal-header .btn-close:hover {
        opacity: 1;
    }

.modal-header.bg-primary {
    background: linear-gradient(90deg, #0d6efd, #5fa8ff) !important;
}

.modal-header.bg-success {
    background: linear-gradient(90deg, #198754, #4ade80) !important;
}

.modal-header.bg-dark {
    background: linear-gradient(90deg, #111827, #1f2937) !important;
}

.modal-body .form-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

.modal-body .form-control {
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 15px;
}

/* אנימציה */
@keyframes modalFadeUp {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .modal-dialog {
        margin: 12px;
    }

    .modal-content {
        border-radius: 16px;
    }
}

/* =========================
   DOSIK REPORT DESIGN
========================= */

.dosik-report {
    background: #ffffff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.08);
}

/* Header */
.dosik-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eef1f6;
    padding-bottom: 14px;
}

.dosik-report-title {
    font-size: 22px;
    font-weight: 700;
    color: #0a3e87;
    margin: 0;
}

.dosik-report-date {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
}

/* Table wrapper */
.dosik-report-table-wrapper {
    overflow-x: auto;
}

/* Table tweaks */
.dosik-report-table td,
.dosik-report-table th {
    font-size: 14px;
}

/* Summary row */
.dosik-report-table .summary-row td {
    background: linear-gradient(90deg, #e8f4ff, #f4fbff);
    font-weight: 700;
    color: #0d6efd;
    border-top: 2px solid #0d6efd;
}

/* =========================
   DOSIK REPORT SUMMARY ROW
========================= */

.dosik-report-table .summary-row td {
    background: linear-gradient(90deg, #f0f6ff, #e6efff);
    font-weight: 700;
    font-size: 15px;
    color: #0a3e87;
    border-top: 2px solid #0d6efd;
    padding: 14px 16px;
}

    /* תא ראשון – תווית סה״כ */
    .dosik-report-table .summary-row td:first-child {
        text-align: center;
        letter-spacing: 0.5px;
        font-size: 14px;
        color: #0d6efd;
    }

    /* מספרים */
    .dosik-report-table .summary-row td.text-end {
        font-size: 16px;
        color: #003c8f;
    }

@media (max-width: 768px) {
    .dosik-report {
        padding: 18px;
    }

    .dosik-report-title {
        font-size: 18px;
    }

    .dosik-report-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        border-radius: 14px;
    }

        /* שורת סיכום – יותר מודגשת בנייד */
        .dosik-report-table .summary-row td {
            font-size: 14px;
        }
}

/* =========================
   DOSIK SEARCH
========================= */
.dosik-search {
    position: relative;
    max-width: 420px;
    width: 100%;
}

    .dosik-search input {
        width: 100%;
        padding: 12px 42px 12px 14px;
        border-radius: 12px;
        border: 1px solid #d6e4ff;
        background: #ffffff;
        font-size: 15px;
        direction: rtl;
        text-align: right;
        transition: all 0.25s ease;
    }

        .dosik-search input::placeholder {
            color: #9aa6b2;
        }

        .dosik-search input:focus {
            outline: none;
            border-color: #0d6efd;
            box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
        }

.dosik-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #0d6efd;
    pointer-events: none;
}

/* =========================
   DOSIK BUTTONS
========================= */
.dosik-btn {
    border: none;
    border-radius: 14px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .dosik-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* Primary */
.dosik-btn-primary {
    background: linear-gradient(135deg, #0d6efd, #5fa8ff);
    color: #fff;
    box-shadow: 0 6px 18px rgba(13,110,253,0.35);
}

    .dosik-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 26px rgba(13,110,253,0.45);
    }

/* Success */
.dosik-btn-success {
    background: linear-gradient(135deg, #198754, #3ddc97);
    color: #fff;
}

    .dosik-btn-success:hover {
        transform: translateY(-2px);
    }

/* Danger */
.dosik-btn-danger {
    background: linear-gradient(135deg, #dc3545, #ff6b6b);
    color: #fff;
}

/* =========================
   DOSIK ACTION BAR
========================= */
.dosik-actions-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* ⬅️ שינוי קריטי */
    gap: 24px;
    direction: rtl;
    margin-bottom: 20px; /* ⬅️ מרווח מהטבלה */
}

/* ימין – חיפוש + צ'קבוקסים */
.dosik-actions-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
}

/* שמאל – כפתור */
.dosik-actions-left {
    display: flex;
    align-items: flex-start;
}

/* מובייל */
@media (max-width: 768px) {
    .dosik-actions-layout {
        flex-direction: column;
        gap: 16px;
    }

    .dosik-actions-left {
        width: 100%;
    }

        .dosik-actions-left .dosik-btn {
            width: 100%;
            justify-content: center;
        }
}

@media (max-width: 768px) {

    .dosik-actions-layout {
        flex-direction: column;
        align-items: stretch; /* 🔥 זה הקריטי */
    }

    .dosik-actions-right {
        max-width: 100%;
        width: 100%;
    }

    .dosik-search {
        width: 100%;
    }

        .dosik-search input {
            width: 100%;
        }

    .dosik-checkbox {
        align-self: stretch; /* יתחיל מאותו קו ימין */
    }

    .dosik-actions-left {
        width: 100%;
    }

        .dosik-actions-left .dosik-btn {
            width: 100%;
            justify-content: center;
        }

    /* תא פעולות בכרטיס */
    .actions-cell {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

        /* כפתורים ברוחב מלא */
        .actions-cell .dosik-btn {
            width: 100%;
            justify-content: center;
        }
}


/* =========================
   DOSIK CHECKBOX
========================= */

.dosik-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    user-select: none;
}

    /* מסתירים את הצ'קבוקס המקורי */
    .dosik-checkbox input {
        display: none;
    }

    /* הקופסה */
    .dosik-checkbox span {
        width: 20px;
        height: 20px;
        border-radius: 6px;
        border: 2px solid #c7d7ff;
        background: #ffffff;
        position: relative;
        transition: all 0.25s ease;
    }

        /* ✔ סימון */
        .dosik-checkbox span::after {
            content: "";
            position: absolute;
            left: 5px;
            top: 1px;
            width: 6px;
            height: 12px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg) scale(0);
            transition: transform 0.2s ease;
        }

    /* מצב מסומן */
    .dosik-checkbox input:checked + span {
        background: linear-gradient(135deg, #0d6efd, #5fa8ff);
        border-color: #0d6efd;
    }

        .dosik-checkbox input:checked + span::after {
            transform: rotate(45deg) scale(1);
        }

    /* Hover */
    .dosik-checkbox:hover span {
        border-color: #0d6efd;
    }

    /* Disabled */
    .dosik-checkbox input:disabled + span {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* =========================
   DOSIK USER MENU – MODERN FLAT
========================= */

.dosik-user-menu {
    position: relative;
}

.dosik-user-anchor {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ===== USER TRIGGER ===== */
.dosik-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #0a3e87 !important;
    border: none;
}

    .dosik-user-trigger:hover {
        color: #0d6efd !important;
    }

    .dosik-user-trigger:focus,
    .dosik-user-trigger:focus-visible,
    .dosik-user-trigger:active {
        outline: none !important;
        box-shadow: none !important;
    }

/* שלום */
.user-hello {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
}

/* שם */
.user-name {
    font-size: 14px;
    font-weight: 700;
    color: inherit;
}

/* ===== ARROW ===== */
.dosik-user-trigger.dropdown-toggle::after {
    margin-right: 4px;
    margin-left: 0;
    font-size: 12px;
    opacity: 0.7;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.dosik-user-trigger[aria-expanded="true"]::after {
    transform: rotate(180deg);
    opacity: 1;
}

/* =========================
   DROPDOWN MENU
========================= */

/* ===== DROPDOWN MENU ===== */
.dosik-dropdown {
    position: absolute !important;
    top: calc(100% + 6px) !important; /* 🔴 בדיוק מתחת לחץ */
    left: 50% !important;
    transform: translateX(-50%);
    transform-origin: top center;
    min-width: 220px;
    padding: 8px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
}

    /* פתוח */
    .dosik-dropdown.show {
        opacity: 1;
        pointer-events: auto;
        animation: dropdownFade 0.18s ease;
    }

/* =========================
   DROPDOWN ITEMS
========================= */

.dosik-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    background: transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

    .dosik-dropdown-item i {
        font-size: 16px;
        color: #0d6efd;
    }

    /* hover */
    .dosik-dropdown-item:hover {
        background: #f4f8ff;
        color: #0d6efd;
    }

    /* logout */
    .dosik-dropdown-item.danger {
        color: #dc3545;
    }

        .dosik-dropdown-item.danger i {
            color: #dc3545;
        }

        .dosik-dropdown-item.danger:hover {
            background: #fff1f1;
        }

/* divider */
.dosik-dropdown .dropdown-divider {
    margin: 6px 0;
    border-color: #eef1f6;
}

/* =========================
   ANIMATION
========================= */

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}