/* Milestone 11 management CRUD and setup surfaces */
.management-heading {
    align-items: center;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--dq-line);
}
.management-heading .management-actions { justify-content: flex-end; }

.m11-management-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
}
.m11-management-summary > div {
    min-height: 68px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--dq-line);
    border-radius: 7px;
    background: #fff;
    box-shadow: var(--dq-shadow);
}
.m11-management-summary strong { font-size: 20px; line-height: 1; }
.m11-management-summary span { color: var(--dq-muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }

.m11-list-toolbar {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 10px;
    border: 1px solid var(--dq-line);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    background: #fff;
}
.m11-list-toolbar strong { font-size: 11px; }
.m11-list-toolbar span { color: var(--dq-muted); font-size: 9px; }
.m11-list-toolbar + .dashboard-table-wrap { border-radius: 0 0 7px 7px; }

.m11-entity-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 180px;
}
.m11-entity-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: #e8f4f2;
    color: var(--dq-green-dark);
    font-size: 10px;
    font-weight: 900;
}
.m11-entity-icon.is-blue { background: #e8eef9; color: var(--dq-blue); }
.m11-entity-icon.is-cream { background: #f4f0e8; color: #6d6254; }
.m11-entity-cell small,
.management-table td small { display: block; margin-top: 1px; color: var(--dq-muted); font-size: 9px; }

.management-table-card { padding: 0; overflow: hidden; }
.management-table-card > .dashboard-table-wrap { border: 0; box-shadow: none; overflow-x: auto; overflow-y: visible; }
.management-table-card .management-table th { position: static; top: auto; }
.management-table td:last-child { white-space: nowrap; }
.management-table .table-action + .table-action { margin-left: 3px; }

.m11-state-cell {
    min-width: 92px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* Form workspace */
.management-form-card {
    position: relative;
    max-width: 900px;
    padding: 0;
    overflow: hidden;
}
.m11-form-intro {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--dq-line);
    background: #fafbfc;
}
.m11-form-intro strong { display: block; font-size: 12px; }
.m11-form-intro span { display: block; margin-top: 2px; color: var(--dq-muted); font-size: 10px; }
.management-form-card .management-form { padding: 15px 16px 16px; }

.m11-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 14px;
}
.m11-form-grid .is-full { grid-column: 1 / -1; }

.management-permissions {
    border-color: var(--dq-line);
    background: #fafbfc;
}
.management-permissions summary {
    color: #3c4850;
    font-size: 10px;
}
.management-checkbox-list {
    max-height: 270px;
    overflow: auto;
    padding: 2px;
}
.management-checkbox-list label {
    padding: 5px 6px;
    border-radius: 5px;
}
.management-checkbox-list label:hover { background: #f1f5f5; }
.management-checkbox-list input { accent-color: var(--dq-green); }
.management-form-actions {
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--dq-line);
}

.m11-access-note {
    display: flex;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid #d9e9e6;
    border-radius: 6px;
    background: #f4faf9;
    color: #49615d;
    font-size: 10px;
}
.m11-access-note strong { color: var(--dq-green-dark); }

/* Hierarchical Employee access manager */
.m11-access-manager {
    overflow: hidden;
    border: 1px solid var(--dq-line);
    border-radius: 8px;
    background: #fff;
}
.m11-access-manager-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--dq-line);
    background: #fafbfc;
}
.m11-access-manager-heading h2 { margin: 2px 0 3px; font-size: 15px; }
.m11-access-manager-heading p:not(.eyebrow) { margin: 0; max-width: 620px; color: var(--dq-muted); font-size: 9px; }
.m11-access-legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.m11-access-legend span { display: inline-flex; align-items: center; gap: 4px; color: #637078; font-size: 8px; font-weight: 750; }
.m11-access-legend i { width: 7px; height: 7px; border-radius: 2px; background: #8d99a1; }
.m11-access-legend i.is-service { background: var(--dq-blue); }
.m11-access-legend i.is-client { background: var(--dq-green); }
.m11-access-legend i.is-month { background: #8b6bc1; }

.m11-access-service-list { max-height: 560px; overflow: auto; background: #f8fafb; }
.m11-access-service-group {
    margin: 10px;
    overflow: hidden;
    border: 1px solid #dde3e7;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(18, 45, 54, .035);
}
.m11-access-service-group + .m11-access-service-group { margin-top: 8px; }
.m11-access-service-summary {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 7px 11px;
    border-left: 3px solid var(--dq-blue);
    background: #f7f9fd;
    cursor: pointer;
    list-style: none;
}
.m11-access-service-summary::-webkit-details-marker { display: none; }
.m11-access-disclosure { color: #6c7d88; font-size: 12px; transition: transform .15s ease; }
.m11-access-service-group:not([open]) .m11-access-disclosure { transform: rotate(-90deg); }
.m11-access-count {
    padding: 3px 6px;
    border-radius: 999px;
    background: #edf1f5;
    color: #6c7780;
    font-size: 8px;
    font-weight: 800;
    white-space: nowrap;
}

.m11-access-client-list { border-top: 1px solid #e8ecef; }
.m11-access-client-row {
    display: grid;
    grid-template-columns: minmax(210px, .9fr) minmax(0, 1.45fr);
    min-height: 58px;
    border-bottom: 1px solid #eef1f3;
}
.m11-access-client-row:last-child { border-bottom: 0; }
.m11-access-client-head {
    display: flex;
    align-items: center;
    padding-left: 16px;
    border-right: 1px solid #edf0f2;
    background: #fcfefd;
}
.m11-access-choice {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 9px;
    cursor: pointer;
}
.m11-access-choice.is-service { padding: 4px 2px; }
.m11-access-choice > input,
.m11-access-month-chip > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.m11-access-checkmark {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid #b8c1c7;
    border-radius: 4px;
    background: #fff;
}
.m11-access-choice input:checked + .m11-access-checkmark { border-color: var(--dq-green); background: var(--dq-green); }
.m11-access-choice.is-service input:checked + .m11-access-checkmark { border-color: var(--dq-blue); background: var(--dq-blue); }
.m11-access-choice input:checked + .m11-access-checkmark::after { content: "✓"; color: #fff; font-size: 10px; font-weight: 900; }
.m11-access-choice strong { display: block; color: #27343b; font-size: 10px; }
.m11-access-choice small { display: block; margin-top: 1px; color: var(--dq-muted); font-size: 8px; line-height: 1.25; }
.m11-access-choice:hover { background: #f5f9f8; }
.m11-access-choice.is-inherited { cursor: default; background: #f7fbfa; }
.m11-access-choice.is-inherited .m11-access-checkmark { opacity: .72; }

.m11-access-years { display: grid; align-content: center; padding: 6px 9px; }
.m11-access-year-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 32px;
}
.m11-access-year-row + .m11-access-year-row { border-top: 1px dashed #eef1f3; }
.m11-access-year {
    color: #5e6d76;
    font-size: 9px;
    font-weight: 850;
}
.m11-access-months {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 4px 0;
}
.m11-access-month-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 31px;
    min-height: 25px;
    padding: 4px 7px;
    border: 1px solid #d8dce2;
    border-radius: 5px;
    background: #fff;
    color: #536069;
    font-size: 8px;
    font-weight: 800;
    cursor: pointer;
}
.m11-access-month-chip:has(input:checked) { border-color: #b7a3da; background: #f3effa; color: #674c95; }
.m11-access-month-chip.is-inherited { opacity: .76; cursor: default; border-style: dashed; }
.m11-access-empty { padding: 8px 0; color: #8a949b; font-size: 8px; }
.m11-access-empty-row { padding: 11px 14px 11px 40px; color: #7d888f; font-size: 9px; }
.m11-access-manager > .field-error,
.m11-access-manager > .management-inline-note { margin: 10px 12px 12px; }

/* Password-recovery operations */
.m11-reset-layout {
    display: grid;
    grid-template-columns: minmax(250px, .75fr) minmax(0, 1.5fr);
    gap: 12px;
    align-items: start;
}
.m11-reset-layout .task-context-card { position: sticky; top: 66px; }
.m11-reset-actions { display: grid; gap: 12px; }
.m11-reset-actions .management-form-card { max-width: none; }
.m11-reset-actions .management-form-card > .eyebrow,
.m11-reset-actions .management-form-card > h2,
.m11-reset-actions .management-form-card > .muted {
    margin-left: 16px;
    margin-right: 16px;
}
.m11-reset-actions .management-form-card > .eyebrow { margin-top: 15px; }
.m11-reset-actions .management-form-card > h2 { margin-top: 4px; }
.m11-danger-card { border-color: #ead4d8; }
.m11-danger-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #b64c61;
}
.m11-danger-button { border-color: #d9a9b2; color: #96384b; }
.m11-danger-button:hover { background: #fbf2f4; }

@media (max-width: 900px) {
    .m11-management-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .m11-form-grid { grid-template-columns: 1fr; }
    .m11-form-grid .is-full { grid-column: auto; }
    .m11-access-manager-heading { flex-direction: column; }
    .m11-access-legend { justify-content: flex-start; }
    .m11-access-client-row { grid-template-columns: 1fr; }
    .m11-access-client-head { border-right: 0; border-bottom: 1px solid #edf0f2; }
    .m11-access-years { padding-left: 40px; }
    .m11-reset-layout { grid-template-columns: 1fr; }
    .m11-reset-layout .task-context-card { position: static; }
}

@media (max-width: 640px) {
    .m11-management-summary { grid-template-columns: 1fr; }
    .m11-list-toolbar { align-items: flex-start; flex-direction: column; }
    .m11-access-service-list { max-height: none; }
    .m11-access-service-summary { grid-template-columns: 16px minmax(0, 1fr); }
    .m11-access-count { display: none; }
    .m11-access-years { padding-left: 22px; }
    .m11-access-year-row { grid-template-columns: 40px minmax(0, 1fr); }
}
