/* When mounted inside the shared SPA shell, use the admin's complete navigation instead of nesting two sidebars. */
.app-shell.adm-embedded-mode { display: block !important; }
.app-shell.adm-embedded-mode > .sidebar, .app-shell.adm-embedded-mode > .mobile-overlay, .app-shell.adm-embedded-mode > .shell-main > .topbar { display: none !important; }
.app-shell.adm-embedded-mode > .shell-main { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
.app-shell.adm-embedded-mode > .shell-main > .workspace-content { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
/* Admin styles are scoped so they can coexist with the customer-facing SPA. */
.admin-shell {
  --adm-bg: #f5f7fb;
  --adm-panel: #fff;
  --adm-ink: #18233b;
  --adm-muted: #77849a;
  --adm-border: #e9edf4;
  --adm-blue: #3467ed;
  --adm-blue-deep: #2855d0;
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--adm-bg);
  color: var(--adm-ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.admin-shell *, .admin-shell *::before, .admin-shell *::after { box-sizing: border-box; }
.admin-shell h1, .admin-shell h2, .admin-shell p { margin: 0; }
.admin-shell button, .admin-shell input, .admin-shell select, .admin-shell textarea { font: inherit; }
.admin-shell button { cursor: pointer; }
.admin-shell button:disabled { cursor: not-allowed; }
.admin-shell button:focus-visible, .admin-shell input:focus-visible, .admin-shell select:focus-visible, .admin-shell textarea:focus-visible { outline: 3px solid rgba(52,103,237,.28); outline-offset: 2px; }
.adm-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.adm-sidebar { position: sticky; top: 0; align-self: flex-start; display: flex; flex-direction: column; flex: 0 0 238px; width: 238px; min-height: 100vh; max-height: 100vh; padding: 27px 15px 17px; overflow-y: auto; background: #101c32; color: #a7b2c6; }
.adm-brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 35px; color: #fff; }
.adm-brand-mark { display: flex; align-items: center; justify-content: center; width: 37px; height: 37px; flex: 0 0 auto; border-radius: 11px; color: #fff; background: linear-gradient(145deg,#598bff,#365ce5); box-shadow: 0 7px 18px rgba(47,89,225,.25); font-size: 21px; font-weight: 850; letter-spacing: -2px; }
.adm-brand-mark span { color: #97b8ff; }
.adm-brand strong, .adm-brand small { display: block; }
.adm-brand strong { font-size: 14px; letter-spacing: -.2px; }
.adm-brand small { margin-top: 2px; color: #72819b; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.adm-nav-caption { margin: 0 13px 9px; color: #687b98; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.adm-nav .adm-nav-caption { margin-top: 22px; }
.adm-nav { display: flex; flex-direction: column; gap: 3px; }
.adm-nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 10px 13px; border: 0; border-radius: 8px; background: transparent; color: #a8b5c9; text-align: left; font-weight: 500; transition: background .16s, color .16s; }
.adm-nav-item .adm-icon { width: 17px; height: 17px; color: #8190a9; }
.adm-nav-item:hover { background: #1b2a43; color: #fff; }
.adm-nav-item.is-active { background: #284475; color: #fff; font-weight: 650; }
.adm-nav-item.is-active::before { position: absolute; top: 10px; bottom: 10px; left: 0; width: 3px; border-radius: 3px; background: #7da3ff; content: ""; }
.adm-nav-item.is-active .adm-icon { color: #a8c2ff; }
.adm-sidebar-foot { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 20px 5px 1px; border-top: 1px solid #26344a; }
.adm-avatar, .adm-table-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 35px; height: 35px; border-radius: 10px; background: #304b78; color: #d7e6ff; font-weight: 700; }
.adm-identity { min-width: 0; flex: 1; }
.adm-identity strong, .adm-identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-identity strong { color: #e9eff9; font-size: 12px; }
.adm-identity span { margin-top: 2px; color: #7f8fa8; font-size: 11px; }
.adm-btn--side { flex: 0 0 auto; padding: 4px 5px !important; border: 0 !important; background: transparent !important; color: #9dafca !important; font-size: 10px !important; }
.adm-btn--side:hover { color: #fff !important; }
.adm-main { min-width: 0; flex: 1; }
.adm-topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 32px; border-bottom: 1px solid #edf0f5; background: rgba(255,255,255,.95); }
.adm-breadcrumb { color: #8995a8; font-size: 12px; }
.adm-breadcrumb span { display: inline-block; margin: 0 9px; color: #c6ced9; }
.adm-breadcrumb strong { color: #4d5a70; font-weight: 600; }
.adm-top-actions { display: flex; align-items: center; gap: 15px; }
.adm-top-status { display: flex; align-items: center; gap: 7px; color: #7c899b; font-size: 12px; }
.adm-top-status span { width: 7px; height: 7px; border-radius: 50%; background: #36c493; box-shadow: 0 0 0 4px #e3f7f0; }
.adm-top-link { padding: 3px 0; border: 0; background: transparent; color: #6f8098; font-size: 12px; }
.adm-top-link:hover { color: #3467ed; }
.adm-workspace { max-width: 1650px; margin: 0 auto; padding: 32px; }
.adm-page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 27px; }
.adm-eyebrow { margin-bottom: 5px; color: #7890bc; font-size: 10px; font-weight: 750; letter-spacing: .14em; }
.adm-page-heading h1 { color: #17243b; font-size: 26px; font-weight: 750; letter-spacing: -.65px; line-height: 1.3; }
.adm-page-heading p { margin-top: 7px; color: #8b97a8; font-size: 13px; }
.adm-content { display: flex; flex-direction: column; gap: 19px; }
.adm-panel { min-width: 0; overflow: hidden; border: 1px solid #e9eef5; border-radius: 12px; background: var(--adm-panel); box-shadow: 0 3px 16px rgba(36,55,90,.035); }
.adm-section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 23px; }
.adm-section-head h2 { color: #26354d; font-size: 15px; font-weight: 700; }
.adm-section-head p { margin-top: 5px; color: #98a4b4; font-size: 12px; }
.adm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 7px 12px; border: 1px solid transparent; border-radius: 7px; background: #fff; color: #56657b; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.adm-btn .adm-icon { width: 15px; height: 15px; }
.adm-btn:disabled { opacity: .42; }
.adm-btn--primary { border-color: var(--adm-blue); background: var(--adm-blue); color: #fff; box-shadow: 0 4px 9px rgba(52,103,237,.14); }
.adm-btn--primary:not(:disabled):hover { border-color: var(--adm-blue-deep); background: var(--adm-blue-deep); }
.adm-btn--dark { border-color: #253a5c; background: #253a5c; color: #fff; }
.adm-btn--dark:not(:disabled):hover { background: #172c4f; }
.adm-btn--outline { border-color: #dfe6ef; background: #fff; color: #53627a; }
.adm-btn--outline:not(:disabled):hover, .adm-btn--subtle:not(:disabled):hover { border-color: #d4e1ff; background: #f2f6ff; color: #3264e2; }
.adm-btn--subtle { min-height: 30px; padding: 5px 8px; color: #536881; }
.adm-btn--danger { border-color: #d54c55; background: #d54c55; color: #fff; }
.adm-btn--danger:hover { background: #bf3d47; }
.adm-btn--danger-link { min-height: 30px; padding: 5px 8px; color: #c5535e; }
.adm-btn--danger-link:not(:disabled):hover { background: #fff3f3; }
.adm-text-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px; border: 0; background: transparent; color: #426ee7; font-size: 12px; font-weight: 600; white-space: nowrap; }
.adm-text-link .adm-icon { width: 14px; height: 14px; }
.adm-banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; border: 1px solid #dbe8ff; border-radius: 9px; background: #f1f6ff; color: #58729b; font-size: 12px; line-height: 1.65; }
.adm-banner .adm-icon { width: 16px; height: 16px; margin-top: 2px; color: #5b82d1; }
.adm-banner--warning { border-color: #f6e6c5; background: #fffaf0; color: #8e7444; }
.adm-banner--warning .adm-icon { color: #c49848; }
.adm-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 17px; }
.adm-stat { min-width: 0; padding: 20px 20px 18px; border: 1px solid #e9eef5; border-radius: 12px; background: #fff; box-shadow: 0 3px 16px rgba(36,55,90,.035); }
.adm-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #7d8a9d; font-size: 12px; font-weight: 600; }
.adm-stat-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; background: #edf3ff; color: #4778ee; }
.adm-stat-icon .adm-icon { width: 17px; height: 17px; }
.adm-stat-icon--violet { background: #f3efff; color: #896ce3; }
.adm-stat-icon--cyan { background: #e9f8fa; color: #27a4ae; }
.adm-stat-icon--amber { background: #fff5e6; color: #d89b40; }
.adm-stat-value { margin-top: 14px; color: #1c2b43; font-size: 29px; font-weight: 750; letter-spacing: -.8px; line-height: 1; }
.adm-stat-note { margin-top: 9px; color: #a2adbb; font-size: 11px; }
.adm-overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); align-items: start; gap: 19px; }
.adm-health { padding-bottom: 8px; }
.adm-health-row { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid #f0f3f7; }
.adm-health-row > div { min-width: 0; flex: 1; }
.adm-health-row strong { color: #42516a; font-size: 12px; }
.adm-health-row p { margin-top: 3px; color: #9ba7b7; font-size: 11px; }
.adm-health-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 9px; background: #f1f5fc; color: #7890b1; }
.adm-health-icon .adm-icon { width: 16px; height: 16px; }
.adm-table-wrap { width: 100%; overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; text-align: left; }
.adm-table thead { background: #f8fafc; }
.adm-table th { padding: 11px 20px; border-top: 1px solid #f0f3f7; border-bottom: 1px solid #edf1f6; color: #9aa6b7; font-size: 11px; font-weight: 650; white-space: nowrap; }
.adm-table td { padding: 14px 20px; border-bottom: 1px solid #f1f4f8; color: #69788e; font-size: 12px; vertical-align: middle; white-space: nowrap; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover { background: #fbfcff; }
.adm-table td strong { color: #34435b; font-weight: 650; }
.adm-table .adm-cell-wrap { min-width: 160px; max-width: 310px; white-space: normal; overflow-wrap: anywhere; }
.adm-table .adm-subline { display: block; margin-top: 4px; color: #9ca8b8; font-size: 11px; }
.adm-money { color: #34435b; font-variant-numeric: tabular-nums; font-weight: 650; }
.adm-muted { color: #a5b0bf; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 1px; }
.adm-user-cell { display: flex; align-items: center; gap: 9px; }
.adm-table-avatar { width: 32px; height: 32px; border-radius: 9px; background: #eef3ff; color: #6282c4; font-size: 12px; }
.adm-user-cell small { display: block; margin-top: 3px; color: #a6b1bf; font-size: 10px; }
.adm-card-number { color: #516179; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.adm-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 5px; background: #f1f4f8; color: #8591a2; font-size: 10px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.adm-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.adm-badge--green { background: #eaf8f2; color: #2f9b70; }
.adm-badge--amber { background: #fff6e8; color: #bd8a3e; }
.adm-badge--red { background: #fff0f1; color: #c75e68; }
.adm-badge--blue { background: #edf3ff; color: #5d80cf; }
.adm-mini-tag { display: inline-block; margin-left: 4px; padding: 2px 5px; border-radius: 4px; background: #edf3ff; color: #5a7ed3; font-size: 10px; }
.adm-empty { display: flex; min-height: 200px; flex-direction: column; align-items: center; justify-content: center; padding: 30px; border-top: 1px solid #f1f3f7; text-align: center; }
.adm-empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 12px; background: #f1f5fb; color: #a1b3cc; }
.adm-empty strong { color: #65748a; font-size: 13px; }
.adm-empty p { margin-top: 5px; color: #a6b1c0; font-size: 12px; }
.adm-search { display: flex; align-items: center; gap: 7px; min-width: 245px; padding: 3px 3px 3px 10px; border: 1px solid #e4eaf2; border-radius: 8px; background: #fff; }
.adm-search > .adm-icon { width: 15px; height: 15px; color: #a6b2c0; }
.adm-search input { min-width: 0; width: 100%; padding: 4px 0; border: 0; outline: 0; color: #36455c; background: transparent; font-size: 12px; }
.adm-search input:focus-visible { outline: 0; }
.adm-search .adm-btn { min-height: 29px; }
.adm-search input::placeholder, .adm-field input::placeholder, .adm-field textarea::placeholder, .adm-filter input::placeholder { color: #bdc6d2; }
.adm-filter { display: grid; grid-template-columns: repeat(5,minmax(110px,1fr)) auto; align-items: end; gap: 12px; padding: 0 23px 22px; }
.adm-filter label { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.adm-filter label span { color: #7d8b9d; font-size: 11px; font-weight: 600; }
.adm-filter input, .adm-field input:not([type=checkbox]), .adm-field select, .adm-field textarea { width: 100%; min-width: 0; min-height: 38px; padding: 9px 11px; border: 1px solid #dfe6ef; border-radius: 7px; outline: 0; background: #fff; color: #34435b; font-size: 12px; }
.adm-filter input:focus, .adm-field input:focus, .adm-field select:focus, .adm-field textarea:focus { border-color: #82a1f3; box-shadow: 0 0 0 3px rgba(79,120,236,.1); }
.adm-filter-actions { display: flex; gap: 6px; }
.adm-oauth-row { display: flex; align-items: center; gap: 14px; padding: 19px 23px; border-top: 1px solid #f0f3f7; }
.adm-oauth-logo { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid #e7edf5; border-radius: 10px; background: #fff; font-size: 21px; font-weight: 750; }
.adm-oauth-logo--google { color: #4285f4; }
.adm-oauth-logo--facebook { background: #edf3ff; color: #4267b2; }
.adm-oauth-copy { min-width: 0; flex: 1; }
.adm-oauth-copy strong { color: #3b4b63; font-size: 13px; }
.adm-oauth-copy p { margin-top: 4px; color: #9aa6b6; font-size: 11px; }
.adm-switch { position: relative; width: 34px; height: 19px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 12px; background: #d7dee8; }
.adm-switch::before { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: white; content: ""; }
.adm-oauth-note { display: flex; gap: 8px; padding: 17px 24px; border-top: 1px solid #f0f3f7; color: #9da9b8; font-size: 11px; }
.adm-oauth-note .adm-icon { width: 14px; height: 14px; }
.adm-loading { display: flex; min-height: 180px; align-items: center; justify-content: center; gap: 10px; color: #91a0b3; font-size: 13px; }
.adm-spinner { width: 18px; height: 18px; border: 2px solid #e0e8f8; border-top-color: #6388ea; border-radius: 50%; animation: adm-spin .8s linear infinite; }
@keyframes adm-spin { to { transform: rotate(360deg); } }
.adm-error { display: flex; min-height: 260px; flex-direction: column; align-items: center; justify-content: center; padding: 30px; color: #8d9bb0; text-align: center; }
.adm-error > .adm-icon { width: 29px; height: 29px; margin-bottom: 12px; color: #e0a561; }
.adm-error h2 { color: #53637b; font-size: 15px; }
.adm-error p { max-width: 450px; margin: 7px 0 16px; font-size: 12px; overflow-wrap: anywhere; }
.adm-inline-error { padding: 25px; color: #b16666; font-size: 12px; overflow-wrap: anywhere; }
.adm-modal-backdrop { position: fixed; z-index: 1000; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(13,23,41,.56); }
.adm-dialog { width: min(100%, 600px); max-height: min(90vh, 850px); overflow-y: auto; border: 1px solid #e5ebf3; border-radius: 13px; background: #fff; box-shadow: 0 22px 70px rgba(15,28,52,.25); }
.adm-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 25px 19px; border-bottom: 1px solid #edf1f6; }
.adm-dialog-head h2 { color: #25334a; font-size: 17px; font-weight: 750; }
.adm-dialog-head p { margin-top: 5px; color: #95a1b0; font-size: 12px; }
.adm-icon-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: #f5f7fa; color: #8d9aab; }
.adm-icon-button .adm-icon { width: 16px; height: 16px; }
.adm-dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 22px 25px; }
.adm-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.adm-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.adm-field--full { grid-column: 1 / -1; }
.adm-field > span { color: #59697f; font-size: 12px; font-weight: 650; }
.adm-field em { color: #e66c75; font-style: normal; }
.adm-field small, .adm-check small { color: #9ca8b8; font-size: 11px; line-height: 1.5; }
.adm-field textarea { min-height: 80px; resize: vertical; }
.adm-check { display: flex; align-items: flex-start; gap: 9px; padding: 13px; border: 1px solid #edf1f6; border-radius: 8px; background: #fafbfd; }
.adm-check input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: #426fe7; }
.adm-check strong, .adm-check small { display: block; }
.adm-check strong { color: #58677d; font-size: 12px; }
.adm-check small { margin-top: 3px; }
.adm-dialog-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 17px 25px; border-top: 1px solid #edf1f6; background: #fbfcfe; }
.adm-dialog-footer .adm-btn { min-width: 86px; }
.adm-form-note { color: #9aa5b4; font-size: 11px; }
.adm-form-error { padding: 10px 12px; border: 1px solid #f4d5d8; border-radius: 7px; background: #fff4f5; color: #b2505a; font-size: 12px; overflow-wrap: anywhere; }
.adm-adjust-account { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 10px; align-items: center; padding: 13px; border-radius: 8px; background: #f6f8fc; font-size: 12px; }
.adm-adjust-account span { color: #9aa7b8; }
.adm-adjust-account strong { color: #475873; overflow-wrap: anywhere; }
@media (max-width: 1220px) {
  .adm-workspace { padding: 26px; }
  .adm-filter { grid-template-columns: repeat(3,minmax(110px,1fr)); }
  .adm-filter-actions { align-self: end; }
  .adm-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .admin-shell { display: block; }
  .adm-sidebar { position: static; display: block; width: 100%; min-height: 0; max-height: none; padding: 14px 16px 10px; overflow: visible; }
  .adm-brand { margin: 0 0 13px; }
  .adm-brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 18px; }
  .adm-sidebar > .adm-nav-caption, .adm-nav .adm-nav-caption { display: none; }
  .adm-nav { display: flex; flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  .adm-nav::-webkit-scrollbar { display: none; }
  .adm-nav-item { width: auto; min-height: 38px; flex: 0 0 auto; gap: 7px; padding: 8px 11px; font-size: 12px; white-space: nowrap; }
  .adm-nav-item.is-active::before { top: auto; right: 10px; bottom: 0; left: 10px; width: auto; height: 2px; }
  .adm-sidebar-foot { display: none; }
  .adm-topbar { height: 52px; padding: 0 20px; }
  .adm-workspace { padding: 24px 20px; }
  .adm-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
}
@media (max-width: 560px) {
  .adm-top-status { display: none; }
  .adm-top-actions { gap: 11px; }
  .adm-workspace { padding: 22px 14px; }
  .adm-page-heading { margin-bottom: 20px; }
  .adm-page-heading h1 { font-size: 23px; }
  .adm-content { gap: 14px; }
  .adm-section-head { align-items: flex-start; flex-direction: column; padding: 18px 16px; }
  .adm-section-head > .adm-search { width: 100%; min-width: 0; }
  .adm-section-head > .adm-btn { align-self: flex-start; }
  .adm-stat { padding: 15px; }
  .adm-stat-value { font-size: 25px; }
  .adm-table th, .adm-table td { padding-right: 15px; padding-left: 15px; }
  .adm-filter { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 16px 18px; }
  .adm-filter-actions { grid-column: 1 / -1; }
  .adm-oauth-row { flex-wrap: wrap; padding: 17px; }
  .adm-oauth-copy { flex-basis: calc(100% - 60px); }
  .adm-modal-backdrop { align-items: flex-end; padding: 0; }
  .adm-dialog { max-height: 92vh; border-radius: 14px 14px 0 0; }
  .adm-dialog-head, .adm-dialog-body, .adm-dialog-footer { padding-right: 18px; padding-left: 18px; }
  .adm-form-grid { grid-template-columns: 1fr; }
  .adm-field--full { grid-column: auto; }
  .adm-adjust-account { grid-template-columns: auto 1fr; }
}
@media (prefers-reduced-motion: reduce) { .admin-shell *, .admin-shell *::before, .admin-shell *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
