:root {
    --form-surface-bg: rgba(255, 255, 255, 0.88);
    --form-surface-border: rgba(255, 255, 255, 0.58);
    --form-surface-shadow: 0 4px 14px -12px rgba(15, 23, 42, 0.28);
    --form-input-bg: #f8fafc;
    --form-input-border: #e2e8f0;
    --form-primary: #4f46e5;
    --form-primary-soft: rgba(79, 70, 229, 0.2);
    --form-text-main: #1e293b;
    --form-text-muted: #64748b;
    --form-text-faint: #94a3b8;
}

.app-page-content {
    color: #1f2937;
}

/* Global modernized form language for all /app pages */
.app-page-content .mud-paper:not(.mud-popover):not(.mud-menu):not(.mud-tooltip):not(.mud-dialog) {
    border: 1px solid var(--form-surface-border);
    border-radius: 16px;
    background: var(--form-surface-bg);
    box-shadow: var(--form-surface-shadow);
}

.app-page-content .mud-card {
    border: 1px solid var(--form-surface-border);
    border-radius: 16px;
    background: var(--form-surface-bg);
    box-shadow: var(--form-surface-shadow);
}

.app-page-content .mud-input-label {
    color: #334155;
}

.app-page-content .mud-input-helper-text {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 400;
}

.app-page-content .mud-input-outlined {
    border-radius: 12px;
    background: var(--form-input-bg);
}

.app-page-content .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--form-input-border) !important;
}

.app-page-content .mud-input-outlined.mud-input-focused {
    background: #ffffff;
    box-shadow: 0 0 0 2px var(--form-primary-soft);
}

.app-page-content .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: rgba(79, 70, 229, 0.65) !important;
}

.app-page-content .mud-button-root,
.app-page-content .lumex-btn {
    text-transform: none;
    border-radius: 10px;
}

.app-page-content .mud-toggle-group {
    border-radius: 12px;
    overflow: hidden;
}

.app-page-content .mud-table {
    border-radius: 12px;
}

.form-page-shell {
    padding: 8px 0 12px;
}

.form-shell {
    width: 100%;
    padding: 8px;
}

.form-status-card,
.form-card {
    border: 1px solid var(--form-surface-border);
    border-radius: 16px;
    background: var(--form-surface-bg);
    backdrop-filter: blur(8px);
    box-shadow: var(--form-surface-shadow);
}

.form-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 0.2rem;
}

.form-section-heading {
    color: var(--form-text-main);
    font-size: 1.23rem;
    line-height: 1.3;
    font-weight: 600;
}

.form-card-title .mud-icon-root {
    font-size: 1.05rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    padding: 6px;
    color: var(--form-primary);
}

.form-modern-input .mud-input-label,
.instruction-modern-input .mud-input-label {
    color: #334155;
}

.form-modern-input .mud-input-outlined,
.instruction-modern-input .mud-input-outlined {
    border-radius: 12px;
    background: var(--form-input-bg);
}

.form-modern-input .mud-input-outlined .mud-input-outlined-border,
.instruction-modern-input .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--form-input-border) !important;
}

.form-modern-input .mud-input-outlined.mud-input-focused,
.instruction-modern-input .mud-input-outlined.mud-input-focused {
    background: #ffffff;
    box-shadow: 0 0 0 2px var(--form-primary-soft);
}

.form-modern-input .mud-input-outlined.mud-input-focused .mud-input-outlined-border,
.instruction-modern-input .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: rgba(79, 70, 229, 0.65) !important;
}

.form-modern-input .mud-input-helper-text,
.instruction-modern-input .mud-input-helper-text {
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 400;
}

.text-undo-field {
    border-radius: 12px;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.text-undo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.text-undo-file-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.text-undo-history-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.25rem;
}

.text-undo-upload-button,
.text-undo-default-button,
.text-undo-history-button,
.text-undo-example-button {
    text-transform: none;
    border-radius: 10px;
    min-width: 0;
    padding-inline: 0.55rem;
}

.text-undo-history-button {
    color: #475569;
}

.text-undo-upload-button,
.text-undo-default-button {
    color: var(--form-primary);
}

.text-undo-example-button {
    color: #0f766e;
}

.text-undo-label {
    margin-bottom: 0.2rem;
    color: var(--form-text-main);
    font-size: 1rem;
    font-weight: 600;
}

.text-undo-description {
    margin-bottom: 0.45rem;
    color: var(--form-text-muted);
    font-size: 0.95rem;
}

.text-undo-editor-shell {
    border: 1px solid var(--form-input-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--form-input-bg);
}

.text-undo-textarea {
    width: 100%;
    resize: vertical;
    padding: 0.75rem 0.85rem;
    border: 0;
    background: transparent;
    outline: none;
    color: #334155;
    line-height: 1.45;
    font-size: 1rem;
}

.text-undo-textarea:focus {
    box-shadow: inset 0 0 0 2px var(--form-primary-soft);
    background: #ffffff;
}

.text-undo-counter {
    white-space: nowrap;
    color: var(--form-text-faint);
    font-size: 0.84rem;
}

.text-undo-helper {
    margin-top: 0.3rem;
}

.text-undo-footer {
    margin-top: 0.2rem;
    display: flex;
    justify-content: flex-end;
}

