/* The web app's own pieces (KAN-350), over Synthsphere.Web.Shared's layout, in the theme's tokens. */

.app-starting {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.app-starting img {
    animation: app-pulse 1.4s ease-in-out infinite;
}

@keyframes app-pulse {
    50% {
        opacity: 0.4;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1000;
    padding: 12px 16px;
    background: #fde7e9;
    color: #242424;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

#blazor-error-ui span {
    display: block;
}

/* Signed out: the sign-in or registration card, centred. */
.app-card-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 16px 48px;
}

.app-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    padding: 24px;
    border-radius: var(--borderRadiusLarge);
    background: var(--colorNeutralBackground1);
    border: 1px solid var(--colorNeutralStroke2);
    box-shadow: var(--shadow4);
}

.app-card.wide {
    max-width: 720px;
}

.app-card h1 {
    margin: 0 0 4px;
    font-size: var(--fontSizeBase600);
    line-height: var(--lineHeightBase600);
    font-weight: var(--fontWeightSemibold);
}

.app-card h2 {
    margin: 24px 0 8px;
    font-size: var(--fontSizeBase400);
    font-weight: var(--fontWeightSemibold);
}

.app-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-form-row {
    display: grid;
    align-items: start;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.app-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-field label {
    font-weight: var(--fontWeightSemibold);
}

.app-field input,
.app-field select {
    box-sizing: border-box;
    width: 100%;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--colorNeutralStroke1);
    border-bottom-color: var(--colorNeutralStrokeAccessible);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
    color: var(--colorNeutralForeground1);
    font: inherit;
}

.app-field input:focus,
.app-field select:focus {
    border-bottom: 2px solid var(--colorCompoundBrandStroke);
    outline: none;
}

.app-hint {
    color: var(--colorNeutralForeground3);
    font-size: var(--fontSizeBase200);
}

.app-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-below-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--colorNeutralForeground2);
}

.app-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Signed in: the header, the menu at the side, the page. */
.app-shell {
    display: grid;
    grid-template-columns: auto 1fr;
    min-height: calc(100vh - 57px);
}

.app-nav {
    border-inline-end: 1px solid var(--colorNeutralStroke2);
    background: var(--colorNeutralBackground1);
    padding: 8px;
}

.app-content {
    min-width: 0;
    padding: 24px var(--ss-gutter) 48px;
}

.app-content h1 {
    margin: 0 0 8px;
    font-size: var(--fontSizeBase600);
    line-height: var(--lineHeightBase600);
    font-weight: var(--fontWeightSemibold);
}

.app-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 24px;
    margin: 16px 0;
}

.app-details dt {
    color: var(--colorNeutralForeground2);
}

.app-details dd {
    margin: 0;
}

@media (max-width: 720px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-nav {
        border-inline-end: none;
        border-bottom: 1px solid var(--colorNeutralStroke2);
    }

    .app-nav.collapsed {
        display: none;
    }

    /* The open menu fills the window's width. */
    .app-nav > nav {
        width: 100% !important;
    }

    .app-wide-only {
        display: none;
    }

    /* The header stays one line: the menu button, the mark, the user's name (cut short if long) and Sign out. */
    .app-header .ss-header-inner {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .app-header fluent-button {
        min-width: 0;
        flex: none;
    }

    .app-user-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (min-width: 721px) {
    .app-menu-button {
        display: none;
    }
}

/* KAN-352: the pages' shared pieces. */
.app-page-header {
    margin-bottom: 8px;
}

.app-page-description {
    margin: 0 0 12px;
    max-width: var(--ss-reading-width);
    color: var(--colorNeutralForeground2);
}

.app-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.app-loading-bar {
    width: 100%;
    margin-bottom: 8px;
}

.app-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.app-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--colorNeutralStroke2);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
}

.app-table {
    width: 100%;
    border-collapse: collapse;
}

.app-table th,
.app-table td {
    padding: 8px 12px;
    text-align: start;
    border-bottom: 1px solid var(--colorNeutralStroke2);
    vertical-align: middle;
}

.app-table th {
    font-weight: var(--fontWeightSemibold);
    color: var(--colorNeutralForeground2);
}

.app-table tbody tr:hover {
    background: var(--colorNeutralBackground1Hover);
}

.app-table .app-number {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.app-unread td {
    font-weight: var(--fontWeightSemibold);
}

.app-cut {
    max-width: 48ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-wrap {
    white-space: pre-wrap;
}

.app-row-actions {
    width: 1%;
    white-space: nowrap;
}

.app-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: var(--colorNeutralForeground2);
}

.app-pager-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-card.app-detail {
    max-width: var(--ss-reading-width);
    margin-bottom: 16px;
}

.app-stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    margin: 16px 0;
}

