:root {
  font-family: var(--font);
  color: var(--cmit-text);
  background: #f4f6f8;
}

body {
  margin: 0;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  margin-right: 1rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.content {
  /* max-width:960px; */
  margin: 0 auto;
  padding: 1.5rem;
}

.hero h1 {
  margin-bottom: 0.25rem;
}

.card {
  background: #fff;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.error {
  color: #b00020;
}

.badge-soon {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #e8eaf0;
  color: #555;
  margin-left: 0.5rem;
}

/* —— Admin shell (layout + chrome aligned with Customer Portal) —— */
.admin-shell {
  --admin-sidebar-width: 268px;
  --admin-sidebar-collapsed: 72px;
  --admin-sidebar-current: var(--admin-sidebar-width);
  --admin-topbar-h: 58px;
  --admin-page-header-h: var(--admin-topbar-h);
  --mc-panel-header-h: 65px;
  --mc-grid-head-h: 40px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: var(--cmit-bg);
}

.admin-shell--collapsed {
  --admin-sidebar-current: var(--admin-sidebar-collapsed);
}

.admin-body {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: var(--cmit-white);
}

/* Sticky footer chỉ trong vùng content — không đè lên sidebar */
.admin-content-action-bar {
  position: fixed;
  left: var(--admin-sidebar-current);
  right: 0;
  bottom: 0;
  z-index: 20;
}

.admin-sidebar {
  width: var(--admin-sidebar-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--cmit-white);
  color: var(--cmit-navy-deep);
  border-right: 1px solid var(--cmit-border-light);
  transition: width 0.2s ease;
  height: 100%;
  align-self: stretch;
  overflow: hidden;
  min-height: 0;
  font-size: 14px;
}

.admin-shell--collapsed .admin-sidebar {
  width: var(--admin-sidebar-collapsed);
}

.admin-shell--collapsed .admin-sidebar__title,
.admin-shell--collapsed .admin-sidebar__link-text,
.admin-shell--collapsed .dyn-nav-folder__chevron {
  display: none;
}

.admin-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 10px 16px;
  border-bottom: 1px solid rgba(0, 45, 86, 0.08);
  flex-shrink: 0;
}

.admin-shell--collapsed .admin-sidebar__header {
  justify-content: center;
  padding: 12px 8px;
}

.admin-sidebar__title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--cmit-navy-deep);
}

.admin-sidebar__toggle {
  border: none;
  background: transparent;
  color: var(--cmit-navy-deep);
  width: 32px;
  height: 32px;
  border-radius: var(--cmit-control-radius);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.admin-sidebar__toggle:hover {
  background: rgba(0, 90, 156, 0.08);
}

.admin-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 45, 86, 0.28) transparent;
}

.admin-sidebar__nav::-webkit-scrollbar {
  width: 6px;
}

.admin-sidebar__nav::-webkit-scrollbar-track {
  background: transparent;
}

.admin-sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(0, 45, 86, 0.22);
  border-radius: 999px;
}

.admin-sidebar__nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 45, 86, 0.38);
}

.admin-sidebar__hint {
  margin: 8px 10px;
  font-size: 12px;
  color: var(--cmit-text-muted);
}

.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--cmit-control-radius);
  color: var(--cmit-navy-deep);
  text-decoration: none;
  font-size: var(--cmit-sidebar-font-size);
  font-weight: 600;
  line-height: 1.25;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.admin-sidebar__link i {
  width: var(--cmit-sidebar-icon-box);
  font-size: 1em;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.85;
}

.admin-sidebar__link:hover {
  background: rgba(0, 120, 173, 0.08);
}

.admin-sidebar__link.active {
  background: #d7ebf7;
  color: var(--cmit-navy-deep);
  font-weight: 600;
}

.admin-sidebar__link-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
}

.admin-shell--collapsed .admin-sidebar__link {
  justify-content: center;
  padding: 10px;
}

/* —— Internal top bar (Portal-style navy chrome) —— */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  height: var(--admin-topbar-h);
  min-height: var(--admin-topbar-h);
  padding: 0 20px 0 14px;
  background: var(--cmit-navy);
  color: var(--cmit-white);
  flex-shrink: 0;
  z-index: 40;
}

