/* RevPoint layout (D15). Colors only from theme variables, so a theme switch or client colors carry over. */
/* Base size: PrimeFaces sizes everything in rem, so text and spacing all scale from here (browser default 16px). */
html {
    font-size: 14px;
}
body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--surface-ground);
    color: var(--text-color);
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--surface-card);
    /* --surface-c, not --surface-border: Aura dark sets --surface-border to a light color. */
    border-bottom: 1px solid var(--surface-c);
    position: sticky;
    top: 0;
    z-index: 100;
}
/* Logged out: the top bar without its bar look (background, line, sticky). */
.topbar.topbar-plain {
    background: transparent;
    border-bottom: none;
    position: static;
}
/* User pill in the top bar (initial and username) and its menu (D15). */
.user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border: 1px solid var(--surface-c);
    border-radius: 2rem;
    cursor: pointer;
}
.user-pill:hover {
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
}
body .user-pill .ui-avatar {
    background: var(--primary-color);
    color: var(--primary-color-text);
}
.user-pill .pi-chevron-down {
    font-size: 0.75rem;
    color: var(--text-color-secondary);
}
body .user-menu-panel .ui-overlaypanel-content {
    padding: 0.5rem 0;
}
.user-menu-header {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 1rem 0.5rem;
}
.user-menu-header span {
    font-size: 0.85rem;
    color: var(--text-color-secondary);
}
/* The menu sits flat inside the panel: no own border, shadow, background or fixed width. */
body .user-menu.ui-menu,
body .user-menu.ui-menu.ui-shadow {
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 0;
    width: auto;
    min-width: 14rem;
}
body .user-menu .ui-menu-list .ui-menuitem .ui-menuitem-link {
    display: flex;
    align-items: center;
}
/* The tick (primeicons pi-check) after the current theme. */
.user-menu li.theme-current .ui-menuitem-link::after {
    content: "\e909";
    font-family: "primeicons";
    margin-left: auto;
    color: var(--brand-primary-ink);
}
body .user-menu .menuitem-danger .ui-menuitem-text,
body .user-menu .menuitem-danger .ui-menuitem-icon {
    color: #ef4444;
}
@media (max-width: 576px) {
    .user-pill {
        padding: 0;
        border: none;
    }
    .user-pill-name,
    .user-pill .pi-chevron-down {
        display: none;
    }
}
/* Top bar: the brand wordmark (05 Texto, 06 colours on dark) links home. */
.app-name {
    display: flex;
}
.brand-wordmark {
    display: block;
    height: 1.75rem;
}
/* Client branding (0.3.0): the uploaded light or dark PNG, by the theme. */
[data-theme="light"] img.brand-dark,
[data-theme="dark"] img.brand-light {
    display: none;
}
.page {
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem;
}
.page-narrow {
    max-width: 420px;
    margin: 2rem auto 0;
}
/* Login and change password: the box in the middle of the screen (6rem = top bar and page padding). */
.page-centered {
    min-height: calc(100vh - 6rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 0;
}
.field {
    margin-bottom: 1rem;
}
.field label {
    display: block;
    margin-bottom: 0.5rem;
}
/* Icons inside inputs (the password eye): truly centred. Aura uses top 50% with a fixed -0.5rem, but the icon is taller than 1rem. */
body .ui-input-icon-left > i,
body .ui-input-icon-right > i {
    line-height: 1;
    margin-top: 0;
    transform: translateY(-50%);
}
/* A field's error message a little apart from its input, on every page (and under the users table row actions). */
body .field .ui-message,
body .buttons + .ui-message {
    margin: 0.5rem 0 0 0;
}
/* Static info/warn messages keep a 1rem gap from boxes and other elements; after a panel its own bottom margin is the gap. */
body .ui-staticmessage {
    margin: 1rem 0;
}
body .ui-panel + .ui-staticmessage {
    margin-top: 0;
}
/* Same width and edges as the box above it. */
body .page-centered > .ui-staticmessage {
    align-self: stretch;
    width: auto;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}
.ui-panel {
    margin-bottom: 1rem;
}
/* Keeps a first paragraph's margin inside the panel body; without it the margin leaks out as a dark gap between title and body. */
.ui-panel .ui-panel-content {
    display: flow-root;
}
/* Aura dark declares color-scheme light, so its light-dark() borders (panels, tables) come out light. Dark theme loaded: dark scheme. */
:root:has(link[href*="aura-dark"]) {
    color-scheme: dark;
}
/* Toasts below the top bar, not over Sign out; as wide as the message, up to 40rem (or the screen), then the text wraps. */
body .ui-growl {
    top: 4.5rem;
    width: auto;
    max-width: min(40rem, calc(100vw - 2rem));
}
/* Toast text centred on its icon (PrimeFaces puts the title at the top, with room for a detail line we never use). */
body .ui-growl .ui-growl-item-container .ui-growl-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-right: 2.5rem;
}
/* The icon box only as tall as the glyph (line-height 1): in its default 32px box the glyph sits low. */
body .ui-growl .ui-growl-item .ui-growl-image {
    float: none;
    flex-shrink: 0;
    width: auto;
    height: auto;
    line-height: 1;
}
body .ui-growl .ui-growl-item .ui-growl-message {
    margin: 0;
    padding: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
body .ui-growl .ui-growl-item .ui-growl-title {
    padding: 0;
}
body .ui-growl .ui-growl-item .ui-growl-message p:empty {
    display: none;
}
/* Every table (styleClass app-table, 0.3.0; D16): no focus box on a clicked cell or row (PrimeFaces draws one in the primary color). */
body .app-table .ui-datatable-data td:focus,
body .app-table .ui-datatable-data tr:focus,
body .log-levels-table .ui-datatable-data td:focus,
body .log-levels-table .ui-datatable-data tr:focus {
    outline: none;
    box-shadow: none;
}
/* Clickable rows: Users (opens the actions) and Log levels (selects). */
.users-table .ui-datatable-data > tr:not(.ui-expanded-row-content),
.log-levels-table .ui-datatable-data > tr {
    cursor: pointer;
}
/* Text color at low strength, not --surface-hover: Aura dark sets --surface-hover to a light color. */
.app-table .ui-datatable-data > tr:not(.ui-expanded-row-content):hover,
.log-levels-table .ui-datatable-data > tr:not(.ui-state-highlight):hover {
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
}
/* A row whose data changed in the automatic refresh glows in the primary color for 3 s. */
.app-table .ui-datatable-data > tr.row-changed {
    animation: row-changed 3s ease-out;
}
@keyframes row-changed {
    from {
        background: color-mix(in srgb, var(--primary-color) 35%, transparent);
    }
}
.buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}
/* Column being reordered (js/table.js): stays in the table, faded. */
.column-ghost {
    opacity: 0.35;
}
.column-dragging,
.column-dragging * {
    cursor: grabbing !important;
    user-select: none;
}
/* Yes/No marks in every table: green tick (theme green, fixed: the primary colour is per client since 0.3.0), red cross (Aura has no red variable, so its danger red). */
.app-table td .pi-check {
    color: var(--p-green-500);
}
.app-table td .pi-times {
    color: #ef4444;
}
/* Maintenance window status: scheduled blue (theme blue, "info"), finished green (theme green; both fixed: the primary colour is per client), cancelled red, in progress amber (the maintenance-on colour). */
.status-SCHEDULED {
    color: var(--p-blue-500);
}
.status-FINISHED {
    color: var(--p-green-500);
}
.status-CANCELLED {
    color: #ef4444;
}
.status-IN_PROGRESS {
    color: #f59e0b;
}
.app-table td:has(> .pi-check, > .pi-times) {
    text-align: center;
}
/* Column filters hidden until the filter icon in the header opens them (js/table.js). */
.ui-datatable thead th.ui-filter-column:not(.filter-open) .ui-column-filter,
.ui-datatable thead th.ui-filter-column:not(.filter-open) .ui-selectonemenu {
    display: none;
}
.column-filter-toggle {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color-secondary);
    cursor: pointer;
}
.filter-open > .column-filter-toggle {
    color: var(--brand-primary-ink);
}
/* A sorted header keeps the normal header look (Aura marks it green with another background); only its sort arrow stays green. */
body .ui-datatable thead th.ui-state-active,
body .ui-datatable thead th.ui-state-active.ui-state-hover {
    background: var(--surface-card);
    color: var(--text-color);
}
body .ui-datatable thead th.ui-state-active .ui-sortable-column-icon {
    color: var(--brand-primary-ink);
}
/* Panels side by side, same height, wrapping to one per line on narrow screens. */
.panel-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
/* Aura draws the border and background on the title bar and the body, not on the panel: the body grows so every panel in the row ends level with the tallest. */
.panel-row > .ui-panel {
    flex: 1 1 20rem;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}