.form-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 240px;
}

.form-dropdown-label {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.2;
}

.form-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
    border: 1px solid var(--form-input-border);
    background: var(--form-input-bg);
    color: #1f2937;
    font-size: 1rem;
    font-weight: 400;
    text-transform: none;
    min-height: 54px;
    padding-inline: 0.9rem;
}

.form-dropdown-trigger .mud-icon-root {
    color: #64748b;
}

.form-dropdown-helper {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.2;
}

.form-dropdown-menu {
    max-height: 320px;
    overflow: auto;
}

.form-dropdown-item {
    font-size: 0.95rem;
}

.settings-switch-base {
    display: flex;
    flex-direction: row-reverse;
    width: 100%;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid var(--form-input-border);
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    background: var(--form-input-bg);
}

.settings-switch-host-fill {
    width: 100%;
}

.settings-switch-host-fill > * {
    width: 100%;
}

.settings-switch-force-fill {
    width: 100% !important;
    display: flex !important;
}

.settings-switch-force-fill .settings-switch-base {
    width: 100% !important;
}

.settings-switch-wrapper {
    padding: 0;
    height: 1rem;
    margin-top: 0.22rem;
    overflow: visible;
}

.settings-switch-thumb {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid #cbd5e1;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.settings-switch-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.settings-switch-label {
    margin: 0;
    color: var(--form-text-main);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
}

.settings-switch-description {
    margin: 0;
    color: var(--form-text-muted);
    font-size: 0.95rem;
    line-height: 1.25;
}

/* App drawer trigger alignment */
.organization-picker,
.profile-menu-trigger {
    justify-content: flex-start !important;
    text-align: left !important;
}

.organization-icon-trigger,
.profile-icon-trigger,
.app-drawer-profile-section {
    flex-shrink: 0 !important;
}

.organization-icon-trigger,
.profile-icon-trigger {
    min-height: 56px;
}

.organization-picker {
    border: 1px solid var(--form-input-border);
    border-radius: 10px;
    background: transparent;
}

.organization-picker-popover {
    width: max-content !important;
    min-width: 0 !important;
}

.organization-picker > *,
.profile-menu-trigger > * {
    width: 100%;
    min-width: 0;
}

.profile-menu-trigger-content {
    width: 100%;
    justify-content: flex-start !important;
}

/* Appointment cards: tighten left/right inset to align better with section content. */
.appointment-switch-compact .settings-switch-base {
    padding-left: 0.55rem;
    padding-right: 0.7rem;
}

.settings-switch-inline-label {
    color: var(--form-text-main);
    font-size: 0.95rem;
    line-height: 1.3;
}

.settings-description-text {
    color: #64748b;
}

.hours-holiday-section {
    border: 1px solid var(--form-input-border);
    border-radius: 12px;
    background: var(--form-input-bg);
    padding: 0.9rem 0.95rem;
}

.holiday-action-row {
    align-items: flex-end;
}

.special-date-row {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
}

.special-date-add-button {
    margin-left: 0 !important;
    align-self: center;
}

/* Notifications accordion: restore colored left accents per option card. */
.notifications-accordion .notifications-accordion-item {
    border-left: 4px solid #cbd5e1;
    border-radius: 12px;
}

.notifications-accordion .notifications-accordion-item-sms {
    border-left-color: #60a5fa;
}

.notifications-accordion .notifications-accordion-item-mobile {
    border-left-color: #22c55e;
}

.notifications-accordion .notifications-accordion-item-printer {
    border-left-color: #f59e0b;
}

/* Voice page description tone should match instruction page muted text. */
.voice-page .voice-description-text {
    color: #64748b;
}

.voice-page .mud-text-secondary.text-undo-description,
.voice-page .mud-text-secondary.text-undo-counter {
    color: #64748b !important;
}

.voice-page .text-undo-example-button {
    color: #0f766e !important;
}

.provider-brand-btn {
    min-height: 44px;
    border-radius: 12px !important;
    border: 1px solid #d0d7de !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: none !important;
}

.provider-brand-btn:hover {
    filter: brightness(0.98);
}

.provider-brand-btn.provider-brand-btn--square {
    border-color: #111111 !important;
    color: #111111 !important;
}

.provider-brand-btn.provider-brand-btn--clover {
    border-color: #2f9e44 !important;
    color: #1f6f2f !important;
}

.provider-brand-btn.provider-brand-btn--toast {
    border-color: #f97316 !important;
    color: #9a3412 !important;
}

.provider-brand-btn.provider-brand-btn--google {
    border-color: #34a853 !important;
    color: #19663a !important;
}

.provider-brand-btn.provider-brand-btn--outlook {
    border-color: #0078d4 !important;
    color: #0b4a7a !important;
}

.provider-brand-btn.provider-brand-btn--calendly {
    border-color: #006bff !important;
    color: #0052cc !important;
}

.provider-brand-logo {
    width: 22px;
    height: 22px;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
}

.provider-brand-btn.provider-brand-btn--calendly .provider-brand-logo {
    width: 30px;
    height: 30px;
}

.provider-brand-check {
    font-size: 22px !important;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .text-undo-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-shell {
        padding: 6px;
    }

    .special-date-row {
        flex-wrap: wrap;
    }
}
