/*
 * ZAST layer on saga-blue: the density and the colours of the former bluesky theme.
 * Saga writes every selector as "body .ui-...", so each rule here does the same to win.
 */

/* Density. Saga sizes its paddings in rem, so the root font sets the scale. */
html { font-size: 11px; }
body, body .ui-widget, body .ui-widget .ui-widget {
    font-family: Arial, Verdana, sans-serif;
    font-size: 11px;
}
body .ui-inputfield,
body .ui-inputtext,
body .ui-selectonemenu .ui-selectonemenu-label {
    padding: 2px 4px;
    font-size: 11px;
}
body .ui-outputlabel { white-space: nowrap; }

/* Headers: the bluesky blue bar with white bold text. */
body .ui-panel .ui-panel-titlebar,
body .ui-panelmenu h3.ui-panelmenu-header {
    background: #1381d0;
    border-color: #1381d0;
    color: #ffffff;
    font-weight: bold;
    padding: 5px 6px;
}
body .ui-panel .ui-panel-titlebar .ui-panel-title,
body .ui-panelmenu h3.ui-panelmenu-header a,
body .ui-panelmenu h3.ui-panelmenu-header .ui-icon {
    color: #ffffff;
    background: transparent;
    font-size: 11px;
}
body .ui-panelmenu h3.ui-panelmenu-header.ui-state-active,
body .ui-panelmenu h3.ui-panelmenu-header.ui-state-active:hover,
body .ui-panelmenu h3.ui-panelmenu-header:not(.ui-state-active):hover {
    background: #1381d0;
    border-color: #1381d0;
    color: #ffffff;
}
body .ui-panelmenu h3.ui-panelmenu-header.ui-state-active a,
body .ui-panelmenu h3.ui-panelmenu-header.ui-state-active .ui-icon { color: #ffffff; }

/* Panel bodies: the bluesky light blue. */
body .ui-panel,
body .ui-panel .ui-panel-content {
    background: #c6deff;
    border-color: #bed6f8;
}
body .ui-panel .ui-panel-content { padding: 4px; }

/* Menu entries. */
body .ui-panelmenu .ui-panelmenu-content {
    background: #d1e5ff;
    border-color: #bed6f8;
    padding: 0;
}
body .ui-panelmenu .ui-panelmenu-content .ui-menuitem .ui-menuitem-link {
    padding: 4px 6px;
    color: #000000;
}
body .ui-panelmenu .ui-panelmenu-content .ui-menuitem .ui-menuitem-link:hover { background: #b2d4ff; }
body .ui-panelmenu .ui-panelmenu-content .ui-menuitem .ui-menuitem-link .ui-menuitem-icon { color: #000000; }

/* Data table: compact, white and striped as before. */
body .ui-datatable thead th,
body .ui-datatable .ui-datatable-data > tr > td,
body .ui-datatable tfoot td {
    padding: 3px 4px;
    font-size: 11px;
}
body .ui-datatable thead th { background: #d3e4fc; color: #000000; border-color: #bed6f8; }
body .ui-datatable .ui-datatable-data > tr { background: #ffffff; color: #000000; }
body .ui-datatable .ui-datatable-data > tr.ui-datatable-odd { background: #eef4fd; }
body .ui-datatable .ui-datatable-data > tr.ui-state-highlight { background: #b2d4ff; }
body .ui-paginator { padding: 2px; background: #d3e4fc; }
body .ui-paginator .ui-paginator-page,
body .ui-paginator .ui-paginator-first,
body .ui-paginator .ui-paginator-prev,
body .ui-paginator .ui-paginator-next,
body .ui-paginator .ui-paginator-last {
    min-width: 22px;
    height: 22px;
}

/* Buttons: compact. Disabled buttons stay readable: grey text on grey. */
body .ui-button .ui-button-text { padding: 3px 8px; }
body .ui-button.ui-state-disabled {
    background: #e4e4e4;
    border-color: #c8c8c8;
    color: #6b6b6b;
    opacity: 1;
}
body .ui-button.ui-state-disabled .ui-icon,
body .ui-button.ui-state-disabled .ui-button-text { color: #6b6b6b; }

/* Check boxes: the height of the label line. */
body .ui-chkbox .ui-chkbox-box { width: 14px; height: 14px; }
body .ui-chkbox .ui-chkbox-box .ui-chkbox-icon { font-size: 10px; }

/* Masthead: the logout button keeps a light background, so its icon needs a dark colour. */
body .ui-button.iconButton .ui-icon,
body .ui-button.iconButton .ui-button-icon-left { color: #000000; }

/* Legacy jQuery UI icon names that the pages still use (confirm dialogs, Anwendermanagement). Saga
   draws them only inside its own widgets, so the layer maps them to the matching PrimeIcons. */
body .ui-icon-alert,
body .ui-icon-check,
body .ui-icon-close,
body .ui-icon-disk,
body .ui-icon-arrowthick-1-s {
    font-family: "primeicons";
    font-style: normal;
    font-weight: normal;
    display: inline-block;
    width: 1em;
    height: 1em;
    line-height: 1;
}
body .ui-icon-alert:before { content: "\e922"; }
body .ui-icon-check:before { content: "\e909"; }
body .ui-icon-close:before { content: "\e90b"; }
body .ui-icon-disk:before { content: "\e95b"; }
body .ui-icon-arrowthick-1-s:before { content: "\e956"; }

/* The empty state of a check box keeps a box, so no icon of the page has zero size. */
body .ui-chkbox .ui-chkbox-box .ui-chkbox-icon {
    width: 10px;
    height: 10px;
    margin-left: -5px;
    margin-top: -5px;
}

/* F1: the panel title sits in the vertical centre of the bar. stylesheet-pf.css fixes the bar at
   20px, which pushes the title to the top once Saga adds its padding and line height. */
body .ui-panel .ui-panel-titlebar {
    height: auto;
    display: flex;
    align-items: center;
}
body .ui-panel .ui-panel-titlebar .ui-panel-title {
    margin: 0;
    line-height: 1.2;
}
body .ui-panel .ui-panel-titlebar .ui-panel-titlebar-icon { margin-left: auto; }

/* Calendar trigger: a solid blue square of the input height with the white PrimeIcons
   calendar glyph, flush with the input. */
body .ui-calendar.ui-trigger-calendar { white-space: nowrap; }
body .ui-calendar.ui-trigger-calendar > .ui-inputfield { vertical-align: top; border-top-right-radius: 0; border-bottom-right-radius: 0; }
body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only:is(.ui-state-default, .ui-state-hover, .ui-state-focus, .ui-state-active) {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 0;
    padding: 0;
    margin: 0 0 0 -1px;
    vertical-align: top;
    border-radius: 0 4px 4px 0;
    box-shadow: none;
}
body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only .ui-button-text { display: none; }
body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only .ui-icon-calendar {
    position: static;
    display: block;
    margin: 0;
    width: 11px;
    height: 11px;
    text-indent: 0;
    background-image: none !important;
}
body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only:is(.ui-state-default, .ui-state-hover, .ui-state-focus, .ui-state-active) { background: #2196f3; border: 1px solid #2196f3; color: #ffffff; }
body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only:is(.ui-state-default, .ui-state-hover, .ui-state-focus, .ui-state-active):hover, body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only.ui-state-hover, body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only.ui-state-focus { background: #1976d2; }
body .ui-datepicker-trigger.ui-button .ui-icon-calendar { color: #ffffff; }
body .ui-datepicker-trigger.ui-button .ui-icon-calendar {
    font-family: 'primeicons';
    font-style: normal;
    font-size: 11px;
    line-height: 11px;
    text-align: center;
}
body .ui-datepicker-trigger.ui-button .ui-icon-calendar::before { content: "\e927"; }
/* stylesheet-pf.css turns every span of a hovered icon-only button black at 10px. */
body .ui-datepicker-trigger.ui-button.ui-widget.ui-corner-all.ui-button-icon-only.ui-state-hover .ui-icon-calendar { color: #ffffff; font-size: 11px; }