.app-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: var(--borderRadiusLarge);
    background: var(--colorNeutralBackground1);
    border: 1px solid var(--colorNeutralStroke2);
}

.app-stat-label {
    color: var(--colorNeutralForeground2);
}

.app-stat-value {
    font-size: var(--fontSizeBase600);
    line-height: var(--lineHeightBase600);
    font-weight: var(--fontWeightSemibold);
    font-variant-numeric: tabular-nums;
}

.app-stat-detail {
    color: var(--colorNeutralForeground3);
    font-size: var(--fontSizeBase200);
}

.app-charts {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    margin: 16px 0;
}

.app-chart {
    margin: 0;
    padding: 16px;
    border-radius: var(--borderRadiusLarge);
    background: var(--colorNeutralBackground1);
    border: 1px solid var(--colorNeutralStroke2);
}

.app-chart figcaption {
    margin-bottom: 12px;
    font-weight: var(--fontWeightSemibold);
}

.app-chart ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.app-chart li {
    display: grid;
    grid-template-columns: minmax(0, 10em) 1fr auto;
    align-items: center;
    gap: 8px;
}

.app-chart-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-chart-track {
    height: 12px;
    border-radius: 6px;
    background: var(--colorNeutralBackground3);
}

.app-chart-bar {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--colorBrandBackground);
}

.app-chart-value {
    font-variant-numeric: tabular-nums;
}

.app-alert-list {
    margin: 4px 0;
    padding-inline-start: 20px;
}

.app-nav-search {
    box-sizing: border-box;
    width: 100%;
    min-height: 32px;
    margin-bottom: 8px;
    padding: 0 10px;
    border: 1px solid var(--colorNeutralStroke1);
    border-bottom-color: var(--colorNeutralStrokeAccessible);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
    color: var(--colorNeutralForeground1);
    font: inherit;
}

.app-success {
    position: fixed;
    inset-inline: 16px;
    bottom: 16px;
    z-index: 50;
    max-width: 520px;
    margin-inline: auto;
}

@media (forced-colors: active) {
    .app-chart-bar {
        background: Highlight;
    }
}

/* KAN-353: forms, the description editor, images and search. */
.app-record-form {
    max-width: 720px;
}

.app-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.app-field-label {
    font-weight: var(--fontWeightSemibold);
}

.app-search {
    min-width: min(100%, 240px);
}

.app-editor {
    border: 1px solid var(--colorNeutralStroke1);
    border-bottom-color: var(--colorNeutralStrokeAccessible);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
}

.app-editor:focus-within {
    border-bottom: 2px solid var(--colorCompoundBrandStroke);
}

.app-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border-bottom: 1px solid var(--colorNeutralStroke2);
}

.app-field .app-editor-style {
    width: auto;
    min-height: 32px;
    margin-inline-end: 4px;
    padding: 0 8px;
    border: 1px solid var(--colorNeutralStroke1);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
    color: var(--colorNeutralForeground1);
    font: inherit;
}

.app-editor-link {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid var(--colorNeutralStroke2);
}

.app-editor-text {
    min-height: 120px;
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 12px;
    outline: none;
}

.app-editor-text p,
.app-rich-text p {
    margin: 0 0 8px;
}

.app-rich-text h1,
.app-rich-text h2,
.app-rich-text h3 {
    margin: 8px 0;
}

.app-rich-text {
    max-width: var(--ss-reading-width);
}

.app-image-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.app-image {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border: 1px solid var(--colorNeutralStroke2);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground2);
}

.app-image-none {
    display: grid;
    place-items: center;
    color: var(--colorNeutralForeground3);
}

.app-image-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.app-detail .app-details {
    margin: 0;
}

@media (max-width: 720px) {
    .app-details {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .app-details dd {
        margin-bottom: 8px;
    }
}

.app-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    cursor: pointer;
}

.app-sort:focus-visible {
    outline: 2px solid var(--colorStrokeFocus2);
    outline-offset: 2px;
}

.app-taxpayer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--colorNeutralForeground2);
}

.app-record-form h2 {
    margin: 16px 0 0;
    font-size: var(--fontSizeBase400);
    font-weight: var(--fontWeightSemibold);
}
.app-choice,
.app-choice > *,
.app-choice fluent-dropdown {
    width: 100%;
    box-sizing: border-box;
}
/* Filters in a toolbar: a drop-down or a number beside the search. */
.app-toolbar {
    align-items: flex-end;
}

