/* ==========================================================================
   1. GLOBAL CORE & VIEWPORT CONTAINMENT (NET-HAMISHPAT PROTOCOL)
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
body {
    background-color: #ffffff;
    color: #333333;
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.25;
}

.radio-secret-engine {
    position: fixed !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: -1 !important;
}

/* ==========================================================================
   2. INDEX PAGE COMPONENTS (MAIN PORTAL MAIN LAYOUT)
   ========================================================================== */
.ngcs-main-header {
    width: 100%;
    background-color: #2b5f8c;
    color: #ffffff;
    min-height: 54px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
    border-bottom: 2px solid #1b446c;
}
.header-title-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: right;
}
.main-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    color: #ffffff;
}
.user-id-meta {
    font-size: 11px;
    font-weight: normal;
    color: #e8f2f9;
    margin-top: 2px;
}
.header-left-group {
    display: flex;
    align-items: center;
    gap: 15px;
}
.domain-title {
    font-size: 18px;
    font-weight: bold;
    direction: ltr;
}
.menu-nav-item-btn {
    background-color: #1b446c;
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    padding: 6px 14px;
    border: 1px solid #5191ce;
    pointer-events: auto;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    transition: all 0.15s ease;
}
.menu-nav-item-btn:hover {
    background-color: #5191ce;
    color: #ffffff;
    border-color: #2b5f8c;
}
.engine-workspace-grid {
    display: block;
    width: 100%;
    min-height: calc(100vh - 54px);
    background-color: #ffffff;
}
.engine-central-display-area {
    padding: 24px;
    background-color: #ffffff;
    width: 100%;
}
.ngcs-tabs-row-container {
    display: flex;
    background: linear-gradient(to bottom, #f2f7fc 0%, #e4f0fc 100%);
    border: 1px solid #cbd5e1;
    padding: 4px 6px 0 6px;
    margin-bottom: 20px;
    gap: 4px;
}
.ngcs-tab-matrix-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: normal;
    color: #2b5f8c;
    background-color: #e8f2f9;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    cursor: pointer;
    display: inline-block;
}
.ngcs-tab-matrix-btn:hover {
    background-color: #ffffff;
}
.proceedings-table-wrapper { 
    display: none; 
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.foi-empty-state { display: none; }

#view-proceedings:checked ~ .engine-workspace-grid .proceedings-table-wrapper { display: block; }
#view-proceedings:checked ~ .engine-workspace-grid .view-tab-btn-proceedings {
    background-color: #ffffff;
    color: #333333;
    font-weight: bold;
    border-bottom: 1px solid #ffffff;
    position: relative;
    z-index: 2;
}
#view-foi:checked ~ .engine-workspace-grid .foi-empty-state { display: block; }
#view-foi:checked ~ .engine-workspace-grid .view-tab-btn-foi {
    background-color: #ffffff;
    color: #333333;
    font-weight: bold;
    border-bottom: 1px solid #ffffff;
    position: relative;
    z-index: 2;
}
.foi-empty-state {
    border: 1px solid #cbd5e1;
    padding: 40px;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #666666;
    background-color: #f8fafc;
}
.engine-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 30px;
    border: 1px solid #cbd5e1;
}
.engine-grid-table th {
    background: linear-gradient(to bottom, #f2f7fc 0%, #e4f0fc 100%);
    color: #2b5f8c;
    border: 1px solid #cbd5e1;
    padding: 8px;
    text-align: right;
    font-weight: bold;
}
.engine-grid-table td {
    border: 1px solid #dcdcdc;
    padding: 7px 8px;
    vertical-align: middle;
}
.engine-grid-table tr:nth-child(even) { background-color: #f9fbfd; }
.engine-grid-table tr:hover { background-color: #e8f2f9; }

.engine-open-popup-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 7px 8px;
    color: #2b5f8c;
    text-decoration: underline;
    pointer-events: auto;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}
.engine-open-popup-trigger:hover { color: #5191ce; background-color: #e8f2f9; }
.engine-open-popup-trigger * { pointer-events: none !important; }
.case-type { margin-left: 3px; }
.case-num { display: inline-block; }

/* ==========================================================================
   3. NO-JAVASCRIPT POPUP IFRAME LAYER ENGINE
   ========================================================================== */
.modal-overlay-backdrop-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.55);
    display: none;
    z-index: 99999;
}
.modal-dismissal-clickable-surface {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}
.modal-content-window-card {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -45%);
    background-color: #ffffff;
    width: 840px;
    max-width: 95%;
    height: 75vh;
    max-height: 78vh;
    border: 3px solid #2b5f8c;
    padding: 10px;
    z-index: 2;
    box-shadow: 0 12px 36px rgba(0,0,0,0.4);
    overflow: hidden;
}
.modal-x-close-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #2b5f8c;
    cursor: pointer;
    z-index: 10;
    background-color: #ffffff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
}
.modal-x-close-btn:hover { background-color: #e8f2f9; color: #2b5f8c; border-color: #1b446c; }
.modal-iframe-viewport-frame { width: 100%; height: 100%; border: none; background-color: #ffffff; display: block; }

#popup-info:checked ~ #overlay-info,
#popup-act101:checked ~ #overlay-act101,
#popup-act102:checked ~ #overlay-act102,
#popup-act103:checked ~ #overlay-act103,
#popup-act104:checked ~ #overlay-act104,
#popup-act105:checked ~ #overlay-act105,
#popup-act106:checked ~ #overlay-act106 {
    display: flex !important;
}

.disclosure-block-box, .disclosure-box {
    margin-top: 25px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 15px;
    font-size: 12px;
    color: #666666;
    display: block;
}

/* ==========================================================================
   4. CASE VIEW DOCUMENT COMPONENTS (FOR SUB-PAGES / IFRAMES)
   ========================================================================== */
.case-view-body .title { font-size: 17px; font-weight: bold; color: #2b5f8c; border-bottom: 2px solid #2b5f8c; padding-bottom: 5px; margin-bottom: 15px; }
.case-view-body .strip { padding: 10px; font-weight: bold; font-size: 12px; margin-bottom: 15px; background-color: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.case-view-body .table-form { width: 100%; border-collapse: collapse; margin-bottom: 15px; }
.case-view-body .table-form th { background-color: #f1f5f9; color: #2b5f8c; border: 1px solid #cbd5e1; padding: 8px; text-align: right; font-weight: bold; width: 145px; vertical-align: top; }
.case-view-body .table-form td { border: 1px solid #cbd5e1; padding: 8px; text-align: justify; color: #333333; }

.case-view-body .btn-row { background-color: #f8fafc; border: 1px solid #e2e8f0; padding: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.case-view-body .btn { display: inline-flex; background-color: #2b5f8c; color: #ffffff; text-decoration: none; font-size: 11px; font-weight: bold; padding: 6px 12px; border: 1px solid #1b446c; pointer-events: auto; cursor: pointer; }
.case-view-body .btn:hover { background-color: #5191ce; color: #ffffff; border-color: #2b5f8c; }

/* DUAL MODE CONTAINER REALIGNMENT PROTOCOL */
html.standalone-mode {
    background-color: #f0f4f8 !important;
}
html.standalone-mode .case-view-body {
    background-color: #f0f4f8 !important;
    padding: 0 !important;
    padding-top: 54px !important; /* פיצוי גובה קשיח עבור הסרגל המקובע בדסקטוב */
}
html.standalone-mode .case-container {
    background-color: #ffffff !important;
    max-width: 840px !important;
    margin: 24px auto !important;
    padding: 30px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07) !important;
}

/* SUBPAGE RE-ISOLATION INSIDE IFRAMES */
html:not(.standalone-mode) .case-view-body {
    background-color: #ffffff !important;
    padding: 15px !important;
}
html:not(.standalone-mode) .case-container {
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* HARD-PINNED DIRECT ACCESS FLOATING NAVIGATION BANNER */
.direct-access-strip {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #2b5f8c;
    border-bottom: 2px solid #1b446c;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    z-index: 99999 !important; /* אבטחת קדימות חומרה על פני גוף המסמך */
}
.direct-access-strip .portal-warn {
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
}
.direct-access-strip .portal-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    border: 1px solid #5191ce;
    padding: 5px 12px;
    background-color: #1b446c;
    border-radius: 2px;
    transition: all 0.15s ease;
}
.direct-access-strip .portal-link:hover {
    background-color: #5191ce;
}

/* ==========================================================================
   5. UNBREAKABLE GLOBAL MOBILE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    /* Main Index Structure */
    .ngcs-main-header { min-height: 60px; padding: 6px 10px; flex-direction: row !important; justify-content: space-between; align-items: center; }
    .main-title { font-size: 13px !important; white-space: nowrap !important; }
    .user-id-meta { font-size: 10px !important; }
    .header-left-group { gap: 6px !important; flex-grow: 0 !important; flex-shrink: 1 !important; }
    .menu-nav-item-btn { padding: 4px 8px !important; font-size: 10px !important; white-space: nowrap !important; }
    .domain-title { font-size: 13px !important; white-space: nowrap !important; }
    .engine-central-display-area { padding: 15px 10px; }
    .ngcs-tabs-row-container { flex-direction: column; gap: 2px; padding: 6px; border-bottom: 1px solid #cbd5e1; margin-bottom: 15px; }
    .ngcs-tab-matrix-btn { border-bottom: 1px solid #cbd5e1; text-align: center; width: 100%; }
    #view-proceedings:checked ~ .engine-workspace-grid .view-tab-btn-proceedings,
    #view-foi:checked ~ .engine-workspace-grid .view-tab-btn-foi { background-color: #2b5f8c; color: #ffffff; border-bottom: 1px solid #2b5f8c; }
    .engine-grid-table th, .engine-grid-table td { white-space: normal !important; word-break: break-word; }
    .engine-open-popup-trigger .case-num { font-size: 10px !important; font-weight: normal !important; }
    .engine-open-popup-trigger .case-type { font-size: 12px !important; font-weight: bold !important; }
    .proceedings-table-wrapper { max-width: 100%; overflow-x: hidden; }
    .modal-content-window-card { width: 94vw !important; height: 68vh !important; max-height: 70vh !important; padding: 5px; border-width: 2px; top: 45% !important; left: 50% !important; transform: translate(-50%, -45%) !important; }
    .modal-x-close-btn { top: 10px; left: 10px; width: 32px; height: 32px; font-size: 22px; }

    /* Sub-Page Standalone Mobile Adjustments */
    html.standalone-mode .case-view-body {
        padding-top: 76px !important; /* התאמת מרווח עליון מוגדל עבור סרגל שבור במובייל */
    }
    html.standalone-mode .case-container {
        margin: 10px auto !important;
        padding: 15px 10px !important;
        border: none !important;
        box-shadow: none !important;
    }
    .direct-access-strip {
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center !important;
        padding: 10px !important;
    }
    .direct-access-strip .portal-link {
        width: 100% !important;
        text-align: center !important;
    }

    /* Sub-Page Document Forms (Armored Zero Overflow Protocol) */
    .case-view-body { padding: 10px !important; padding-bottom: 90px !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
    .case-view-body .title, .case-view-body .strip { margin-left: 0 !important; margin-right: 0 !important; }
    .case-view-body .table-form { display: block !important; width: 100% !important; border: none !important; margin: 0 0 15px 0 !important; padding: 0 !important; }
    .case-view-body .table-form tbody { display: block !important; width: 100% !important; }
    .case-view-body .table-form tr { display: block !important; width: 100% !important; margin-bottom: 12px !important; border: 1px solid #cbd5e1 !important; padding: 0 !important; }
    .case-view-body .table-form th, .case-view-body .table-form td { display: block !important; width: 100% !important; max-width: 100% !important; white-space: normal !important; word-break: break-word !important; box-sizing: border-box !important; }
    .case-view-body .table-form th { font-size: 12px !important; padding: 8px 10px !important; background-color: #2b5f8c !important; color: #ffffff !important; text-align: right !important; border: none !important; }
    .case-view-body .table-form td { border: none !important; padding: 12px 10px !important; text-align: justify !important; line-height: 1.45 !important; background-color: #f8fafc !important; font-size: 12px !important; }
    .case-view-body .btn-row { margin: 15px 0 0 0 !important; width: 100% !important; padding: 0 !important; background: none !important; border: none !important; gap: 8px !important; }
    .case-view-body .btn { width: 100% !important; justify-content: center !important; padding: 10px !important; font-size: 12.5px !important; margin: 0 !important; }
    .case-view-body .disclosure-box { padding: 0 !important; width: 100% !important; margin-top: 20px !important; }
}