/**
 * PH Transporte — layout base (funciona sem Vite / Tailwind).
 */
:root {
    --ph-red: #c8102e;
    --ph-red-bright: #ed1c24;
    --ph-red-dark: #9b0c24;
    --ph-black: #1a1a1b;
    --ph-gray: #333333;
    --ph-muted: #6b6b6b;
    --ph-line: #e8e8ea;
    --ph-surface: #f5f5f6;
    --ph-card-radius: 12px;
    --ph-input-radius: 8px;
}

.ph-root {
    margin: 0;
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ph-root--guest {
    min-height: 100vh;
    color: var(--ph-black);
    background-color: #f0f0f2;
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgb(200 16 46 / 0.07), transparent 55%),
        linear-gradient(180deg, #fafafa 0%, #f0f0f2 40%, #ececef 100%);
}

.ph-auth-frame {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.ph-auth-wrap {
    width: 100%;
    max-width: 26.5rem;
    margin: 0 auto;
}

.ph-auth-back-row {
    margin-bottom: 1.25rem;
    text-align: center;
}

.ph-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ph-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.ph-auth-back:hover {
    color: var(--ph-red);
}

.ph-auth-card {
    position: relative;
    border-radius: var(--ph-card-radius);
    background: #fff;
    box-shadow:
        0 4px 6px -1px rgb(26 26 27 / 0.06),
        0 12px 24px -4px rgb(26 26 27 / 0.08),
        0 0 0 1px rgb(26 26 27 / 0.04);
    overflow: hidden;
    box-sizing: border-box;
}

.ph-auth-accent {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--ph-red-dark) 0%, var(--ph-red) 45%, var(--ph-red-bright) 100%);
}

.ph-auth-card-inner {
    padding: 2rem 2rem 2.25rem;
    box-sizing: border-box;
}

@media (min-width: 40rem) {
    .ph-auth-card-inner {
        padding: 2.25rem 2.5rem 2.5rem;
    }
}

.ph-auth-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.ph-auth-logo {
    height: 5.5rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

@media (min-width: 40rem) {
    .ph-auth-logo {
        height: 6.25rem;
    }
}

.ph-auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ph-black);
    text-align: center;
}

.ph-auth-subtitle {
    margin: 0 0 1.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ph-muted);
    text-align: center;
}

.ph-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.125rem;
}

.ph-auth-field {
    margin: 0;
}

.ph-auth-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ph-gray);
}

.ph-auth-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--ph-input-radius);
    border: 1px solid var(--ph-line);
    background: #fafafa;
    padding: 0.75rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--ph-black);
    font-family: inherit;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.ph-auth-input:hover {
    border-color: #d0d0d4;
    background: #fff;
}

.ph-auth-input:focus {
    outline: none;
    border-color: var(--ph-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgb(200 16 46 / 0.12);
}

.ph-auth-input::placeholder {
    color: #a3a3a8;
}

.ph-auth-error {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ph-red);
}

.ph-auth-remember {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
    margin-top: 0.125rem;
}

.ph-auth-checkbox {
    width: 1.0625rem;
    height: 1.0625rem;
    accent-color: var(--ph-red);
    cursor: pointer;
}

.ph-auth-remember span {
    color: var(--ph-muted);
}

.ph-auth-submit {
    margin-top: 0.5rem;
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--ph-input-radius);
    background: linear-gradient(180deg, var(--ph-red-bright) 0%, var(--ph-red) 100%);
    padding: 0.8125rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 4px rgb(200 16 46 / 0.25);
    transition:
        filter 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
}

.ph-auth-submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgb(200 16 46 / 0.3);
}

.ph-auth-submit:active {
    transform: translateY(1px);
    filter: brightness(0.96);
}

.ph-auth-foot {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ph-line);
    text-align: center;
}

.ph-auth-foot p {
    margin: 0;
    font-size: 0.75rem;
    color: #9a9a9f;
    line-height: 1.45;
}

.ph-auth-foot strong {
    color: var(--ph-muted);
    font-weight: 600;
}

/* App shell */
.ph-root--app {
    min-height: 100vh;
    background: var(--ph-surface);
    color: var(--ph-black);
}

.ph-app-header {
    border-bottom: 1px solid var(--ph-line);
    background: #fff;
    box-shadow: 0 1px 0 rgb(26 26 27 / 0.04);
}

.ph-app-header-inner {
    margin: 0 auto;
    max-width: 56rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    box-sizing: border-box;
}

.ph-app-header a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.ph-app-logo {
    height: 2.5rem;
    width: auto;
    object-fit: contain;
}

.ph-app-logout {
    border-radius: var(--ph-input-radius);
    border: 1px solid var(--ph-line);
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--ph-gray);
    background: #fff;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease,
        background 0.15s ease;
}

.ph-app-logout:hover {
    border-color: var(--ph-red);
    color: var(--ph-red);
    background: rgb(200 16 46 / 0.04);
}

.ph-app-main {
    margin: 0 auto;
    max-width: 56rem;
    padding: 2.5rem 1.5rem;
    box-sizing: border-box;
}

.ph-dash-title {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ph-black);
    margin: 0;
}

.ph-dash-lead {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--ph-muted);
}

.ph-dash-lead strong {
    font-weight: 600;
    color: var(--ph-gray);
}

.ph-dash-card {
    margin-top: 1.75rem;
    border-radius: var(--ph-card-radius);
    background: #fff;
    border: 1px solid var(--ph-line);
    padding: 1.5rem 1.75rem;
    box-shadow: 0 1px 3px rgb(26 26 27 / 0.05);
}

.ph-dash-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ph-muted);
    line-height: 1.55;
}

/* ------------------------------------------------------------------------- */
/* Admin shell (sidebar + header) — resources/views/admin/layouts/           */
/* ------------------------------------------------------------------------- */

.ph-admin-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--ph-surface);
    color: var(--ph-black);
}

@media (max-width: 1023.98px) {
    body.ph-scroll-lock {
        overflow: hidden !important;
        overscroll-behavior: none;
        touch-action: none;
    }

    body.ph-scroll-lock .ph-admin-main-column {
        touch-action: none;
    }
}

.ph-admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: min(17.5rem, calc(100vw - 2.5rem));
    max-width: 19rem;
    flex-direction: column;
    border-right: 1px solid var(--ph-line);
    background: #fff;
    box-shadow: 4px 0 24px rgb(26 26 27 / 0.06);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    max-height: 100vh;
    max-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    overscroll-behavior: contain;
}

.ph-sidebar-open .ph-admin-sidebar {
    transform: translateX(0);
}

.ph-admin-sidebar__brand {
    flex-shrink: 0;
    padding: 0.65rem 0.85rem 0.75rem;
    border-bottom: 1px solid var(--ph-line);
}

.ph-admin-sidebar__brand-link {
    display: block;
    text-decoration: none;
}

.ph-admin-sidebar__logo {
    display: block;
    height: 2.4rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.ph-admin-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.55rem 1rem;
    -webkit-overflow-scrolling: touch;
}

.ph-admin-sidebar__group {
    margin-bottom: 0.5rem;
}

.ph-admin-sidebar__group--flat {
    margin-bottom: 0.35rem;
}

.ph-admin-sidebar__group:last-child {
    margin-bottom: 0;
}

.ph-admin-sidebar__group-label {
    margin: 0 0 0.5rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a9a9f;
}

.ph-admin-sidebar__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ph-admin-sidebar__collapsible {
    margin: 0;
}

.ph-admin-sidebar__collapsible-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.05rem 0;
    min-height: 2.35rem;
    padding: 0.3rem 0.5rem;
    list-style: none;
    border-radius: var(--ph-input-radius);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.12s ease;
}

.ph-admin-sidebar__collapsible-summary::-webkit-details-marker {
    display: none;
}

.ph-admin-sidebar__collapsible-summary::marker {
    display: none;
}

.ph-admin-sidebar__collapsible-summary:hover {
    background: var(--ph-surface);
}

.ph-admin-sidebar__collapsible-summary-lead {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.ph-admin-sidebar__collapsible-summary-lead svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--ph-muted);
}

.ph-admin-sidebar__link svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.ph-admin-sidebar__section-head {
    display: flex;
    align-items: center;
    margin: 0 0 0.2rem 0;
    padding: 0.3rem 0.5rem;
    min-height: 2.35rem;
}

.ph-admin-sidebar__collapsible-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    pointer-events: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ph-gray);
    letter-spacing: normal;
    text-transform: none;
}