.app-filter {
    min-width: min(100%, 200px);
}

.app-filter-number {
    min-width: min(100%, 180px);
}

.app-number-box {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--colorNeutralStroke1);
    border-bottom-color: var(--colorNeutralStrokeAccessible);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
}

.app-number-box:focus-within {
    border-bottom: 2px solid var(--colorCompoundBrandStroke);
}

.app-field .app-number-input {
    flex: 1 1 auto;
    min-width: 4ch;
    min-height: 30px;
    border: none;
    background: transparent;
    text-align: end;
    outline: none;
}

.app-number-suffix {
    color: var(--colorNeutralForeground2);
}

.app-table tr.app-low td {
    background: var(--colorPaletteYellowBackground1);
}

.app-badge {
    margin-inline-start: 8px;
}

.app-chosen {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--colorPaletteGreenForeground1);
}

.app-picker-results {
    margin: 0;
    padding: 4px;
    list-style: none;
    border: 1px solid var(--colorNeutralStroke2);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
    max-height: 280px;
    overflow-y: auto;
}

.app-picker-results button {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: var(--borderRadiusMedium);
    background: none;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.app-picker-results button:hover,
.app-picker-results button[aria-pressed="true"] {
    background: var(--colorNeutralBackground1Hover);
}

.app-picker-results button:focus-visible {
    outline: 2px solid var(--colorStrokeFocus2);
}

.app-checklist {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--colorNeutralStroke2);
    border-radius: var(--borderRadiusMedium);
    max-height: 280px;
    overflow-y: auto;
}

.app-checklist legend {
    font-weight: var(--fontWeightSemibold);
}

.app-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}

.app-inline-form fluent-button {
    margin-top: 26px;
}
.app-section-title {
    margin: 24px 0 8px;
    font-size: var(--fontSizeBase400);
    font-weight: var(--fontWeightSemibold);
}
.app-detail-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    margin-bottom: 16px;
}

.app-detail h2 {
    margin: 0 0 12px;
    font-size: var(--fontSizeBase400);
    font-weight: var(--fontWeightSemibold);
}

.app-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.app-gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.app-gallery-item .app-image {
    width: 140px;
    height: 140px;
}

.app-plain-list {
    margin: 0 0 8px;
    padding-inline-start: 20px;
}
.app-pack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: none;
}

.app-pack legend {
    padding: 0 4px;
    font-weight: var(--fontWeightSemibold);
}

.app-pack h3 {
    margin: 8px 0 0;
    font-size: var(--fontSizeBase300);
    font-weight: var(--fontWeightSemibold);
}

.app-tier {
    align-items: end;
}
/* KAN-354: the point of sale: the cart beside the payment, one above the other on a narrow window. */
.app-pos {
    display: grid;
    gap: 16px;
    margin-top: 16px;
    grid-template-columns: minmax(0, 2fr) minmax(min(100%, 320px), 1fr);
    align-items: start;
}

.app-pos-cart,
.app-pos-pay {
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 960px) {
    .app-pos {
        grid-template-columns: 1fr;
    }
}
/* KAN-355: the service orders board: a column per status, side by side, scrolled across on a narrow window. */
.app-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.app-board-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.app-board-column h2 {
    margin: 0;
    font-size: var(--fontSizeBase300);
    font-weight: var(--fontWeightSemibold);
}

.app-board-card {
    max-width: none;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-board-card.app-overdue {
    border-inline-start: 3px solid var(--colorPaletteRedBorder2);
}

.app-board-moves {
    display: flex;
    justify-content: space-between;
}
/* KAN-355: a list's entry chosen to show its details below, as a link. */
.app-link-button {
    padding: 0;
    border: none;
    background: none;
    color: var(--colorBrandForegroundLink);
    font: inherit;
    text-align: start;
    text-decoration: underline;
    cursor: pointer;
}

.app-link-button:hover {
    color: var(--colorBrandForegroundLinkHover);
}

/* KAN-355: whether a record is in use: a coloured icon and its word. */
.app-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.app-status-on {
    color: var(--colorPaletteGreenForeground1);
}

.app-status-off {
    color: var(--colorNeutralForeground3);
}

/* KAN-356: a row overdue (an invoice, an account, a payment late) stands out; one voided or cancelled is dimmed. */
.app-table tr.app-overdue td {
    color: var(--colorPaletteRedForeground1);
}

.app-table tr.app-dimmed td {
    color: var(--colorNeutralForegroundDisabled);
}

/* What an invoice's lines add up to, under them at the right. */
.app-totals {
    margin-inline-start: auto;
    min-width: 240px;
}
