/* ============================================================
   EMPLOYEE DETAIL PANEL COMPONENT
   All .edp-* classes for the 440px sliding side panel,
   its sub-tabs (Info / Schedule / Org), and mobile full-screen.
   ============================================================ */

/* ── Fixed overlay backdrop ────────────────────────────────── */
.edp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 499;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

.edp-backdrop--visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Fixed overlay panel shell ─────────────────────────────── */
.edp {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 440px;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    overflow: hidden;
}

.edp--open {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .edp {
        width: 100vw;
    }
}

/* ── Legacy inline panel (kept for compatibility) ─────────── */
.edp-panel {
    width: 440px;
    min-width: 0;
    flex-shrink: 0;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width var(--transition-slow);
}

.edp-panel.edp-closed {
    width: 0;
    border-left: none;
    overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────── */
.edp-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.edp-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: var(--legacy-radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    margin-right: auto;
    flex-shrink: 0;
}

.edp-close-btn:hover {
    background: var(--color-background);
    color: var(--color-text-primary);
}

.edp-header-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* Status toggle pill */
.edp-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.edp-status-pill:hover {
    opacity: 0.8;
}

.edp-status-pill.active {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.edp-status-pill.inactive {
    background: var(--color-background);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.edp-status-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: currentColor;
    flex-shrink: 0;
}

/* ── Avatar + name block ──────────────────────────────────── */
.edp-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.edp-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    margin-bottom: var(--space-3);
}

.edp-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.edp-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 var(--space-1);
    text-align: center;
}

.edp-job-title {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
    text-align: center;
}

/* ── Tab bar ──────────────────────────────────────────────── */
.edp-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.edp-tab {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
    text-align: center;
}

.edp-tab:hover {
    color: var(--color-text-primary);
}

.edp-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

/* ── Tab body ─────────────────────────────────────────────── */
.edp-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-5);
    min-height: 0;
}

/* ── Info tab rows ────────────────────────────────────────── */
.edp-info-row {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}

.edp-info-row:last-child {
    border-bottom: none;
}

.edp-info-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    width: 120px;
    flex-shrink: 0;
    padding-top: 1px;
}

.edp-info-value {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    word-break: break-word;
}

.edp-info-value.muted {
    color: var(--color-text-secondary);
}

/* ── Section title inside tabs ────────────────────────────── */
.edp-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 var(--space-3);
}

.edp-section {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.edp-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ── Time input row (schedule override) ──────────────────── */
.edp-time-row {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.edp-time-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.edp-time-field label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--color-text-secondary);
}

.edp-time-sep {
    padding-bottom: 7px;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.edp-time-input,
.edp-select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.edp-time-input:focus,
.edp-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ── Day chips ────────────────────────────────────────────── */
.edp-day-chips {
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

.edp-day-chip {
    padding: 3px 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    line-height: 1.5;
}

.edp-day-chip:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.edp-day-chip.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

/* ── Location list ────────────────────────────────────────── */
.edp-location-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.edp-location-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) 0;
}

.edp-location-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    flex: 1;
    min-width: 0;
}

.edp-location-check input[type="checkbox"] {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--color-accent);
}

.edp-location-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edp-location-primary {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    cursor: pointer;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
}

.edp-location-primary input[type="radio"] {
    cursor: pointer;
    accent-color: var(--color-accent);
}

/* ── Save / Clear actions ─────────────────────────────────── */
.edp-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
    margin-top: var(--space-3);
}

/* ── Hint text ────────────────────────────────────────────── */
.edp-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-3);
    line-height: 1.5;
}

.edp-error {
    font-size: var(--font-size-xs);
    color: var(--color-error);
    margin: 0 0 var(--space-2);
}

/* ── Direct reports list ──────────────────────────────────── */
.edp-reports-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.edp-report-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
}

.edp-report-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    flex-shrink: 0;
}

.edp-report-name {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.edp-report-title {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* ── Manager search list ──────────────────────────────────── */
.edp-manager-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: var(--space-2);
}

.edp-manager-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-family: inherit;
}

.edp-manager-option:last-child {
    border-bottom: none;
}

.edp-manager-option:hover {
    background: var(--color-background);
}

.edp-manager-option--current {
    background: var(--color-accent-subtle);
}

.edp-manager-name {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.edp-manager-badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-accent-subtle);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* ── Mobile action buttons ────────────────────────────────── */
.edp-mobile-actions {
    display: none;
}

/* ── Mobile: full-screen panel ────────────────────────────── */
@media (max-width: 767px) {
    .edp-mobile-actions {
        display: flex;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-5);
        border-bottom: 1px solid var(--color-border);
        flex-shrink: 0;
    }

    .edp-action-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-1);
        padding: var(--space-2) var(--space-2);
        border-radius: var(--radius-md);
        border: 1px solid var(--color-border);
        background: transparent;
        font-size: var(--font-size-xs);
        font-weight: 500;
        font-family: inherit;
        cursor: pointer;
        transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    }

    .edp-action-btn--ghost {
        color: var(--color-text-secondary);
    }

    .edp-action-btn--ghost:hover {
        background: var(--color-background);
        color: var(--color-text-primary);
    }

    .edp-action-btn--warning {
        color: var(--color-warning);
        border-color: var(--color-warning);
    }

    .edp-action-btn--warning:hover {
        background: var(--color-warning-subtle);
        color: var(--color-warning-hover);
    }

    .edp-action-btn--success {
        color: var(--color-success);
        border-color: var(--color-success);
    }

    .edp-action-btn--success:hover {
        background: var(--color-success-subtle);
        color: var(--color-success-hover);
    }

    .edp-action-btn--danger {
        color: var(--color-error);
        border-color: var(--color-error);
    }

    .edp-action-btn--danger:hover {
        background: var(--color-error-subtle);
        color: var(--color-error-hover);
    }


    .edp-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: calc(var(--z-modal) - 1);
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .edp-panel {
        position: fixed;
        inset: 0;
        z-index: var(--z-modal);
        width: 100%;
        border-left: none;
        border-radius: 0;
        transition: none;
    }

    .edp-panel.edp-closed {
        display: none;
        width: 100%;
    }
}

/* ── Pay rate input ──────────────────────────────────────── */

.edp-pay-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 150ms;
}

.edp-pay-input-wrap:focus-within {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.edp-pay-symbol {
    padding: 0 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4B5563;
    background: #F9FAFB;
    border-right: 1px solid #E5E7EB;
    height: 100%;
    display: flex;
    align-items: center;
    min-height: 36px;
}

.edp-pay-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 10px;
    font-size: 0.875rem;
    color: #111827;
    background: transparent;
    min-width: 0;
}

.edp-pay-unit {
    padding: 0 10px;
    font-size: 0.8rem;
    color: #9CA3AF;
    white-space: nowrap;
}