.ph-admin-sidebar__collapsible-summary::after {
    content: '';
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    margin-right: 0.2rem;
    border-right: 2px solid var(--ph-muted);
    border-bottom: 2px solid var(--ph-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.ph-admin-sidebar__collapsible[open] > .ph-admin-sidebar__collapsible-summary::after {
    transform: rotate(-135deg);
    margin-top: 0.12rem;
}

.ph-admin-sidebar__collapsible[open] > .ph-admin-sidebar__collapsible-summary {
    background: var(--ph-surface);
}

.ph-admin-sidebar__list--submenu {
    margin: 0;
    padding: 0 0 0.15rem 0;
}

.ph-admin-sidebar__list--submenu .ph-admin-sidebar__link {
    padding-left: 1.1rem;
}

.ph-admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.05rem;
    min-height: 2.35rem;
    padding: 0.3rem 0.5rem;
    border-radius: var(--ph-input-radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ph-gray);
    text-decoration: none;
    transition:
        background 0.12s ease,
        color 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.ph-admin-sidebar__link:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: -2px;
}

.ph-admin-sidebar__link:hover {
    background: var(--ph-surface);
    color: var(--ph-black);
}

.ph-admin-sidebar__link.is-active {
    background: rgb(200 16 46 / 0.12);
    color: var(--ph-red);
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--ph-red);
}

.ph-admin-sidebar__link.is-active svg {
    color: var(--ph-red);
}

.ph-admin-sidebar__link--disabled {
    cursor: not-allowed;
    opacity: 0.45;
    pointer-events: none;
}

.ph-admin-main-column {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    min-height: 100vh;
}

.ph-admin-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: nowrap;
    border-bottom: 1px solid var(--ph-line);
    background: rgb(255 255 255 / 0.92);
    padding-top: max(0.6rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.6rem;
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 rgb(26 26 27 / 0.04);
}

.ph-admin-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.5rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    color: var(--ph-gray);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.ph-admin-menu-toggle:hover {
    border-color: var(--ph-red);
    color: var(--ph-red);
}

.ph-admin-menu-toggle:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: 2px;
}

.ph-admin-header__context {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
}

.ph-admin-header__meta {
    min-width: 0;
}

.ph-admin-header__datetime {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: var(--ph-muted);
    text-transform: capitalize;
}

/* Título e trilho ficam em .ph-page-head (área principal), não no header. */
.ph-page-head {
    margin-bottom: 1.5rem;
}

.ph-breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    font-weight: 500;
}

.ph-breadcrumb__item a {
    color: var(--ph-muted);
    text-decoration: none;
    transition: color 0.12s ease;
}

.ph-breadcrumb__item a:hover {
    color: var(--ph-red);
}

.ph-breadcrumb__text {
    color: var(--ph-muted);
}

.ph-breadcrumb__item--current span {
    font-weight: 600;
    color: var(--ph-gray);
}

.ph-breadcrumb__sep {
    color: #c4c4c8;
    user-select: none;
    font-weight: 400;
}

.ph-page-title {
    margin: 0;
    font-size: clamp(1.2rem, 3.2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--ph-black);
}

.ph-admin-header__actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.35rem;
}

.ph-admin-header__dropdown-wrap {
    position: relative;
    z-index: 1;
}

.ph-admin-header__dropdown-wrap:has(.ph-admin-header__dropdown:not([hidden])) {
    z-index: 55;
}

.ph-admin-header__icon-btn {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    min-width: 2.65rem;
    min-height: 2.65rem;
    padding: 0.45rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    color: var(--ph-gray);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease,
        background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.ph-admin-header__icon-btn--notif-alert {
    border-color: rgb(200 16 46 / 0.42);
    background: rgb(200 16 46 / 0.09);
    color: var(--ph-red, #c8102e);
}

.ph-admin-header__icon-btn--notif-alert:hover {
    border-color: var(--ph-red, #c8102e);
    background: rgb(200 16 46 / 0.12);
    color: var(--ph-red-dark, #a00d26);
}

.ph-admin-header__notif-count {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.5625rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    background: var(--ph-red, #c8102e);
    color: #fff;
    box-shadow: 0 0 0 2px #fff;
}

.ph-admin-header__icon-btn:hover {
    border-color: var(--ph-red);
    color: var(--ph-red);
    background: rgb(200 16 46 / 0.04);
}

.ph-admin-header__icon-btn:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: 2px;
}

.ph-admin-header__icon-btn[aria-expanded='true'] {
    border-color: rgb(200 16 46 / 0.45);
    color: var(--ph-red);
    background: rgb(200 16 46 / 0.06);
}

.ph-admin-header__dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: min(17.5rem, calc(100vw - 2rem));
    max-width: 20rem;
    padding: 0.5rem 0;
    border-radius: var(--ph-card-radius);
    border: 1px solid var(--ph-line);
    background: #fff;
    box-shadow:
        0 4px 6px -1px rgb(26 26 27 / 0.08),
        0 12px 24px -4px rgb(26 26 27 / 0.1);
    box-sizing: border-box;
}

/* O painel de notificações usa display:flex; sem isto, [hidden] pode perder na cascata e o menu “não fecha”. */
.ph-admin-header__dropdown[hidden] {
    display: none !important;
}

.ph-admin-header__dropdown--notifications {
    min-width: min(21rem, calc(100vw - 2rem));
    max-width: 22rem;
    max-height: min(32rem, calc(100vh - 5rem));
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.ph-admin-header__notif-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.75rem 1rem 0.6rem;
    border-bottom: 1px solid var(--ph-line);
    flex-shrink: 0;
}

.ph-admin-header__notif-head-title {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ph-gray);
}

.ph-admin-header__notif-head-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ph-muted);
}

.ph-admin-header__notif-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.ph-admin-header__notif-li {
    margin: 0;
    padding: 0;
}

.ph-admin-header__notif-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 1rem 0.7rem;
    margin: 0 0.5rem 0.35rem;
    border-radius: calc(var(--ph-input-radius) + 2px);
    border: 1px solid rgb(0 0 0 / 0.06);
    border-left-width: 4px;
    text-decoration: none;
    color: inherit;
    background: #fafafb;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease;
    box-sizing: border-box;
}

a.ph-admin-header__notif-item:hover {
    background: #fff;
    border-color: rgb(200 16 46 / 0.2);
    box-shadow: 0 2px 8px rgb(26 26 27 / 0.06);
}

.ph-admin-header__notif-item--static {
    cursor: default;
}

.ph-admin-header__notif-item--static:hover {
    box-shadow: none;
    border-color: rgb(0 0 0 / 0.06);
    background: #fafafb;
}

.ph-admin-header__notif-item--critica {
    border-left-color: var(--ph-red, #c8102e);
}

.ph-admin-header__notif-item--alta {
    border-left-color: #ea580c;
}

.ph-admin-header__notif-item--media {
    border-left-color: #22c55e;
}

.ph-admin-header__notif-item-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.5rem;
}

.ph-admin-header__notif-pri {
    margin-left: 0;
}

.ph-admin-header__notif-when {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ph-muted);
    white-space: nowrap;
}

.ph-admin-header__notif-type {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ph-black);
}

.ph-admin-header__notif-entity {
    font-size: 0.75rem;
    color: var(--ph-gray);
    line-height: 1.35;
}

.ph-admin-header__notif-date {
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #9a9a9f;
}

.ph-admin-header__notif-more {
    margin: 0;
    padding: 0.35rem 1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--ph-muted);
    text-align: center;
}