.panel-row > .ui-panel > .ui-panel-content {
    flex: 1;
}
/* While auto-size measures a column (js/table.js): every header and value on one line. */
.column-measuring th,
.column-measuring td {
    white-space: nowrap;
}
/* Log levels: the select boxes centred in their column, header and rows alike. */
.log-levels-table .ui-selection-column {
    text-align: center;
}
/* No select-all box in the header (rows only); it stays in the page, hidden, because the Select all button clicks it (admin.js). */
.log-levels-table thead .ui-chkbox-all {
    visibility: hidden;
}
/* Level, Change and Select all at the bottom right of the panel. */
.log-levels-buttons {
    justify-content: flex-end;
}
/* Maintenance: while it is on, the panel gets an orange border (on title bar and body, where Aura draws it). */
body .ui-panel.maintenance-on > .ui-panel-titlebar,
body .ui-panel.maintenance-on > .ui-panel-content {
    border-color: #f59e0b;
}
/* Maintenance body, form and warning box fill the panel; the warning is centred in the space under the switch. */
body .ui-panel.maintenance-panel > .ui-panel-content,
.maintenance-form {
    display: flex;
    flex-direction: column;
}
.maintenance-form,
.maintenance-warning {
    flex: 1;
}
.maintenance-warning {
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Maintenance, 404 and error pages: wider box, image on top, big title under it. */
.image-page {
    max-width: 720px;
}
/* The SVG viewBox is cropped to the drawing, so the same 2rem gap sits above the image, below it and at least at its sides. */
body .image-page .ui-panel-content {
    padding: 2rem;
}
/* Every image gets the same frame, the maintenance (404) image's proportions; a drawing with other proportions is centred inside it. */
.page-image svg {
    display: block;
    width: 100%;
    max-width: 34rem;
    aspect-ratio: 500 / 372.6;
    margin: 0 auto;
}
/* Room for two lines (the maintenance text wraps), a shorter title sits in the middle of that room. */
.page-image-title {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5em;
    margin: 2rem 0 0 0;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}
/* Pages without the Reference line keep its space (0.5rem + 1.5rem), so every box has the same height. */
.page-image-title:last-child {
    margin-bottom: 2rem;
}
.page-image-text {
    margin: 0.5rem 0 0 0;
    line-height: 1.5rem;
    text-align: center;
    color: var(--text-color-secondary);
}
/* Side menu (D17): full width with names, or an icon rail (sidebar-collapsed); on a phone hidden, opened over the page (sidebar-open). */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.layout {
    display: flex;
    align-items: flex-start;
}
.layout > .page {
    flex: 1;
    min-width: 0;
}
.sidebar {
    position: sticky;
    top: var(--topbar-height, 3.75rem);
    flex: none;
    box-sizing: border-box;
    width: 15rem;
    height: calc(100vh - var(--topbar-height, 3.75rem));
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    background: var(--surface-card);
    border-right: 1px solid var(--surface-c);
    transition: width 0.2s;
}
body .sidebar .ui-menu {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
}
body .sidebar .ui-menuitem-link {
    display: flex;
    align-items: center;
}
body .sidebar .ui-menu .ui-menu-list .ui-menuitem .ui-menuitem-link.sidebar-active {
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
}
body .sidebar .ui-menu .ui-menu-list .ui-menuitem .ui-menuitem-link.sidebar-active .ui-menuitem-icon,
body .sidebar .ui-menu .ui-menu-list .ui-menuitem .ui-menuitem-link.sidebar-active .ui-menuitem-text {
    color: var(--brand-primary-ink);
}
/* Icon rail on desktop only; on a phone the menu always opens full. */
@media (min-width: 768px) {
    html.sidebar-collapsed .sidebar {
        width: 3.75rem;
    }
    html.sidebar-collapsed .sidebar .ui-menuitem-text {
        display: none;
    }
    /* Rail: only the icon, centred in its row (the theme's icon margin and link padding removed), no hover or current-page background
       (the current page shows as a primary-coloured icon); group headings become a small gap. Selectors as long as the theme's, so they win. */
    html.sidebar-collapsed body .sidebar .ui-menu .ui-menu-list .ui-menuitem .ui-menuitem-link {
        justify-content: center;
        padding: 0.5rem 0;
        background: transparent;
    }
    html.sidebar-collapsed body .sidebar .ui-menu .ui-menu-list .ui-menuitem .ui-menuitem-link .ui-menuitem-icon {
        margin: 0;
    }
    html.sidebar-collapsed body .sidebar .ui-menu .ui-menu-list .ui-menuitem .ui-menuitem-link.ui-state-hover .ui-menuitem-icon {
        color: var(--brand-primary-ink);
    }
    html.sidebar-collapsed body .sidebar .ui-menu .ui-menu-list .ui-widget-header {
        height: 0.75rem;
        padding: 0;
        overflow: hidden;
        visibility: hidden;
    }
}
.sidebar-shade {
    display: none;
}
/* Warning dialog (maintenance notice after sign-in): the whole dialog amber (the maintenance-on colour), icon in the header.
   Selectors longer than the theme's dialog rules; darker amber when the dark theme is loaded. */
body .ui-dialog.ui-widget-content.warning-dialog {
    max-width: 36rem;
    border: 1px solid #f59e0b;
    background: #fff7ed;
}
body .ui-dialog.warning-dialog .ui-dialog-titlebar,
body .ui-dialog.warning-dialog .ui-dialog-content {
    background: #fff7ed;
    color: #b45309;
}
:root:has(link[href*="aura-dark"]) .ui-dialog.ui-widget-content.warning-dialog,
:root:has(link[href*="aura-dark"]) .ui-dialog.warning-dialog .ui-dialog-titlebar,
:root:has(link[href*="aura-dark"]) .ui-dialog.warning-dialog .ui-dialog-content {
    background: #3a2a10;
    color: #fbbf24;
}
body .ui-dialog.warning-dialog .ui-dialog-title .pi {
    margin-right: 0.5rem;
}
/* Dialogs centre on the page area, not the whole window: shifted right by half the side menu (PrimeFaces positions them with
   left/top, so the separate translate property doesn't fight it). Desktop only; on a phone the menu sits over the page. */
@media (min-width: 768px) {
    body:has(.sidebar) .ui-dialog {
        translate: 7.5rem 0;
    }
    html.sidebar-collapsed body:has(.sidebar) .ui-dialog {
        translate: 1.875rem 0;
    }
}
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        left: 0;
        z-index: 1000;
        width: 16rem;
        transform: translateX(-100%);
        transition: transform 0.2s;
    }
    html.sidebar-open .sidebar {
        transform: none;
    }
    html.sidebar-open .sidebar-shade {
        display: block;
        position: fixed;
        inset: var(--topbar-height, 3.75rem) 0 0 0;
        z-index: 999;
        background: rgb(0 0 0 / 40%);
    }
}
/* Buttons above a table (e.g. Clear filters), at the right. */
.table-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0.5rem 0;
}
/* Brand logo (docs/official/design): Original colours on light; on dark the Reverso colours (flat #4DDBA5 icon, #F6F8F7 text). */
.login-logo {
    margin: 0 0 2rem 0;
}
.brand-logo {
    display: block;
    width: 100%;
}
[data-theme="dark"] .brand-logo .logo-icon {
    fill: #4ddba5;
}
[data-theme="dark"] .brand-logo .logo-text,
[data-theme="dark"] .brand-wordmark .logo-text {
    fill: #f6f8f7;
}
/* Scheduled maintenance panel (0.3.0, U6): a "schedule" subsection (fields on one line, label on top, button below) and a
   "list" subsection under a divider. Subsection titles stay smaller than the panel title. */
