:root {
  --bg: #060914;
  --sidebar: #090d1a;
  --surface: #0d1322;
  --surface-2: #11192b;
  --surface-3: #151f34;
  --border: #1c2942;
  --border-soft: #172137;
  --text: #f4f7ff;
  --muted: #8290a9;
  --muted-2: #5c6a83;
  --blue: #4b7dff;
  --blue-2: #76a5ff;
  --violet: #8b5cf6;
  --cyan: #15b8d2;
  --green: #23c483;
  --red: #fb5b74;
  --amber: #f2ae49;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.icon { width: 20px; height: 20px; display: block; }
[hidden] { display: none !important; }

.mg-body { min-height: 100vh; background: radial-gradient(circle at 62% -10%, rgba(46, 94, 224, .09), transparent 29%), var(--bg); }
.mg-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: 256px; display: flex; flex-direction: column; background: rgba(8, 12, 24, .98); border-right: 1px solid var(--border-soft); box-shadow: 18px 0 50px rgba(0, 0, 0, .12); }
.mg-sidebar-head { min-height: 78px; padding: 18px 20px; display: flex; align-items: center; border-bottom: 1px solid var(--border-soft); }
.mg-brand { display: inline-flex; align-items: center; gap: 12px; }
.mg-brand > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: white; font-weight: 900; font-size: 20px; background: linear-gradient(145deg, #6294ff, #2658ef); box-shadow: 0 10px 28px rgba(57, 125, 255, .3), inset 0 1px rgba(255,255,255,.3); }
.mg-brand div { display: flex; flex-direction: column; line-height: 1.05; }
.mg-brand b { font-size: 14px; letter-spacing: .2em; }
.mg-brand small { margin-top: 5px; color: #6f809d; font-size: 8px; font-weight: 800; letter-spacing: .18em; }
.mg-sidebar-x { display: none; margin-left: auto; }
.mg-workspace { padding: 20px 16px 10px; }
.mg-workspace > span, .mg-nav > small { display: block; padding: 0 10px 10px; color: #51607a; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.mg-workspace > div { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #0c1322; }
.mg-workspace > div > i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-style: normal; font-weight: 800; font-size: 10px; color: #b9ccff; background: #172648; }
.mg-workspace p { min-width: 0; margin: 0; display: flex; flex: 1; flex-direction: column; }
.mg-workspace p b { font-size: 11px; }
.mg-workspace p small { color: var(--muted-2); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-workspace em { padding: 3px 6px; border-radius: 5px; color: #9db9ff; background: #17264a; font-size: 8px; font-style: normal; font-weight: 900; }
.mg-nav { padding: 12px 12px; }
.mg-nav > small:not(:first-child) { margin-top: 20px; }
.mg-nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 3px 0; padding: 0 12px; color: #8491aa; border-radius: 10px; transition: .18s ease; }
.mg-nav a:hover { color: #dbe5ff; background: #10182a; }
.mg-nav a.active { color: white; background: linear-gradient(90deg, rgba(66, 116, 255, .22), rgba(66, 116, 255, .06)); box-shadow: inset 3px 0 var(--blue); }
.mg-nav a.active .icon { color: #73a0ff; }
.mg-nav a span { flex: 1; font-size: 12px; font-weight: 650; }
.mg-nav a b { color: #62718c; font-size: 10px; }
.mg-sidebar-card { margin: auto 16px 16px; padding: 15px; border: 1px solid #1d2b48; border-radius: 13px; background: linear-gradient(140deg, #10192c, #0c1220); }
.mg-sidebar-card > div { display: flex; align-items: center; gap: 8px; }
.mg-sidebar-card > div span { color: #78a0ff; }
.mg-sidebar-card > div .icon { width: 15px; }
.mg-sidebar-card > div small { color: #65738d; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.mg-sidebar-card strong { display: block; margin-top: 8px; font-size: 18px; }
.mg-sidebar-card > p { height: 4px; margin: 12px 0 8px; overflow: hidden; border-radius: 5px; background: #202a3e; }
.mg-sidebar-card > p i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #7d62f2); border-radius: inherit; }
.mg-sidebar-card > small { color: #65738d; font-size: 8px; }
.mg-sidebar-card > small em { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.mg-sidebar-user { min-height: 72px; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border-soft); }
.mg-sidebar-user > span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #345298; border-radius: 50%; color: #dfe8ff; background: #182851; font-weight: 800; }
.mg-sidebar-user > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.mg-sidebar-user b { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.mg-sidebar-user small { color: var(--muted-2); font-size: 8px; }

.mg-app { min-height: 100vh; margin-left: 256px; }
.mg-topbar { position: sticky; top: 0; z-index: 30; height: 78px; padding: 0 34px; display: flex; align-items: center; gap: 20px; background: rgba(6, 9, 20, .83); border-bottom: 1px solid rgba(28, 41, 66, .8); backdrop-filter: blur(18px); }
.mg-menu-btn { display: none !important; }
.mg-global-search { width: min(510px, 46vw); height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #0b1120; transition: .18s; }
.mg-global-search:focus-within { border-color: #456fc7; box-shadow: 0 0 0 3px rgba(57,125,255,.08); }
.mg-global-search > span { color: #70809c; font-size: 22px; transform: rotate(-12deg); }
.mg-global-search input { width: 100%; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 12px; }
.mg-global-search input::placeholder { color: #54627b; }
.mg-global-search kbd { padding: 3px 7px; color: #687792; border: 1px solid #27344c; border-radius: 5px; background: #111827; font: 9px inherit; white-space: nowrap; }
.mg-top-actions { margin-left: auto; display: flex; gap: 10px; }
.mg-content { width: min(1540px, 100%); margin: 0 auto; padding: 34px 38px 60px; }

.mg-btn { min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 750; transition: .18s ease; }
.mg-btn:hover { transform: translateY(-1px); }
.mg-btn .icon { width: 15px; height: 15px; }
.mg-btn.primary { color: white; background: linear-gradient(135deg, #4c81ff, #315eea); box-shadow: 0 8px 24px rgba(52, 102, 238, .22); }
.mg-btn.primary:hover { box-shadow: 0 12px 30px rgba(52, 102, 238, .32); }
.mg-btn.subtle { color: #aab7cf; border-color: var(--border); background: #0d1423; }
.mg-btn.subtle:hover { color: white; border-color: #35445f; }
.mg-btn.white { color: #1d3364; background: white; }
.mg-btn.danger { color: #ff8194; border-color: rgba(251,91,116,.25); background: rgba(251,91,116,.08); }
.mg-btn.wide { width: 100%; }
.mg-icon-btn { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; color: #8190aa; background: #0e1524; cursor: pointer; }
.mg-icon-btn:hover { color: white; border-color: #35445f; }
.mg-icon-btn .icon { width: 17px; }

.mg-page-head { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.mg-page-head h1 { margin: 6px 0 4px; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.1; letter-spacing: -.035em; }
.mg-page-head p { margin: 0; color: var(--muted); font-size: 12px; }
.mg-page-actions { display: flex; align-items: center; gap: 10px; }
.mg-eyebrow { display: flex; align-items: center; gap: 7px; color: #6f8ed2; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.mg-eyebrow > i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 12px var(--blue); }
.mg-panel { border: 1px solid var(--border-soft); border-radius: var(--radius); background: linear-gradient(145deg, rgba(15,22,38,.96), rgba(11,16,29,.96)); box-shadow: 0 14px 45px rgba(0,0,0,.12); }

.mg-hero-banner { position: relative; min-height: 260px; margin-bottom: 22px; overflow: hidden; display: grid; grid-template-columns: 1.2fr .8fr; border: 1px solid #315ab4; border-radius: 22px; background: radial-gradient(circle at 85% 15%, rgba(110,130,255,.45), transparent 33%), linear-gradient(120deg, #173b99, #274fbd 52%, #4030a5); box-shadow: 0 25px 60px rgba(23,64,165,.24), inset 0 1px rgba(255,255,255,.15); }
.mg-hero-banner::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(90deg, transparent, #000); }
.mg-hero-copy { position: relative; z-index: 2; padding: 38px 42px; }
.mg-hero-copy > span { font-size: 9px; font-weight: 900; letter-spacing: .19em; color: #b7caff; }
.mg-hero-copy h2 { margin: 10px 0; font-size: clamp(29px, 3vw, 43px); line-height: 1.02; letter-spacing: -.045em; font-weight: 500; }
.mg-hero-copy h2 strong { font-weight: 850; }
.mg-hero-copy p { max-width: 510px; margin: 0; color: #c6d5ff; font-size: 12px; }
.mg-hero-copy > div { margin-top: 24px; display: flex; align-items: center; gap: 22px; }
.mg-hero-copy > div > a { color: #dce6ff; font-size: 11px; font-weight: 700; }
.mg-hero-visual { position: relative; min-height: 250px; }
.mg-hero-visual .orbit { position: absolute; top: 50%; left: 53%; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; transform: translate(-50%,-50%); }
.mg-hero-visual .orbit.one { width: 230px; height: 230px; }
.mg-hero-visual .orbit.two { width: 340px; height: 340px; }
.media-cube { position: absolute; top: 50%; left: 53%; width: 98px; height: 98px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 28px; color: white; background: linear-gradient(145deg, rgba(255,255,255,.32), rgba(255,255,255,.08)); box-shadow: 0 28px 60px rgba(7,17,72,.35), inset 0 1px rgba(255,255,255,.4); transform: translate(-50%,-50%) rotate(-7deg); backdrop-filter: blur(8px); }
.media-cube .icon { width: 42px; height: 42px; }
.floating-card { position: absolute; z-index: 2; padding: 8px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 8px; background: rgba(6,16,60,.48); box-shadow: 0 10px 30px rgba(0,0,0,.18); font: 9px ui-monospace, monospace; font-style: normal; backdrop-filter: blur(8px); }
.floating-card.img { top: 25%; left: 4%; }
.floating-card.vid { right: 8%; bottom: 22%; }

.mg-stat-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.mg-stat-grid article { min-height: 112px; padding: 19px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--border-soft); border-radius: 15px; background: #0c1220; }
.stat-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; }
.stat-icon .icon { width: 19px; }
.stat-icon.blue { color: #7ca4ff; background: rgba(57,125,255,.13); }
.stat-icon.violet { color: #ac8aff; background: rgba(139,92,246,.13); }
.stat-icon.cyan { color: #57d6e8; background: rgba(21,184,210,.13); }
.stat-icon.amber { color: #ffc56e; background: rgba(242,174,73,.13); }
.mg-stat-grid article > div { display: flex; flex: 1; flex-direction: column; }
.mg-stat-grid small { color: #65738d; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.mg-stat-grid strong { margin: 2px 0; font-size: 24px; line-height: 1.1; }
.mg-stat-grid em { color: #61708a; font-size: 9px; font-style: normal; }
.mg-stat-grid article > i { align-self: flex-start; color: #6b7da1; font-size: 9px; font-style: normal; }
.mg-stat-grid article > a { color: #6e91e6; font-size: 19px; }

.mg-dashboard-grid { margin-bottom: 26px; display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.65fr); gap: 16px; }
.mg-dashboard-grid.bottom { margin-top: 28px; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); }
.mg-panel > header { padding: 19px 21px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-soft); }
.mg-panel > header h3 { margin: 3px 0 0; font-size: 15px; }
.mg-panel > header > span, .mg-panel > header > a { color: #687a99; font-size: 9px; }
.mg-live-pill { padding: 5px 8px; border: 1px solid rgba(35,196,131,.18); border-radius: 20px; color: #65dca9 !important; background: rgba(35,196,131,.07); font-weight: 800; }
.mg-live-pill i { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.mg-bar-chart { height: 215px; padding: 25px 25px 16px; display: flex; align-items: stretch; gap: 16px; }
.mg-bar-chart > div { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.mg-bar-chart > div > span { position: relative; width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid #263149; background: repeating-linear-gradient(to top, transparent 0, transparent 38px, rgba(49,64,90,.28) 39px, transparent 40px); }
.mg-bar-chart i { position: relative; width: min(25px,65%); min-height: 6px; border-radius: 6px 6px 2px 2px; background: linear-gradient(to top,#3667e8,#6e96ff); box-shadow: 0 5px 18px rgba(57,125,255,.18); }
.mg-bar-chart i b { position: absolute; top: -18px; left: 50%; color: #8798b8; font-size: 8px; transform: translateX(-50%); }
.mg-bar-chart small { color: #56647d; font-size: 8px; font-weight: 750; }
.mg-storage-panel { min-width: 0; }
.mg-storage-panel header strong { font-size: 13px; }
.mg-storage-ring { width: 118px; height: 118px; margin: 20px auto 14px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--image-percent) * 1%), var(--violet) 0); }
.mg-storage-ring::before { content: ""; width: 84px; height: 84px; border-radius: 50%; background: #0d1423; }
.mg-storage-ring span { position: absolute; display: flex; flex-direction: column; align-items: center; }
.mg-storage-ring b { font-size: 20px; }
.mg-storage-ring small { color: #6d7b93; font-size: 8px; }
.mg-storage-legend { padding: 0 24px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mg-storage-legend p { margin: 0; display: flex; align-items: center; gap: 7px; }
.mg-storage-legend p > i { width: 7px; height: 7px; border-radius: 50%; }
.mg-storage-legend i.blue { background: var(--blue); }
.mg-storage-legend i.violet { background: var(--violet); }
.mg-storage-legend span { display: flex; flex-direction: column; font-size: 9px; }
.mg-storage-legend small { color: #64728b; }

.mg-section-head { margin: 28px 0 13px; display: flex; align-items: flex-end; justify-content: space-between; }
.mg-section-head h2 { margin: 4px 0 0; font-size: 17px; }
.mg-section-head > a, .mg-section-head > span { color: #7693d6; font-size: 10px; }
.mg-section-head.compact { margin: 0 0 14px; }
.mg-recent-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 13px; }
.mg-recent-card { overflow: hidden; border: 1px solid var(--border-soft); border-radius: 14px; background: #0c1220; transition: .2s; }
.mg-recent-card:hover { border-color: #2f4267; transform: translateY(-2px); box-shadow: 0 15px 35px rgba(0,0,0,.2); }
.mg-recent-preview { position: relative; height: 126px; display: block; overflow: hidden; background: #070b13; }
.mg-recent-preview img, .mg-recent-preview video { width: 100%; height: 100%; object-fit: contain; transition: .25s; }
.mg-recent-card:hover img { transform: scale(1.035); }
.mg-recent-preview > em { position: absolute; top: 9px; right: 9px; padding: 3px 6px; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; color: #cbd8f7; background: rgba(7,12,24,.72); font-size: 7px; font-style: normal; font-weight: 800; backdrop-filter: blur(8px); }
.play { position: absolute; inset: 50% auto auto 50%; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(4,8,20,.58); transform: translate(-50%,-50%); }
.mg-recent-card > div { padding: 12px; display: flex; flex-direction: column; }
.mg-recent-card > div > b { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-recent-card > div > small { margin: 2px 0 10px; color: #65738b; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-recent-card button { padding: 0; display: flex; align-items: center; gap: 5px; color: #7297ee; border: 0; background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.mg-recent-card button .icon { width: 12px; }

.mg-popular-list, .mg-folder-list { padding: 8px 20px 16px; }
.mg-popular-list > div { min-height: 60px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--border-soft); }
.mg-popular-list > div:last-child { border-bottom: 0; }
.mg-popular-list > div > b { color: #52617c; font-size: 10px; }
.mg-popular-list .thumb { width: 38px; height: 38px; overflow: hidden; display: grid; place-items: center; border-radius: 8px; color: #7185ad; background: #151d2d; }
.mg-popular-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mg-popular-list .thumb .icon { width: 16px; }
.mg-popular-list p { min-width: 0; margin: 0; flex: 1; display: flex; flex-direction: column; }
.mg-popular-list p strong { font-size: 10px; }
.mg-popular-list p small { color: #5e6e89; font: 8px ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-popular-list > div > em { color: #8191af; font-size: 9px; font-style: normal; }
.mg-folder-list > a { min-height: 60px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--border-soft); }
.mg-folder-list > a:last-child { border: 0; }
.mg-folder-list > a > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--folder); background: color-mix(in srgb, var(--folder) 12%, transparent); }
.mg-folder-list .icon { width: 17px; }
.mg-folder-list p { margin: 0; flex: 1; display: flex; flex-direction: column; }
.mg-folder-list b { font-size: 10px; }
.mg-folder-list small, .mg-folder-list em { color: #65738b; font-size: 8px; font-style: normal; }

.mg-library-summary { margin-bottom: 15px; display: grid; grid-template-columns: repeat(4,1fr); gap: 11px; }
.mg-library-summary article { padding: 14px 16px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--border-soft); border-radius: 12px; background: #0b111e; }
.mg-library-summary article > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #7fa4ff; background: #13203a; }
.mg-library-summary .icon { width: 16px; }
.mg-library-summary p { margin: 0; display: flex; flex-direction: column; }
.mg-library-summary small { color: #596883; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.mg-library-summary b { font-size: 13px; }
.mg-view-toggle { height: 39px; padding: 3px; display: flex; border: 1px solid var(--border); border-radius: 9px; background: #0c1220; }
.mg-view-toggle button { width: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; color: #5f6e87; background: transparent; cursor: pointer; }
.mg-view-toggle button.active { color: #9bb7fb; background: #192541; }
.mg-view-toggle .icon { width: 15px; }
.list-symbol { font-size: 21px; line-height: 1; }
.mg-library-tools { margin-bottom: 14px; padding: 14px; }
.mg-filter-form { display: flex; align-items: flex-end; gap: 9px; }
.mg-filter-form > label { display: flex; flex-direction: column; gap: 5px; }
.mg-filter-form > label > small { color: #61708b; font-size: 8px; font-weight: 800; }
.mg-filter-form select { height: 39px; padding: 0 34px 0 11px; color: #afbad0; border: 1px solid var(--border); border-radius: 8px; outline: 0; background: #0a101d; font-size: 10px; }
.mg-search-box { min-width: 230px; height: 39px; margin-right: auto; padding: 0 12px; flex: 1; flex-direction: row !important; align-items: center; gap: 8px !important; border: 1px solid var(--border); border-radius: 8px; background: #0a101d; }
.mg-search-box span { color: #62728d; font-size: 18px; }
.mg-search-box input { width: 100%; color: white; border: 0; outline: 0; background: transparent; font-size: 11px; }
.mg-format-tabs { margin-top: 12px; padding-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px solid var(--border-soft); }
.mg-format-tabs a { min-height: 29px; padding: 0 10px; display: flex; align-items: center; gap: 7px; color: #687790; border: 1px solid #1b273d; border-radius: 6px; background: #0a101c; font-size: 8px; font-weight: 800; }
.mg-format-tabs a.active { color: #a9c0ff; border-color: #365baa; background: #162446; }
.mg-format-tabs b { color: #53627b; font-size: 7px; }
.mg-category-strip { margin-bottom: 16px; display: flex; align-items: center; gap: 13px; }
.mg-category-strip > span { color: #52617b; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.mg-category-strip > div { padding-bottom: 3px; display: flex; flex: 1; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.mg-category-strip a { min-height: 32px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; color: #71809a; border: 1px solid var(--border-soft); border-radius: 8px; background: #0a101c; font-size: 9px; white-space: nowrap; }
.mg-category-strip a.active { color: white; border-color: #36599d; background: #152342; }
.mg-category-strip a i { width: 6px; height: 6px; border-radius: 50%; background: var(--category,#64748b); }
.mg-category-strip a b { color: #5d6c86; font-size: 8px; }

.mg-bulk-bar { position: sticky; top: 88px; z-index: 20; min-height: 58px; margin-bottom: 15px; padding: 9px 12px; display: flex; align-items: center; gap: 11px; border: 1px solid #25457f; border-radius: 12px; background: rgba(14,27,53,.95); box-shadow: 0 14px 35px rgba(0,0,0,.25); backdrop-filter: blur(12px); opacity: .7; transition: .2s; }
.mg-bulk-bar.has-selection { opacity: 1; border-color: #3f6fd0; }
.mg-bulk-bar > div { margin-right: auto; display: flex; flex-direction: column; }
.mg-bulk-bar b { font-size: 10px; }
.mg-bulk-bar small { color: #71819d; font-size: 8px; }
.mg-bulk-bar select, .mg-bulk-bar input[type=text] { width: 170px; height: 36px; padding: 0 10px; color: #aebbd2; border: 1px solid #2b3d5d; border-radius: 7px; outline: 0; background: #0a1222; font-size: 9px; }
.mg-check { width: 18px; height: 18px; display: inline-block; cursor: pointer; }
.mg-check input { position: absolute; opacity: 0; pointer-events: none; }
.mg-check span { width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid #43506a; border-radius: 5px; background: #0c1220; }
.mg-check input:checked + span { border-color: #5b88f6; background: var(--blue); }
.mg-check input:checked + span::after { content: "✓"; color: white; font-size: 11px; font-weight: 900; }

.mg-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(225px,1fr)); gap: 14px; }
.mg-media-card { position: relative; min-width: 0; overflow: visible; border: 1px solid var(--border-soft); border-radius: 15px; background: #0c1220; transition: .22s ease; }
.mg-media-card:hover { border-color: #304466; box-shadow: 0 18px 42px rgba(0,0,0,.22); transform: translateY(-2px); }
.mg-media-card.inactive { opacity: .67; }
.mg-media-card.inactive:hover { opacity: 1; }
.mg-card-select { position: absolute; z-index: 5; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.mg-card-select > * { pointer-events: auto; }
.mg-status { padding: 4px 7px; display: flex; align-items: center; gap: 4px; border: 1px solid rgba(35,196,131,.18); border-radius: 15px; color: #69d5aa; background: rgba(5,19,18,.75); font-size: 7px; font-style: normal; font-weight: 850; backdrop-filter: blur(7px); }
.mg-status i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }
.mg-status.inactive { color: #a3acc0; border-color: rgba(140,150,170,.22); background: rgba(12,17,28,.78); }
.mg-status.inactive i { background: #7a8498; box-shadow: none; }
.mg-preview { position: relative; width: 100%; height: 190px; padding: 0; display: block; overflow: hidden; border: 0; border-radius: 14px 14px 0 0; background: radial-gradient(circle,#141d30,#070a11); cursor: zoom-in; }
.mg-preview img, .mg-preview video { width: 100%; height: 100%; object-fit: contain; transition: .25s ease; }
.mg-media-card:hover .mg-preview img { transform: scale(1.025); }
.mg-format-badge { position: absolute; right: 10px; bottom: 9px; padding: 3px 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; color: #c9d5ec; background: rgba(6,10,18,.72); font-size: 7px; font-weight: 850; backdrop-filter: blur(7px); }
.mg-preview-action { position: absolute; left: 50%; top: 50%; padding: 6px 10px; border: 1px solid rgba(255,255,255,.24); border-radius: 20px; background: rgba(5,9,18,.7); font-size: 8px; opacity: 0; transform: translate(-50%,-40%); transition: .2s; backdrop-filter: blur(7px); }
.mg-preview:hover .mg-preview-action { opacity: 1; transform: translate(-50%,-50%); }
.mg-card-body { padding: 13px; }
.mg-card-title { display: flex; align-items: flex-start; gap: 7px; }
.mg-card-title > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.mg-card-title b { overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.mg-card-title small { margin-top: 2px; color: #63718a; font-size: 8px; }
.mg-card-menu, .mg-copy-menu, .mg-folder-card details { position: relative; }
.mg-card-menu summary, .mg-copy-menu summary, .mg-folder-card details summary { list-style: none; cursor: pointer; }
.mg-card-menu summary::-webkit-details-marker, .mg-copy-menu summary::-webkit-details-marker, .mg-folder-card summary::-webkit-details-marker { display: none; }
.mg-card-menu summary { padding: 1px 4px; color: #687791; font-weight: 900; letter-spacing: 1px; }
.mg-card-menu > div, .mg-copy-menu > div, .mg-folder-card details > div { position: absolute; z-index: 25; top: calc(100% + 5px); right: 0; width: 145px; overflow: hidden; padding: 5px; border: 1px solid #2a3852; border-radius: 9px; background: #111929; box-shadow: 0 15px 35px rgba(0,0,0,.45); }
.mg-card-menu button, .mg-card-menu a, .mg-copy-menu button, .mg-folder-card details button { width: 100%; min-height: 31px; padding: 0 9px; display: flex; align-items: center; color: #a7b3c8; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 9px; text-align: left; }
.mg-card-menu button:hover, .mg-card-menu a:hover, .mg-copy-menu button:hover, .mg-folder-card details button:hover { color: white; background: #1a263c; }
.mg-card-menu button.danger, .mg-folder-card details button.danger { color: #ff7188; }
.mg-card-menu form, .mg-folder-card details form { margin: 0; }
.mg-card-category { margin: 11px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mg-card-category > span { min-width: 0; display: flex; align-items: center; gap: 5px; color: #7787a2; font-size: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mg-card-category span i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--category); }
.mg-card-category em { color: #61708a; font-size: 8px; font-style: normal; white-space: nowrap; }
.mg-route-box { height: 34px; padding: 0 5px 0 9px; display: flex; align-items: center; border: 1px solid var(--border-soft); border-radius: 7px; background: #080d17; }
.mg-route-box code { min-width: 0; flex: 1; overflow: hidden; color: #8399ca; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.mg-copy-menu summary { width: 26px; height: 26px; display: grid; place-items: center; color: #7194e7; border-radius: 5px; }
.mg-copy-menu summary:hover { background: #17233b; }
.mg-copy-menu .icon { width: 13px; }
.mg-copy-menu > div { top: auto; bottom: calc(100% + 6px); }
.mg-card-edit { width: 100%; margin-top: 9px; padding: 8px 0 0; display: flex; justify-content: space-between; color: #7698e7; border: 0; border-top: 1px solid var(--border-soft); background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.mg-card-edit span { font-size: 13px; }
.mg-gallery.list-mode { grid-template-columns: 1fr; }
.mg-gallery.list-mode .mg-media-card { min-height: 112px; display: grid; grid-template-columns: 150px minmax(0,1fr); }
.mg-gallery.list-mode .mg-preview { height: 100%; min-height: 112px; border-radius: 14px 0 0 14px; }
.mg-gallery.list-mode .mg-card-body { display: grid; grid-template-columns: minmax(180px,1fr) minmax(150px,.7fr) minmax(190px,1fr) 100px; align-items: center; gap: 20px; }
.mg-gallery.list-mode .mg-card-title, .mg-gallery.list-mode .mg-card-category, .mg-gallery.list-mode .mg-route-box, .mg-gallery.list-mode .mg-card-edit { margin: 0; }
.mg-gallery.list-mode .mg-card-edit { width: auto; padding: 9px 12px; border: 1px solid var(--border); border-radius: 7px; }
.mg-gallery.list-mode .mg-card-select { right: auto; }
.mg-gallery.list-mode .mg-status { display: none; }
.mg-empty { min-height: 300px; padding: 40px; grid-column: 1/-1; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #263651; border-radius: var(--radius); background: #0a0f1b; text-align: center; }
.mg-empty > span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 15px; color: #718ed3; background: #131e36; }
.mg-empty h3 { margin: 14px 0 3px; }
.mg-empty p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.mg-empty.compact { min-height: 190px; }
.mg-empty-small { color: #64738d; font-size: 10px; }
.mg-pagination { margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 20px; }
.mg-pagination a { padding: 9px 13px; color: #9aabc8; border: 1px solid var(--border); border-radius: 8px; background: #0c1220; font-size: 9px; }
.mg-pagination a.disabled { opacity: .35; pointer-events: none; }
.mg-pagination span { color: #697994; font-size: 9px; }

.mg-category-overview { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.mg-category-overview article { padding: 17px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border-soft); border-radius: 13px; background: #0c1220; }
.mg-category-overview article > span { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; }
.mg-category-overview span.blue { color: #85a9ff; background: rgba(57,125,255,.12); }
.mg-category-overview span.violet { color: #b192ff; background: rgba(139,92,246,.12); }
.mg-category-overview span.cyan { color: #66dcea; background: rgba(21,184,210,.12); }
.mg-category-overview .icon { width: 18px; }
.mg-category-overview article > div { display: flex; flex-direction: column; }
.mg-category-overview small { color: #61708a; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.mg-category-overview b { font-size: 18px; }
.mg-category-overview em { color: #61708a; font-size: 8px; font-style: normal; }
.mg-category-layout { display: grid; grid-template-columns: 310px minmax(0,1fr); align-items: start; gap: 17px; }
.mg-category-editor { position: sticky; top: 98px; padding-bottom: 18px; }
.mg-category-editor > header h2 { font-size: 16px; }
.mg-editor-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: #7ca1f7 !important; background: #162441; }
.mg-editor-icon .icon { width: 17px; }
.mg-category-editor > p { margin: 17px 19px; color: #75839b; font-size: 10px; }
.mg-category-editor > form { padding: 0 19px; display: flex; flex-direction: column; gap: 12px; }
.mg-category-editor label, .mg-form label, .mg-form-grid label { display: flex; flex-direction: column; gap: 6px; }
.mg-category-editor label > span, .mg-form label > span, .mg-form-grid label > span { color: #a6b2c7; font-size: 9px; font-weight: 700; }
.mg-category-editor input, .mg-form input, .mg-form select, .mg-form-grid input { width: 100%; height: 42px; padding: 0 12px; color: white; border: 1px solid #263650; border-radius: 8px; outline: 0; background: #090f1c; font-size: 10px; }
.mg-category-editor input:focus, .mg-form input:focus, .mg-form select:focus, .mg-form-grid input:focus { border-color: #4772cc; box-shadow: 0 0 0 3px rgba(57,125,255,.08); }
.mg-category-editor form > div:last-child { display: flex; gap: 8px; }
.mg-color-input { height: 42px; padding: 4px 10px 4px 4px; display: flex; align-items: center; gap: 10px; border: 1px solid #263650; border-radius: 8px; background: #090f1c; }
.mg-color-input input { width: 50px; height: 32px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.mg-color-input code { color: #8090ac; font-size: 9px; }
.mg-category-tip, .mg-detail-note { margin: 17px 19px 0; padding: 10px; display: flex; gap: 8px; border: 1px solid #203459; border-radius: 9px; background: rgba(39,83,164,.09); }
.mg-category-tip > span, .mg-detail-note > span { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #8fb0ff; background: #1d376b; font-size: 9px; font-weight: 850; }
.mg-category-tip p, .mg-detail-note p { margin: 0; color: #6f809d; font-size: 8px; }
.mg-category-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 13px; }
.mg-folder-card { min-height: 216px; padding: 17px; border: 1px solid var(--border-soft); border-radius: 14px; background: linear-gradient(145deg,#0d1424,#0b111e); transition: .2s; }
.mg-folder-card[data-folder-open] { cursor: pointer; }
.mg-folder-card[data-folder-open]:focus-visible { outline: 2px solid #4b82ff; outline-offset: 3px; }
.mg-folder-card:hover { border-color: color-mix(in srgb,var(--folder) 45%,#26344d); transform: translateY(-2px); }
.mg-folder-card > header { padding: 0; display: flex; justify-content: space-between; border: 0; }
.mg-folder-card > header > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--folder); background: color-mix(in srgb,var(--folder) 12%,transparent); }
.mg-folder-card .icon { width: 19px; }
.mg-folder-card details summary { padding: 5px; color: #66758e; }
.mg-folder-card h3 { margin: 14px 0 0; font-size: 14px; }
.mg-folder-card > p { margin: 1px 0 15px; color: #5c6b84; font-size: 8px; }
.mg-folder-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.mg-folder-metrics span { padding: 8px; display: flex; flex-direction: column; border-radius: 7px; background: #090f1b; }
.mg-folder-metrics b { font-size: 10px; }
.mg-folder-metrics small { color: #5d6c85; font-size: 7px; }
.mg-folder-composition { height: 3px; margin: 13px 0 9px; overflow: hidden; border-radius: 4px; background: #272038; }
.mg-folder-composition span { display: block; height: 100%; border-radius: inherit; background: var(--folder); }
.mg-folder-card > footer { display: flex; justify-content: space-between; }
.mg-folder-card > footer small { color: #61708a; font-size: 8px; }
.mg-folder-card > footer a { color: #799ae4; font-size: 8px; font-weight: 750; }
.mg-folder-card.new { min-height: 216px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #687996; border-style: dashed; cursor: pointer; }
.mg-folder-card.new > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #7899e4; background: #15213a; }
.mg-folder-card.new b { margin-top: 10px; color: #aab7ce; font-size: 11px; }
.mg-folder-card.new small { font-size: 8px; }

.mg-modal { position: fixed; z-index: 100; inset: 0; padding: 22px; display: none; align-items: center; justify-content: center; background: rgba(2,5,12,.84); backdrop-filter: blur(12px); }
.mg-modal.open { display: flex; animation: fadeIn .17s ease; }
.mg-modal-card { position: relative; width: min(600px,100%); max-height: calc(100vh - 44px); overflow: auto; border: 1px solid #273a5c; border-radius: 19px; background: #0d1423; box-shadow: 0 35px 100px rgba(0,0,0,.55); }
.mg-modal-close { position: absolute; z-index: 3; top: 15px; right: 15px; width: 31px; height: 31px; border: 1px solid #2a3850; border-radius: 8px; color: #8e9bb0; background: #121b2c; cursor: pointer; font-size: 18px; }
.mg-modal-head { padding: 25px 25px 18px; }
.mg-modal-head h2 { margin: 6px 0 3px; font-size: 21px; letter-spacing: -.025em; }
.mg-modal-head p { margin: 0; color: #74829a; font-size: 10px; }
.mg-upload-modal { width: min(720px,100%); }
.mg-upload-modal form { padding: 0 25px 24px; }
.mg-upload-type-tabs { margin-bottom: 13px; padding: 3px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--border); border-radius: 9px; background: #090f1b; }
.mg-upload-type-tabs button { height: 35px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #687994; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 9px; font-weight: 750; }
.mg-upload-type-tabs button.active { color: #afc6ff; background: #172747; }
.mg-upload-type-tabs .icon { width: 14px; }
.mg-dropzone { min-height: 190px; padding: 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #38517d; border-radius: 13px; background: radial-gradient(circle at 50% 20%,rgba(57,125,255,.08),transparent 55%),#090f1b; cursor: pointer; text-align: center; transition: .2s; }
.mg-dropzone:hover, .mg-dropzone.drag { border-color: #5c88e8; background-color: #0d1830; }
.mg-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mg-drop-icon { width: 48px; height: 48px; margin-bottom: 12px; display: grid; place-items: center; border: 1px solid #315496; border-radius: 13px; color: #89abfa; background: #162849; box-shadow: 0 10px 25px rgba(44,96,210,.15); }
.mg-drop-icon .icon { width: 22px; }
.mg-dropzone b { display: block; font-size: 12px; }
.mg-dropzone small { display: block; margin-top: 4px; color: #71829f; font-size: 8px; }
.mg-dropzone em { display: block; margin-top: 7px; color: #52617b; font-size: 8px; font-style: normal; }
.mg-file-selection { margin-top: 10px; padding: 10px; border: 1px solid var(--border-soft); border-radius: 9px; background: #090f1b; }
.mg-file-selection > div:first-child { display: flex; justify-content: space-between; }
.mg-file-selection b { font-size: 9px; }
.mg-file-selection button { color: #7899e4; border: 0; background: transparent; cursor: pointer; font-size: 8px; }
.mg-file-selection > div:last-child { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.mg-file-selection span { max-width: 180px; padding: 4px 7px; overflow: hidden; color: #7888a4; border-radius: 5px; background: #131c2d; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.mg-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mg-form-grid .full { grid-column: 1/-1; }
.mg-upload-modal .mg-form-grid { margin-top: 14px; }
.mg-form label > span i, .mg-form-grid label > span i { color: #596985; font-size: 8px; font-style: normal; }
.mg-form label > small, .mg-form-grid label > small { color: #52617b; font-size: 8px; }
.mg-prefix { height: 42px; display: flex; border: 1px solid #263650; border-radius: 8px; background: #090f1c; }
.mg-prefix:focus-within { border-color: #4772cc; box-shadow: 0 0 0 3px rgba(57,125,255,.08); }
.mg-prefix em { padding: 0 0 0 11px; display: flex; align-items: center; color: #6f89c6; font: 9px ui-monospace,monospace; font-style: normal; }
.mg-prefix input { height: 40px; border: 0 !important; box-shadow: none !important; }
.mg-upload-progress { margin-top: 14px; padding: 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border: 1px solid #28457c; border-radius: 9px; background: #101d36; }
.mg-upload-progress > div { height: 5px; overflow: hidden; border-radius: 6px; background: #25334c; }
.mg-upload-progress > div span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--blue),#7e66f5); transition: width .2s; }
.mg-upload-progress p { margin: 0; display: flex; flex-direction: column; }
.mg-upload-progress b { font-size: 9px; }
.mg-upload-progress small { color: #71809a; font-size: 7px; }
.mg-modal-footer { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.mg-modal-footer > div { display: flex; flex-direction: column; }
.mg-modal-footer span { color: #5d6c85; font-size: 8px; }
.mg-modal-footer code { color: #7e9ee8; font-size: 8px; }
.mg-detail-modal { width: min(980px,100%); }
.mg-detail-layout { display: grid; grid-template-columns: 38% 62%; }
.mg-detail-preview { min-height: 590px; padding: 22px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: radial-gradient(circle,#192642,#080d17 70%); }
.mg-detail-preview img, .mg-detail-preview video { max-width: 100%; max-height: 530px; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.mg-detail-layout > section { min-width: 0; }
.mg-detail-strip { margin: 0 25px 15px; padding: 10px 0; display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--border-soft); border-radius: 9px; background: #090f1b; }
.mg-detail-strip div { padding: 0 11px; display: flex; flex-direction: column; border-right: 1px solid var(--border-soft); }
.mg-detail-strip div:last-child { border: 0; }
.mg-detail-strip small { color: #5b6a83; font-size: 7px; font-weight: 800; }
.mg-detail-strip b { font-size: 10px; }
.mg-detail-layout .mg-form { padding: 0 25px 25px; display: flex; flex-direction: column; gap: 11px; }
.mg-readonly { min-height: 42px; padding-left: 11px; display: flex; align-items: center; border: 1px solid #263650; border-radius: 8px; background: #090f1c; }
.mg-readonly code { min-width: 0; flex: 1; overflow: hidden; color: #839cd3; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.mg-readonly button { align-self: stretch; padding: 0 11px; color: #8aabf5; border: 0; border-left: 1px solid #263650; background: transparent; cursor: pointer; font-size: 8px; }
.mg-detail-note { margin: 0; }
.mg-preview-modal { padding: 0; background: rgba(1,3,8,.93); }
.mg-preview-modal-card { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }
.mg-preview-modal-card > div { min-height: 0; padding: 50px; flex: 1; display: flex; align-items: center; justify-content: center; }
.mg-preview-modal-card img, .mg-preview-modal-card video { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.mg-preview-modal-card footer { min-height: 78px; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #1b263a; background: #090e19; }
.mg-preview-modal-card footer > div { display: flex; flex-direction: column; }
.mg-preview-modal-card footer b { font-size: 12px; }
.mg-preview-modal-card footer small { color: #677791; font-size: 9px; }

.mg-toast { position: fixed; z-index: 150; top: 92px; right: 24px; width: min(390px,calc(100vw - 32px)); min-height: 55px; padding: 11px 13px; display: flex; align-items: center; gap: 10px; border: 1px solid #275b49; border-radius: 11px; background: rgba(12,35,29,.96); box-shadow: 0 20px 55px rgba(0,0,0,.35); }
.mg-toast > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #72dfb2; background: #153e31; font-weight: 900; }
.mg-toast p { margin: 0; flex: 1; color: #c5e9db; font-size: 10px; }
.mg-toast button { color: #719486; border: 0; background: transparent; cursor: pointer; font-size: 18px; }
.mg-toast.error { border-color: #673043; background: rgba(48,17,28,.97); }
.mg-toast.error > span { color: #ff8195; background: #562033; }
.mg-toast.warning { border-color: #66502b; background: rgba(43,33,15,.97); }
.mg-toast.warning > span { color: #f7c66b; background: #57411e; }

.mg-login-body { min-height: 100vh; padding: 30px; display: grid; place-items: center; background: radial-gradient(circle at 18% 45%,rgba(44,85,210,.17),transparent 32%),radial-gradient(circle at 82% 15%,rgba(106,60,224,.11),transparent 28%),#050812; }
.mg-login-shell { width: min(1080px,100%); min-height: 640px; overflow: hidden; display: grid; grid-template-columns: 1.2fr .8fr; border: 1px solid #1d2b46; border-radius: 25px; background: #0b111e; box-shadow: 0 40px 110px rgba(0,0,0,.46); }
.mg-login-brand { position: relative; padding: 46px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-right: 1px solid #274c9e; background: radial-gradient(circle at 80% 30%,rgba(135,103,255,.4),transparent 34%),linear-gradient(140deg,#102d76,#214eb9 58%,#3f2998); }
.mg-login-brand::after { content: "U"; position: absolute; right: -50px; bottom: -170px; color: rgba(255,255,255,.045); font-size: 470px; font-weight: 950; line-height: 1; transform: rotate(-8deg); }
.mg-login-brand .mg-brand { position: relative; z-index: 2; }
.mg-login-brand .mg-brand > span { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); }
.mg-login-brand .mg-brand small { color: #b8cbfa; }
.mg-login-copy { position: relative; z-index: 2; }
.mg-login-copy em { color: #b6c9fa; font-size: 9px; font-style: normal; font-weight: 850; letter-spacing: .18em; }
.mg-login-copy h1 { margin: 13px 0; font-size: clamp(38px,5vw,60px); line-height: .98; letter-spacing: -.055em; font-weight: 400; }
.mg-login-copy h1 strong { font-weight: 850; }
.mg-login-copy p { max-width: 470px; color: #c1d2fa; }
.mg-login-points { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; }
.mg-login-points span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; color: #d8e3ff; background: rgba(7,18,58,.18); font-size: 8px; font-weight: 700; }
.mg-login-card { align-self: center; padding: 48px; }
.mg-login-heading > span { color: #7399ed; font-size: 9px; font-weight: 850; letter-spacing: .17em; }
.mg-login-heading h2 { margin: 8px 0 3px; font-size: 25px; }
.mg-login-heading p { margin: 0 0 24px; color: #77859d; font-size: 11px; }
.mg-login-card .mg-form { display: flex; flex-direction: column; gap: 14px; }
.mg-login-card .mg-form input { height: 47px; }
.mg-login-card .mg-btn { min-height: 47px; margin-top: 4px; }
.mg-login-security { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #596881; font-size: 8px; }
.mg-login-security i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.mg-alert { margin-bottom: 14px; padding: 10px; border: 1px solid #2c634e; border-radius: 8px; color: #a9e3c9; background: #0f2a21; font-size: 10px; }
.mg-alert.error { color: #ff9bac; border-color: #673043; background: #30111c; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

@media (max-width: 1180px) {
  .mg-sidebar { width: 228px; }
  .mg-app { margin-left: 228px; }
  .mg-content { padding-inline: 25px; }
  .mg-recent-grid { grid-template-columns: repeat(3,1fr); }
  .mg-stat-grid { grid-template-columns: repeat(2,1fr); }
  .mg-gallery.list-mode .mg-card-body { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .mg-sidebar { width: 270px; transform: translateX(-105%); transition: .22s ease; }
  .mg-sidebar.open { transform: translateX(0); }
  .mg-sidebar-backdrop { position: fixed; z-index: 39; inset: 0; display: none; background: rgba(1,4,10,.7); }
  .mg-sidebar-backdrop.open { display: block; }
  .mg-sidebar-x { display: grid; }
  .mg-app { margin-left: 0; }
  .mg-topbar { padding: 0 20px; }
  .mg-menu-btn { display: grid !important; flex: 0 0 auto; }
  .mg-global-search { width: auto; flex: 1; }
  .mg-global-search kbd, .mg-admin-link { display: none; }
  .mg-dashboard-grid, .mg-dashboard-grid.bottom { grid-template-columns: 1fr; }
  .mg-storage-panel { min-height: 290px; }
  .mg-category-layout { grid-template-columns: 1fr; }
  .mg-category-editor { position: static; }
  .mg-detail-layout { grid-template-columns: 1fr; }
  .mg-detail-preview { min-height: 250px; max-height: 320px; }
  .mg-gallery.list-mode .mg-card-body { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 680px) {
  .mg-topbar { height: 66px; padding: 0 13px; gap: 9px; }
  .mg-top-actions .mg-btn { width: 41px; padding: 0; font-size: 0; }
  .mg-top-actions .mg-btn .icon { width: 18px; }
  .mg-global-search { height: 40px; }
  .mg-content { padding: 24px 14px 45px; }
  .mg-page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .mg-page-actions { width: 100%; }
  .mg-page-actions > .mg-btn { flex: 1; }
  .mg-hero-banner { grid-template-columns: 1fr; }
  .mg-hero-copy { padding: 30px 25px; }
  .mg-hero-visual { display: none; }
  .mg-stat-grid, .mg-library-summary, .mg-category-overview { grid-template-columns: 1fr 1fr; }
  .mg-recent-grid { grid-template-columns: 1fr 1fr; }
  .mg-filter-form { align-items: stretch; flex-direction: column; }
  .mg-search-box { min-width: 0; width: 100%; flex: none; }
  .mg-filter-form > label:not(.mg-search-box) { width: 100%; }
  .mg-category-strip { align-items: flex-start; flex-direction: column; }
  .mg-category-strip > div { width: 100%; }
  .mg-bulk-bar { top: 74px; flex-wrap: wrap; }
  .mg-bulk-bar > div { flex: 1; }
  .mg-bulk-bar select, .mg-bulk-bar input[type=text] { width: calc(50% - 6px); }
  .mg-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .mg-preview { height: 150px; }
  .mg-gallery.list-mode .mg-media-card { grid-template-columns: 105px 1fr; }
  .mg-gallery.list-mode .mg-card-body { display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
  .mg-gallery.list-mode .mg-card-category { display: none; }
  .mg-gallery.list-mode .mg-card-edit { justify-content: center; }
  .mg-modal { padding: 10px; }
  .mg-modal-card { max-height: calc(100vh - 20px); border-radius: 15px; }
  .mg-form-grid { grid-template-columns: 1fr; }
  .mg-form-grid .full { grid-column: auto; }
  .mg-detail-strip { grid-template-columns: 1fr 1fr; }
  .mg-detail-strip div:nth-child(2) { border-right: 0; }
  .mg-detail-strip div:nth-child(n+3) { margin-top: 8px; }
  .mg-modal-footer { align-items: stretch; flex-direction: column; }
  .mg-category-grid { grid-template-columns: 1fr; }
  .mg-login-body { padding: 12px; }
  .mg-login-shell { min-height: auto; grid-template-columns: 1fr; }
  .mg-login-brand { min-height: 280px; padding: 28px; border-right: 0; border-bottom: 1px solid #274c9e; }
  .mg-login-copy h1 { font-size: 39px; }
  .mg-login-points { display: none; }
  .mg-login-card { padding: 30px 25px; }
}

@media (max-width: 440px) {
  .mg-stat-grid, .mg-library-summary, .mg-category-overview { grid-template-columns: 1fr; }
  .mg-recent-grid, .mg-gallery { grid-template-columns: 1fr; }
  .mg-preview { height: 220px; }
  .mg-gallery.list-mode { grid-template-columns: 1fr; }
  .mg-gallery.list-mode .mg-media-card { display: block; }
  .mg-gallery.list-mode .mg-preview { height: 160px; border-radius: 14px 14px 0 0; }
  .mg-login-brand { min-height: 250px; }
  .mg-upload-type-tabs button { font-size: 8px; }
}