.ph-admin-header__notif-foot {
    flex-shrink: 0;
    border-top: 1px solid var(--ph-line);
    padding: 0;
    background: linear-gradient(180deg, rgb(250 250 251 / 0.95) 0%, #fafafb 100%);
}

.ph-admin-header__notif-foot-link {
    border-radius: 0 0 calc(var(--ph-card-radius) - 1px) calc(var(--ph-card-radius) - 1px);
    font-size: 0.8125rem;
    color: var(--ph-red, #c8102e);
}

.ph-admin-header__notif-foot-link:hover {
    color: var(--ph-red-dark, #a00d26);
}

.ph-admin-header__dropdown-empty {
    margin: 0;
    padding: 1rem 1.1rem;
    font-size: 0.8125rem;
    color: var(--ph-muted);
    line-height: 1.45;
}

.ph-admin-header__dropdown-empty--notif {
    padding: 1rem 1.15rem 1.15rem;
    flex: 1 1 auto;
}

.ph-admin-header__dropdown-meta {
    display: grid;
    gap: 0.2rem 0.5rem;
    padding: 0.35rem 1rem 0.65rem;
}

.ph-admin-header__dropdown-label {
    grid-column: 1;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a9a9f;
}

.ph-admin-header__dropdown-value {
    grid-column: 1;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ph-gray);
    word-break: break-word;
}

.ph-admin-header__dropdown-value:last-child {
    margin-bottom: 0;
}

.ph-admin-header__dropdown-value--email {
    font-weight: 600;
    color: var(--ph-black);
}

.ph-admin-header__dropdown-divider {
    height: 1px;
    margin: 0.25rem 0;
    background: var(--ph-line);
}

.ph-admin-header__dropdown-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    color: var(--ph-gray);
    cursor: pointer;
    transition:
        background 0.12s ease,
        color 0.12s ease;
    box-sizing: border-box;
}

a.ph-admin-header__dropdown-item:hover,
.ph-admin-header__dropdown-item:hover {
    background: var(--ph-surface);
    color: var(--ph-black);
}

.ph-admin-header__dropdown-item--button {
    color: var(--ph-red);
}

.ph-admin-header__dropdown-item--button:hover {
    background: rgb(200 16 46 / 0.06);
    color: var(--ph-red-dark);
}

.ph-admin-header__dropdown-form {
    margin: 0;
}

.ph-admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgb(26 26 27 / 0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.ph-sidebar-open .ph-admin-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.ph-admin-sidebar-backdrop[hidden] {
    display: none;
}

.ph-sidebar-open .ph-admin-sidebar-backdrop {
    display: block;
}

.ph-admin-main {
    flex: 1;
    width: 100%;
    max-width: 100%;
    padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) max(1.25rem, calc(0.75rem + env(safe-area-inset-bottom, 0px)))
        max(1rem, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .ph-admin-main {
        padding-top: 1.5rem;
        padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
        padding-bottom: max(1.5rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
    }
}

.ph-admin-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--ph-line);
    background: rgb(255 255 255 / 0.97);
    padding: 0.55rem max(1rem, env(safe-area-inset-right, 0px)) max(0.65rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
    text-align: center;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .ph-admin-footer {
        padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
        padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
    }
}

.ph-admin-footer__text {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ph-muted);
    letter-spacing: 0.02em;
}

@media (min-width: 1024px) {
    /* Viewport fixo: sidebar encostada à esquerda; só a coluna principal faz scroll. */
    .ph-admin-shell {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .ph-admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 50;
        width: 17.5rem;
        max-width: 17.5rem;
        flex-shrink: 0;
        transform: none;
        box-shadow: none;
        border-right: 1px solid var(--ph-line);
    }

    .ph-admin-menu-toggle {
        display: none;
    }

    .ph-admin-sidebar-backdrop {
        display: none !important;
    }

    .ph-sidebar-open .ph-admin-sidebar {
        transform: none;
    }

    .ph-admin-main-column {
        display: flex;
        width: calc(100% - 17.5rem);
        min-width: 0;
        min-height: 0;
        flex: 1;
        flex-direction: column;
        margin-left: 17.5rem;
    }

    .ph-admin-header {
        flex-shrink: 0;
    }

    .ph-admin-main {
        flex: 1;
        min-height: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Module placeholder */
.ph-placeholder-card {
    max-width: none;
}

.ph-placeholder-card__badge {
    display: inline-block;
    margin: 0 0 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgb(200 16 46 / 0.1);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ph-red);
}

.ph-placeholder-card__heading {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ph-black);
}

.ph-placeholder-card__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--ph-muted);
}

.ph-placeholder-card__code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    background: var(--ph-surface);
    font-size: 0.8125rem;
    color: var(--ph-gray);
}

/* ------------------------------------------------------------------------- */
/* Dashboard operacional                                                     */
/* ------------------------------------------------------------------------- */

.ph-ops-dash {
    width: 100%;
    max-width: none;
    margin: 0;
}

.ph-ops-dash__intro {
    margin-bottom: 1.75rem;
}

.ph-ops-dash__heading {
    margin: 0 0 0.5rem;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ph-black);
}

.ph-ops-dash__lead {
    margin: 0 0 0.75rem;
    max-width: none;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--ph-muted);
}

.ph-ops-dash__session {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ph-muted);
}

.ph-ops-dash__session strong {
    color: var(--ph-gray);
    font-weight: 600;
    word-break: break-all;
}

.ph-ops-dash__section {
    margin-bottom: 2rem;
}

.ph-ops-dash__section--quick {
    margin-bottom: 1.75rem;
}

.ph-ops-dash__section--activity {
    margin-bottom: 0;
}

.ph-ops-dash__section--flush {
    margin-bottom: 0;
}

.ph-ops-dash__middle {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: start;
}

@media (min-width: 900px) {
    .ph-ops-dash__middle {
        grid-template-columns: 1fr 1fr;
        gap: 1.75rem;
    }
}

.ph-ops-dash__section--muted {
    margin-bottom: 0;
}

.ph-ops-dash__section-title {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a9a9f;
}

.ph-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .ph-kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .ph-kpi-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.ph-kpi-card {
    margin: 0;
    min-width: 0;
}

.ph-kpi-card__inner,
.ph-kpi-card__link {
    display: flex;
    height: 100%;
    min-height: 6.5rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 1rem 1.1rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-card-radius);
    background: #fff;
    box-shadow: 0 1px 2px rgb(26 26 27 / 0.04);
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.ph-kpi-card__link:hover {
    border-color: rgb(200 16 46 / 0.35);
    box-shadow: 0 4px 12px rgb(26 26 27 / 0.06);
}

.ph-kpi-card__link:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: 2px;
}

.ph-kpi-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ph-black);
    line-height: 1.1;
}

.ph-kpi-card__label {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ph-gray);
}

.ph-kpi-card__hint {
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #9a9a9f;
}

/* Manutenção: resumo por prioridade (alertas) e por estado (registos) */
.ph-kpi-grid--maint-summary {
    margin-bottom: 1.15rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.25rem), 1fr));
}

@media (min-width: 640px) {
    .ph-kpi-grid--maint-summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .ph-kpi-grid--maint-records {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .ph-kpi-grid--maint-records {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ph-kpi-card__inner--maint-priority,
.ph-kpi-card__inner--maint-record {
    min-height: 5.75rem;
}

.ph-kpi-card__inner--maint-priority-critica {
    border-left: 4px solid var(--ph-red, #c8102e);
    background: linear-gradient(90deg, rgb(200 16 46 / 0.06) 0%, #fff 48%);
}

.ph-kpi-card__inner--maint-priority-alta {
    border-left: 4px solid #ca8a04;
    background: linear-gradient(90deg, rgb(202 138 4 / 0.08) 0%, #fff 48%);
}

.ph-kpi-card__inner--maint-priority-media {
    border-left: 4px solid #15803d;
    background: linear-gradient(90deg, rgb(21 128 61 / 0.07) 0%, #fff 48%);
}

.ph-kpi-card__inner--maint-record-scheduled {
    border-left: 4px solid #2563eb;
    background: linear-gradient(90deg, rgb(37 99 235 / 0.07) 0%, #fff 45%);
}

.ph-kpi-card__inner--maint-record-open {
    border-left: 4px solid #ca8a04;
    background: linear-gradient(90deg, rgb(202 138 4 / 0.06) 0%, #fff 45%);
}

.ph-kpi-card__inner--maint-record-resolved {
    border-left: 4px solid #15803d;
    background: linear-gradient(90deg, rgb(21 128 61 / 0.07) 0%, #fff 45%);
}

.ph-kpi-card__inner--maint-record-total {
    border-left: 4px solid var(--ph-line);
    background: #fff;
}

.ph-quick-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 520px) {
    .ph-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ph-quick-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

.ph-quick-card {
    position: relative;
    display: flex;
    min-height: 5.5rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 1.1rem 2.25rem 1.1rem 1.1rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-card-radius);
    background: #fff;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgb(26 26 27 / 0.04);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.ph-quick-card:hover {
    border-color: rgb(200 16 46 / 0.3);
    box-shadow: 0 4px 14px rgb(26 26 27 / 0.07);
}

.ph-quick-card:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: 2px;
}

.ph-quick-card__title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ph-black);
}

.ph-quick-card__desc {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--ph-muted);
    line-height: 1.4;
}

.ph-quick-card__arrow {
    position: absolute;
    top: 50%;
    right: 1rem;
    font-size: 1.125rem;
    color: var(--ph-red);
    transform: translateY(-50%);
}

.ph-ops-empty {
    padding: 1.25rem 1.35rem;
    border: 1px dashed var(--ph-line);
    border-radius: var(--ph-card-radius);
    background: rgb(255 255 255 / 0.6);
}

.ph-ops-empty p {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--ph-muted);
}

.ph-ops-empty p:last-child {
    margin-bottom: 0;
}

.ph-ops-empty__link {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ph-red);
    text-decoration: none;
}

.ph-ops-empty__link:hover {
    text-decoration: underline;
}

.ph-ops-demo-banner {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgb(200 16 46 / 0.22);
    border-radius: var(--ph-card-radius);
    background: rgb(200 16 46 / 0.06);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--ph-gray);
}

.ph-ops-demo-banner strong {
    color: var(--ph-black);
    font-weight: 600;
}

.ph-ops-demo-banner__dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: var(--ph-red);
}

.ph-ops-dash__meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: var(--ph-surface);
}

