﻿/* ============================================
   XDOCKET LAYOUT SYSTEM - OVERRIDE LAYER
   Version: 2.0.0
   ============================================ */

/* ============================================
   BASE SETUP
   ============================================ */
html,
body {
    height: 100%;
}

    /* ============================================
   LAYOUT TYPE SYSTEM - Works WITH sidebar-main-resized
   ============================================ */

    /* TYPE 1: LIST LAYOUT (MatterTable, AddressBook, Calendar) */
    body[data-layout-type="list"] .main-content,
    body[data-layout-type="list"] .page-content .content-wrapper .content {
        height: calc(var(--viewport-height-safe, 100vh) - var(--height-header-fluid));
        max-height: calc(var(--viewport-height-safe, 100vh) - var(--height-header-fluid));
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body[data-layout-type="list"] .content-inner {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* TYPE 2: TABBED LAYOUT (MatterDetails) */
    body[data-layout-type="tabbed"] {
        overflow: hidden;
    }

        body[data-layout-type="tabbed"] .main-content {
            height: auto;
            min-height: 100vh;
            max-height: none;
            overflow: visible;
            display: flex;
            flex-direction: column;
        }

        body[data-layout-type="tabbed"] .page-content .content-wrapper .content {
            height: auto;
            max-height: none;
            overflow: visible;
            flex: 1;
        }

        body[data-layout-type="tabbed"] .content-inner {
            height: 100%;
            overflow: visible;
            display: flex;
            flex-direction: column;
        }

        /* Tab structure within tabbed layout */
        body[data-layout-type="tabbed"] .page-header {
            flex-shrink: 0;
        }

        body[data-layout-type="tabbed"] .nav-tabs {
            flex-shrink: 0;
        }

        body[data-layout-type="tabbed"] .tab-content {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }

        body[data-layout-type="tabbed"] .tab-pane {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
        }

    /* TYPE 3: DASHBOARD LAYOUT */
    body[data-layout-type="dashboard"] .main-content {
        height: calc(var(--viewport-height-safe, 100vh) - var(--height-header-fluid));
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* DEFAULT: Pages without layout type */
    body:not([data-layout-type]) .main-content {
        min-height: 100vh;
    }
