
/********************************************************************************
 * grids.css
 *
 * Style tweaks for the new grids.
 ********************************************************************************/


/******************************
 * header table
 ******************************/

.grid-wrapper .grid-header td.filters {
    vertical-align: bottom;
    width: 100%;
}

.grid-wrapper .grid-header td.menu {
    padding: 0.5em;
    vertical-align: top;
    white-space: nowrap;
}

.grid-wrapper .grid-header #context-menu {
    margin: 0;
}

.grid-tools {
    display: flex;
    gap: 0.5rem;
}

.grid-wrapper .grid-header td.tools {
    margin: 0;
    padding: 0;
    text-align: right;
    vertical-align: bottom;
    white-space: nowrap;
}

.grid-wrapper .grid-header td.tools p {
    line-height: 2em;
    margin: 0;
    padding: 0 0.5em 0 0;
}

.grid-wrapper .grid-header td.tools form {
    display: inline-block;
}


/******************************
 * filters
 ******************************/

.grid-wrapper .newfilters {
    margin: 0;
}

.grid-wrapper .newfilters fieldset {
    margin: 0;
    padding: 1px 5px 5px 5px;
    width: 80%;
}

.grid-wrapper .newfilters .filter {
    margin-bottom: 2px;
}

.grid-wrapper .newfilters .filter:last-child {
    margin-bottom: 0;
}

.grid-wrapper .newfilters .filter .toggle {
    margin: 0;
    text-align: left;
    width: 15em;
}

.grid-wrapper .newfilters .ui-button-text {
    line-height: 1.4em;
}

.grid-wrapper .ui-button-text-icon-primary .ui-button-text {
    padding: 0.2em 1em 0.2em 2.1em;
}

.grid-wrapper .ui-selectmenu-button .ui-selectmenu-text {
    padding: 0.2em 2.1em 0.2em 1em;
}

.grid-wrapper .newfilters .filter label {
    font-weight: bold;
    padding: 0.4em 0.2em;
    position: relative;
    top: -14px;
}

.grid-wrapper .newfilters .filter .value {
    display: inline-block;
    vertical-align: top;
}

.grid-wrapper .newfilters .filter .value input {
    height: 19px;
}

.grid-wrapper .newfilters .filter .inputs {
    display: inline-block;
    /* TODO: Would be nice not to hard-code a height here... */
    height: 26px;
    vertical-align: top;
}

.grid-wrapper .newfilters .buttons {
    margin: 0.5em 0 0 0;
    padding: 0;
}

.grid-wrapper .newfilters #add-filter-button {
    margin-right: 5px;
    vertical-align: middle;
}


/******************************
 * table
 ******************************/

.grid {
    clear: both;
    margin-top: 1em;
}

.grid.no-border {
    margin-top: 0;
}

.grid table {
    background-color: white;
    border: 1px solid black;
    border-collapse: collapse;
    font-size: 10pt;
    line-height: normal;
    white-space: nowrap;
}

.grid.full table {
    width: 100%;
}

.grid.half table {
    width: 50%;
}

.grid.no-border table {
    border-left: none;
    border-top: none;
}


/******************************
 * thead
 ******************************/

.grid thead th,
.grid tr.header td {
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    font-weight: bold;
    padding: 2px 3px;
    text-align: center;
}

/* .grid table thead th:last-child { */
/*     border-right: none; */
/* } */

.grid tr.header a {
    display: block;
    padding-right: 18px;
}

.grid tr.header .asc,
.grid tr.header .dsc {
    background-position: right center;
    background-repeat: no-repeat;
}

.grid tr.header .asc {
    background-image: url(../img/sort_arrow_up.png);
}

.grid tr.header .dsc {
    background-image: url(../img/sort_arrow_down.png);
}


/******************************
 * tbody
 ******************************/

.grid tbody td {
    padding: 5px 6px;
}

.grid.selectable tbody td {
    cursor: default;
}

.grid tr.odd {
    background-color: #e0e0e0;
}

.grid tr:not(.header).hovering {
    background-color: #bbbbbb;
}

.grid tr:not(.header).warning.odd {
    background-color: #fcc;
}

.grid tr:not(.header).warning.even {
    background-color: #ebb;
}

.grid tr:not(.header).warning.hovering {
    background-color: #daa;
}

.grid tr:not(.header).notice.odd {
    background-color: #fe8;
}

.grid tr:not(.header).notice.even {
    background-color: #fd6;
}

.grid tr:not(.header).notice.hovering {
    background-color: #ec7;
}

.grid tr:not(.header) td.checkbox {
    text-align: center;
}

.grid tr:not(.header).selected.odd {
    background-color: #507aaa;
}

.grid tr:not(.header).selected.even {
    background-color: #628db6;
}

.grid tr:not(.header).selected.hovering {
    background-color: #3e5b76;
    color: white;
}

.grid tr:not(.header).selected a {
    color: #cccccc;
}


/******************************
 * main actions
 ******************************/

a.grid-action {
    white-space: nowrap;
}

.grid .actions {
    width: 1px;
}

.grid .actions a {
    margin: 0 5px 0 0;
    position: relative;
    top: -2px;
}

.grid .actions a:last-child {
    margin: 0;
}

.grid .actions .ui-icon {
    display: inline-block;
    position: relative;
    top: 3px;
}


/******************************
 * more actions
 ******************************/

.grid .actions div.more {
    background-color: white;
    border: 1px solid black;
    display: none;
    padding: 3px 10px 3px 5px;
    position: absolute;
    z-index: 1;
}

.grid .actions .more a {
    display: block;
    padding: 2px 0;
}


/******************************
 * pager
 ******************************/

.pager {
    margin-bottom: 20px;
    margin-top: 5px;
}

.pager p {
    font-size: 10pt;
    margin: 0px;
}

.pager .showing {
    float: left;
}

.pager #grid-page-count {
    font-size: 8pt;
}

.pager .page-links {
    float: right;
}
