/* ─── Manager card grid ────────────────────────────────────────────────────── */
.mgr-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1100px) {
    .mgr-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .mgr-card-grid { grid-template-columns: 1fr; }
}

/* ─── Single manager card ──────────────────────────────────────────────────── */
.mgr-card {
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 18px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    box-shadow: 0 2px 8px rgba(15,23,42,.04);
    transition: box-shadow .15s, border-color .15s;
}

.mgr-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 6px 24px rgba(124,58,237,.10);
}

.mgr-card__top {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
}

.mgr-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.mgr-card__meta {
    flex: 1;
    min-width: 0;
}

.mgr-card__name {
    font-size: .9375rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mgr-card__uname {
    font-size: .75rem;
    color: #94a3b8;
    margin-top: .1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mgr-card__role {
    display: inline-flex;
    align-items: center;
    margin-top: .35rem;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .18rem .5rem;
    border-radius: 6px;
    background: #ede9fe;
    color: #6d28d9;
}

/* ─── Section divider inside card ─────────────────────────────────────────── */
.mgr-card__section {
    border-top: 1px solid #f1f5f9;
    padding-top: .8rem;
}

.mgr-card__sec-label {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #94a3b8;
    margin-bottom: .4rem;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.mgr-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

/* ─── Edit button ──────────────────────────────────────────────────────────── */
.mgr-card__edit-btn {
    margin-top: auto;
    width: 100%;
    padding: .55rem 1rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #374151;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.mgr-card__edit-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(124,58,237,.28);
}

/* ─── Overlay backdrop ─────────────────────────────────────────────────────── */
.mgr-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15,23,42,.38);
    backdrop-filter: blur(2px);
}

/* ─── Slide-over panel ─────────────────────────────────────────────────────── */
.mgr-slideover {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 100vw);
    background: #fff;
    box-shadow: -16px 0 60px rgba(15,23,42,.16);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-radius: 20px 0 0 20px;
    overflow: hidden;
}

.mgr-slideover__hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.375rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg,#fff 0%,#fafbfd 100%);
    flex-shrink: 0;
}

.mgr-slideover__hdr-info {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.mgr-slideover__hdr-av {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.mgr-slideover__close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 9px;
    cursor: pointer;
    color: #64748b;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s;
}

.mgr-slideover__close:hover { background: #e2e8f0; }

.mgr-slideover__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.375rem;
}

/* ─── Section heading inside slide-over ───────────────────────────────────── */
.mgr-sec-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .6rem;
}

.mgr-sec-head__icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #ede9fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    color: #7c3aed;
    flex-shrink: 0;
}

.mgr-sec-head__label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #475569;
}

/* ─── Permission icon cards ────────────────────────────────────────────────── */
.admin-ui .mgr-slideover label.mgr-wh-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0;
    margin: 0 !important;
}

.admin-ui .mgr-slideover label.mgr-perm-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: .3rem;
    margin: 0 !important;
}

.admin-ui .mgr-slideover .mgr-pick-chip__check {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    pointer-events: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.admin-ui .mgr-slideover .mgr-pick-chip__check::before {
    display: none !important;
    content: none !important;
}

.mgr-perm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .4rem;
}

@media (max-width: 480px) {
    .mgr-perm-grid { grid-template-columns: repeat(3, 1fr); }
}

.mgr-perm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .55rem .35rem;
    border-radius: 12px;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    transition: background .12s;
    text-align: center;
    user-select: none;
}

.mgr-perm-card__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    color: #64748b;
    transition: color .12s;
}

.mgr-perm-card__svg {
    width: 22px;
    height: 22px;
    object-fit: contain;
    opacity: .68;
}

.mgr-perm-card__lbl {
    font-size: .62rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
    transition: color .12s;
}

.mgr-perm-card:has(input:checked) {
    background: #ede9fe;
}

.mgr-perm-card:has(input:checked) .mgr-perm-card__icon {
    color: #7c3aed;
}

.mgr-perm-card:has(input:checked) .mgr-perm-card__svg {
    opacity: 1;
}

.mgr-perm-card:has(input:checked) .mgr-perm-card__lbl { color: #5b21b6; }

/* ─── Warehouse cards ──────────────────────────────────────────────────────── */
.mgr-wh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
}

@media (max-width: 480px) {
    .mgr-wh-grid { grid-template-columns: repeat(2, 1fr); }
}

.mgr-wh-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: .45rem .55rem;
    border-radius: 12px;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    transition: background .12s;
    text-align: center;
    user-select: none;
}

.mgr-wh-card__lbl {
    font-size: .6875rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.25;
    transition: color .12s;
}

.mgr-wh-card:has(input:checked) {
    background: #ede9fe;
}

.mgr-wh-card:has(input:checked) .mgr-wh-card__lbl { color: #5b21b6; }

/* ─── Field labels ─────────────────────────────────────────────────────────── */
.mgr-field-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .3rem;
}

/* ─── Badges ───────────────────────────────────────────────────────────────── */
.mgr-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem .55rem;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 600;
    white-space: nowrap;
}

.mgr-badge--stock { background: #ede9fe; color: #6d28d9; }
.mgr-badge--perm  { background: #f0fdf4; color: #15803d; }
.mgr-badge--none  { background: #fef2f2; color: #fca5a5; }