.admin-topbar__left {
  display: flex;
  align-items: center;
  gap: 88px;
  min-width: 0;
  flex: 1;
}

.admin-topbar__logo {
  display: flex;
  align-items: center;
  height: 54px;
  flex-shrink: 0;
}

.admin-topbar__logo img {
  height: 54px;
  width: auto;
  display: block;
  object-fit: contain;
}

.admin-topbar__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cmit-white);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  color: var(--cmit-white);
}

.admin-topbar .language-selector {
  color: var(--cmit-white);
}

.admin-topbar .language-selector__trigger {
  min-height: 32px;
  padding: 0.25rem 0.35rem;
  border-radius: var(--cmit-control-radius);
}

.admin-topbar .language-selector__trigger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-topbar__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--cmit-control-radius);
  background: transparent;
  color: var(--cmit-white);
  cursor: pointer;
  list-style: none;
}

.admin-topbar__icon-btn::-webkit-details-marker {
  display: none;
}

.admin-topbar__icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-topbar__notify {
  position: relative;
}

.admin-topbar__notify-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 2px var(--cmit-navy);
  opacity: 0.55;
}

.admin-topbar__notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: 280px;
  padding: 14px 16px;
  background: #fff;
  color: var(--cmit-text);
  border: 1px solid var(--cmit-border);
  border-radius: var(--cmit-surface-radius);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.admin-topbar__notify-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cmit-navy-deep);
}

.admin-topbar__notify-empty {
  margin: 0;
  font-size: 13px;
  color: var(--cmit-text-muted);
}

.admin-topbar__notify-soon {
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.admin-topbar__username {
  font-size: 14px;
  font-weight: 600;
  color: var(--cmit-white);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-topbar__logout {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 6px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: var(--cmit-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.admin-topbar__logout:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-shell-loading {
  padding: 2rem;
  text-align: center;
  color: #666;
}

@media (max-width: 900px) {
  .admin-body {
    flex-direction: column;
  }

  .admin-sidebar,
  .admin-shell--collapsed .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--cmit-border-light);
    max-height: 42vh;
    height: auto;
    flex-shrink: 0;
  }

  .admin-topbar__username {
    display: none;
  }

  .admin-topbar__title {
    font-size: 0.9rem;
  }

  .admin-topbar__breadcrumb {
    font-size: 12px;
    max-width: 46vw;
  }
}

.admin-main__content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  /* Prevent width/reflow jumps when collapsing a panel toggles the vertical scrollbar. */
  scrollbar-gutter: stable;
  /* The stable Windows scrollbar gutter is ~16px; compensate it so the visual right edge stays at 24px. */
  padding: 20px 8px 28px 24px;
}

/* Page spacing is owned by .admin-main__content so every Admin page shares one gutter. */
.system-admin-page {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 0;
}

/* —— Master Data page —— */
.md-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.md-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.md-toolbar__search {
    min-width: 240px;
    flex: 1 1 280px;
    max-width: 420px;
}

/* Khớp TextInputWithPrefix shell (h-10 = 40px). */
.md-toolbar__action {
    flex-shrink: 0;
}

.md-toolbar .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}

.md-toolbar label {
  font-size: var(--cmit-field-label-font-size);
  font-weight: 600;
  color: var(--cmit-navy-deep);
}

.md-status-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.md-status-chip {
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.md-status-chip--all {
    background: #eef2f7;
    border-color: #d5dee8;
    color: #3d4f66;
}

.md-status-chip--all.is-selected {
    background: var(--cmit-navy-deep);
    border-color: var(--cmit-navy-deep);
    color: #fff;
}

.md-status-chip--active {
    background: #e8f6ee;
    border-color: #b7e0c5;
    color: #1b6b3a;
}

.md-status-chip--active.is-selected {
    background: #1b6b3a;
    border-color: #1b6b3a;
    color: #fff;
}

.md-status-chip--inactive {
    background: #fdecea;
    border-color: #f5c2be;
    color: #b42318;
}

.md-status-chip--inactive.is-selected {
    background: #b42318;
    border-color: #b42318;
    color: #fff;
}

.md-toolbar select,
.md-form input,
.md-form select {
  height: var(--cmit-control-height);
  min-height: var(--cmit-control-height);
  box-sizing: border-box;
  border: 1px solid var(--cmit-border);
  border-radius: var(--cmit-control-radius);
  padding: 0 12px;
  font: inherit;
  color: var(--cmit-text);
  background: var(--cmit-white);
}

/* Filter toolbar dùng chung md-toolbar + md-form: bỏ min-width 240px (gây chồng khi grid hẹp). */
.md-toolbar.md-form .field {
    min-width: 0;
}

.md-sync-filters {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 14px;
    align-items: end;
}

.md-sync-filters .field--datetime {
    min-width: 200px;
}

.md-sync-filters .field--wide {
    min-width: 220px;
}

.md-sync-filters .md-form__actions {
    flex-wrap: wrap;
}

.md-panel {
  background: var(--cmit-white);
  border: 1px solid var(--cmit-border);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
}

.md-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cmit-border-light);
  background: var(--cmit-blue-soft);
}