.ph-ops-dash__meta-line {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--ph-muted);
}

.ph-ops-dash__meta-line strong {
    color: var(--ph-gray);
    font-weight: 600;
}

.ph-ops-dash__meta-k {
    display: inline-block;
    min-width: 4.5rem;
    margin-right: 0.35rem;
    font-weight: 600;
    color: #9a9a9f;
}

.ph-kpi-card__trend {
    display: inline-block;
    margin-top: 0.2rem;
    margin-bottom: 0.1rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ph-kpi-card__trend--up {
    background: rgb(22 101 52 / 0.1);
    color: #166534;
}

.ph-kpi-card__trend--down {
    background: rgb(200 16 46 / 0.1);
    color: var(--ph-red-dark);
}

.ph-kpi-card__trend--neutral {
    background: var(--ph-surface);
    color: var(--ph-muted);
    font-weight: 600;
}

.ph-ops-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: 0.65rem;
}

.ph-ops-stat-pill {
    padding: 0.85rem 1rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    box-shadow: 0 1px 2px rgb(26 26 27 / 0.04);
}

.ph-ops-stat-pill__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ph-black);
    line-height: 1.15;
}

.ph-ops-stat-pill__label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ph-gray);
    line-height: 1.3;
}

.ph-ops-stat-pill__sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.6875rem;
    color: #9a9a9f;
}

.ph-ops-dash__columns {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 960px) {
    .ph-ops-dash__columns {
        grid-template-columns: 1fr min(20rem, 32%);
    }
}

.ph-ops-dash__main {
    min-width: 0;
}

.ph-ops-dash__aside {
    min-width: 0;
}

.ph-ops-activity {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-card-radius);
    background: #fff;
    overflow: hidden;
}

.ph-ops-activity__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.65rem 0.75rem;
    align-items: start;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ph-line);
}

.ph-ops-activity__item:last-child {
    border-bottom: none;
}

.ph-ops-activity__time {
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #9a9a9f;
    white-space: nowrap;
}

.ph-ops-activity__text {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--ph-gray);
}

.ph-ops-activity__tag {
    justify-self: end;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--ph-surface);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ph-muted);
}

.ph-ops-activity__primary {
    display: block;
    font-weight: 600;
    color: var(--ph-gray);
}

.ph-ops-activity__sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ph-muted);
}

.ph-ops-activity__item--dl-warn {
    border-left: 3px solid #ca8a04;
    padding-left: calc(1rem - 3px);
}

.ph-ops-activity__item--dl-info {
    border-left: 3px solid rgb(154 154 159 / 0.65);
    padding-left: calc(1rem - 3px);
}

.ph-ops-activity__item--empty {
    display: block;
    grid-column: 1 / -1;
    border-bottom: none;
}

.ph-ops-dash__footnote {
    margin: 0.65rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #9a9a9f;
}

.ph-ops-deadlines {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ph-ops-deadlines__item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    margin-bottom: 0.5rem;
}

.ph-ops-deadlines__item:last-child {
    margin-bottom: 0;
}

.ph-ops-deadlines__item--warn {
    border-left: 3px solid #ca8a04;
}

.ph-ops-deadlines__item--info {
    border-left: 3px solid var(--ph-muted);
}

.ph-ops-deadlines__date {
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ph-red);
}

.ph-ops-deadlines__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ph-gray);
}

.ph-ops-deadlines__ref {
    font-size: 0.6875rem;
    color: var(--ph-muted);
}

.ph-ops-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ph-ops-alert {
    display: block;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

a.ph-ops-alert:hover {
    border-color: rgb(200 16 46 / 0.35);
    box-shadow: 0 2px 10px rgb(26 26 27 / 0.06);
}

.ph-ops-alert--danger {
    border-color: rgb(200 16 46 / 0.35);
    background: rgb(200 16 46 / 0.05);
}

.ph-ops-alert--warn {
    border-color: rgb(202 138 4 / 0.45);
    background: rgb(254 252 232 / 0.8);
}

.ph-ops-alert--info {
    border-color: var(--ph-line);
    background: var(--ph-surface);
}

.ph-ops-alert__title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ph-black);
}

.ph-ops-alert__body {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--ph-muted);
}

.ph-ops-alert__action {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ph-red);
}

@media (max-width: 640px) {
    .ph-ops-activity__item:not(.ph-ops-activity__item--empty) {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .ph-ops-activity__tag {
        justify-self: start;
    }
}

/* ------------------------------------------------------------------------- */
/* CRUD (utilizadores, perfis, auditoria)                                      */
/* ------------------------------------------------------------------------- */

.ph-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ph-muted {
    color: var(--ph-muted);
    font-size: 0.875rem;
}

.ph-crud-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ph-crud-lead {
    margin: 0;
    max-width: none;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--ph-muted);
}

.ph-crud-card {
    border-radius: var(--ph-card-radius);
    background: #fff;
    border: 1px solid var(--ph-line);
    padding: 1.25rem 1.35rem;
    box-shadow: 0 1px 3px rgb(26 26 27 / 0.05);
    box-sizing: border-box;
}

.ph-crud-card--form {
    max-width: none;
}

.ph-crud-card--filter {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
}

/* Painel de filtros colapsável (largura total da área de conteúdo) */
.ph-filter-panel {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 1rem;
    border-radius: var(--ph-card-radius);
    background: #fff;
    border: 1px solid var(--ph-line);
    box-shadow: 0 1px 3px rgb(26 26 27 / 0.05);
}

.ph-filter-panel__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.25rem 1.05rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    list-style: none;
    color: var(--ph-black);
    box-sizing: border-box;
}

.ph-filter-panel__summary::-webkit-details-marker {
    display: none;
}

.ph-filter-panel__summary-lead {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
}

.ph-filter-panel__icon {
    flex-shrink: 0;
    color: var(--ph-red);
    opacity: 0.9;
}

.ph-filter-panel__summary:hover .ph-filter-panel__icon {
    opacity: 1;
}

.ph-filter-panel__summary-text {
    text-align: left;
}

.ph-filter-panel__summary::after {
    content: "";
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    margin-top: -0.2rem;
    border-right: 2px solid var(--ph-muted);
    border-bottom: 2px solid var(--ph-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.ph-filter-panel[open] .ph-filter-panel__summary::after {
    margin-top: 0.15rem;
    transform: rotate(-135deg);
}

.ph-filter-panel__inner {
    padding: 1.15rem 1.35rem 1.35rem;
    border-top: 1px solid var(--ph-line);
}

.ph-filter-panel__inner .ph-filter-form__grid {
    margin-top: 0.15rem;
}

.ph-filter-panel__inner .ph-filter-form__actions {
    margin-top: 1.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgb(0 0 0 / 0.06);
}

/* Modal de confirmação (eliminações, etc.) */
body.ph-modal-open {
    overflow: hidden;
}

.ph-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.ph-modal[hidden] {
    display: none !important;
}

.ph-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
    cursor: pointer;
}

.ph-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 26rem);
    max-height: min(90vh, 32rem);
    overflow: auto;
    padding: 1.35rem 1.4rem 1.25rem;
    border-radius: var(--ph-card-radius);
    background: #fff;
    border: 1px solid var(--ph-line);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
    box-sizing: border-box;
}

.ph-modal__title {
    margin: 0 0 0.65rem;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ph-black);
    letter-spacing: -0.02em;
}

.ph-modal__message {
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ph-gray);
}

.ph-modal__message[hidden] {
    display: none !important;
}

.ph-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.ph-modal__confirm-btn--danger {
    background: var(--ph-red);
    border-color: var(--ph-red-dark);
    color: #fff;
}