.subsection-title {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color-secondary);
}
.subsection-separated {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid color-mix(in srgb, var(--text-color) 20%, transparent);
}
.schedule-fields {
    display: flex;
    gap: 1.5rem;
}
.schedule-fields .field {
    flex: 1;
    margin-bottom: 0;
}
/* Calendar/clock button inside the field on the right, like the password eye; the input keeps the theme's round corners (6px). */
body .schedule-fields .ui-calendar.ui-trigger-calendar {
    position: relative;
    display: block;
    width: 100%;
}
body .schedule-fields .ui-calendar.ui-trigger-calendar input.hasDatepicker {
    width: 100%;
    padding-right: 2.5rem;
    border-radius: 6px;
}
body .schedule-fields .ui-calendar.ui-trigger-calendar .ui-datepicker-trigger.ui-button,
body .schedule-fields .ui-calendar.ui-trigger-calendar .ui-datepicker-trigger.ui-button:hover {
    position: absolute;
    top: 0;
    right: 0;
    width: 2.5rem;
    height: 100%;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--text-color-secondary);
}
body .schedule-fields .ui-calendar.ui-trigger-calendar .ui-datepicker-trigger.ui-button:hover {
    color: var(--brand-primary-ink);
}
/* Time picker columns (admin.js): hours and minutes, each scrolls on its own. */
.time-lists {
    display: flex;
    gap: 0.5rem;
}
.time-list {
    position: relative;
    flex: 1;
    height: 12rem;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    text-align: center;
}
.time-list li {
    padding: 0.375rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}