.md-panel__header h2 {
  margin: 0;
  font-size: 15px;
  color: var(--cmit-navy-deep);
}

.md-panel__sub {
  margin: 0;
  font-size: 12px;
  color: var(--cmit-text-muted);
}

.md-panel__body {
  padding: 12px 16px 16px;
}

.md-table-wrap {
  overflow-x: auto;
}

.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.md-table th,
.md-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--cmit-border-light);
  text-align: left;
  vertical-align: middle;
}

/* Keep td as table-cell so row borders stay aligned; flex lives on inner wrap. */
.md-table td.md-actions {
  vertical-align: middle;
  white-space: nowrap;
  display: table-cell;
}

.md-table td.md-actions .btn-act + .btn-act {
  margin-left: 4px;
}

.md-actions__row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}

.md-table th {
  background: var(--cmit-blue-soft);
  color: var(--cmit-navy-deep);
  font-weight: 700;
  white-space: nowrap;
}

.md-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.md-badge--ok {
  background: #d1fae5;
  color: #065f46;
}

.md-badge--off {
  background: #fdecea;
  color: #b42318;
}

.md-badge--warn {
  background: var(--cmit-blue-soft);
  color: var(--cmit-navy-deep);
}

.md-actions button,
.md-link-btn {
  border: none;
  background: none;
  color: var(--cmit-blue);
  cursor: pointer;
  font: inherit;
  font-size: var(--cmit-button-font-size);
  line-height: 1.25;
  padding: 0;
  margin: 0;
  height: auto;
  display: inline-flex;
  align-items: center;
}

.md-actions button:hover,
.md-link-btn:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  width: fit-content;
  min-width: var(--cmit-button-min-width);
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--cmit-button-height);
  padding: 0 16px;
  border-radius: var(--cmit-control-radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: var(--cmit-button-font-size);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  border-color: var(--cmit-blue);
  background: var(--cmit-blue);
  color: var(--cmit-white);
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--cmit-blue-hover);
  background: var(--cmit-blue-hover);
}

.btn-outline {
  background: var(--cmit-white);
  border-color: var(--cmit-border);
  color: var(--cmit-text);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--cmit-blue);
  color: var(--cmit-blue);
}

.btn:disabled {
  cursor: not-allowed;
  border-color: var(--cmit-border);
  background: var(--cmit-button-disabled-bg);
  color: var(--cmit-button-disabled-text);
}

.md-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px dashed var(--cmit-border);
  border-radius: var(--cmit-surface-radius);
  background: #fafbfc;
}

.md-form .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.md-form .field--full {
  grid-column: 1 / -1;
}

.md-form label {
  font-size: var(--cmit-field-label-font-size);
  font-weight: 600;
}

.md-sync-log-detail__id {
  display: block;
  min-width: 0;
  flex: 1 1 12rem;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: pre-wrap;
}

.md-sync-log-detail__payload {
  margin: 0;
  max-height: 20rem;
  overflow: auto;
  padding: 0.75rem;
  border: 1px solid var(--cmit-border);
  border-radius: var(--cmit-surface-radius);
  background: var(--cmit-bg);
  color: var(--cmit-text);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.md-form__actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.md-message {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.md-message--ok {
  background: #e8f6ee;
  border: 1px solid #b7e0c5;
  color: #1b6b3a;
}

.md-message--err {
  background: #fdecea;
  border: 1px solid #f3c0bb;
  color: #b42318;
}

.md-footer-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--cmit-text-muted);
  line-height: 1.5;
}

