/* Management views share typography, controls and surfaces with the application shell. */
.management-page { min-width: 0; padding-bottom: 2rem; }
.mg-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 0 0 1.65rem; }
.mg-page-heading p { margin-top: .38rem; font-size: .95rem; }
.mg-section { margin-top: 2rem; }
.mg-section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .85rem; }
.mg-section-title > div { min-width: 0; }
.mg-section-title a { display: inline-flex; align-items: center; gap: .35rem; flex: none; text-decoration: none; font-weight: 700; font-size: .9rem; padding-block: .35rem; }
.mg-section-title p { margin-top: .25rem; }
.mg-summary-grid, .mg-project-grid, .mg-card-grid { display: grid; gap: 1rem; }
.mg-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mg-project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mg-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mg-summary { display: grid; gap: 1.25rem; min-width: 0; color: var(--ink); text-decoration: none; padding: 1.25rem; }
.mg-summary:hover, .mg-project:hover { border-color: #aab9ec; }
.mg-summary-icon, .mg-empty-icon { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 12px; background: var(--soft-blue); color: var(--blue); flex: none; }
.mg-summary strong { display: block; color: var(--navy); font-size: clamp(2rem, 3vw, 2.5rem); line-height: 1.1; font-weight: 760; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.mg-summary small { display: block; margin-top: .45rem; color: var(--muted); font-size: .85rem; }
.mg-summary > .icon:last-child { margin-left: auto; color: var(--blue); }
.mg-project { padding: 0; overflow: hidden; }
.mg-project-link { display: block; color: var(--ink); text-decoration: none; }
.mg-project-link:focus-visible { outline-offset: -4px; border-radius: var(--radius); }
.mg-project-visual { position: relative; display: grid; place-items: center; min-height: 9rem; aspect-ratio: 2 / 1; background: linear-gradient(125deg, #e3eaff, #bfcafa); overflow: hidden; }
.mg-project-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mg-project-monogram { color: #4051a7; font-size: clamp(2rem, 4vw, 3.6rem); font-weight: 750; letter-spacing: -.07em; }
.mg-project-state { position: absolute; top: .75rem; left: .75rem; }
.mg-project-content { padding: 1.25rem; }
.mg-project-content h2, .mg-detail-card h2, .mg-record h2 { overflow-wrap: anywhere; font-size: 1.13rem; }
.mg-project-content p { display: flex; align-items: center; gap: .36rem; color: var(--muted); margin: .35rem 0 .7rem; overflow-wrap: anywhere; font-size: .9rem; }
.mg-open-link, .mg-back { display: inline-flex; align-items: center; gap: .4rem; color: var(--blue); text-decoration: none; font-weight: 700; font-size: .88rem; }
.mg-open-link:hover, .mg-back:hover { text-decoration: underline; }
.mg-back { margin-bottom: .85rem; min-height: 44px; }
.mg-detail-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.mg-detail-aside, .mg-record-list { display: grid; gap: 1rem; min-width: 0; }
.mg-detail-card, .mg-record { min-width: 0; padding: 1.25rem; }
.mg-detail-card > .mg-pill { margin: .3rem 0 .8rem; }
.mg-detail-cover { display: block; width: 100%; max-height: 21rem; object-fit: cover; border-radius: 12px; margin-bottom: .8rem; }
.mg-text { color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; margin: .65rem 0; }
.mg-note { font-size: .83rem; color: var(--blue); font-weight: 700; margin-bottom: .5rem; }
.mg-data-list { list-style: none; margin: .7rem 0; padding: 0; }
.mg-data-list li { display: flex; justify-content: space-between; align-items: start; gap: .65rem; padding: .56rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mg-pill { display: inline-flex; align-items: center; flex: none; width: fit-content; max-width: 100%; padding: .22rem .53rem; border-radius: 999px; font-size: .75rem; font-weight: 750; line-height: 1.35; }
.mg-pill-blue { background: #edf0ff; color: #263a9c; }
.mg-pill-good { background: #e6f5ed; color: #14583d; }
.mg-pill-warn { background: #fff0e2; color: #8f3612; }
.mg-project-state .mg-pill { box-shadow: 0 3px 12px #17236525; }
.mg-stack { padding: 0 1rem; }
.mg-inline-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 0; }
.mg-inline-row + .mg-inline-row { border-top: 1px solid var(--line); }
.mg-inline-row div > span { display: block; font-size: .85rem; }
.mg-empty { display: grid; gap: .45rem; justify-items: center; text-align: center; padding: clamp(1.25rem, 4vw, 2.35rem) 1rem; border: 1px dashed #c7d2ee; background: #fff; border-radius: var(--radius); }
.mg-empty p { max-width: 36rem; color: var(--muted); }
.mg-empty h2 { margin-top: .25rem; }
.mg-empty .btn { margin-top: .6rem; }
.mg-disclosure { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: .55rem 0; }
.mg-disclosure > summary { min-height: 44px; cursor: pointer; padding: .61rem .8rem; font-weight: 720; color: var(--navy); }
.mg-disclosure > summary:hover { background: #f6f8ff; border-radius: 12px; }
.mg-disclosure[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.mg-disclosure-body { padding: 1.1rem; }
.mg-create { margin: 0 0 1rem; }
.mg-create > summary { background: var(--soft-blue); color: var(--navy); border-radius: 12px; }
.mg-form { display: grid; gap: .8rem; min-width: 0; }
.mg-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; min-width: 0; }
.mg-field { min-width: 0; display: grid; gap: .32rem; align-content: start; }
.mg-field > span { font-size: .86rem; font-weight: 690; }
.mg-field input, .mg-field select, .mg-field textarea { width: 100%; min-width: 0; }
.mg-field input[type=file] { padding: .5rem; font-size: .88rem; }
.mg-field input[type=file]::file-selector-button { cursor: pointer; color: var(--navy); background: var(--soft-blue); border: 1px solid #c5d0f3; border-radius: 8px; padding: .4rem .6rem; margin-right: .55rem; }
.mg-form > .muted { font-size: .88rem; }
.mg-check { display: flex; align-items: start; gap: .55rem; font-size: .88rem; min-height: 44px; padding-block: .5rem; cursor: pointer; }
.mg-check > input { width: 1.1rem; height: 1.1rem; flex: none; margin-top: .18rem; accent-color: var(--blue); }
.mg-form-end { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.mg-form-status { font-size: .86rem; color: var(--muted); }
.mg-form-status[data-tone=error] { color: var(--danger); }
.mg-toolbar { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; background: #fff; margin: 0 0 1rem; }
.mg-toolbar .mg-form { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.mg-toolbar .mg-field { min-width: 10rem; flex: 1 1 11rem; max-width: 23rem; }
.mg-toolbar .mg-check { align-self: end; }
.mg-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.mg-table { width: 100%; border-collapse: collapse; min-width: 31rem; }
.mg-table th, .mg-table td { padding: 1rem; text-align: left; vertical-align: top; }
.mg-table th { background: #f7f9ff; color: var(--navy); font-size: .8rem; font-weight: 750; white-space: nowrap; }
.mg-table td { border-top: 1px solid var(--line); font-size: .9rem; overflow-wrap: anywhere; }
.mg-table .mg-disclosure { min-width: 6rem; margin: 0; }
.mg-table .mg-disclosure + .mg-disclosure { margin-top: .4rem; }
.mg-table .mg-disclosure[open] { min-width: 15rem; }
.mg-table .mg-disclosure .form-grid { grid-template-columns: minmax(0, 1fr); }
.mg-cell-sub { display: block; color: var(--muted); font-size: .78rem; margin-top: .17rem; }
.mg-pager { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; color: var(--muted); font-size: .86rem; }
.mg-facts { display: flex; flex-wrap: wrap; gap: .7rem 1.1rem; margin: .65rem 0; }
.mg-facts dt { color: var(--muted); font-size: .78rem; }
.mg-facts dd { margin: .1rem 0 0; font-size: .89rem; font-weight: 680; overflow-wrap: anywhere; }
.mg-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .55rem; margin-top: .65rem; }
.mg-photo-grid a { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--soft-blue); }
.mg-photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-audio { display: grid; gap: .35rem; margin-top: .7rem; font-size: .86rem; color: var(--muted); }
.mg-audio audio { width: min(100%, 32rem); }
.mg-balance { display: flex; align-items: center; gap: .8rem; margin: 0 0 1rem; padding: 1rem; }
.mg-balance strong { display: block; font-size: 1.65rem; color: var(--navy); line-height: 1.35; }
.mg-invite-result { display: grid; justify-items: start; gap: .6rem; background: var(--soft-blue); border-radius: 10px; padding: .75rem; margin-top: .75rem; }
.mg-invite-result .mg-field { width: 100%; }
.mg-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.management-page { --navy: #102247; --blue: #245bea; --soft-blue: #edf3ff; }
.mg-page-heading .page-title { font-weight: 760; letter-spacing: -.045em; }
.mg-dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
  gap: 1.5rem;
  min-height: 248px;
  margin-bottom: 1.25rem;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  border: 1px solid #254c88;
  border-radius: 24px;
  color: #fff;
  background: radial-gradient(ellipse at 92% 48%, #2458ac 0%, transparent 64%), linear-gradient(125deg, #102247, #162f60);
  box-shadow: 0 16px 35px -22px #123e9b85, inset 0 1px 0 #ffffff18;
  overflow: hidden;
}
.mg-hero-copy { position: relative; z-index: 1; min-width: 0; }
.mg-hero-copy h2 { max-width: 23ch; font-size: clamp(1.55rem, 3vw, 2.45rem); font-weight: 740; letter-spacing: -.04em; line-height: 1.17; overflow-wrap: anywhere; color: #fff; }
.mg-hero-copy p { max-width: 42ch; margin-top: .7rem; color: #d0def4; line-height: 1.65; font-size: .94rem; }
.mg-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.2rem; margin-top: 1.4rem; }
.mg-hero-primary { border-color: #fff; background: #fff; color: #173d80; border-radius: 12px; padding-inline: 1rem; box-shadow: 0 5px 15px #07182f26; }
.mg-hero-primary:not(:disabled):hover { border-color: #c9ddff; color: #13377a; background: #edf4ff; }
.mg-hero-secondary { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; color: #e1ebff; text-decoration: none; font-size: .87rem; font-weight: 650; }
.mg-hero-secondary:hover { text-decoration: underline; text-underline-offset: 5px; }
.mg-structure { position: relative; width: 240px; height: 190px; perspective: 700px; pointer-events: none; }
.mg-structure-grid { position: absolute; inset: -40px -75px; opacity: .32; background-image: linear-gradient(#8abaff26 1px, transparent 1px), linear-gradient(90deg, #8abaff26 1px, transparent 1px); background-size: 24px 24px; mask-image: radial-gradient(ellipse, black, transparent 72%); transform: rotate(-10deg); }
.mg-structure-model { position: absolute; width: 130px; height: 130px; left: 55px; top: 30px; transform-style: preserve-3d; transform: rotateX(61deg) rotateZ(-34deg); animation: mg-assemble .85s cubic-bezier(.2,.8,.3,1) backwards; }
.mg-structure-level { position: absolute; inset: 0; display: block; border: 2px solid #9dc7ff; background: linear-gradient(135deg, #bddaff36, #61a5ff15); box-shadow: 0 0 24px #7ab5ff24, inset 0 0 22px #cce7ff18; transform: translateZ(-50px); }
.mg-structure-level::before, .mg-structure-level::after { content: ''; position: absolute; background: #92bdff8a; }
.mg-structure-level::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.mg-structure-level::after { top: 50%; left: 0; right: 0; height: 1px; }
.mg-structure-level:nth-child(2) { transform: translateZ(5px); }
.mg-structure-level:nth-child(3) { transform: translateZ(60px); background: linear-gradient(135deg, #cee8ff75, #7bb4ff42); }
.mg-structure-column { position: absolute; width: 5px; height: 110px; background: linear-gradient(90deg, #b7d8ff, #6298e2); top: 0; left: -2px; transform-origin: top; transform: translateZ(60px) rotateX(-90deg); }
.mg-structure-column:nth-child(5) { left: auto; right: -2px; }
.mg-structure-column:nth-child(6) { top: 125px; }
.mg-structure-column:nth-child(7) { top: 125px; left: auto; right: -2px; }
.mg-summary { position: relative; border-radius: 18px; box-shadow: 0 5px 16px -8px #163c6b1c; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.mg-summary-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.mg-summary-top > .icon { color: #7084a8; }
.mg-summary-icon { border: 1px solid #dbe7fd; background: linear-gradient(145deg, #f4f8ff, #e5edff); box-shadow: inset 0 1px 0 white; border-radius: 13px; }
.mg-summary:hover { transform: translateY(-3px); box-shadow: 0 15px 24px -18px #123c8c55; border-color: #a7c4f4; }
.mg-summary:nth-child(2) .mg-summary-icon { background: #edf5ff; color: #18559a; border-color: #d7e9ff; }
.mg-summary:nth-child(3) .mg-summary-icon { background: #fff6e9; color: #96520a; border-color: #f3e3c9; }
.mg-section-title { align-items: center; padding-inline: .1rem; }
.mg-section-title h2 { font-size: 1.16rem; font-weight: 740; }
.mg-project { border-radius: 20px; box-shadow: 0 5px 16px -9px #163c6b25; transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.mg-project:hover { transform: translateY(-4px); border-color: #b8cbec; box-shadow: 0 18px 28px -19px #18366e65; }
.mg-project-visual-blueprint { background: linear-gradient(115deg, #172e53, #244a7c); isolation: isolate; }
.mg-project-visual-blueprint::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(#a6cbff12 1px, transparent 1px), linear-gradient(90deg, #a6cbff12 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(115deg, transparent, black); }
.mg-project-monogram { position: absolute; left: 1.25rem; bottom: .85rem; color: #e5efff; font-size: 2.75rem; letter-spacing: -.04em; font-weight: 650; }
.mg-project-outline { position: absolute; width: 85px; height: 85px; right: 15%; bottom: 16%; transform: rotate(-30deg) skewX(25deg); opacity: .62; }
.mg-project-outline i { position: absolute; inset: 0; border: 1px solid #b4d5ff; background: #93bfff07; }
.mg-project-outline i:nth-child(2) { transform: translate(-13px, -21px); }
.mg-project-outline i:nth-child(3) { transform: translate(-26px, -42px); }
.mg-project-visual-photo img { transition: transform .45s ease; }
.mg-project:hover .mg-project-visual-photo img { transform: scale(1.035); }
.mg-project-content p { min-height: 1.5rem; margin-block: .5rem 1rem; }
.mg-open-link { min-height: 30px; }
.mg-project-content .mg-open-link { display: flex; justify-content: space-between; border-top: 1px solid #edf1f7; padding-top: .85rem; }
.mg-row-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #f0f4fb; color: #536e9c; flex: none; }
.mg-inline-row { min-height: 76px; gap: 1rem; }
.mg-inline-row > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mg-inline-row strong { font-size: .95rem; font-weight: 650; }
.mg-inline-row div > span { margin-top: .2rem; }
.mg-empty { border-style: solid; border-color: #e0e7f1; background: radial-gradient(ellipse at 50% 0%, #f0f5ff, #fff 65%); padding-block: 2.25rem; }
.mg-empty-icon { width: 3.4rem; height: 3.4rem; border: 1px solid #dce6f9; border-radius: 17px; background: linear-gradient(145deg, white, #e7efff); box-shadow: 0 7px 15px -8px #3663af4a, inset 0 1px 0 white; margin-bottom: .4rem; transform: rotate(-5deg); }
.mg-empty-icon .icon { transform: rotate(5deg); }
.mg-empty h2 { font-size: 1.12rem; }
.mg-empty p { font-size: .91rem; line-height: 1.65; }
.mg-table-wrap { box-shadow: 0 4px 18px -12px #12366e30; }
.mg-table th { background: #f7f9fc; color: #63718a; font-size: .76rem; letter-spacing: .025em; font-weight: 700; }
.mg-table tbody tr { transition: background .15s ease; }
.mg-table tbody tr:hover { background: #f9fbff; }
.mg-table td { border-top-color: #edf1f7; }
.mg-disclosure { border-color: #e0e7f1; border-radius: 13px; overflow: clip; }
.mg-disclosure > summary { display: flex; justify-content: space-between; align-items: center; gap: .75rem; list-style: none; padding: .85rem 1rem; font-size: .9rem; }
.mg-disclosure > summary::-webkit-details-marker { display: none; }
.mg-disclosure > summary::after { content: ''; width: 7px; height: 7px; border-bottom: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 3px; flex: none; transition: transform .18s ease; }
.mg-disclosure[open] > summary::after { transform: rotate(225deg); }
.mg-create { margin-bottom: 1.4rem; border-color: #c8d8f7; }
.mg-create > summary { color: #1d4eb4; background: #eef4ff; padding-block: .95rem; }
.mg-field > span { font-size: .82rem; color: #445575; }
.mg-field :is(input, select, textarea) { border-color: #d1dbe9; border-radius: 11px; }
.mg-form { gap: 1rem; }
.mg-form .form-grid { gap: 1rem; }
.mg-form-end { padding-top: .25rem; }
.mg-balance { border-color: #cfdef8; background: linear-gradient(120deg, #f5f9ff, #e9f1ff); border-radius: 18px; padding: 1.3rem; }
.mg-balance strong { font-size: 2rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.mg-audio { padding: 1rem; border: 1px solid #dce6f5; border-radius: 14px; background: #f7faff; }
.mg-record header { border-bottom: 1px solid #edf1f7; padding-bottom: .8rem; }
@keyframes mg-assemble { from { transform: rotateX(61deg) rotateZ(-42deg) translateZ(-35px); } to { transform: rotateX(61deg) rotateZ(-34deg) translateZ(0); } }
@media (max-width: 1120px) {
  .mg-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mg-dashboard-hero { grid-template-columns: minmax(0, 1fr) 170px; }
  .mg-structure { width: 170px; transform: scale(.8); transform-origin: center; }
  .mg-structure-model { left: 20px; }
}
@media (max-width: 720px) {
  .mg-summary-grid, .mg-card-grid, .mg-detail-layout { grid-template-columns: minmax(0, 1fr); }
  .mg-summary { padding: 1rem 1.2rem; display: flex; align-items: center; gap: 1rem; }
  .mg-summary-top > .icon { display: none; }
  .mg-summary-value { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: .75rem; }
  .mg-summary small { order: -1; margin: 0; font-size: .88rem; }
  .mg-summary strong { font-size: 1.75rem; }
  .mg-page-heading { align-items: flex-start; flex-direction: column; }
  .mg-dashboard-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 0; padding: 1.5rem; position: relative; }
  .mg-structure { position: absolute; right: -45px; top: 2px; opacity: .23; transform: scale(.65); transform-origin: top right; }
  .mg-hero-copy h2 { max-width: 85%; }
  .mg-hero-copy p { max-width: 29ch; }
  .mg-hero-actions { gap: .65rem 1rem; }
  .mg-section { margin-top: 1.65rem; }
}
@media (max-width: 480px) {
  .mg-project-grid, .mg-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .mg-project-visual { min-height: 8rem; }
  .mg-section-title { flex-wrap: wrap; }
  .mg-toolbar .mg-field { flex: 1 1 100%; max-width: none; }
  .mg-toolbar .mg-form-end { width: 100%; }
  .mg-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .mg-structure-model { animation: none; }
  .mg-summary, .mg-project, .mg-project-visual-photo img, .mg-table tbody tr, .mg-disclosure > summary::after { transition: none; }
  .mg-summary:hover, .mg-project:hover, .mg-project:hover .mg-project-visual-photo img { transform: none; }
}
