/* Form components share geometry and states. Theme colors come from --app-* only. */
.app-shell .app-card {
    padding: 28px; background: var(--app-surface); color: var(--app-text);
    border: 0; border-radius: var(--app-radius); box-shadow: var(--app-shadow);
}
:root { --app-width-compact: 480px; --app-width-standard: 640px; --app-width-wide: 1024px; }
.app-shell :is(.app-width-compact, .app-width-standard, .app-width-wide) { width: 100%; min-width: 0; margin-inline: auto; }
.app-shell .app-width-compact { max-width: var(--app-width-compact); }
.app-shell .app-width-standard { max-width: var(--app-width-standard); }
.app-shell .app-width-wide { max-width: var(--app-width-wide); }
.profile-page-header { display: grid; gap: 10px; padding-bottom: 20px; }
/* Wrap whole actions according to their labels and container, not viewport breakpoints. */
.app-shell .app-form-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 16px; }
.app-shell .app-form-actions > :is(button, a) { flex: 1 1 auto; width: auto; max-width: 100%; min-width: min-content; white-space: normal; overflow-wrap: normal; word-break: normal; }
.profile-page-header .profile-page-title { margin: 0 !important; }
.profile-page-description { max-width: 720px; margin-inline: auto; color: var(--app-muted); font-size: 14px; line-height: 1.6; text-align: center; }
.profile-parent-link { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; padding: 6px 10px; margin-left: -10px; border-radius: var(--app-control-radius); color: var(--app-link); font-size: 14px; }
.profile-parent-link > span { min-width: 0; overflow-wrap: anywhere; }
.profile-parent-link > i { flex-shrink: 0; }
.profile-parent-link:hover { background: var(--app-hover); }
.profile-page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.profile-home > .profile-qr-action { width: 100%; max-width: 360px; padding: 12px 0 4px; }
.profile-qr-action > .app-button { width: 100%; }
.profile-qr-action > p { margin: 8px 0 0; color: var(--app-muted); font-size: 13px; line-height: 1.5; }
.security-event-details { margin-top: 10px; color: var(--app-muted); font-size: 13px; }
.security-event-details summary { cursor: pointer; width: fit-content; max-width: 100%; padding: 4px 8px; margin-left: -8px; border-radius: var(--app-control-radius); color: var(--app-link); }
.security-event-details summary:hover { background: var(--app-hover); }
.security-event-details p { padding: 12px; border-radius: var(--app-control-radius); background: var(--app-surface-alt); overflow-wrap: anywhere; }
.security-activity-list > .security-event:first-child { border-top: 0; margin-top: 0; }
.profile-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; color: var(--app-muted); font-size: 13px; }
.profile-pagination-links { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.app-shell .app-input {
    display: block; min-height: 46px; min-width: 0; max-width: 100%; padding: 10px 16px;
    border: 1px solid var(--app-field-border); border-radius: var(--app-control-radius);
    background: var(--app-field); color: var(--app-text); line-height: 24px;
    transition: background-color var(--app-transition), border-color var(--app-transition);
}
.app-shell .app-input::placeholder { color: var(--app-muted); opacity: 1; }
.app-shell .app-input:hover:not(:disabled):not([readonly]) { border-color: var(--app-focus); }
.app-shell .app-input:focus-visible { outline: var(--app-focus-ring); outline-offset: var(--app-focus-offset); box-shadow: none; }
.app-shell .app-input[readonly], .app-shell .app-input:disabled { background: var(--app-surface-alt); }
.app-shell .app-input:disabled { opacity: var(--app-disabled-opacity); cursor: not-allowed; }
.app-shell .app-input:is(.input-validation-error, [aria-invalid="true"]) { border-color: var(--app-danger); }
.app-shell .app-input:is(.input-validation-error, [aria-invalid="true"]):focus-visible { outline-color: var(--app-danger); }
.app-shell .password-field > .app-input { padding-right: 48px; }
.app-shell select.app-input { appearance: auto; padding-right: 12px; }
.app-shell textarea.app-input { resize: vertical; }
.app-shell input.app-input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }
.app-shell .app-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; min-width: 0; padding: 10px 16px; border: 1px solid transparent;
    border-radius: var(--app-control-radius); font-weight: 600; line-height: 22px;
    text-align: center; text-decoration: none; overflow-wrap: normal;
    transition: background-color var(--app-transition), border-color var(--app-transition), color var(--app-transition);
}
.app-shell .app-button-primary { background: var(--app-primary); color: var(--app-on-action); }
.app-shell .app-button-primary:hover:not(:disabled) { background: var(--app-primary-hover); color: var(--app-on-action); }
.app-shell .app-button-primary:active:not(:disabled) { background: var(--app-primary-hover); filter: brightness(.92); }
.app-shell .app-button-secondary { background: var(--app-surface-alt); border-color: transparent; color: var(--app-text); }
.app-shell .app-button-secondary:hover:not(:disabled) { background: var(--app-hover); }
.app-shell .app-button-secondary:active:not(:disabled) { background: var(--app-hover); }
.app-shell .app-button:focus-visible { outline: var(--app-focus-ring); outline-offset: var(--app-focus-offset); }
.app-shell .app-button:disabled { opacity: var(--app-disabled-opacity); cursor: not-allowed; }
.app-settings-list { display: grid; }
.app-setting-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 0;
}
.app-setting-row + .app-setting-row { border-top: 1px solid var(--app-border); }
.app-setting-row:first-child { padding-top: 0; }
.app-setting-content { min-width: 0; flex: 1; }
.app-setting-label { font-size: 13px; color: var(--app-muted); margin-bottom: 4px; }
.app-setting-value { color: var(--app-text); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.app-shell .app-setting-action { font-size: 13px; font-weight: 500; flex-shrink: 0; max-width: 50%; border-color: transparent; color: var(--app-link); }
.app-choice-row {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px;
    border-radius: var(--app-control-radius);
    background: transparent; color: var(--app-text); cursor: pointer;
    transition: background-color var(--app-transition), border-color var(--app-transition);
}
.app-choice-row > input { flex-shrink: 0; }
.app-choice-row > div { min-width: 0; overflow-wrap: anywhere; }
.app-choice-row:hover:not(.app-choice-row-fixed) { background: var(--app-hover); }
.app-choice-row:focus-within { outline: var(--app-focus-ring); outline-offset: var(--app-focus-offset); }
.app-choice-row-fixed { cursor: default; }
.client-list-page { container-type: inline-size; }
.client-list-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.client-list-filters { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(120px, auto) minmax(140px, auto) auto; align-items: end; gap: 12px; flex: 1 1 680px; min-width: 0; }
.client-list-filters > div { min-width: 0; }
@container (max-width: 700px) {
    .client-list-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-list-search, .client-list-filters > button { grid-column: 1 / -1; }
}
.client-list-filters label { display: block; font-size: 13px; color: var(--app-muted); margin-bottom: 6px; }
.client-list-create { margin-left: auto; }
.client-list-reset { display: inline-block; margin-bottom: 16px; color: var(--app-link); }
.client-list { list-style: none; padding: 0; margin: 0; border: 0; border-radius: var(--app-radius); background: var(--app-surface); overflow: hidden; }
.client-list > li + li { border-top: 1px solid var(--app-border); }
.client-list-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 12px; align-items: center; gap: 16px; padding: 18px 20px; color: var(--app-text); text-decoration: none; }
.client-list-row:hover { background: var(--app-hover); }
.app-shell .client-list-row:focus-visible { outline-offset: -3px; background: var(--app-hover); }
.client-list-avatar { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--app-control-radius); background: var(--app-surface-alt); font-weight: 600; overflow: hidden; }
.client-list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.client-list-details { min-width: 0; }
.client-list-name { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.client-list-date { display: block; margin-top: 4px; color: var(--app-muted); font-size: 13px; }
.client-list-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; overflow-wrap: anywhere; }
.client-list-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.client-list-status.is-active { color: var(--app-success); }
.client-list-status.is-inactive { color: var(--app-muted); }
.client-list-chevron { font-size: 12px; color: var(--app-muted); }
.client-list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 13px; color: var(--app-muted); }
.client-list-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.client-list-empty { padding: 40px 24px; border: 0; border-radius: var(--app-radius); background: var(--app-surface); color: var(--app-muted); text-align: center; }
@media (max-width: 767px) {
    .client-list-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .client-list-search, .client-list-filters > button { grid-column: 1 / -1; }
    .client-list-row { grid-template-columns: 40px minmax(0, 1fr) 12px; gap: 8px 12px; padding: 16px; }
    .client-list-avatar { grid-column: 1; grid-row: 1; align-self: start; }
    .client-list-details { grid-column: 2; grid-row: 1; }
    .client-list-chevron { grid-column: 3; grid-row: 1; }
    .client-list-status { grid-column: 2; grid-row: 2; justify-self: start; }
}
@media (max-width: 767px) {
    .app-shell .app-card { padding: 24px 20px; }
}
@media (max-width: 480px) {
    .app-setting-row { align-items: flex-start; flex-direction: column; gap: 12px; }
    .app-shell .app-setting-action { max-width: 100%; align-self: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
    .app-shell :is(.app-input, .app-button, .app-choice-row) { transition: none; }
}