.md-panel__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px 16px;
}

.mc-message {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.mc-message--ok {
  background: #e8f6ee;
  border: 1px solid #b7e0c5;
  color: #1b6b3a;
}

.mc-message--err {
  background: #fdecea;
  border: 1px solid #f3c0bb;
  color: #b42318;
}

.mc-panel {
  background: #fff;
  border: 1px solid var(--cmit-border);
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: visible;
}

.mc-sticky-region + .mc-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.mc-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mc-sticky-region {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--cmit-white);
}

.mc-sticky-region::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: 20px;
  background: var(--cmit-white);
  pointer-events: none;
}

.mc-panel__actions {
  display: flex;
  gap: 8px;
}

.mc-table-wrap {
  padding: 0 0 16px;
}

.mc-empty {
  margin: 0;
  padding: 16px;
  color: var(--cmit-text-muted);
}

.mc-grid {
  display: grid;
  grid-template-columns:
    28px 28px minmax(220px, 1.4fr) 110px 110px minmax(140px, 1fr)
    minmax(140px, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.mc-grid--head {
  padding: 10px;
  margin: 0 -4px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  box-shadow: 0 1px 0 #e2e8f0;
}

.mc-scope-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
  text-align: center;
}

.mc-row {
  display: grid;
  grid-template-columns:
    28px 28px minmax(220px, 1.4fr) 110px 110px minmax(140px, 1fr)
    minmax(140px, 1fr);
  gap: 8px 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--cmit-surface-radius);
  background: #fff;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

.mc-row:hover {
  background: #f8fafc;
}

.mc-row--folder .mc-row__title-text {
  font-size: 15px;
}

.mc-row--dragging {
  opacity: 0.45;
  border-color: #94a3b8;
  background: #f1f5f9;
}

.mc-row__drag {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: grab;
}

.mc-row__drag:active {
  cursor: grabbing;
}

.mc-row__expand {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-row__expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.mc-row__expand-btn:hover {
  background: #e2e8f0;
}

.mc-row__title {
  min-width: 0;
  padding-left: calc(var(--mc-depth, 0) * 1.25rem);
}

.mc-row__title-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.mc-row__title-text {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.mc-row__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-row__field {
  min-width: 0;
}

.mc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
  cursor: pointer;
}

.mc-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.mc-switch__track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.2s ease;
}

.mc-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.mc-switch input:checked + .mc-switch__track {
  background: var(--cmit-primary-action);
}

.mc-switch input:checked + .mc-switch__track .mc-switch__thumb {
  transform: translateX(16px);
}

.mc-switch input:disabled + .mc-switch__track {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Match FormTextInput border tokens; keep compact row height (not --cmit-control-height). */
.mc-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--cmit-border);
  border-radius: var(--cmit-control-radius);
  background: var(--cmit-white);
  color: var(--cmit-text);
  font-size: 13px;
}

.mc-input:focus {
  outline: none;
  border-color: var(--cmit-blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cmit-blue) 15%, transparent);
}

.mc-forbidden {
  max-width: 480px;
  margin: 48px auto;
  text-align: center;
}

.dyn-nav-folder__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

/* Cỡ chữ mọi cấp kế thừa --cmit-sidebar-font-size từ .admin-sidebar__link.
   Không override theo độ sâu — phân cấp nhận biết bằng thụt lề + chevron. */

/* Folder toggle: chỉ khai layout. Node này luôn mang kèm class
   .admin-sidebar__link nên cỡ chữ đã lấy từ token ở đó. */
.admin-sidebar .dyn-nav-folder__toggle {
  padding: 9px 10px;
  font-weight: 600;
  line-height: 1.25;
}

.admin-shell--collapsed .admin-sidebar .dyn-nav-folder__toggle {
  padding: 10px;
}

.dyn-nav-folder__children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
}

/* Chevron: cùng hộp icon với icon dẫn đầu, chỉ khác opacity để giảm nhấn. */
.dyn-nav-folder__chevron {
  margin-left: auto;
  font-size: 1em;
  width: var(--cmit-sidebar-icon-box);
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.7;
}

