/* new layouts */

/* Sensible defaults */
table.layout-ng-grid {
    border-spacing: 0px;
}
table.layout-ng-grid td {
    padding: 0px;
}

/* Full height page layout */
html.layout-ng-page-fullheight > body {
    margin: 0px;
}
html.layout-ng-page-fullheight,
html.layout-ng-page-fullheight > body,
html.layout-ng-page-fullheight > body > .layout-ng-page,
html.layout-ng-page-fullheight > body > .layout-ng-page > * {
    height: 100%;
}

/* Full size layout in dialog */
.w_content > div > div > .layout-ng-fullwidth {
    width: 100%;
}
.w_content > div > div > .layout-ng-fullheight {
    height: 100%;
}

/* Style for children of HorizontalLayout. If HorizontalLayout has fixed height,
   each layout item spans the whole height */
.layout-ng-horizontal > * {
    display: inline-block;
    vertical-align: top;
    min-height: 100%;
}

/* Style for children of VerticalLayout. Each layout item spans the whole
   width */
.layout-ng-vertical > * {
    display: block;
}

/* Style for table alternatives of Horizontal and VerticalLayout. They fill up
   whole area of parent layout item by default. */
.layout-ng-horizontal-table, .layout-ng-vertical-table, div.layout-ng-grid {
    display: table;
}
.layout-ng-horizontal-table > *, .layout-ng-vertical-table > *, div.layout-ng-grid > * {
    display: table-row;
}
.layout-ng-horizontal-table > * > *, .layout-ng-vertical-table > * > *, div.layout-ng-grid > * > *, table.layout-ng-grid > tbody > tr > td, table.layout-ng-grid > tr > td {
    display: table-cell;
    vertical-align: top;
}

/* Each table cell of HorizontalLayout has 100% height, each of VerticalLayout
   has 100% width. */
.layout-ng-horizontal-table > * > * {
    height: 100%;
}
.layout-ng-vertical-table > * > * {
    width: 100%;
}

/* Sometimes the components render additional JavaScript after their body, so
   it appears as next item of the layout. Don't display it. */
.layout-ng-vertical > script, .layout-ng-horizontal > script,
.layout-ng-horizontal-table > * > script, .layout-ng-vertical-table > * > script,
.layout-ng-grid > * > script {
    display: none;
}

/* 100% width */
.layout-ng-fullwidth > * {
    width: 100%;
}

/* 100% height */
.layout-ng-fullheight > * {
    height: 100%;
}

.layout-ng-fullheight {
    height: 100%;
}

/* ScrollArea. Absolute positioning to top and bottom fixes the problem when
   scroll area is in element with relative height. */
.layout-ng-scrollarea {
    height: 100%;
    position: relative;
}
.layout-ng-scrollarea > div {
    position: absolute;
    top: 0px;
    width: 100%;
    bottom: 0px;
    overflow: auto;
}

/* Fix misinterpretation of 100% height in Opera: 100% height <div> inside <td>
   is interpreted as 100% of table height, not row height. The same issue is in
   IE, in IE8 it is hacked around the same way (see layouts-ng-ie.css), IE9
   cannot have relatively positioned <td>, so it must be done using JS. */
/* { */
    noindex:-o-prefocus, .layout-ng-fullheight {
        position: relative;
    }
    noindex:-o-prefocus, .layout-ng-fullheight > * {
        position: absolute !important;
        top: 0px;
        bottom: 0px;
    }

    /* Fullheight in dialogs doesn't have the table-related problem */
    noindex:-o-prefocus, .w_content > div > div > .layout-ng-fullheight {
        position: static !important;
    }
    noindex:-o-prefocus, .w_content > div > div > .layout-ng-fullheight > * {
        height: 100%;
        position: static !important;
    }

    /* ScrollArea - disable absolute positioning, as it will be done with
       .layout-ng-fullheight already, if needed. */
    noindex:-o-prefocus, .layout-ng-fullheight > .layout-ng-scrollarea {
        width: 100%;
        height: auto;
    }
    noindex:-o-prefocus, .layout-ng-scrollarea {
        overflow: auto;
    }
    noindex:-o-prefocus, .layout-ng-scrollarea > div {
        position: static;
        top: auto;
        bottom: auto;
        width: auto;
        overflow: visible;
    }
/* } */

/* Vertical align */
.layout-ng-horizontal.layout-ng-va-center > *,
.layout-ng-grid > * > .layout-ng-va-center,
table.layout-ng-grid > tbody > tr > td.layout-ng-va-center,
.layout-ng-horizontal-table > * > .layout-ng-va-center,
.layout-ng-vertical-table > * > .layout-ng-va-center {
    vertical-align: middle;
}

.layout-ng-grid > * > .layout-ng-va-baseline,
table.layout-ng-grid > tbody > tr > td.layout-ng-va-baseline,
.layout-ng-horizontal-table > * > .layout-ng-va-baseline,
.layout-ng-vertical-table > * > .layout-ng-va-baseline {
    vertical-align: baseline;
}

.layout-ng-grid > * > .layout-ng-va-bottom,
table.layout-ng-grid > tbody > tr > td.layout-ng-va-bottom,
.layout-ng-horizontal-table > * > .layout-ng-va-bottom,
.layout-ng-vertical-table > * > .layout-ng-va-bottom {
    vertical-align: bottom;
}

/* Horizontal align */
.layout-ng-ha-center > * {
    margin-left: auto !important;
    margin-right: auto !important;
}
.layout-ng-ha-right > * {
    float: right;
}
/*Right alignment for grid layout*/
.layout-ng-ha-right .layout-ng-grid div {
	text-align: right;
}



/* FIXME: Cleaning up aggresive styling */
.layout-ng-horizontal-table > * > .fullwidth, .layout-ng-horizontal > .fullwidth,
.layout-ng-grid > * > .fullwidth, .layout-ng-grid > tbody > tr > td.fullwidth {
    width: auto;
}