.time-list li:hover {
    background: color-mix(in srgb, var(--text-color) 8%, transparent);
}
.time-list li.ui-state-highlight {
    background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    color: var(--brand-primary-ink);
}
@media (max-width: 767px) {
    .schedule-fields {
        flex-direction: column;
        gap: 1rem;
    }
}
/* Branding panel (0.3.0): one card per image slot, spread evenly over the width (one line on wide screens, wrapping on narrow
   ones), content centred. Each card's 5 rows (title, hint, preview, buttons, message) are rows of the shared grid (subgrid), so
   previews and buttons line up even when a hint takes more lines. */
.branding-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    column-gap: 1.5rem;
    row-gap: 0.5rem;
}
.branding-slot {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    text-align: center;
}
/* A vertical line between images (logo, wordmark, icon; their light and dark cards stay together), the same line as between the
   Colour and Images subsections; the gap is split around it. */
.branding-slot + .branding-slot-light {
    margin-left: -0.75rem;
    padding-left: 0.75rem;
    border-left: 2px solid color-mix(in srgb, var(--text-color) 20%, transparent);
}
/* Upload (PrimeFaces advanced mode, for drag and drop): the preview box is the upload. Click it (admin.js opens the file chooser)
   or drop a PNG on it; it is highlighted on hover and while a file is dragged over it. The PrimeFaces upload itself stays in the
   page, working but not visible. */
