﻿html,
body {
    height: 100%;
}

body {
    background: var(--colorNeutralBackground2);
    color: var(--colorNeutralForeground1);
    font-family: var(--fontFamilyBase);
}

/* FluentLayout paints the header with the brand color; this app uses a neutral bar so the
   standard button styles stay legible on it. */
.fluent-layout .fluent-layout-item[area="header"] {
    background: var(--colorNeutralBackground1);
    color: var(--colorNeutralForeground1);
    border-bottom: 1px solid var(--colorNeutralStroke2);
    padding: 0;
}

/* Cards sit on the slightly darker page background, as in Fluent 2 apps. */
.fluent-layout .fluent-layout-item[area="content"] {
    background: var(--colorNeutralBackground2);
}

.app-header {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    height: 100%;
}

.app-header a.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--colorNeutralForeground1);
    font-weight: var(--fontWeightSemibold);
    font-size: var(--fontSizeBase400);
    text-decoration: none;
}

.app-header .header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-header .who {
    font-size: var(--fontSizeBase300);
    color: var(--colorNeutralForeground2);
    padding: 0 8px;
}

.page-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 64px;
}

.narrow-form {
    max-width: 460px;
    margin: 0 auto;
}

/* Fluent 2 cards default to 12px padding; the forms here read better with more room. */
.page-shell .fluent-card {
    padding: 20px;
}

/* Blazor focuses the page heading after navigation; it does not need a focus ring. */
h1:focus {
    outline: none;
}

.page-title {
    margin: 0;
    font-size: var(--fontSizeBase600);
    line-height: var(--lineHeightBase600);
    font-weight: var(--fontWeightSemibold);
}

.muted {
    color: var(--colorNeutralForeground3);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* FluentStack lays its children out at content width; page sections should fill the shell. */
.page-shell .fluent-stack-horizontal,
.page-shell .fluent-stack-vertical {
    width: 100%;
}

/* Cards linking to a request on the dashboard. */
a.record-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

a.record-link:hover .fluent-card {
    outline: 1px solid var(--colorBrandStroke1);
}

.record-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.badge-gap {
    margin-inline-start: 8px;
}

@media (max-width: 640px) {
    .field-grid {
        grid-template-columns: 1fr;
    }

    .page-shell {
        padding: 16px 16px 48px;
    }

    .app-header {
        padding: 0 12px;
    }

    .app-header a.brand span,
    .app-header .who {
        display: none;
    }
}

/* Signature capture */
.signature-host {
    width: 100%;
}

.signature-pad {
    border: 1px dashed var(--colorNeutralStroke1);
    border-radius: var(--borderRadiusMedium);
    background: var(--colorNeutralBackground1);
    touch-action: none;
    width: 100%;
    height: 160px;
    display: block;
    cursor: crosshair;
}

.signature-pad.signed {
    border-style: solid;
    border-color: var(--colorBrandStroke1);
}

.signature-image {
    max-width: 240px;
    max-height: 90px;
    background: #fff;
    border: 1px solid var(--colorNeutralStroke1);
    border-radius: var(--borderRadiusMedium);
    padding: 4px;
}

.attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--colorNeutralStroke2);
}

.attachment-row:last-child {
    border-bottom: none;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
