html,
body {
    background: #fffaf4;
    color: #211913;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

h1:focus {
    outline: none;
}

.content {
    padding: 0;
}

.page-shell {
    margin: 0 auto;
    max-width: 1280px;
    padding: 32px;
}

.page-header {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.eyebrow {
    color: #b76518;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08rem;
    margin: 0 0 8px;
    text-transform: uppercase;
}

h1 {
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0;
}

.lead {
    color: #6b5a48;
    margin: 8px 0 0;
    max-width: 720px;
}

.summary-card {
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    min-width: 132px;
    padding: 16px 18px;
    text-align: right;
}

.summary-card span {
    display: block;
    font-size: 1.55rem;
    font-weight: 800;
}

.summary-card small {
    color: #7a6854;
}

.toolbar {
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    margin-bottom: 20px;
    padding: 16px;
}

.toolbar label {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.report-table {
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 920px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #f0e0c8;
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #fff0d9;
    color: #6a5134;
    font-size: .78rem;
    text-transform: uppercase;
}

tr.completed {
    background: #fff3df;
    color: #5a3a18;
}

td strong {
    display: block;
}

td small {
    color: #7a6854;
    display: block;
    margin-top: 4px;
}

.status-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: .82rem;
    font-weight: 800;
    padding: 5px 10px;
}

.status-pill.done {
    background: #f5dfba;
    color: #70420f;
}

.status-pill.open {
    background: #fff0d9;
    color: #7b470f;
}

.settings-list {
    display: grid;
    gap: 12px;
}

.settings-row {
    align-items: end;
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(260px, 1fr) minmax(150px, .55fr) minmax(130px, .4fr) minmax(90px, .25fr) auto;
    padding: 16px;
}

.settings-row label {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.settings-row small {
    color: #7a6854;
    display: block;
    margin-top: 4px;
}

.check-label {
    align-items: center;
    display: flex !important;
    flex-direction: row;
    gap: 8px !important;
    min-height: 38px;
}

.empty-state,
.alert {
    border-radius: 8px;
    padding: 18px;
}

.empty-state {
    background: #ffffff;
    border: 1px solid #ead8bf;
    color: #7a6854;
}

#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}

@media (max-width: 820px) {
    .page-shell {
        padding: 20px;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .summary-card {
        text-align: left;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .settings-row {
        grid-template-columns: 1fr;
    }
}

.auth-shell {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 24px;
}

.auth-panel {
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 460px;
    padding: 28px;
    width: 100%;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.auth-form label {
    color: #66513b;
    display: grid;
    font-size: .9rem;
    font-weight: 700;
    gap: 6px;
}

.user-form {
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 16px;
}

.user-form h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 14px;
}

.user-grid,
.new-user-fields {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
}

.user-grid label,
.new-user-fields label {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.new-user-layout {
    display: grid;
    gap: 16px;
}

.new-user-actions {
    border-top: 1px solid #f0e0c8;
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
}

.new-user-actions .btn {
    min-width: 180px;
}

.user-card {
    align-items: start;
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(180px, .32fr) minmax(0, 1fr);
    padding: 18px;
}

.user-card-summary {
    display: grid;
    gap: 5px;
    padding-top: 4px;
}

.user-card-summary strong {
    font-size: 1.04rem;
}

.user-card-summary small {
    color: #7a6854;
}

.user-card-body {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.user-edit-grid {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
}

.user-edit-grid label {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.user-rights {
    align-items: center;
    display: flex;
    gap: 14px;
    min-height: 38px;
}

.user-card-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.user-card-actions .btn {
    min-width: 110px;
}

@media (max-width: 1100px) {
    .user-grid,
    .user-card,
    .user-edit-grid {
        grid-template-columns: 1fr;
    }

    .user-card-actions {
        justify-content: stretch;
    }

    .user-card-actions .btn {
        flex: 1 1 0;
    }
}

.message-form-grid {
    align-items: stretch;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
}

.message-form-grid label,
.message-form-left label,
.message-body-field {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.message-row {
    grid-template-columns: minmax(220px, .8fr) minmax(260px, 1fr) auto auto;
}

.message-body {
    color: #55483a;
    margin: 0;
    white-space: pre-wrap;
}

.message-form-left {
    display: grid;
    gap: 14px;
}

.message-body-field textarea {
    min-height: 214px;
    resize: vertical;
}

.pharmacy-target-list {
    min-height: 132px;
}

.message-form-actions {
    align-items: center;
    border-top: 1px solid #f0e0c8;
    display: flex;
    gap: 14px;
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 14px;
}

.message-form-actions .btn {
    min-width: 180px;
}


@media (max-width: 920px) {
    .message-form-grid,
    .message-row {
        grid-template-columns: 1fr;
    }

    .message-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .message-form-actions .btn {
        min-width: 0;
        width: 100%;
    }
}

.pharmacy-form-grid,
.employee-form-grid,
.employee-row {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto auto;
}

.pharmacy-form-grid label,
.employee-form-grid label,
.employee-row label {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.pharmacy-panel {
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    display: grid;
    gap: 16px;
    padding: 16px;
}

.pharmacy-header-row {
    align-items: start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.pharmacy-header-row strong {
    display: block;
    font-size: 1.05rem;
}

.pharmacy-header-row small {
    color: #7a6854;
    display: block;
    margin-top: 4px;
}

.employee-section {
    border-top: 1px solid #f0e0c8;
    display: grid;
    gap: 12px;
    padding-top: 14px;
}

.employee-section h2 {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.employee-list {
    display: grid;
    gap: 10px;
}

.employee-row {
    background: #fffaf4;
    border: 1px solid #f0e0c8;
    border-radius: 8px;
    padding: 12px;
}

.compact-empty {
    padding: 12px;
}

@media (max-width: 1100px) {
    .pharmacy-form-grid,
    .employee-form-grid,
    .employee-row {
        grid-template-columns: 1fr;
    }
}
#app:has(.app-loading) {
    align-items: center;
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.app-loading {
    color: #6b5a48;
    display: grid;
    gap: 12px;
    justify-items: center;
}

.app-loading p {
    font-size: .95rem;
    margin: 0;
}

.loading-mark {
    animation: app-loading-spin .8s linear infinite;
    border: 4px solid #ead8bf;
    border-radius: 50%;
    border-top-color: #b76518;
    height: 42px;
    width: 42px;
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}
.pwa-install-button {
    background: #b76518;
    border: 0;
    border-radius: 8px;
    bottom: 18px;
    box-shadow: 0 10px 28px rgba(24, 29, 36, .18);
    color: #ffffff;
    font-weight: 800;
    min-height: 42px;
    padding: 10px 16px;
    position: fixed;
    right: 18px;
    z-index: 1100;
}

.pwa-install-button:hover {
    background: #955313;
}

@media (max-width: 640px) {
    .pwa-install-button {
        bottom: 12px;
        left: 12px;
        right: 12px;
        width: auto;
    }
}


.pharmacy-access-field {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.pharmacy-check-list {
    background: #fffaf4;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding: 10px;
}

.pharmacy-check-list.compact {
    max-height: 150px;
}

.pharmacy-check {
    color: #211913;
    font-weight: 600;
    min-height: 28px;
}

.pharmacy-access-list {
    background: #fffaf4;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 10px;
}

.pharmacy-access-row,
.pharmacy-add-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.pharmacy-access-row .btn,
.pharmacy-add-row .btn {
    min-height: 38px;
}

@media (max-width: 720px) {
    .pharmacy-access-row,
    .pharmacy-add-row {
        grid-template-columns: 1fr;
    }
}



@media (max-width: 720px) {
    .new-user-actions {
        justify-content: stretch;
    }

    .new-user-actions .btn {
        width: 100%;
    }
}

.message-target-field {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.message-target-field small {
    color: #7a6854;
    font-weight: 600;
}

.message-target-checks {
    background: #fffaf4;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    max-height: 214px;
    min-height: 132px;
    overflow-y: auto;
    padding: 12px;
}

.task-attachments {
    border-top: 1px solid #f0e0c8;
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
}

.task-attachments-header {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.task-attachments-header strong {
    color: #211913;
}

.task-attachments-header small,
.attachment-row small,
.attachment-empty {
    color: #7a6854;
}

.attachment-list {
    display: grid;
    gap: 8px;
}

.attachment-row {
    align-items: center;
    background: #fffaf4;
    border: 1px solid #f0e0c8;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 8px 10px;
}

.attachment-download {
    font-weight: 800;
    overflow-wrap: anywhere;
    padding: 0;
    text-align: left;
}

@media (max-width: 720px) {
    .attachment-row {
        grid-template-columns: 1fr;
    }
}

.modal-backdrop-panel {
    align-items: center;
    background: rgba(33, 25, 19, .38);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 28px;
    position: fixed;
    z-index: 1200;
}

.task-modal {
    background: #ffffff;
    border: 1px solid #ead8bf;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(33, 25, 19, .22);
    display: grid;
    gap: 18px;
    max-width: 980px;
    padding: 22px;
    width: min(980px, 100%);
}

.task-modal {
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    grid-auto-rows: max-content;
    align-content: start;
}

.task-modal > *,
.message-form-grid > *,
.message-form-left > * {
    min-width: 0;
}

.message-target-checks label.check-label {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    overflow-wrap: anywhere;
}

.message-target-checks label.check-label input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.task-modal-header {
    align-items: start;
    border-bottom: 1px solid #f0e0c8;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding-bottom: 14px;
}

.task-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
}

.task-modal-header p {
    color: #7a6854;
    margin: 4px 0 0;
}

.task-modal-grid {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.task-modal-grid label {
    color: #66513b;
    display: grid;
    font-size: .86rem;
    font-weight: 700;
    gap: 6px;
}

.task-modal-grid small {
    color: #7a6854;
}

.wide-field {
    grid-column: 1 / -1;
}

.task-modal-actions {
    border-top: 1px solid #f0e0c8;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 14px;
}

@media (max-width: 720px) {
    .modal-backdrop-panel {
        align-items: flex-start;
        padding: 14px;
    }

    .task-modal {
        max-height: calc(100vh - 28px);
        max-height: calc(100dvh - 28px);
    }

    .task-modal-grid {
        grid-template-columns: 1fr;
    }

    .task-modal-header,
    .task-modal-actions {
        flex-direction: column;
    }

    .task-modal-actions .btn {
        width: 100%;
    }
}

.modal-user-fields {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

@media (max-width: 720px) {
    .modal-user-fields {
        grid-template-columns: 1fr;
    }
}

.page-header .home-summary {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-header .home-summary .btn {
    min-height: 42px;
}