.ph-modal__confirm-btn--danger:hover {
    filter: brightness(1.06);
    color: #fff;
}

.ph-crud-card--vehicle-fleet {
    padding: 1.35rem 1.25rem 1.15rem;
}

/* Carrinhas — grelha de cartões */
.ph-vehicle-fleet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
    gap: 1.15rem;
    margin-bottom: 1.1rem;
}

@media (min-width: 900px) {
    .ph-vehicle-fleet {
        grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr));
        gap: 1.35rem;
    }
}

.ph-vehicle-card {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-width: 0;
    border: 1px solid var(--ph-line);
    border-radius: calc(var(--ph-card-radius) + 2px);
    background: #fff;
    box-shadow: 0 1px 2px rgb(26 26 27 / 0.04);
    overflow: hidden;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.ph-vehicle-card:hover {
    border-color: rgb(200 16 46 / 0.22);
    box-shadow: 0 8px 28px rgb(26 26 27 / 0.08);
    transform: translateY(-2px);
}

.ph-vehicle-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(145deg, #f4f4f6 0%, #e8e8ec 55%, #f0f0f3 100%);
}

.ph-vehicle-card__media--no-photo {
    background: #fff;
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.05);
}

.ph-vehicle-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ph-vehicle-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.ph-vehicle-card__media--no-photo .ph-vehicle-card__placeholder {
    color: var(--ph-red, #c8102e);
}

.ph-vehicle-card__media--no-photo .ph-vehicle-card__placeholder-svg {
    opacity: 1;
}

.ph-vehicle-card__media-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgb(0 0 0 / 0.55) 100%);
    pointer-events: none;
}

.ph-vehicle-card__media--no-photo .ph-vehicle-card__media-shade {
    display: none;
}

.ph-vehicle-card__plate-overlay {
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.65rem;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 1px 3px rgb(0 0 0 / 0.45);
    line-height: 1.2;
}

.ph-vehicle-card__media--no-photo .ph-vehicle-card__plate-overlay {
    color: var(--ph-red, #c8102e);
    text-shadow: none;
}

.ph-vehicle-card__body {
    flex: 1 1 auto;
    padding: 1rem 1rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.ph-vehicle-card__code {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #9a9a9f;
}

.ph-vehicle-card__badge {
    align-self: flex-start;
    margin-left: 0;
}

.ph-vehicle-card__badge--neutral {
    display: inline-block;
    margin-left: 0;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--ph-surface);
    color: var(--ph-muted);
}

.ph-vehicle-card__title {
    margin: 0.15rem 0 0;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ph-black);
    letter-spacing: -0.01em;
}

.ph-vehicle-card__assign {
    margin: 0.35rem 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.8125rem;
}

.ph-vehicle-maintenance-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
}

.ph-vehicle-card__meta {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ph-gray);
}

.ph-vehicle-card__meta-sep {
    margin: 0 0.25rem;
    color: var(--ph-muted);
}

.ph-vehicle-card__docs {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0.55rem 0 0;
    border-top: 1px solid rgb(0 0 0 / 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ph-vehicle-card__doc-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.ph-vehicle-card__doc-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.ph-vehicle-card__doc-dot--critica {
    background: var(--ph-red, #c8102e);
    box-shadow: 0 0 0 2px rgb(200 16 46 / 0.2);
}

.ph-vehicle-card__doc-dot--alta {
    background: #ea580c;
    box-shadow: 0 0 0 2px rgb(234 88 12 / 0.22);
}

.ph-vehicle-card__doc-dot--media {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgb(34 197 94 / 0.2);
}

.ph-vehicle-card__doc-dot--empty {
    background: var(--ph-line);
}

.ph-vehicle-card__doc-label {
    color: var(--ph-gray);
    font-weight: 600;
    min-width: 0;
}

.ph-vehicle-card__doc-date {
    font-variant-numeric: tabular-nums;
    color: var(--ph-muted);
    font-weight: 500;
}

.ph-vehicle-card__footer {
    margin-top: auto;
    padding: 0.65rem 0.85rem 0.85rem;
    border-top: 1px solid rgb(0 0 0 / 0.06);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: linear-gradient(180deg, rgb(250 250 251 / 0.9) 0%, #fafafb 100%);
}

.ph-vehicle-card__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ph-vehicle-card__action {
    margin: 0;
}

.ph-vehicle-card__no-actions {
    font-size: 0.875rem;
}

.ph-vehicle-fleet__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border: 1px dashed var(--ph-line);
    border-radius: var(--ph-card-radius);
    background: var(--ph-surface, #fafafa);
}

.ph-vehicle-fleet__empty-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ph-black);
}

.ph-vehicle-fleet__empty-text {
    margin: 0 0 1.1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ph-gray);
    max-width: 26rem;
    margin-left: auto;
    margin-right: auto;
}

.ph-vehicle-fleet__empty-btn {
    min-height: 2.5rem;
}

.ph-crud-flash {
    margin-bottom: 1.25rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--ph-input-radius);
    border: 1px solid var(--ph-line);
}

.ph-crud-flash--success {
    background: rgb(34 197 94 / 0.08);
    border-color: rgb(34 197 94 / 0.35);
}

.ph-crud-flash--error {
    background: rgb(200 16 46 / 0.06);
    border-color: rgb(200 16 46 / 0.3);
}

.ph-crud-flash__text {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ph-gray);
}

.ph-crud-flash__text:last-child {
    margin-bottom: 0;
}

/* Toasts (session flash) — canto superior direito */
.ph-toast-stack {
    position: fixed;
    top: max(0.65rem, env(safe-area-inset-top, 0px));
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    z-index: 100;
    display: flex;
    width: min(calc(100vw - 1.3rem), 22rem);
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    pointer-events: none;
    box-sizing: border-box;
}

.ph-toast {
    --ph-toast-ms: 6.5s;
    pointer-events: auto;
    overflow: hidden;
    max-width: 100%;
    border-radius: var(--ph-input-radius);
    border: 1px solid var(--ph-line);
    background: #fff;
    box-shadow:
        0 4px 24px rgb(26 26 27 / 0.12),
        0 0 0 1px rgb(26 26 27 / 0.04);
    opacity: 0;
    transform: translateX(0.75rem);
    animation: ph-toast-in 0.35s ease forwards;
}

@keyframes ph-toast-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ph-toast--out {
    animation: ph-toast-out 0.28s ease forwards;
}

@keyframes ph-toast-out {
    to {
        opacity: 0;
        transform: translateX(0.5rem) scale(0.98);
    }
}

.ph-toast--success {
    border-color: rgb(34 197 94 / 0.35);
}

.ph-toast--error {
    border-color: rgb(200 16 46 / 0.35);
}

.ph-toast__inner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0.65rem 0.75rem 0.85rem;
}

.ph-toast__text {
    flex: 1;
    margin: 0;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--ph-gray);
}

.ph-toast__close {
    flex-shrink: 0;
    display: flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    margin: -0.15rem -0.1rem 0 0;
    padding: 0;
    border: none;
    border-radius: var(--ph-input-radius);
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--ph-muted);
    cursor: pointer;
    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.ph-toast__close:hover {
    color: var(--ph-black);
    background: rgb(0 0 0 / 0.05);
}

.ph-toast__close:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: 1px;
}

.ph-toast__track {
    height: 3px;
    background: rgb(0 0 0 / 0.06);
}

.ph-toast__progress {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    background: rgb(34 197 94 / 0.85);
    animation-name: ph-toast-progress-shrink;
    animation-duration: var(--ph-toast-ms, 6.5s);
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.ph-toast--error .ph-toast__progress {
    background: rgb(200 16 46 / 0.75);
}

@keyframes ph-toast-progress-shrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (min-width: 1024px) {
    .ph-toast-stack {
        top: max(0.85rem, env(safe-area-inset-top, 0px));
        right: max(1rem, env(safe-area-inset-right, 0px));
    }
}

.ph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.65rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--ph-input-radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid var(--ph-line);
    background: #fff;
    color: var(--ph-gray);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease,
        background 0.15s ease;
    box-sizing: border-box;
}

.ph-btn:hover {
    border-color: var(--ph-red);
    color: var(--ph-red);
    background: rgb(200 16 46 / 0.04);
}

.ph-btn--primary {
    border-color: var(--ph-red);
    background: var(--ph-red);
    color: #fff;
}

.ph-btn--primary:hover {
    background: var(--ph-red-dark);
    border-color: var(--ph-red-dark);
    color: #fff;
}

