/* MMO8386-MANAGED-FILE-V1 | assets/css/app.css */
.field{margin-bottom:14px}
.field label{display:block;margin-bottom:6px;color:#444;font-size:14px;font-weight:600}
.field input{width:100%;height:46px;padding:0 12px;border:1px solid #d8d8d8;border-radius:10px;font-size:16px}
.login-card h1{margin:0 0 20px;color:#222;font-size:24px}


/* Fast data loading status */
.is-refreshing{position:relative}
.is-refreshing::after{
  content:"Đang cập nhật…";
  position:absolute;
  right:10px;
  top:8px;
  z-index:3;
  padding:3px 7px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  background:rgba(245,245,245,.94);
  color:#666;
  pointer-events:none;
}
html[data-theme="dark"] .is-refreshing::after{
  background:rgba(37,42,49,.96);
  color:#cfd4dc;
  border:1px solid #383e47;
}


/* Housekeeping card */
.housekeeping-card .panel-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.housekeeping-card .panel-card__head p{margin:4px 0 0}
html[data-theme="dark"] .housekeeping-card{
  background:var(--ui-surface)!important;
  color:var(--ui-text)!important;
  border-color:var(--ui-border)!important;
}
@media(max-width:620px){
  .housekeeping-card .panel-card__head{flex-direction:column}
}


/* v0.9.37 universal long-list rule */
.list-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.list-keyword-search{
  min-width:240px;height:38px;padding:0 11px;border:1px solid #d7dbe0;
  border-radius:9px;background:#fff;color:#222
}
.universal-pagination{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;
  margin-top:12px
}
.universal-page-jump{display:flex;align-items:center;justify-content:center;gap:7px}
.universal-page-jump input{
  width:72px;height:36px;padding:0 8px;text-align:center;border:1px solid #d7dbe0;
  border-radius:8px;background:#fff;color:#222
}
html[data-theme="dark"] .list-keyword-search,
html[data-theme="dark"] .universal-page-jump input{
  background:#171a1f!important;color:#f1f3f5!important;border-color:#3a3f47!important
}
@media(max-width:620px){
  .list-toolbar{width:100%}
  .list-keyword-search{width:100%;min-width:0}
  .universal-pagination{grid-template-columns:1fr 1fr}
  .universal-page-jump{grid-column:1/-1;grid-row:1}
  .universal-pagination>button:first-child{grid-column:1;grid-row:2}
  .universal-pagination>button:last-child{grid-column:2;grid-row:2}
}


/* v0.9.38 page size selector */
.page-size-control{
  display:flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  font-size:12px;
  color:#666;
}
.page-size-control select,
#auditPageSize{
  height:36px;
  min-width:76px;
  padding:0 8px;
  border:1px solid #d7dbe0;
  border-radius:8px;
  background:#fff;
  color:#222;
}
html[data-theme="dark"] .page-size-control{
  color:#a6adb7;
}
html[data-theme="dark"] .page-size-control select,
html[data-theme="dark"] #auditPageSize{
  background:#171a1f!important;
  color:#f1f3f5!important;
  border-color:#3a3f47!important;
}
@media(max-width:620px){
  .page-size-control{
    width:100%;
    justify-content:flex-start;
  }
}


/* v0.9.39 — collapsible Hệ thống sidebar only */
.nav-item--system-toggle{position:relative}
.system-menu-chevron{
  margin-left:auto;
  font-size:18px;
  line-height:1;
  transition:transform .18s ease
}
.nav-item--system-open .system-menu-chevron{transform:rotate(90deg)}
.system-submenu[hidden]{display:none!important}
.system-submenu{
  position:relative;
  margin:3px 0 6px 18px;
  padding-left:9px;
  border-left:1px solid rgba(120,126,136,.28)
}
.system-submenu--open{display:block}
.nav-item--sub{
  width:100%;
  min-height:38px;
  padding-left:10px;
  font-size:13px
}
.nav-item--sub .nav-item__icon{transform:scale(.9)}
html[data-theme="dark"] .system-submenu{border-left-color:#3a3f47}
@media(max-width:900px){
  .system-submenu{margin-left:14px}
}


/* v0.9.41 dashboard system health */
.system-health-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.module-pill--warning{
  background:#fff3cd!important;
  color:#775800!important;
}
.system-health-list strong{
  max-width:62%;
  text-align:right;
  overflow-wrap:anywhere;
}
.system-health-issues{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #efdba1;
  border-radius:9px;
  background:#fff9e7;
  color:#765b00;
  font-size:12px;
  line-height:1.5;
}
html[data-theme="dark"] .module-pill--warning{
  background:#4a3a12!important;
  color:#ffe29a!important;
}
html[data-theme="dark"] .system-health-issues{
  background:#332b16!important;
  border-color:#5a4b23!important;
  color:#f2d88c!important;
}
@media(max-width:620px){
  .system-health-summary{
    align-items:flex-start;
    flex-direction:column;
  }
  .system-health-list strong{
    max-width:58%;
  }
}

#restoreBatchInfo{margin-top:8px}

/* MMO8386-MANAGED-FILE-V1 | v0.9.53 migration */
.migration-backup-card{margin-top:14px}.migration-backup-card .section-head{align-items:flex-start}.migration-backup-status{margin-top:12px}.migration-backup-status strong{overflow-wrap:anywhere;word-break:break-word}#migrationBackupResult{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px}

/* MMO8386-MANAGED-FILE-V1 | v0.9.54 housekeeping hardening */
.housekeeping-details{margin-top:12px;border-top:1px solid #eceff2;padding-top:10px}
.housekeeping-details summary{cursor:pointer;font-weight:700}
.housekeeping-task-list{display:grid;gap:7px;margin-top:10px}
.housekeeping-task-row{display:flex;justify-content:space-between;gap:12px;min-width:0;padding:7px 0;border-bottom:1px solid #f0f1f3}
.housekeeping-task-row:last-child{border-bottom:0}
.housekeeping-task-row span,.housekeeping-task-row small{min-width:0;overflow-wrap:anywhere}
.housekeeping-task-error{color:#b42318}
html[data-theme="dark"] .housekeeping-details{border-color:#30343b}
html[data-theme="dark"] .housekeeping-task-row{border-color:#30343b}
@media(max-width:700px){.housekeeping-task-row{display:block}.housekeeping-task-row small{display:block;margin-top:3px}}

/* MMO8386-MANAGED-FILE-V1 | v0.9.55 integrity check details */
.housekeeping-task-main{min-width:0;width:100%}
.housekeeping-subchecks{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:6px;
  margin-top:7px;
}
.housekeeping-subcheck{
  display:flex;
  justify-content:space-between;
  gap:8px;
  min-width:0;
  padding:6px 8px;
  border:1px solid #e6e8eb;
  border-radius:8px;
  background:rgba(0,0,0,.015);
}
.housekeeping-subcheck span,.housekeeping-subcheck small{
  min-width:0;
  overflow-wrap:anywhere;
}
.housekeeping-task-warning{color:#9a6700}
html[data-theme="dark"] .housekeeping-subcheck{
  border-color:#30343b;
  background:rgba(255,255,255,.025);
}
@media(max-width:700px){
  .housekeeping-subchecks{grid-template-columns:1fr}
  .housekeeping-subcheck{display:block}
  .housekeeping-subcheck small{display:block;margin-top:2px}
}

/* MMO8386-MANAGED-FILE-V1 | v0.10.1 native external module links */
a.nav-item{
  text-decoration:none;
  color:inherit;
  box-sizing:border-box;
}
a.nav-item:visited{color:inherit}
a.nav-item[hidden]{display:none!important}

/* MMO8386-MANAGED-FILE-V1 | v0.10.2 install app after gate */
.sidebar-install-app{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
  margin:0 0 8px;
  padding:10px 11px;
  border:1px solid #dfe3e8;
  border-radius:10px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:700;
  cursor:pointer;
}
.sidebar-install-app:hover{background:rgba(0,0,0,.035)}
.sidebar-install-app:disabled{opacity:.55;cursor:wait}
.sidebar-install-app[hidden]{display:none!important}
.sidebar-install-app__icon{font-size:17px;line-height:1}
.sidebar-install-app__message{
  min-height:0;
  margin:0 0 7px;
  font-size:11px;
  line-height:1.35;
  color:#777;
  overflow-wrap:anywhere;
}
.sidebar-install-app__message:empty{display:none}
html[data-theme="dark"] .sidebar-install-app{border-color:#343a43}
html[data-theme="dark"] .sidebar-install-app:hover{background:rgba(255,255,255,.04)}
html[data-theme="dark"] .sidebar-install-app__message{color:#a6adb7}

/* MMO8386-MANAGED-FILE-V1 | v0.10.3 custom link modules */
.custom-link-module-form{
  display:grid;
  grid-template-columns:minmax(160px,1fr) minmax(260px,2fr) minmax(80px,.45fr) minmax(140px,.7fr) auto;
  gap:12px;
  align-items:end;
}
.custom-link-module-actions{display:flex;gap:8px;align-items:center;padding-bottom:1px}
#customLinkModuleNavItems:empty{display:none}
@media(max-width:980px){
  .custom-link-module-form{grid-template-columns:1fr 1fr}
  .custom-link-module-url{grid-column:1/-1}
  .custom-link-module-actions{grid-column:1/-1}
}
@media(max-width:620px){
  .custom-link-module-form{grid-template-columns:1fr}
  .custom-link-module-url,.custom-link-module-actions{grid-column:auto}
}

/* MMO8386-MANAGED-FILE-V1 | v0.10.5 strict disabled-module hiding */
.nav-item[hidden],
[data-module-shell-key][hidden],
.module-view[hidden]{
  display:none!important;
}

/* MMO8386-MANAGED-FILE-V1 | v0.10.6 offline shell */
.network-status{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.network-status::before{
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  background:currentColor;
}
.network-status--online{
  color:#247a43;
  background:rgba(38,166,91,.10);
}
.network-status--offline{
  color:#a75d00;
  background:rgba(229,143,20,.12);
}
.offline-shell-note{
  margin:0 0 8px;
  font-size:11px;
  line-height:1.35;
  color:#777;
  overflow-wrap:anywhere;
}
.offline-shell-note:empty{display:none}
html[data-theme="dark"] .network-status--online{color:#7bd99c}
html[data-theme="dark"] .network-status--offline{color:#f0b45b}
html[data-theme="dark"] .offline-shell-note{color:#a6adb7}

.btn-danger{background:#b42318;color:#fff;border-color:#b42318}
.btn-danger:hover{filter:brightness(.96)}

/* MMO8386 Phase 3.5 — marketplace sync history */
.market-history-toolbar{display:grid;grid-template-columns:minmax(150px,1fr) minmax(140px,.8fr) auto;gap:10px;margin-bottom:12px}.market-history-toolbar select{min-width:0}.market-history-list{display:grid;gap:8px}.market-history-row{border:1px solid var(--border,#2d333b);border-radius:10px;padding:10px 12px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:start}.market-history-row strong,.market-history-row span,.market-history-row small{display:block}.market-history-row small{margin-top:4px;opacity:.72}.market-history-meta{text-align:right;white-space:nowrap}.market-history-change{margin-top:6px;font-size:12px;opacity:.85;word-break:break-word}.market-history-pager{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:12px}@media(max-width:700px){.market-history-toolbar{grid-template-columns:1fr}.market-history-row{grid-template-columns:1fr}.market-history-meta{text-align:left}}
/* MMO8386 Phase 3.6 — history safety/compactness */
#marketHistoryCard{overflow:hidden}.market-history-list{max-height:760px;overflow:auto;overscroll-behavior:contain}.market-history-main{min-width:0}.market-history-main strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.market-history-change{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}@media(max-width:700px){.market-history-list{max-height:620px}.market-history-change{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}}
