/* Global administration shares the asset workspace’s spacing, surfaces and type. */
.dam-shell .mg-page { max-width: 1320px; margin: 0 auto; min-width: 0; }
.dam-shell .mg-header, .dam-shell .mg-page > .page-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 4px 0 26px; }
.dam-shell .mg-header h1, .dam-shell .mg-page > .page-title h1 { font-size: clamp(25px, 2.5vw, 32px); font-weight: 580; letter-spacing: -1.1px; line-height: 1.16; margin: 9px 0 10px; }
.dam-shell .mg-header p, .dam-shell .mg-page > .page-title p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; max-width: 630px; }
.dam-shell .mg-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; padding-top: 14px; }
.dam-shell .mg-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 10px; background: var(--line); margin: 0 0 22px; overflow: hidden; }
.dam-shell .mg-stats > div { padding: 17px 20px; background: #1a1d17; }
.dam-shell .mg-stats dt { color: var(--muted); font-size: 11px; line-height: 1.5; }
.dam-shell .mg-stats dd { margin: 8px 0 0; font-size: 26px; font-weight: 550; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.dam-shell .mg-guidance { display: flex; align-items: center; gap: 20px; padding: 17px 20px; margin: 0 0 25px; background: #20231b; border: 1px solid #373c2d; border-radius: 9px; }
.dam-shell .mg-guidance p { font-size: 12px; line-height: 1.8; color: #abb29f; margin: 0; flex: 1; }
.dam-shell .mg-guidance strong { color: #e1e5d7; font-weight: 550; }
.dam-shell .mg-toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.dam-shell .mg-search { flex: 1 1 250px; min-width: 0; max-width: 600px; }
.dam-shell .mg-search, .dam-shell .mg-filter { display: flex; flex-direction: column; gap: 7px; }
.dam-shell .mg-search > span, .dam-shell .mg-filter > span { font-size: 11px; color: #a4aa9a; }
.dam-shell .mg-search input, .dam-shell .mg-filter select { width: 100%; height: 42px; padding: 10px 12px; font-size: 12px; background: #1a1e16; border-color: #3a4031; }
.dam-shell .mg-search input::placeholder { color: #838c77; }
.dam-shell .mg-filter { flex: 0 1 175px; min-width: 130px; }
.dam-shell .mg-results-label { font-size: 11px; color: var(--muted); margin-bottom: 12px; min-height: 16px; }
.dam-shell .mg-table-wrap, .dam-shell .mg-page .table-wrap { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.dam-shell .mg-people-table { background: #1b1e18; font-size: 12px; }
.dam-shell .mg-people-table th { padding: 14px 18px; background: #22271e; }
.dam-shell .mg-people-table td { padding: 16px 18px; line-height: 1.65; vertical-align: middle; overflow-wrap: anywhere; }
.dam-shell .mg-people-table td:nth-child(1) { min-width: 240px; }
.dam-shell .mg-people-table td:nth-child(2) { min-width: 130px; }
.dam-shell .mg-people-table tr:hover { background: #20251c; }
.dam-shell .mg-person { display: flex; align-items: center; gap: 11px; }
.dam-shell .mg-person strong { display: inline; font-size: 12px; font-weight: 550; }
.dam-shell .mg-person small { font-size: 11px; margin-top: 2px; color: #a4aa9b; }
.dam-shell .mg-avatar { width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: #343a2b; color: #cbd2be; font-size: 10px; letter-spacing: .4px; }
.dam-shell .mg-you { display: inline-flex; font-size: 9px; margin: 6px 0 0; border-radius: 4px; background: #3c3522; color: var(--gold); padding: 0 6px; }
.dam-shell .mg-row-actions { text-align: right; white-space: nowrap; }
.dam-shell .mg-row-actions .btn { min-height: 36px; }
.dam-shell .mg-empty { text-align: center; padding: 46px 22px; color: var(--muted); width: 100%; }
.dam-shell .mg-empty h2 { margin: 0 0 10px; color: #e3e7dc; font-size: 18px; font-weight: 550; }
.dam-shell .mg-empty p { font-size: 13px; line-height: 1.7; margin: 0 auto; max-width: 470px; }
.dam-shell .mg-empty .btn { margin-top: 18px; }
.dam-shell .mg-organization { display: grid; gap: 20px; }
.dam-shell .mg-state { border: 1px solid var(--line); border-radius: 11px; background: #191c16; overflow: hidden; }
.dam-shell .mg-state-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); background: #20251b; }
.dam-shell .mg-state-title { display: flex; gap: 11px; align-items: center; }
.dam-shell .mg-state-code { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; color: var(--gold); background: #393323; font-size: 11px; border-radius: 7px; }
.dam-shell .mg-state-title h2 { margin: 0; font-size: 20px; font-weight: 550; letter-spacing: -.4px; overflow-wrap: anywhere; }
.dam-shell .mg-state-header p, .dam-shell .mg-store-header p { margin: 7px 0 0; font-size: 11px; color: #9da692; line-height: 1.6; }
.dam-shell .mg-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.dam-shell .mg-card-actions .btn { min-height: 36px; padding: 8px 11px; font-size: 11px; }
.dam-shell .mg-card-actions .danger { color: #c7a29b; }
.dam-shell .mg-card-actions .danger:hover { color: #ffbbb0; background: #38221d; border-color: #6e3930; }
.dam-shell .mg-store-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 14px; padding: 18px; }
.dam-shell .mg-store { border: 1px solid #343a2c; border-radius: 8px; overflow: hidden; background: #1c2118; }
.dam-shell .mg-store-header { display: flex; flex-wrap: wrap; gap: 13px; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.dam-shell .mg-store-header h3 { margin: 0; font-size: 15px; line-height: 1.6; font-weight: 550; overflow-wrap: anywhere; }
.dam-shell .mg-locations { margin: 0; padding: 0; list-style: none; }
.dam-shell .mg-locations > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #303629; }
.dam-shell .mg-locations > li:last-child { border-bottom: 0; }
.dam-shell .mg-locations strong { font-size: 12px; line-height: 1.6; font-weight: 500; overflow-wrap: anywhere; }
.dam-shell .mg-locations small { display: block; font-size: 10px; color: #a0aa92; line-height: 1.7; margin-top: 4px; }
.dam-shell .mg-store-footer { border-top: 1px solid var(--line); padding: 12px 16px; }
.dam-shell .mg-store-footer .btn { min-height: 36px; font-size: 11px; }
.dam-shell .mg-organization-empty { padding: 18px 6px; font-size: 12px; color: #98a18b; line-height: 1.7; grid-column: 1/-1; }
.dam-shell .mg-locations > .mg-organization-empty { padding: 18px 16px; }
.dam-shell .mg-footnote { margin: 19px 0 0; color: #99a28d; font-size: 11px; line-height: 1.8; }
.dam-shell .mg-activity { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; list-style: none; background: #1a1e16; }
.dam-shell .mg-activity > li { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 17px; align-items: start; padding: 19px 20px; border-bottom: 1px solid var(--line); }
.dam-shell .mg-activity > li:last-child { border-bottom: 0; }
.dam-shell .mg-activity-mark { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; background: var(--gold); }
.dam-shell .mg-activity-mark.downloads { background: #9ab8ca; }
.dam-shell .mg-activity-mark.accounts { background: #9bc9a6; }
.dam-shell .mg-activity-mark.organization { background: #cfb9d4; }
.dam-shell .mg-activity h2 { font-weight: 550; font-size: 12px; margin: 0 0 4px; line-height: 1.6; }
.dam-shell .mg-activity p { font-size: 12px; line-height: 1.7; color: #bdc6af; margin: 0; overflow-wrap: anywhere; }
.dam-shell .mg-activity small { color: #8e9980; font-size: 10px; display: block; margin-top: 5px; }
.dam-shell .mg-activity time { color: #9aa38e; font-size: 10px; line-height: 1.7; white-space: nowrap; margin-top: 2px; }
.dam-shell .mg-source-summary { display: flex; gap: 14px; align-items: center; padding: 17px 20px; border: 1px solid var(--line); border-radius: 9px; background: #1c2218; margin-bottom: 20px; }
.dam-shell .mg-source-summary strong { font-size: 13px; font-weight: 550; }
.dam-shell .mg-source-summary p { font-size: 11px; margin: 5px 0 0; color: #99a28e; line-height: 1.7; }
.dam-shell .mg-source-summary .status { margin-left: auto; }
.dam-shell .mg-connection-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #ba9760; }
.dam-shell .mg-connection-dot.is-connected { background: var(--green); box-shadow: 0 0 0 4px #9bc9a612; }
.dam-shell .mg-source-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.dam-shell .mg-page .panel { padding: 22px; margin-top: 0; background: #1b2017; border-color: #343b2b; }
.dam-shell .mg-source-card h2 { font-size: 19px; letter-spacing: -.3px; line-height: 1.5; margin: 11px 0; }
.dam-shell .mg-source-card > p { font-size: 12px; line-height: 1.9; }
.dam-shell .mg-source-details { display: grid; gap: 11px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 18px 0; font-size: 11px; }
.dam-shell .mg-source-details > div { display: flex; gap: 12px; justify-content: space-between; }
.dam-shell .mg-source-details dt { color: var(--muted); }
.dam-shell .mg-source-details dd { margin: 0; text-align: right; }
.dam-shell .mg-permission-list { margin: 18px 0 0; padding: 0; list-style: none; }
.dam-shell .mg-permission-list li + li { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 15px; }
.dam-shell .mg-permission-list strong { font-size: 12px; font-weight: 550; }
.dam-shell .mg-permission-list p { margin: 7px 0 0; font-size: 12px; line-height: 1.8; color: #a0aa92; }
.dam-shell .mg-page .notice { background: #25281c; border-color: #424b30; color: #c6ceac; }
.dam-shell .mg-page .field { display: flex; flex-direction: column; gap: 8px; color: #a4ae95; font-size: 11px; margin: 0 0 18px; max-width: 600px; }
.dam-shell .mg-page .field input { width: 100%; height: 42px; font-size: 12px; }
.dam-shell .mg-page .tag-panels { gap: 16px; }
.dam-shell .mg-page .tag-panels .panel { padding: 20px; }
.dam-shell .mg-page .tag-panels .section-head h2 { font-size: 16px; }
.dam-shell .mg-page .tag-option { padding: 12px 0; }
.dam-shell .mg-page .tag-option .btn { min-height: 32px; }
.dam-shell .mg-page .migration-progress { width: 100%; }
/* The native dialog sits beside the workspace root, so its existing ID scopes it. */
#modal { width: min(760px,calc(100vw - 32px)); max-height: min(90vh,900px); max-height: min(90dvh,900px); overflow: auto; overscroll-behavior: contain; background: #1c2118; border-color: #465039; border-radius: 12px; }
#modal .modal-head { position: sticky; top: 0; z-index: 2; background: #1e2419; padding: 20px 24px; gap: 16px; }
#modal .modal-head h2 { min-width: 0; overflow-wrap: anywhere; font-size: 20px; line-height: 1.4; font-weight: 550; letter-spacing: -.4px; }
#modal .modal-head button { width: 36px; height: 36px; display: grid; place-items: center; flex-shrink: 0; border-radius: 6px; }
#modal .modal-head button:hover { color: #eeeee5; background: #323a2a; }
#modal .modal-body { padding: 24px; }
#modal .modal-body p { line-height: 1.8; }
#modal .modal-body .field { min-width: 0; font-size: 12px; }
#modal .modal-body .field :is(input,select,textarea) { min-width: 0; width: 100%; max-width: 100%; background: #171d12; border-color: #404a34; border-radius: 7px; padding: 11px 12px; }
#modal .field-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
#modal .modal-body .small-note { font-size: 11px; color: #a4ae96; line-height: 1.9; }
#modal .notice { background: #252c1c; border-color: #485333; color: #c8d2b2; font-size: 12px; }
#modal .error { color: #ffc0b3; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
#modal .modal-footer { position: sticky; bottom: 0; z-index: 2; background: #1e2419; padding: 17px 24px; flex-wrap: wrap; box-shadow: 0 -8px 18px #14180e40; }
#modal .btn { min-height: 44px; }
#modal :is(button,a,input,select,textarea):focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 1200px) {
 .dam-shell .mg-store-grid { grid-template-columns: 1fr; }
 .dam-shell .mg-source-grid { grid-template-columns: 1fr; }
 .dam-shell .mg-guidance { align-items: flex-start; flex-direction: column; gap: 12px; }
}
@media (max-width: 700px) {
 .dam-shell .mg-header, .dam-shell .mg-page > .page-title { flex-direction: column; gap: 14px; margin-bottom: 22px; }
 .dam-shell .mg-header-actions { padding-top: 0; }
 .dam-shell .mg-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .dam-shell .mg-stats > div { padding: 15px; }
 .dam-shell .mg-stats dd { font-size: 23px; }
 .dam-shell .mg-toolbar { gap: 12px; }
 .dam-shell .mg-search { flex-basis: 100%; max-width: none; }
 .dam-shell .mg-filter { flex: 1 1 125px; }
 .dam-shell .mg-state-header { align-items: flex-start; flex-direction: column; padding: 17px; }
 .dam-shell .mg-state-title h2 { font-size: 18px; }
 .dam-shell .mg-store-grid { padding: 13px; }
 .dam-shell .mg-locations > li { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
 .dam-shell .mg-people-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
 .dam-shell .mg-people-table, .dam-shell .mg-people-table tbody, .dam-shell .mg-people-table tr, .dam-shell .mg-people-table td { display: block; width: 100%; }
 .dam-shell .mg-people-table tr { padding: 15px 17px; border-bottom: 1px solid var(--line); }
 .dam-shell .mg-people-table tr:last-child { border-bottom: 0; }
 .dam-shell .mg-people-table td { border: 0; padding: 7px 0; min-width: 0 !important; text-align: left; }
 .dam-shell .mg-people-table td[data-label]:not(:first-child) { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
 .dam-shell .mg-people-table td[data-label]:not(:first-child)::before { content: attr(data-label); color: #8f9a7f; font-size: 10px; flex-shrink: 0; padding-top: 2px; }
 .dam-shell .mg-row-actions { padding-top: 10px !important; }
 .dam-shell .mg-row-actions .btn { width: 100%; }
 .dam-shell .mg-activity > li { grid-template-columns: 7px minmax(0,1fr); padding: 17px; gap: 10px; }
 .dam-shell .mg-activity time { grid-column: 2; margin-top: 0; white-space: normal; }
 .dam-shell .mg-source-summary { align-items: flex-start; flex-wrap: wrap; padding: 17px; gap: 12px; }
 .dam-shell .mg-source-summary .status { margin-left: 20px; }
 .dam-shell .mg-connection-dot { margin-top: 4px; }
 .dam-shell .mg-page .panel { padding: 18px; }
 .dam-shell .mg-page .tag-panels .panel { padding: 18px; }
 .dam-shell .mg-header-actions .btn, .dam-shell .mg-card-actions .btn { min-height: 40px; }
 #modal .modal-head { padding: 17px 18px; }
 #modal .modal-body { padding: 20px 18px; }
 #modal .field-row { grid-template-columns: 1fr; gap: 0; }
 #modal .modal-footer { padding: 14px 18px; gap: 8px; }
 #modal .modal-footer .btn { flex: 1 1 auto; white-space: normal; }
}

/* Captured legacy details use the same palette in both themes. */
.dam-shell .mg-stats { grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); }
.dam-shell .mg-legacy-summary ul { margin: 10px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.7; }
.mg-legacy-profile { margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; color: inherit; }
.mg-legacy-profile summary { cursor: pointer; font-size: 12px; font-weight: 550; }
.mg-legacy-profile dl { margin: 12px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mg-legacy-profile dt { font-size: 11px; color: var(--muted); }
.mg-legacy-profile dd { margin: 3px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.mg-legacy-profile p { margin: 10px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted); }
.mg-store > .mg-legacy-profile { margin: 0 16px 16px; }
@media (max-width:700px) { .mg-legacy-profile dl { grid-template-columns: 1fr; } }
.mg-contact { min-width: 0; padding: 16px; border-bottom: 1px solid var(--line); }
.mg-contact-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.mg-contact-head h4 { margin: 0; font-size: 12px; font-weight: 600; }
.mg-contact-head .btn { min-height: 36px; font-size: 12px; }
.mg-contact dl { display: grid; gap: 10px; margin: 14px 0 0; }
.mg-contact dl > div { display: grid; grid-template-columns: 65px minmax(0,1fr); gap: 12px; align-items: baseline; }
.mg-contact dt { font-size: 11px; color: var(--muted); }
.mg-contact dd { margin: 0; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.mg-contact-source { margin: 12px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted); }
.mg-location-details { flex: 1; min-width: 0; }
.mg-location-details .mg-contact { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
#modal .mg-contact-scope { margin: 0 0 10px; font-weight: 550; overflow-wrap: anywhere; }
#modal .mg-contact-address { margin: 6px 0 20px; }
#modal .mg-contact-address summary { cursor: pointer; margin-bottom: 16px; font-size: 12px; font-weight: 550; }