.ph-btn--ghost {
    background: transparent;
}

.ph-btn--sm {
    min-height: 2.25rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
}

.ph-table-wrap {
    overflow-x: auto;
    margin: 0 -0.25rem;
}

.ph-table-wrap--wide {
    margin: 0;
}

.ph-table {
    width: 100%;
    min-width: 32rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ph-table--compact {
    font-size: 0.8125rem;
}

.ph-table th {
    text-align: left;
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid var(--ph-line);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a9a9f;
    white-space: nowrap;
}

.ph-table td {
    padding: 0.75rem 0.75rem;
    border-bottom: 1px solid var(--ph-line);
    color: var(--ph-gray);
    vertical-align: top;
}

.ph-table__empty {
    text-align: center;
    color: var(--ph-muted);
    padding: 2rem 1rem !important;
}

td.ph-table__actions {
    vertical-align: middle;
}

.ph-table__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    white-space: nowrap;
    text-align: right;
}

.ph-table-action-form {
    display: inline-flex;
    margin: 0;
    vertical-align: middle;
}

.ph-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    color: var(--ph-muted);
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 0.12s ease,
        color 0.12s ease,
        background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.ph-table-action:hover {
    border-color: rgb(200 16 46 / 0.45);
    color: var(--ph-red);
    background: rgb(200 16 46 / 0.06);
}

.ph-table-action:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: 2px;
}

.ph-table-action--danger:hover {
    border-color: rgb(185 28 28 / 0.45);
    color: #b91c1c;
    background: rgb(185 28 28 / 0.06);
}

.ph-table-action__icon {
    display: block;
    flex-shrink: 0;
}

.ph-table__nowrap {
    white-space: nowrap;
}

.ph-table__strong {
    font-weight: 600;
    color: var(--ph-black);
    word-break: break-all;
}

.ph-table__details {
    max-width: 18rem;
    word-break: break-word;
}

.ph-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}

.ph-badge--ok {
    background: rgb(34 197 94 / 0.12);
    color: #15803d;
}

.ph-badge--off {
    background: var(--ph-surface);
    color: var(--ph-muted);
}

.ph-badge--muted {
    background: var(--ph-surface);
    color: #9a9a9f;
}

.ph-badge--awaiting {
    background: rgb(37 99 235 / 0.12);
    color: #1d4ed8;
}

/* Prioridade (vencimentos / alertas): leitura rápida por cor */
.ph-badge--priority-critica {
    background: rgb(200 16 46 / 0.14);
    color: var(--ph-red, #c8102e);
}

.ph-badge--priority-alta {
    background: rgb(234 88 12 / 0.16);
    color: #c2410c;
}

.ph-badge--priority-media {
    background: rgb(34 197 94 / 0.12);
    color: #15803d;
}

.ph-inline-code {
    font-size: 0.8125rem;
    font-family: ui-monospace, monospace;
    background: var(--ph-surface);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    color: var(--ph-gray);
}

.ph-link-action {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    font-size: inherit;
    font-weight: 600;
    font-family: inherit;
    color: var(--ph-red);
    cursor: pointer;
    text-decoration: none;
}

.ph-link-action:hover {
    text-decoration: underline;
}

.ph-link-action--danger {
    color: var(--ph-red-dark);
}

.ph-inline-form {
    display: inline;
    margin: 0;
}

.ph-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ph-form__row {
    margin-bottom: 1rem;
}

.ph-form__row--check {
    margin-bottom: 0.5rem;
}

/* Duas colunas em ecrãs largos; empilha em telemóvel */
.ph-form__cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1.25rem;
    margin-bottom: 1rem;
    align-items: start;
}

.ph-form__field {
    min-width: 0;
}

.ph-form__field--full {
    grid-column: 1 / -1;
}

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

    .ph-form__field--full {
        grid-column: 1;
    }
}

/* Wizard / passos (tabs + painéis) */
.ph-form-steps {
    margin-bottom: 0.5rem;
}

.ph-form-steps__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1rem;
    padding: 0;
    border-bottom: 1px solid var(--ph-line);
}

.ph-form-steps__tab {
    margin: 0 0 -1px;
    padding: 0.5rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--ph-muted);
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--ph-input-radius) var(--ph-input-radius) 0 0;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ph-form-steps__tab:hover {
    color: var(--ph-gray);
    background: rgb(0 0 0 / 0.03);
}

.ph-form-steps__tab.is-active {
    color: var(--ph-red);
    background: #fff;
    border-color: var(--ph-line);
    border-bottom-color: #fff;
    cursor: default;
}

.ph-form-steps__tab:focus-visible {
    outline: 2px solid var(--ph-red);
    outline-offset: 2px;
}

a.ph-form-steps__tab {
    display: inline-block;
    text-decoration: none;
    box-sizing: border-box;
}

.ph-assignments-tabs__row {
    margin-bottom: 1.25rem;
}

.ph-form-step {
    display: none;
}

.ph-form-step.is-active {
    display: block;
}

.ph-form-steps__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ph-form-steps__actions-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ph-form-steps__actions-end [hidden] {
    display: none !important;
}

.ph-form__label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ph-gray);
}

.ph-form__required {
    margin-left: 0.2em;
    color: var(--ph-red, #c8102e);
    font-weight: 700;
    white-space: nowrap;
}

.ph-form__legend .ph-form__required {
    font-size: inherit;
}

.ph-auth-label .ph-form__required {
    color: var(--ph-red, #c8102e);
}

.ph-form__input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: var(--ph-input-radius);
    border: 1px solid var(--ph-line);
    background: #fafafa;
    padding: 0.65rem 0.8rem;
    font-size: 0.9375rem;
    color: var(--ph-black);
    font-family: inherit;
}

.ph-form__input--readonly {
    background: #f5f5f6;
    color: var(--ph-muted);
    cursor: default;
}

.ph-form__input--readonly:focus {
    border-color: var(--ph-line);
    box-shadow: none;
}

.ph-form__input:focus {
    outline: none;
    border-color: var(--ph-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgb(200 16 46 / 0.12);
}

.ph-form__input.is-invalid {
    border-color: var(--ph-red);
}

.ph-form__textarea {
    min-height: 5rem;
    resize: vertical;
}

.ph-form__textarea--compact {
    min-height: 2.75rem;
}

.ph-form__select {
    appearance: auto;
}

.ph-form__error {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ph-red);
}

.ph-form__hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--ph-muted);
}

.ph-form__banner {
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    border-radius: var(--ph-input-radius);
    background: var(--ph-surface);
    border: 1px solid var(--ph-line);
    font-size: 0.875rem;
    color: var(--ph-gray);
}

.ph-form__fieldset {
    margin: 1.25rem 0 0;
    padding: 0;
    border: none;
}

.ph-form__legend {
    padding: 0;
    margin-bottom: 0.65rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ph-black);
}

.ph-form__checks {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fafafa;
}

.ph-perm-accordions__intro {
    margin: 0 0 0.75rem;
}

.ph-perm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ph-perm-accordion__lead {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.ph-perm-accordion__count {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--ph-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.ph-perm-accordion__tail {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ph-perm-accordion__complete-icon {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: rgb(200 16 46 / 0.12);
    color: var(--ph-red);
}

.ph-perm-accordion--complete .ph-perm-accordion__complete-icon {
    display: inline-flex;
}

.ph-perm-accordion__btn {
    min-height: 1.65rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
}

.ph-perm-accordions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
    align-items: start;
}

@media (max-width: 720px) {
    .ph-perm-accordions {
        grid-template-columns: 1fr;
    }
}

.ph-perm-accordion {
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    overflow: hidden;
}

.ph-perm-accordion__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    list-style: none;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ph-gray);
    background: var(--ph-surface);
    user-select: none;
    transition: background 0.12s ease;
}

.ph-perm-accordion__summary::-webkit-details-marker {
    display: none;
}

.ph-perm-accordion__summary::marker {
    display: none;
}

.ph-perm-accordion__summary:hover {
    background: rgb(26 26 27 / 0.04);
}

.ph-perm-accordion__label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a9a9f;
}

.ph-perm-accordion__hint {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ph-muted);
}

