/**
 * Manual / Edit Time Entry modal — solid FieldOps dialog (office Time Review path).
 * Backdrop may be translucent; panel / header / body / footer / inputs must stay opaque.
 */

.fo-time-entry-modal__surface,
.fo-time-entry-modal__header,
.fo-time-entry-modal__body,
.fo-time-entry-modal__footer,
.fo-time-entry-modal__summary {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
}

.fo-time-entry-modal.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 1060;
    padding: 0.75rem;
    /* Backdrop dim only — never paint the dialog root as glass content */
    background: rgba(2, 6, 23, 0.62) !important;
    background-color: rgba(2, 6, 23, 0.62) !important;
    overflow-y: auto;
}

html[data-fo-theme="light"] .fo-time-entry-modal.modal.show {
    background: rgba(15, 23, 42, 0.45) !important;
    background-color: rgba(15, 23, 42, 0.45) !important;
}

.fo-time-entry-modal .modal-dialog {
    margin: auto;
    width: 100%;
    max-width: min(640px, 100%);
    pointer-events: auto;
}

.fo-time-entry-modal__surface.modal-content {
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 92dvh);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.fo-time-entry-modal__header.modal-header {
    flex-shrink: 0;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--fo-border, #334155) !important;
}

.fo-time-entry-modal__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fo-text-primary, #f1f5f9) !important;
}

.fo-time-entry-modal__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--fo-text-secondary, #94a3b8) !important;
}

.fo-time-entry-modal__body.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

.fo-time-entry-modal__footer.modal-footer {
    flex-shrink: 0;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--fo-border, #334155) !important;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.fo-time-entry-modal .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--fo-text-primary, #f1f5f9) !important;
    margin-bottom: 0.35rem;
}

.fo-time-entry-modal .form-control,
.fo-time-entry-modal .form-select,
.fo-time-entry-modal input,
.fo-time-entry-modal textarea,
.fo-time-entry-modal select {
    min-height: 44px;
    background: var(--fo-surface-primary, var(--fo-bg, #0f172a)) !important;
    background-color: var(--fo-surface-primary, var(--fo-bg, #0f172a)) !important;
    color: var(--fo-text-primary, #f1f5f9) !important;
    border: 1px solid var(--fo-border, #334155) !important;
    opacity: 1 !important;
}

html[data-fo-theme="light"] .fo-time-entry-modal .form-control,
html[data-fo-theme="light"] .fo-time-entry-modal .form-select,
html[data-fo-theme="light"] .fo-time-entry-modal input,
html[data-fo-theme="light"] .fo-time-entry-modal textarea {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

.fo-time-entry-modal .form-control:focus,
.fo-time-entry-modal .form-select:focus,
.fo-time-entry-modal textarea:focus {
    outline: 2px solid var(--fo-btn-focus-ring, #93c5fd);
    outline-offset: 1px;
    box-shadow: none;
}

.fo-time-entry-modal__summary {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: var(--fo-surface-primary, #0f172a) !important;
    background-color: var(--fo-surface-primary, #0f172a) !important;
    border: 1px solid var(--fo-border, #334155) !important;
    color: var(--fo-text-primary, #f1f5f9) !important;
    opacity: 1 !important;
}

html[data-fo-theme="light"] .fo-time-entry-modal__summary {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

.fo-time-entry-modal .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 1rem;
}

.fo-time-entry-modal .btn-close {
    filter: invert(1) grayscale(100%);
    opacity: 0.85;
}

html[data-fo-theme="light"] .fo-time-entry-modal .btn-close {
    filter: none;
}

@media (max-width: 576px) {
    .fo-time-entry-modal.modal.show {
        align-items: flex-end;
        padding: 0;
    }

    .fo-time-entry-modal .modal-dialog {
        max-width: 100%;
        margin: 0;
    }

    .fo-time-entry-modal__surface.modal-content {
        border-radius: 12px 12px 0 0;
        max-height: 94dvh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fo-time-entry-modal * {
        transition: none !important;
    }
}
