/* RTA handover portal shell inspired by the supplied NextGen ERP layout. */
:root {
  --rta-sidebar: #ffffff;
  --rta-page: #f4f6f9;
  --rta-text: #1f2937;
  --rta-muted: #667085;
  --rta-line: #e5e7eb;
  --rta-primary: #0c2c55;
  --rta-primary-2: #114d83;
  --rta-accent: #5b5fc7;
  --rta-success: #15803d;
  --rta-warning: #a16207;
  --rta-danger: #b42318;
  --rta-card: #ffffff;
  --rta-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}

body.rta-portal-ready {
  background: var(--rta-page);
  color: var(--rta-text);
}

body.rta-portal-ready .app-shell {
  min-height: 100vh;
  background: var(--rta-page);
}

body.rta-portal-ready .sidebar {
  width: 240px;
  background: var(--rta-sidebar);
  color: var(--rta-text);
  border-right: 1px solid var(--rta-line);
  box-shadow: 2px 0 10px rgba(15, 23, 42, .04);
  transform: none;
}

body.rta-portal-ready .main {
  margin-left: 240px;
  width: calc(100% - 240px);
  background: var(--rta-page);
}

body.rta-portal-ready .brand {
  min-height: 74px;
  padding: 20px 12px;
  border-bottom: 1px solid var(--rta-line);
  color: var(--rta-text);
  gap: 10px;
}

body.rta-portal-ready .brand strong {
  font-size: 18px;
  color: #111827;
}

body.rta-portal-ready .brand span {
  font-size: 11px;
  color: var(--rta-muted);
}

.rta-logo-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #0aa5bd;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

body.rta-portal-ready .user-card {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--rta-line);
}

body.rta-portal-ready .avatar {
  background: var(--rta-primary);
  color: #fff;
}

body.rta-portal-ready .user-card strong {
  color: #111827;
}

body.rta-portal-ready .user-card span,
body.rta-portal-ready .user-card small {
  color: var(--rta-muted);
}

body.rta-portal-ready .menu-title {
  padding: 18px 12px 8px;
  color: #8a94a6;
  font-size: 10px;
  letter-spacing: .4px;
}

body.rta-portal-ready .menu {
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}

body.rta-portal-ready .nav-item,
body.rta-portal-ready .submenu button {
  color: #444;
  border-radius: 8px;
}

body.rta-portal-ready .nav-item {
  min-height: 50px;
  padding: 13px 12px;
  font-size: 13px;
  font-weight: 500;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 10px;
}

.rta-menu-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  color: #4b5563;
  position: relative;
  font-size: 0;
}

body.rta-portal-ready .nav-item:hover,
body.rta-portal-ready .submenu button:hover {
  background: #f5f5f5;
}

body.rta-portal-ready .nav-item.active,
body.rta-portal-ready .nav-item[aria-current="page"] {
  background: #5b5fc7;
  color: #fff;
  font-weight: 700;
}

body.rta-portal-ready .nav-item.active .rta-menu-icon,
body.rta-portal-ready .nav-item[aria-current="page"] .rta-menu-icon {
  color: #fff;
}

.rta-menu-label {
  min-width: 0;
}

.rta-menu-chevron {
  color: currentColor;
  font-size: 22px;
  line-height: 1;
}

.rta-menu-icon::before {
  font-size: 18px;
  line-height: 1;
}

.rta-menu-icon[data-icon="grid"]::before { content: "▦"; }
.rta-menu-icon[data-icon="users"]::before { content: "♟"; }
.rta-menu-icon[data-icon="card"]::before { content: "▤"; }
.rta-menu-icon[data-icon="truck"]::before { content: "▰"; }
.rta-menu-icon[data-icon="scan"]::before { content: "⌗"; }
.rta-menu-icon[data-icon="cash"]::before { content: "$"; }
.rta-menu-icon[data-icon="client"]::before { content: "▣"; }
.rta-menu-icon[data-icon="chart"]::before { content: "▥"; }
.rta-menu-icon[data-icon="gear"]::before { content: "⚙"; }

body.rta-portal-ready .menu-toggle {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #333;
  font-size: 24px;
  border-radius: 0;
}

body.rta-portal-ready .submenu {
  padding-left: 34px;
  border-left: 2px solid #e5e7eb;
  margin-left: 20px;
}

body.rta-portal-ready .submenu button {
  color: #667085;
  font-size: 12px;
}

body.rta-portal-ready .powered {
  border-top: 1px solid var(--rta-line);
}

body.rta-portal-ready .powered > span {
  color: #8a94a6;
}

body.rta-portal-ready .nextgen-logo {
  width: 150px;
  border: 1px solid var(--rta-line);
  border-radius: 6px;
}

body.rta-portal-ready .topbar {
  min-height: 74px;
  background: #fff;
  border-bottom: 1px solid var(--rta-line);
  box-shadow: none;
  padding: 14px 24px;
}

body.rta-portal-ready .topbar h1 {
  display: none;
  color: #111827;
}

body.rta-portal-ready .topbar p {
  display: none;
  color: var(--rta-muted);
  font-size: 12px;
}

body.rta-portal-ready .sync-pill,
body.rta-portal-ready .sync-time {
  display: none !important;
}

body.rta-portal-ready .icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  font-size: 0;
}

body.rta-portal-ready .icon-btn::before {
  content: "!";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2ff;
  color: #5b5fc7;
  font-size: 12px;
  font-weight: 800;
}