.ph-perm-accordion__summary::after {
    content: '';
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.25rem;
    border-right: 2px solid var(--ph-muted);
    border-bottom: 2px solid var(--ph-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.ph-perm-accordion[open] .ph-perm-accordion__summary::after {
    transform: rotate(-135deg);
    margin-top: 0.2rem;
}

.ph-perm-accordion__body {
    padding: 0.65rem 0.75rem 0.85rem;
    border-top: 1px solid var(--ph-line);
    background: #fafafa;
}

.ph-perm-accordion__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 1rem;
    align-items: start;
}

@media (max-width: 520px) {
    .ph-perm-accordion__grid {
        grid-template-columns: 1fr;
    }
}

.ph-perm-accordion__check {
    min-width: 0;
    font-size: 0.8125rem;
}

.ph-perm-accordion__check span {
    word-break: break-word;
}

.ph-form__check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--ph-gray);
    cursor: pointer;
}

.ph-form__check input {
    margin-top: 0.2rem;
    accent-color: var(--ph-red);
}

.ph-form__code {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ph-muted);
}

.ph-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--ph-line);
}

.ph-filter-form__grid {
    display: grid;
    gap: 0.75rem 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .ph-filter-form__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ph-filter-form__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Vínculos: 1ª linha Colaborador + Carrinha + PDA + Estado; datas em 2+2 */
.ph-filter-form__grid--vinculos {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .ph-filter-form__grid--vinculos {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ph-filter-form__grid--vinculos {
        grid-template-columns: repeat(4, 1fr);
    }
}

.ph-filter-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Paginação padrão em listagens: <x-listing-pagination :paginator="$model" /> */
.ph-listing-pagination {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ph-line);
}

.ph-listing-pagination__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
}

.ph-listing-pagination__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.ph-listing-pagination__btn {
    box-sizing: border-box;
}

.ph-listing-pagination__btn--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.35rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: #fff;
    color: var(--ph-gray);
    text-decoration: none;
    transition:
        border-color 0.12s ease,
        color 0.12s ease,
        background 0.12s ease;
}

a.ph-listing-pagination__btn--icon:hover {
    border-color: rgb(200 16 46 / 0.45);
    color: var(--ph-red);
    background: rgb(200 16 46 / 0.05);
}

.ph-listing-pagination__btn--icon.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.ph-listing-pagination__svg {
    display: block;
}

.ph-listing-pagination__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    margin: 0 0.35rem;
}

.ph-listing-pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.4rem;
    border-radius: var(--ph-input-radius);
    border: 1px solid transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ph-gray);
    text-decoration: none;
    transition:
        background 0.12s ease,
        color 0.12s ease,
        border-color 0.12s ease;
}

a.ph-listing-pagination__page:hover {
    border-color: var(--ph-line);
    background: var(--ph-surface);
    color: var(--ph-black);
}

.ph-listing-pagination__page--current {
    border-color: rgb(200 16 46 / 0.35);
    background: rgb(200 16 46 / 0.08);
    color: var(--ph-red);
    cursor: default;
}

.ph-listing-pagination__meta {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--ph-muted);
}

.ph-listing-pagination__meta strong {
    font-weight: 600;
    color: var(--ph-gray);
}

.ph-listing-pagination__count,
.ph-listing-pagination__range {
    font-weight: 500;
    color: #9a9a9f;
}

.ph-listing-pagination--summary {
    border-top: none;
    margin-top: 1rem;
    padding-top: 0;
}

.ph-listing-pagination__meta--only {
    margin: 0;
}

/* Perfil (página Meu perfil) */
.ph-profile-dl {
    display: grid;
    grid-template-columns: minmax(5rem, 8rem) 1fr;
    gap: 0.35rem 1.25rem;
    margin: 0;
    font-size: 0.875rem;
}

.ph-profile-dl dt {
    margin: 0;
    font-weight: 700;
    color: #9a9a9f;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ph-profile-dl dd {
    margin: 0 0 0.85rem;
    color: var(--ph-gray);
}

.ph-profile-dl dd:last-of-type {
    margin-bottom: 0;
}

.ph-profile-hint {
    margin: 1.25rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Lucide — pacote mallardduck/blade-lucide-icons; atalho <x-lucide-icon name="…" /> */
.ph-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.ph-icon--sm {
    width: 1rem;
    height: 1rem;
}

.ph-icon--md {
    width: 1.125rem;
    height: 1.125rem;
}

.ph-icon--lg {
    width: 1.25rem;
    height: 1.25rem;
}

.ph-icon--zone {
    width: 2.5rem;
    height: 2.5rem;
}

.ph-icon--close {
    width: 1.375rem;
    height: 1.375rem;
}

/* Upload com pré-visualização (componente file-upload) */
.ph-file-upload {
    --ph-fu-radius: 4px;
    margin-bottom: 0.35rem;
    min-width: 0;
    max-width: 100%;
}

.ph-file-upload--embedded-list {
    margin-bottom: 0;
}

/* Ficheiro único já guardado */
.ph-file-upload__pill {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-fu-radius);
    background: var(--ph-surface, #f8f8f9);
    font-size: 0.8125rem;
}

.ph-file-upload__pill--current {
    max-width: 100%;
}

.ph-file-upload__pill-icon {
    display: flex;
    color: var(--ph-gray);
    flex-shrink: 0;
}

.ph-file-upload__pill-text {
    color: var(--ph-gray);
    font-weight: 500;
}

.ph-file-upload__pill-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

a.ph-file-upload__icon-btn {
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.ph-file-upload__current-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.65rem 0.75rem;
    margin: 0 0 0.75rem;
}

.ph-file-upload__current-bar .ph-file-upload__pill {
    margin-bottom: 0;
    flex: 1 1 12rem;
    min-width: 0;
}

.ph-file-upload__existing-thumb-wrap {
    flex-shrink: 0;
    display: flex;
    border-radius: var(--ph-fu-radius);
    overflow: hidden;
    border: 1px solid var(--ph-line);
    background: var(--ph-surface, #f0f0f2);
}

.ph-file-upload__existing-thumb-wrap--saved {
    border-radius: var(--ph-fu-radius);
}

.ph-file-upload__existing-thumb {
    display: block;
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    vertical-align: middle;
}

.ph-file-upload__pill .ph-file-upload__existing-thumb {
    width: 3rem;
    height: 3rem;
}

.ph-file-upload__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-fu-radius);
    background: #fff;
    color: var(--ph-gray);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.ph-file-upload__icon-btn:hover {
    border-color: rgb(200 16 46 / 0.4);
    color: var(--ph-red, #c8102e);
    background: rgb(200 16 46 / 0.06);
}

.ph-file-upload__icon-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(200 16 46 / 0.22);
}

.ph-file-upload__icon-btn--add {
    align-self: center;
    width: 2.65rem;
    height: 2.65rem;
    border-width: 2px;
    border-color: rgb(200 16 46 / 0.35);
    color: var(--ph-red, #c8102e);
    font-weight: 700;
}

.ph-file-upload__icon-btn--add:hover {
    border-color: var(--ph-red, #c8102e);
    background: rgb(200 16 46 / 0.1);
}

.ph-file-upload__composer {
    margin-bottom: 0.15rem;
}

.ph-file-upload__composer[hidden] {
    display: none !important;
}

.ph-file-upload__lightbox {
    margin: 0;
    padding: 0;
    border: none;
    max-width: none;
    max-height: none;
    width: 100vw;
    height: 100vh;
    background: transparent;
}

.ph-file-upload__lightbox::backdrop {
    background: rgb(0 0 0 / 0.78);
    cursor: pointer;
}

.ph-file-upload__lightbox-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 3rem 1.25rem 1.5rem;
    box-sizing: border-box;
}

.ph-file-upload__lightbox-img {
    max-width: min(92vw, 1200px);
    max-height: min(85vh, 900px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--ph-fu-radius);
    box-shadow: 0 12px 48px rgb(0 0 0 / 0.45);
}

.ph-file-upload__lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: var(--ph-fu-radius);
    background: rgb(0 0 0 / 0.45);
    color: #fff;
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.ph-file-upload__lightbox-close:hover {
    background: rgb(0 0 0 / 0.65);
    border-color: rgb(255 255 255 / 0.55);
}

/* Lista “no servidor” (múltiplos) */
.ph-file-upload__saved-block {
    margin: 0 0 0.85rem;
}

.ph-file-upload__saved-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin: 0 0 0.45rem;
}

.ph-file-upload__saved-head {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ph-gray);
    margin: 0;
}

.ph-file-upload__saved-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ph-file-upload__saved-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-fu-radius);
    background: #fff;
    font-size: 0.8125rem;
    transition:
        opacity 0.15s ease,
        border-style 0.15s ease,
        background 0.15s ease;
}