body .branding-slot .ui-fileupload {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
.branding-preview {
    flex-direction: column;
    gap: 0.25rem;
    cursor: pointer;
}
.branding-preview:hover,
.branding-preview:focus-visible,
.branding-preview.ui-state-drag {
    border: 1px dashed var(--primary-color);
}
.branding-drop {
    font-size: 0.75rem;
}
.branding-slot .buttons {
    justify-content: center;
    margin-top: 0.5rem;
}
/* The colour picker's swatch next to its input, not at the far end of the panel. */
.branding-color {
    max-width: 16rem;
}
/* Its swatch (PrimeFaces colour picker, Coloris) is a small rounded square inside the input's right end, not over the input's
   border; the input text stops before it. */
body .branding-color .clr-field input {
    width: 100%;
    padding-right: 2.75rem;
}
body .branding-color .clr-field button {
    width: 1.75rem;
    height: 1.75rem;
    right: 0.4rem;
    border-radius: 4px;
}
.branding-hint {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
}
.branding-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 6rem;
    padding: 0.5rem;
    border: 1px solid var(--surface-d);
    border-radius: var(--border-radius);
    color: var(--text-color-secondary);
}
/* The image takes the box height left by the drop text and is scaled down, centred, keeping its proportions. */
.branding-preview img {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    object-fit: contain;
}
/* Dark-mode images are previewed on the dark theme's background (#1c1c1c), in both themes: a fixed colour like the logo ones. */
.branding-preview-dark {
    background: #1c1c1c;
    color: #a3a3a3;
}