.rta-auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rta-top-btn {
  min-height: 34px;
  border: 1px solid var(--rta-line);
  background: #fff;
  border-radius: 8px;
  padding: 7px 11px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.rta-top-btn.primary {
  border-color: var(--rta-primary);
  background: var(--rta-primary);
  color: #fff;
}

.rta-notification-wrap {
  position: relative;
}

.rta-notification-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #374151;
  cursor: pointer;
  position: relative;
  font-weight: 800;
}

.rta-notification-btn::before {
  content: "";
}

.rta-notification-glyph {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: auto;
  color: #384050;
  font-size: 20px;
  transform: rotate(-14deg);
}

.rta-notification-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 800;
}

.rta-user-menu {
  position: relative;
}

.rta-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  cursor: pointer;
  padding: 2px 4px;
}

.rta-user-trigger strong {
  font-size: 16px;
  font-weight: 800;
}

.rta-admin-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0c2c55, #7378df);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px #fff, 0 2px 8px rgba(15, 23, 42, .18);
}

.rta-caret {
  color: #111827;
  font-size: 16px;
  line-height: 1;
}

.rta-user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 50px;
  width: 160px;
  border: 1px solid #cfd4dc;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .14);
  z-index: 3000;
  overflow: hidden;
}

.rta-user-menu.open .rta-user-dropdown {
  display: block;
}

.rta-user-dropdown a {
  display: block;
  padding: 14px 16px;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid #e5e7eb;
}

.rta-user-dropdown a:last-child {
  border-bottom: 0;
}

.rta-user-dropdown a:hover {
  background: #f5f5f5;
}

.rta-notification-panel {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  width: min(390px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid var(--rta-line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .15);
  z-index: 3000;
  overflow: hidden;
}

.rta-notification-wrap.open .rta-notification-panel {
  display: block;
}

.rta-notification-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rta-line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.rta-notification-list {
  max-height: 440px;
  overflow-y: auto;
}

.rta-notification-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.rta-notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
}

.rta-notification-item strong,
.rta-notification-item span,
.rta-notification-item small {
  display: block;
}

.rta-notification-item strong {
  color: #111827;
  font-size: 12px;
}

.rta-notification-item span {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.4;
  margin-top: 2px;
}

.rta-notification-item small {
  color: #9ca3af;
  font-size: 10px;
  margin-top: 4px;
}

.integration-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.portal-card {
  background: var(--rta-card);
  border: 1px solid var(--rta-line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

.portal-section {
  padding: 16px;
}

.settings-grid,
.portal-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

@media (max-width: 760px) {
  body.rta-portal-ready .sidebar {
    transform: translateX(-100%);
  }

  body.rta-portal-ready .sidebar.open {
    transform: translateX(0);
  }

  body.rta-portal-ready .main {
    margin-left: 0;
    width: 100%;
  }
}

.erp-page {
  padding: 16px 24px 28px;
}

.erp-breadcrumb {
  min-height: 70px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #4b5563;
  margin-bottom: 24px;
}

.erp-breadcrumb span {
  font-size: 14px;
}

.erp-breadcrumb strong {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  color: #111827;
  font-size: 14px;
  border-bottom: 2px solid #0d6efd;
}

.erp-title {
  margin: 0 0 22px;
  color: #111827;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
}

.erp-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 16px;
}

.erp-stat-card {
  min-height: 178px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 14px;
  padding: 20px;
  color: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, .2);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.erp-stat-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.erp-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .22);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

.erp-stat-card h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.erp-stat-value {
  align-self: center;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
}

.erp-stat-action {
  width: 100%;
  min-height: 39px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.erp-blue { background: #3b82f6; }
.erp-purple { background: #8b5cf6; }
.erp-green { background: #10b981; }
.erp-orange { background: #f59e0b; }
.erp-indigo { background: #6366f1; }
.erp-red { background: #ef4444; }
.erp-teal { background: #14b8a6; }
.erp-slate { background: #475569; }

.erp-settings-tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #dfe3e8;
  margin-bottom: 26px;
}

.erp-settings-tab {
  border: 0;
  background: transparent;
  color: #475467;
  padding: 0 0 14px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.erp-settings-tab.active {
  color: #111827;
  border-bottom: 2px solid #111827;
  font-weight: 800;
}

.erp-settings-panel {
  display: none;
}

.erp-settings-panel.active {
  display: block;
}

.erp-form-card {
  padding: 18px;
  margin-bottom: 24px;
}

.erp-form-card h3 {
  margin: 0 0 18px;
  font-size: 16px;
}

.erp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px 16px;
}

.erp-form-field {
  display: grid;
  gap: 8px;
}

.erp-form-field.full {
  grid-column: 1 / -1;
}

.erp-form-field label {
  font-size: 14px;
  color: #111827;
}

.erp-form-field input,
.erp-form-field select,
.erp-form-field textarea {
  min-height: 38px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: #111827;
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}

.erp-form-field textarea {
  min-height: 86px;
  resize: vertical;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.erp-table th,
.erp-table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.erp-table th {
  color: #475467;
  font-weight: 800;
}

@media (max-width: 760px) {
  .erp-page {
    padding: 12px;
  }

  .erp-card-grid,
  .erp-form-grid {
    grid-template-columns: 1fr;
  }

  .rta-user-trigger strong {
    display: none;
  }
}