.ph-file-upload__saved-item.is-pending-remove {
    opacity: 0.55;
    border-style: dashed;
    background: var(--ph-surface, #fafafa);
}

.ph-file-upload__saved-icon {
    display: flex;
    color: var(--ph-gray);
    flex-shrink: 0;
}

.ph-file-upload__saved-main {
    flex: 1 1 12rem;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
}

.ph-file-upload__saved-label {
    min-width: 0;
    font-weight: 600;
    color: var(--ph-black);
    word-break: break-word;
    line-height: 1.35;
}

.ph-file-upload__saved-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.ph-file-upload__saved-remove {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--ph-gray);
    user-select: none;
}

.ph-file-upload__saved-remove-ui {
    border-bottom: 1px solid transparent;
    transition: border-color 0.12s ease;
}

.ph-file-upload__saved-remove:hover .ph-file-upload__saved-remove-ui {
    border-bottom-color: currentColor;
}

.ph-file-upload__remove-cb {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    accent-color: var(--ph-red, #c8102e);
}

/* Zona de arrastar */
.ph-file-upload__zone {
    border: 1px dashed rgb(0 0 0 / 0.14);
    border-radius: var(--ph-fu-radius);
    background: linear-gradient(180deg, #fff 0%, var(--ph-surface, #fafafa) 100%);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
    outline: none;
}

.ph-file-upload__zone:hover {
    border-color: rgb(200 16 46 / 0.28);
    background: #fff;
}

.ph-file-upload__zone:focus-visible {
    box-shadow: 0 0 0 3px rgb(200 16 46 / 0.22);
    border-color: rgb(200 16 46 / 0.45);
}

.ph-file-upload__zone.is-dragover {
    border-color: rgb(200 16 46 / 0.65);
    border-style: solid;
    background: rgb(200 16 46 / 0.05);
    box-shadow: inset 0 0 0 1px rgb(200 16 46 / 0.12);
}

.ph-file-upload__zone-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1rem;
    padding: 1.1rem 1.15rem;
}

.ph-file-upload__zone-icon {
    flex-shrink: 0;
    display: flex;
    color: rgb(200 16 46 / 0.55);
}

.ph-file-upload__zone-copy {
    flex: 1 1 12rem;
    min-width: 0;
}

.ph-file-upload__zone-title {
    margin: 0 0 0.2rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--ph-black);
    letter-spacing: -0.01em;
}

.ph-file-upload__zone-sub {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--ph-gray);
}

.ph-file-upload__browse {
    flex-shrink: 0;
    appearance: none;
    border: 1px solid var(--ph-line);
    background: #fff;
    color: var(--ph-black);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--ph-fu-radius);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        color 0.15s ease;
}

.ph-file-upload__browse:hover {
    border-color: rgb(200 16 46 / 0.45);
    color: var(--ph-red, #c8102e);
    background: rgb(200 16 46 / 0.04);
}

.ph-file-upload__zone-hint {
    margin: 0;
    padding: 0 1.15rem 0.85rem;
    font-size: 0.75rem;
    color: var(--ph-gray);
    line-height: 1.45;
}

/* Fila / pré-visualização */
.ph-file-upload__queue {
    margin-top: 0.85rem;
}

.ph-file-upload__queue-head {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ph-gray);
    margin: 0 0 0.45rem;
}

.ph-file-upload__previews {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ph-file-upload__item {
    display: grid;
    grid-template-columns: 3.5rem 1fr auto;
    gap: 0.65rem 0.75rem;
    align-items: start;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-fu-radius);
    background: #fff;
    box-shadow: 0 1px 0 rgb(0 0 0 / 0.03);
}

.ph-file-upload__item-thumb {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--ph-fu-radius);
    overflow: hidden;
    background: var(--ph-surface, #f0f0f2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ph-file-upload__item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ph-file-upload__item-type {
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #8e8e93;
    text-transform: uppercase;
}

.ph-file-upload__item-type--pdf {
    color: var(--ph-red, #c8102e);
}

.ph-file-upload__item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ph-file-upload__item-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ph-black);
    word-break: break-word;
    line-height: 1.35;
}

.ph-file-upload__item-meta {
    font-size: 0.75rem;
    color: var(--ph-gray);
}

.ph-file-upload__label-input {
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    padding: 0.4rem 0.55rem;
    min-width: 0;
    width: 100%;
}

.ph-file-upload__item-actions {
    align-self: start;
    padding-top: 0.1rem;
}

.ph-file-upload__item-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    background: transparent;
    color: var(--ph-gray);
    cursor: pointer;
    border-radius: var(--ph-fu-radius);
    transition:
        color 0.12s ease,
        background 0.12s ease;
}

.ph-file-upload__item-remove:hover {
    color: var(--ph-red, #c8102e);
    background: rgb(200 16 46 / 0.08);
}

@media (max-width: 640px) {
    .ph-file-upload__zone-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .ph-file-upload__zone-icon {
        justify-content: center;
    }

    .ph-file-upload__browse {
        width: 100%;
    }

    .ph-file-upload__item {
        grid-template-columns: 3rem 1fr;
    }

    .ph-file-upload__item-actions {
        grid-column: 1 / -1;
        justify-self: end;
        padding-top: 0;
    }
}

/* Fichas só leitura (Ver carrinha / colaborador / PDA) */
.ph-entity-show-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.ph-entity-show-card .ph-form-steps__tabs {
    flex-wrap: wrap;
}

.ph-dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 1rem 1.35rem;
    margin: 0;
}

.ph-dl-grid__item {
    margin: 0;
    min-width: 0;
}

.ph-dl-grid__dt {
    margin: 0 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--ph-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

.ph-dl-grid__dd {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ph-black, #1a1a1a);
    line-height: 1.4;
    word-break: break-word;
}

.ph-entity-show-hero {
    display: grid;
    grid-template-columns: minmax(11rem, 15rem) 1fr;
    gap: 1.25rem 1.75rem;
    align-items: start;
}

.ph-entity-show-hero--pda {
    grid-template-columns: minmax(9rem, 12rem) 1fr;
}

.ph-entity-show-hero__media {
    border-radius: var(--ph-input-radius, 8px);
    overflow: hidden;
    background: var(--ph-surface, #f0f0f2);
    aspect-ratio: 4 / 3;
    border: 1px solid var(--ph-line);
}

.ph-entity-show-hero--pda .ph-entity-show-hero__media {
    aspect-ratio: 1;
    max-width: 12rem;
}

.ph-entity-show-hero__media--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ph-muted);
}

.ph-entity-show-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ph-entity-show-hero__placeholder {
    padding: 1.5rem;
    opacity: 0.45;
}

.ph-entity-show-hero__body--solo {
    grid-column: 1 / -1;
}

.ph-entity-show-hero__code {
    margin: 0 0 0.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ph-muted);
}

.ph-entity-show-hero__title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.ph-entity-show-hero__meta {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    color: var(--ph-gray);
    line-height: 1.45;
}

.ph-entity-show-hero__chips {
    margin: 0 0 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ph-entity-chip {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.05);
    color: var(--ph-gray);
}

.ph-entity-show-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.ph-entity-show-hero__assign {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ph-entity-show-doc-strip {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0.75rem 0 0;
    border-top: 1px solid var(--ph-line);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.65rem 1rem;
}

.ph-entity-show-doc-strip__item {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ph-entity-show-doc-strip__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ph-muted);
}

.ph-entity-show-doc-strip__date {
    font-size: 0.875rem;
    font-weight: 600;
}

.ph-entity-doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ph-entity-doc-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-input-radius);
    background: rgb(0 0 0 / 0.015);
}

.ph-entity-doc-list__label {
    font-weight: 600;
    font-size: 0.875rem;
}

.ph-entity-doc-list__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.ph-entity-image-lightbox__panel {
    flex-direction: column;
    justify-content: center;
}

.ph-entity-image-lightbox__stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.ph-entity-image-lightbox__dl {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.ph-entity-image-lightbox__dl:hover {
    color: rgb(255 255 255 / 0.88);
}

.ph-entity-show-assign-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.ph-entity-show-assign-card {
    padding: 0.65rem 0.85rem;
    border-radius: var(--ph-input-radius);
    border: 1px solid var(--ph-line);
    background: rgb(0 0 0 / 0.02);
    min-width: min(100%, 14rem);
}

.ph-entity-show-assign-card__k {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.ph-entity-show-assign-card__v {
    font-size: 0.9rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .ph-entity-show-hero {
        grid-template-columns: 1fr;
    }

    .ph-entity-show-hero--pda .ph-entity-show-hero__media {
        max-width: none;
    }
}
