:root {
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-surface-soft: #f9fafb;
    --app-border: #dfe4ea;
    --app-text: #1f2933;
    --app-muted: #687483;
    --app-primary: #0d6efd;
    --app-radius: 8px;
    --app-navbar-height: 64px;
    --app-shadow: 0 12px 28px rgba(31, 41, 51, 0.08);
    --color-principal: var(--app-primary);
    --color-principal-contrast: #ffffff;
}

.theme-poema {
    --color-principal: #005a9c;
    --color-principal-contrast: #ffffff;
}

.theme-loro {
    --color-principal: #f5d328;
    --color-principal-contrast: #1f2933;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--app-text);
    background: var(--app-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app-shell {
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--app-bg);
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    flex: 0 0 var(--app-navbar-height);
    height: var(--app-navbar-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(10px);
}

.app-navbar__inner {
    width: 100%;
    max-width: 640px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.app-navbar__brand {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-navbar__logo {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    object-fit: contain;
}

.app-navbar__brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-navbar__actions {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.app-navbar__user-pill {
    min-width: 0;
    max-width: 132px;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    color: var(--app-text);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.app-navbar__user-pill:hover {
    border-color: var(--app-primary);
    color: var(--app-primary);
}

.app-navbar__user-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-navbar__user-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: currentColor;
    opacity: 0.8;
}

.app-logout-button {
    flex: 0 0 auto;
    border-radius: var(--app-radius);
}

.app-main {
    width: 100%;
    max-width: 640px;
    flex: 1 1 auto;
    margin: 0 auto;
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.work-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 0.25rem;
    margin: -1rem -1rem 1rem;
    padding: 0.75rem 1rem;
    background: rgba(244, 246, 248, 0.96);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(10px);
}

.work-nav__item {
    min-width: 0;
    min-height: 42px;
    padding: 0.45rem 0.35rem;
    color: var(--app-muted);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-nav__item.is-active {
    color: #ffffff;
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.app-section {
    display: none;
}

.app-section.is-active {
    display: block;
}

.welcome-card {
    padding: 1.25rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.document-category-list {
    display: grid;
    gap: 1rem;
}

.document-category {
    display: grid;
    gap: 0.5rem;
}

.document-category__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0.125rem;
}

.document-category__heading h2 {
    margin: 0;
    color: var(--app-text);
    font-size: 0.95rem;
    font-weight: 800;
}

.document-category__heading span {
    min-width: 28px;
    padding: 0.15rem 0.45rem;
    color: var(--app-muted);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.75rem;
    font-weight: 800;
    text-align: center;
}

.document-card {
    padding: 1rem;
}

.welcome-card__header {
    margin-bottom: 1rem;
}

.welcome-card__eyebrow {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--app-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.welcome-card__title {
    margin: 0;
    color: var(--app-text);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.user-summary {
    margin: 0;
}

.user-summary__row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.875rem 0;
    border-top: 1px solid var(--app-border);
}

.user-summary__row dt {
    color: var(--app-muted);
    font-size: 0.875rem;
    font-weight: 600;
}

.user-summary__row dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--app-text);
    font-size: 0.9375rem;
    font-weight: 600;
}

.dashboard-panel,
.incidencias-panel {
    margin-top: 1rem;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.section-heading__eyebrow {
    display: block;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.section-heading__title {
    margin: 0;
    color: var(--app-text);
    font-size: 1.125rem;
    font-weight: 700;
}

.section-heading__counter {
    min-width: 2rem;
    padding: 0.25rem 0.5rem;
    color: var(--app-primary);
    background: #eaf2ff;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
}

.section-heading__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.section-heading__actions .btn {
    min-height: 34px;
    border-radius: var(--app-radius);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.incidencias-list {
    display: grid;
    gap: 0.75rem;
}

.work-board {
    display: grid;
    gap: 1rem;
}

.work-mini-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.work-mini-summary__item {
    min-width: 0;
    padding: 0.65rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.work-mini-summary__item span {
    display: block;
    min-height: 2.2em;
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.1;
}

.work-mini-summary__item strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--app-text);
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
}

.preventive-placeholder {
    margin-bottom: 1rem;
    padding: 0.65rem 0.75rem;
    color: var(--app-muted);
    background: var(--app-surface);
    border: 1px dashed var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.pending-board {
    display: grid;
    gap: 0.75rem;
}

.work-group {
    display: grid;
    gap: 0.6rem;
}

.preventive-group {
    padding: 0.75rem;
    background: #eef7f1;
    border: 1px solid #cfe8d7;
    border-radius: var(--app-radius);
}

.work-group__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.work-group__heading h2 {
    margin: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
}

.work-group__heading span {
    min-width: 1.8rem;
    padding: 0.2rem 0.5rem;
    color: var(--app-muted);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

.work-group__list {
    display: grid;
    gap: 0.75rem;
}

.work-card {
    --estado-color: var(--app-primary);
    padding: 0.75rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-left: 5px solid var(--estado-color);
    border-radius: var(--app-radius);
    box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.work-card.is-loading {
    min-height: 150px;
    background: linear-gradient(90deg, #ffffff 0%, #f0f3f6 50%, #ffffff 100%);
    background-size: 220% 100%;
    animation: card-loading 1.2s ease-in-out infinite;
}

.work-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.work-card__type {
    display: inline-flex;
    margin-bottom: 0.2rem;
    color: var(--app-primary);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.work-card__title {
    margin: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.work-card__priority {
    flex: 0 0 auto;
    max-width: 42%;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-card__priority.is-high {
    color: #842029;
    background: #f8d7da;
}

.work-card__priority.is-medium {
    color: #7a3b00;
    background: #ffe0b8;
}

.work-card__priority.is-low {
    color: #0f5132;
    background: #d1e7dd;
}

.work-card__status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.work-card__status,
.work-card__date {
    padding: 0.25rem 0.55rem;
    color: var(--app-muted);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.work-card__status {
    --badge-color: var(--app-primary);
    color: var(--app-text);
    background: color-mix(in srgb, var(--badge-color) 16%, #ffffff);
    border-color: color-mix(in srgb, var(--badge-color) 45%, #ffffff);
}

.work-card__details {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.55rem;
}

.work-card__details span {
    min-width: 0;
    padding: 0.4rem 0.55rem;
    overflow: hidden;
    color: var(--app-text);
    background: var(--app-surface-soft);
    border-radius: var(--app-radius);
    font-size: 0.8rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-card__details strong {
    display: inline;
    margin-right: 0.35rem;
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.work-card__location {
    --location-color: var(--app-primary);
    border-left: 4px solid var(--location-color);
}

.work-card__description {
    display: -webkit-box;
    margin: 0 0 0.65rem;
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.9rem;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.work-card__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
}

.work-card__actions .btn {
    min-height: 36px;
    border-radius: var(--app-radius);
    font-size: 0.78rem;
    font-weight: 800;
}

.pending-card__details {
    grid-template-columns: minmax(0, 1fr);
}

.pending-card__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-card__actions .spinner-border,
.detail-actions .spinner-border {
    width: 0.9rem;
    height: 0.9rem;
}

.detail-modal {
    border: 0;
}

.detail-modal__eyebrow {
    display: block;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-loading {
    padding: 1rem;
    color: var(--app-muted);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-weight: 700;
    text-align: center;
}

.detail-card {
    --estado-color: var(--app-primary);
    display: grid;
    gap: 1rem;
    padding-left: 0.75rem;
    border-left: 5px solid var(--estado-color);
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.detail-badges span {
    padding: 0.3rem 0.6rem;
    color: var(--app-text);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
    margin: 0;
}

.detail-field {
    min-width: 0;
    padding: 0.7rem;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.detail-field dt {
    margin-bottom: 0.15rem;
    color: var(--app-muted);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-field dd {
    margin: 0;
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.detail-section {
    display: grid;
    gap: 0.55rem;
}

.detail-section h3 {
    margin: 0;
    color: var(--app-text);
    font-size: 0.95rem;
    font-weight: 900;
}

.detail-description {
    margin: 0;
    color: var(--app-text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.detail-personal-list,
.detail-history-list {
    display: grid;
    gap: 0.5rem;
}

.detail-personal,
.detail-history {
    padding: 0.75rem;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.detail-personal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.detail-personal__name {
    min-width: 0;
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-personal__role,
.detail-history__user {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.detail-history {
    display: grid;
    gap: 0.35rem;
}

.detail-history__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.detail-history__top strong {
    min-width: 0;
    color: var(--app-text);
    font-size: 0.88rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.detail-history__top span {
    flex: 0 0 auto;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.detail-history p {
    margin: 0;
    color: var(--app-text);
    font-size: 0.85rem;
    line-height: 1.4;
}

.photo-gallery,
.photo-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.photo-gallery--inline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-thumb,
.photo-preview__item {
    min-width: 0;
    overflow: hidden;
    color: var(--app-text);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    text-decoration: none;
}

.photo-thumb img,
.photo-preview__item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #e9ecef;
}

.photo-thumb span,
.photo-thumb small,
.photo-preview__item span {
    display: block;
    padding: 0.25rem 0.45rem;
    overflow: hidden;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-thumb small {
    padding-top: 0;
    font-size: 0.68rem;
}

.photo-preview {
    margin-top: 0.75rem;
}

.wizard-modal .modal-body {
    display: grid;
    gap: 1rem;
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
}

.wizard-steps.is-three-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wizard-steps__item {
    min-height: 38px;
    color: var(--app-muted);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.85rem;
    font-weight: 900;
}

.wizard-steps__item.is-active {
    color: #ffffff;
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.wizard-step {
    display: none;
}

.wizard-step.is-active {
    display: grid;
    gap: 0.75rem;
}

.wizard-step h3 {
    margin: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 900;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.segmented-control .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--app-radius);
    font-weight: 900;
}

.assignment-list {
    display: grid;
    gap: 0.55rem;
}

.assignment-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.9rem;
    font-weight: 800;
}

.assignment-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wizard-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.wizard-footer .btn {
    min-height: 42px;
    border-radius: var(--app-radius);
    font-weight: 900;
}

.wizard-footer .btn-success {
    grid-column: 1 / -1;
}

.detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.detail-actions .btn {
    min-height: 38px;
    border-radius: var(--app-radius);
    font-size: 0.82rem;
    font-weight: 800;
}

.compact-alert {
    margin-bottom: 1rem;
    border-radius: var(--app-radius);
    font-size: 0.88rem;
    font-weight: 700;
}

.form-status {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: var(--app-radius);
    font-size: 0.9rem;
    font-weight: 800;
}

.form-status--success,
.form-status--error {
    display: block;
}

.form-status--success {
    color: #0f5132;
    background: #d1e7dd;
    border: 1px solid #badbcc;
}

.form-status--error {
    color: #842029;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}

.notification-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.notification-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.notification-panel__header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #172033;
}

.notification-panel__badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.notification-panel__badge.is-ok {
    background: #dcfce7;
    color: #166534;
}

.notification-panel__badge.is-bad {
    background: #fee2e2;
    color: #991b1b;
}

.notification-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.notification-grid__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 10px;
}

.notification-grid__item span {
    color: #64748b;
    font-size: 0.82rem;
}

.notification-grid__item strong {
    color: #172033;
    font-size: 0.86rem;
    text-align: right;
}

.notification-panel__hint,
.notification-panel__date {
    margin: 0.65rem 0 0;
    color: #64748b;
    font-size: 0.88rem;
}

.notification-panel__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-top: 1rem;
}

.dashboard-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
}

.summary-card {
    min-height: 128px;
    padding: 1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.summary-card.is-loading {
    background: linear-gradient(90deg, #ffffff 0%, #f0f3f6 50%, #ffffff 100%);
    background-size: 220% 100%;
    animation: card-loading 1.2s ease-in-out infinite;
}

.summary-card--department {
    border-left: 5px solid var(--app-primary);
}

.summary-card__title {
    margin: 0 0 0.75rem;
    color: var(--app-text);
    font-size: 0.9375rem;
    font-weight: 800;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.summary-item {
    min-width: 0;
    padding: 0.75rem;
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.summary-item__label {
    display: block;
    min-height: 2.1em;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.15;
}

.summary-item__value {
    display: block;
    margin-top: 0.25rem;
    color: var(--app-text);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}

.incident-card {
    --estado-color: var(--app-primary);
    position: relative;
    min-height: 132px;
    padding: 1rem 1rem 1rem 1.125rem;
    overflow: hidden;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-left: 5px solid var(--estado-color);
    border-radius: var(--app-radius);
    box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.incident-card.is-loading {
    background: linear-gradient(90deg, #ffffff 0%, #f0f3f6 50%, #ffffff 100%);
    background-size: 220% 100%;
    animation: card-loading 1.2s ease-in-out infinite;
}

.incident-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.incident-card__number {
    min-width: 0;
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.incident-card__status {
    flex: 0 0 auto;
    max-width: 48%;
    padding: 0.25rem 0.5rem;
    color: var(--app-text);
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.incident-card__description {
    display: -webkit-box;
    margin: 0 0 0.75rem;
    overflow: hidden;
    color: var(--app-text);
    font-size: 0.9375rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.incident-card__meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    color: var(--app-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.incident-card__meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.incident-card__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--app-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.incident-card__footer span {
    padding: 0.25rem 0.5rem;
    background: var(--app-surface-soft);
    border-radius: 999px;
}

.incident-card__priority {
    color: var(--app-primary);
}

.empty-state {
    padding: 1rem;
    color: var(--app-muted);
    background: var(--app-surface);
    border: 1px dashed var(--app-border);
    border-radius: var(--app-radius);
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
}

.empty-state--error {
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
}

.auth-body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--color-principal) 18%, #ffffff) 0%, #f4f6f8 48%, #ffffff 100%);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-panel {
    width: 100%;
    max-width: 420px;
    padding: 1.25rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.login-brand {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.login-brand__logo {
    width: min(220px, 76vw);
    max-height: 150px;
    margin: 0 auto;
    object-fit: contain;
}

.login-brand__eyebrow {
    display: block;
    color: var(--color-principal);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-brand__title {
    margin: 0;
    color: var(--app-text);
    font-size: 1.35rem;
    font-weight: 900;
}

.login-field {
    margin-bottom: 1rem;
}

.login-field .form-label {
    color: var(--app-text);
    font-weight: 800;
}

.login-field .form-control {
    min-height: 48px;
    border-radius: var(--app-radius);
}

.login-field .form-control:focus {
    border-color: var(--color-principal);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--color-principal) 22%, transparent);
}

.login-submit {
    min-height: 48px;
    color: var(--color-principal-contrast);
    background: var(--color-principal);
    border-color: var(--color-principal);
    border-radius: var(--app-radius);
    font-weight: 900;
}

.login-submit:hover,
.login-submit:focus {
    color: var(--color-principal-contrast);
    background: color-mix(in srgb, var(--color-principal) 88%, #000000);
    border-color: color-mix(in srgb, var(--color-principal) 88%, #000000);
}

.login-install {
    min-height: 44px;
    margin-top: 0.85rem;
    border-radius: var(--app-radius);
    font-weight: 800;
}

.login-alert {
    border-radius: var(--app-radius);
    font-weight: 700;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-panel {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

@media (min-width: 576px) {
    .app-main {
        padding: 1.5rem;
    }

    .work-nav {
        margin: -1.5rem -1.5rem 1.5rem;
        padding: 0.9rem 1.5rem;
    }

    .welcome-card {
        padding: 1.5rem;
    }

    .work-card__details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .work-card__actions {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .detail-actions {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .photo-gallery,
    .photo-preview {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .incident-card__meta {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .dashboard-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-card--department {
        grid-column: 1 / -1;
    }

    .summary-grid--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@keyframes card-loading {
    0% {
        background-position: 120% 0;
    }

    100% {
        background-position: -120% 0;
    }
}

/* Botón para eliminar foto (vista previa y galería) */
.photo-preview__item,
.photo-thumb {
  position: relative;
}

.photo-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  line-height: 24px;
  text-align: center;
  border: 0;
  border-radius: 50%;
  background: rgba(176, 0, 32, 0.92);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.photo-remove-btn:hover {
  background: #b00020;
}