/* ── Pagination (aligned with Portal Track & Trace) ───────────────────── */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 6px;
  flex-wrap: wrap;
  gap: 10px;
}

.rows-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cmit-text-muted);
}

.rows-per-page__options {
  display: inline-flex;
  border: 1px solid var(--cmit-border);
  border-radius: 6px;
  overflow: hidden;
}

.page-size-btn {
  width: 32px;
  height: 28px;
  border: none;
  background: var(--cmit-white);
  cursor: pointer;
  color: var(--cmit-text);
  border-right: 1px solid var(--cmit-border);
  font-size: var(--cmit-button-font-size);
}

.page-size-btn:last-child {
  border-right: none;
}

.page-size-btn.is-active {
  background: var(--cmit-blue);
  color: var(--cmit-white);
  font-weight: 700;
}

.page-size-btn:hover:not(.is-active):not(:disabled) {
  background: var(--cmit-blue-soft);
}

.page-size-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pager-info {
  font-size: 13px;
  color: var(--cmit-text-muted);
  font-weight: 500;
}

.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border: 1px solid var(--cmit-border);
  border-radius: 6px;
  background: var(--cmit-white);
  cursor: pointer;
  color: var(--cmit-text);
  font-size: var(--cmit-button-font-size);
}

.pager-btn:hover:not(:disabled):not(.is-active) {
  border-color: var(--cmit-blue);
  color: var(--cmit-blue);
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pager-btn.is-active,
.pager-btn.is-active:disabled {
  border-color: var(--cmit-blue);
  background: var(--cmit-blue);
  color: var(--cmit-white);
  font-weight: 700;
  opacity: 1;
}

.pager-ellipsis {
  min-width: 24px;
  text-align: center;
  color: var(--cmit-text-muted);
}

.tdr-report-panel {
  overflow: hidden;
  border: 1px solid var(--cmit-border);
  border-radius: 6px;
  background: var(--cmit-white);
}

.tdr-report-table {
  overflow-x: auto;
}

.tdr-report-table .table-wrap {
  padding: 0;
}

.tdr-report-table .data-table th {
  border-bottom-color: var(--cmit-border);
  background: var(--cmit-blue-soft);
}

.tdr-report-table .data-table tbody tr {
  background: var(--cmit-white);
}

.tdr-report-table .data-table tbody tr:nth-child(even) {
  background: var(--cmit-row-alt);
}

.tdr-report-table .data-table tbody tr:hover {
  background: var(--cmit-blue-soft);
}

.tdr-report-table .data-table .tdr-vessel-column:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  text-align: left;
  background: var(--cmit-white);
}

.tdr-report-table .data-table th.tdr-vessel-column:first-child {
  z-index: 3;
  background: var(--cmit-blue-soft);
}

.tdr-report-table .data-table tbody tr:nth-child(even) .tdr-vessel-column {
  background: var(--cmit-row-alt);
}

.tdr-report-table .data-table tbody tr:hover .tdr-vessel-column {
  background: var(--cmit-blue-soft);
}

.tdr-action-button {
  display: inline-flex;
  width: 34px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cmit-border);
  border-radius: 6px;
  background: var(--cmit-white);
  color: var(--cmit-blue);
  cursor: pointer;
}

.tdr-action-button:hover {
  border-color: var(--cmit-blue);
  background: var(--cmit-blue-soft);
}

.tdr-pagination {
  border-top: 1px solid var(--cmit-border);
  background: var(--cmit-white);
}

/* SortableDataTable (CMIT.CP.Web.Shared) — mirrors CMIT.CP.Web.Portal/wwwroot/portal.css so the
   component renders consistently in both apps. */
.table-wrap {
  overflow-x: auto;
  padding: 0 16px;
}

.sortable-table__header {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sortable-table__header:disabled {
  cursor: wait;
}

.sortable-table__header:focus-visible {
  outline: 2px solid var(--cmit-blue);
  outline-offset: 3px;
}

.sortable-table__indicator {
  min-width: 12px;
  color: var(--cmit-text-muted);
  font-size: 10px;
}

.sortable-table__header.is-active .sortable-table__indicator {
  color: var(--cmit-blue);
}
