/* ──────────────────────────────────────────────────────────
   Namespace: eded-  (Edit Department V2 — mass action popup)
   Source:    HR101BL/Pages/employeeslist-v2/EditDepartmentV2.razor
              HR101BL/Pages/employeeslist-v2/EditDepartmentV2Base.cs

   Scope:
   - Standalone modal chrome (header + body + footer) for the
     "Edit Department" mass action triggered from /employeeslist-v2.
   - Mirrors EditOfficeV2 (edof-*) atoms with the eded-* prefix,
     same four-state extensions:
       · Intent  state: department picker + info callouts + Apply CTA
       · No-op   state: success callout, only Close
       · Progress state: icon tile + sweeping bar + shield foot
       · Result  state: header icon flips to green + stat cards
   - Self-contained — does NOT depend on any other CSS.
   - Desktop-only by request — no @media mobile/tablet rules.
   - Tokens are sourced from the globally-loaded design system
     (--is-brand-blue, --is-fg-1, etc.). Fallback values inlined
     in case insync-tokens.css is not present.
   ────────────────────────────────────────────────────────── */

/* ── Scrim + popup container ─────────────────────────────── */
.eded-pop-scrim {
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 50, 0.45);
    z-index: 1050;
}

.eded-pop {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 620px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    background: var(--is-bg-surface, #ffffff);
    border: 1px solid var(--is-border-1, #e6e9ef);
    border-radius: var(--is-radius-lg, 14px);
    box-shadow: var(--is-shadow-3, 0 8px 24px rgba(20, 28, 50, 0.10), 0 2px 6px rgba(20, 28, 50, 0.06));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1051;
    font-family: var(--is-font-sans, 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif);
    color: var(--is-fg-1, #1a1f2e);
}

/* Narrow modal width modifiers (per MD spec). */
.eded-pop--narrow { width: 560px; }
.eded-pop--medium { width: 620px; }

/* ── Header ──────────────────────────────────────────────── */
.eded-pop__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--is-border-1, #e6e9ef);
}

.eded-pop__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--is-radius-sm, 6px);
    display: inline-grid;
    place-items: center;
    font-size: 16px;
    color: #ffffff;
    background: var(--is-brand-blue, #0494da);
    transition: background 0.18s;
}

/* Result state flips the header icon tone to success green. */
.eded-pop__icon--success {
    background: var(--is-success, #26b050);
}

.eded-pop__titles {
    flex: 1;
    min-width: 0;
}

.eded-pop__titles h3 {
    font: 700 17px/1.25 var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    margin: 0 0 3px;
    color: var(--is-fg-1, #1a1f2e);
    letter-spacing: -0.005em;
}

.eded-pop__titles p {
    font: 500 12.5px/1.45 var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    margin: 0;
    color: var(--is-fg-3, #7a8395);
}

.eded-pop__close {
    width: 30px;
    height: 30px;
    border-radius: var(--is-radius-sm, 6px);
    border: 0;
    background: transparent;
    color: var(--is-fg-3, #7a8395);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    font-size: 12px;
    flex-shrink: 0;
}

.eded-pop__close:hover:not(:disabled) {
    background: var(--is-bg-surface-3, #f8f9fa);
    color: var(--is-fg-1, #1a1f2e);
}

.eded-pop__close:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Context bar ─────────────────────────────────────────── */
.eded-pop__ctx {
    padding: 12px 20px;
    background: var(--is-brand-blue-100, #e6f4fb);
    border-bottom: 1px solid #cfe4f4;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.eded-pop__ctx-lead {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: 600 12.5px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-brand-blue-700, #066894);
}

.eded-pop__ctx-lead i {
    font-size: 11px;
}

.eded-pop__ctx-count {
    background: var(--is-brand-blue, #0494da);
    color: #ffffff;
    padding: 2px 9px;
    border-radius: 999px;
    font: 700 11px var(--is-font-mono, 'JetBrains Mono', ui-monospace, monospace);
}

.eded-pop__ctx-chips {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.eded-empchip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #cfe4f4;
    font: 600 11px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-1, #1a1f2e);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eded-empchip--more {
    background: var(--is-brand-blue-700, #066894);
    color: #ffffff;
    border-color: var(--is-brand-blue-700, #066894);
}

/* ── Body ────────────────────────────────────────────────── */
.eded-pop__body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

/* Centered body for Progress + Result anchor blocks. */
.eded-pop__body--centered {
    align-items: center;
    text-align: center;
}

/* ── Department picker field ─────────────────────────────── */
.eded-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.eded-field__label {
    font: 600 12px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-2, #4a5468);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.eded-field__label i {
    font-size: 11px;
    color: var(--is-brand-blue, #0494da);
}

.eded-field__hint {
    font: 500 11.5px/1.45 var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-3, #7a8395);
}

/* Syncfusion single-dropdown alignment — matches the canonical V2 pattern
   (36px wrapper + 34px inner input), same as JobRoleDetailsV2 / ProjectListV2.
   Required so Syncfusion's popup-anchor JS reads the correct field bounding
   rect and aligns the popup just below the trigger. */
.eded-field .e-input-group {
    border-radius: var(--is-radius-sm, 6px);
}

.eded-field .e-ddl.e-input-group {
    min-height: 36px;
    height: 36px;
    box-sizing: border-box;
}

.eded-field .e-ddl.e-input-group input.e-input {
    height: 34px;
    line-height: 34px;
    box-sizing: border-box;
}

/* SfDropDownList popup — Syncfusion renders this at <body> level, NOT inside
   the modal's DOM tree. We target it globally by combining e-popup.e-popup-open
   .e-ddl with our custom CssClass "eded-popup" applied on SfDropDownList. The
   6px margin-top is the V2 standard gap so the popup doesn't visually merge
   with the trigger border. */
.e-popup.e-popup-open.e-ddl.eded-popup {
    border-radius: var(--is-radius-md, 8px);
    box-shadow: 0 10px 28px rgba(8, 12, 36, 0.18);
    border: 1px solid var(--is-border-2, #d1d1d6);
    margin-top: 6px !important;
}

.e-popup.e-popup-open.e-ddl.eded-popup .e-list-item {
    font: 500 13px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-1, #1a1f2e);
    line-height: 1.3;
    padding: 8px 12px;
}

.e-popup.e-popup-open.e-ddl.eded-popup .e-list-item.e-hover {
    background: var(--is-bg-surface-3, #f8f9fa);
    color: var(--is-fg-1, #1a1f2e);
}

.e-popup.e-popup-open.e-ddl.eded-popup .e-list-item.e-active {
    background: var(--is-brand-blue-100, #e6f4fb);
    color: var(--is-brand-blue-700, #066894);
}

/* ── Preview block ───────────────────────────────────────── */
/* Used in two flavours:
   - Intent: `Department: <from>  →  <to>`  (label · from · arrow · to)
   - Result: `<N> employees · now in <department>`  (count phrase · to)
   Both layouts share the same chrome — flex row, surface-3 bg, soft
   border. */
.eded-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: var(--is-radius-sm, 6px);
    background: var(--is-bg-surface-3, #f8f9fa);
    border: 1px solid var(--is-border-1, #e6e9ef);
    font: 500 12.5px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-2, #4a5468);
    flex-wrap: wrap;
}

/* Sitemap-icon prefix on the preview row. Same fg-3 tone as the label so
   they read as a single "Department:" lead. */
.eded-preview__icon {
    color: var(--is-fg-3, #7a8395);
    font-size: 13px;
    flex-shrink: 0;
}

.eded-preview__label {
    font-weight: 600;
    color: var(--is-fg-3, #7a8395);
    text-transform: none;
    flex-shrink: 0;
}

.eded-preview__label::after {
    content: ":";
    margin-left: 2px;
}

.eded-preview__from {
    font-weight: 600;
    color: var(--is-fg-1, #1a1f2e);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.eded-preview__arrow {
    color: var(--is-fg-3, #7a8395);
    font-size: 11px;
    flex-shrink: 0;
}

.eded-preview__to {
    font-weight: 700;
    color: var(--is-brand-blue, #0494da);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}


/* ── Warning / info callouts ─────────────────────────────── */
.eded-warn {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--is-radius-sm, 6px);
    font: 500 12.5px/1.5 var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    border: 1px solid;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.eded-warn i {
    flex-shrink: 0;
    font-size: 13px;
    margin-top: 1px;
}

.eded-warn b {
    font-weight: 700;
}

.eded-warn--info {
    background: var(--is-info-bg, #e6f4fb);
    border-color: #b7dcf2;
    color: #08577f;
}

.eded-warn--info i {
    color: var(--is-info, #0d8fd9);
}

.eded-warn--success {
    background: var(--is-success-bg, #e6f7ec);
    border-color: #b6e0c1;
    color: #1a6e35;
}

.eded-warn--success i {
    color: var(--is-success, #26b050);
}

.eded-warn--warning {
    background: var(--is-warning-bg, #fff5d6);
    border-color: #f1d684;
    color: #7a5800;
}

.eded-warn--warning i {
    color: var(--is-warning, #e6a700);
}

.eded-warn--danger {
    background: var(--is-danger-bg, #fde8e8);
    border-color: #f1b5b5;
    color: #8c1a1a;
}

.eded-warn--danger i {
    color: var(--is-danger, #d93131);
}

/* ── Progress anchor — large icon tile (64×64) ──────────── */
.eded-tile-lg {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    background: var(--is-brand-blue-100, #e6f4fb);
    color: var(--is-brand-blue, #0494da);
    font-size: 26px;
    margin-bottom: 6px;
}

.eded-progress__headline {
    font: 700 16px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-1, #1a1f2e);
    margin: 0;
}

.eded-progress__subhead {
    font: 500 12.5px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-3, #7a8395);
    margin: 4px 0 14px;
}

/* ── Indeterminate sweeping bar (Progress state) ─────────── */
.eded-sweep {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: var(--is-brand-blue-100, #e6f4fb);
    overflow: hidden;
    margin: 0 0 14px;
}

.eded-sweep::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg,
        rgba(4, 148, 218, 0) 0%,
        var(--is-brand-blue, #0494da) 50%,
        rgba(4, 148, 218, 0) 100%);
    animation: eded-sweep 1.1s linear infinite;
}

@keyframes eded-sweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

/* ── Stat cards (Result state) ───────────────────────────── */
.eded-stats {
    display: flex;
    gap: 12px;
    width: 100%;
}

.eded-stat {
    flex: 1;
    padding: 14px 16px;
    border-radius: var(--is-radius-sm, 6px);
    border: 1px solid var(--is-border-1, #e6e9ef);
    background: var(--is-bg-surface-3, #f8f9fa);
    text-align: left;
}

.eded-stat--success {
    background: var(--is-success-bg, #e6f7ec);
    border-color: #b6e0c1;
}

.eded-stat--danger {
    background: var(--is-danger-bg, #fde8e8);
    border-color: #f1b5b5;
}

.eded-stat__num {
    font: 800 24px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-1, #1a1f2e);
    line-height: 1;
}

.eded-stat--success .eded-stat__num {
    color: var(--is-success, #26b050);
}

.eded-stat--muted .eded-stat__num {
    color: var(--is-fg-3, #7a8395);
}

.eded-stat--danger .eded-stat__num {
    color: var(--is-danger, #d93131);
}

.eded-stat__label {
    font: 500 11.5px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-3, #7a8395);
    margin-top: 4px;
}

.eded-stat--success .eded-stat__label { color: #1a6e35; }
.eded-stat--danger .eded-stat__label  { color: #8c1a1a; }

/* ── Footer ──────────────────────────────────────────────── */
.eded-pop__foot {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--is-border-1, #e6e9ef);
    background: var(--is-bg-surface, #ffffff);
}

/* Progress footer pushes the shield meta to the left, button to the right. */
.eded-pop__foot--spread {
    justify-content: space-between;
}

.eded-foot-meta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: 500 11.5px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--is-fg-3, #7a8395);
}

.eded-foot-meta i {
    color: var(--is-info, #0d8fd9);
    font-size: 12px;
}

.eded-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--is-radius-sm, 6px);
    border: 1px solid transparent;
    font: 600 13px var(--is-font-sans, 'Plus Jakarta Sans', sans-serif);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    white-space: nowrap;
}

.eded-btn i {
    font-size: 11px;
}

.eded-btn--primary {
    background: var(--is-brand-blue, #0494da);
    color: #ffffff;
    border-color: var(--is-brand-blue, #0494da);
}

.eded-btn--primary:hover:not(:disabled) {
    background: var(--is-brand-blue-700, #066894);
    border-color: var(--is-brand-blue-700, #066894);
}

.eded-btn--ghost {
    background: #ffffff;
    color: var(--is-fg-2, #4a5468);
    border-color: var(--is-border-3, #b9bfca);
}

.eded-btn--ghost:hover:not(:disabled) {
    background: var(--is-bg-surface-3, #f8f9fa);
    color: var(--is-fg-1, #1a1f2e);
}

.eded-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
