:root {
  --sps-green-900: #063520;
  --sps-green-800: #094a2d;
  --sps-green-700: #0c623e;
  --sps-green-600: #117a4e;
  --sps-green-500: #189662;
  --sps-green-100: #e6f5ee;
  --sps-green-50: #f2fbf6;
  
  --sps-gold-600: #d99b00;
  --sps-gold-500: #f5b800;
  --sps-gold-400: #ffca2c;
  --sps-gold-100: #fff8db;
  
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  
  --danger-600: #dc2626;
  --danger-100: #fee2e2;
  --warning-600: #d97706;
  --warning-100: #fef3c7;
  --info-600: #2563eb;
  --info-100: #dbeafe;
  --purple-600: #7c3aed;
  --purple-100: #ede9fe;

  --sidebar-width: 276px;
  --header-height: 68px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--slate-100);
  color: var(--slate-800);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* LAYOUT */
.erp-wrapper {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.erp-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sps-green-900) 0%, var(--sps-green-800) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.12);
}

.sidebar-brand {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.brand-logo-box {
  width: 54px;
  height: 44px;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 2px solid var(--sps-gold-500);
  flex-shrink: 0;
}

.brand-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-title h1 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-title .brand-sub {
  font-size: 11px;
  color: var(--sps-gold-400);
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 700;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9.5px 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.16s ease;
  margin-bottom: 2px;
  font-family: inherit;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, var(--sps-gold-500) 0%, var(--sps-gold-600) 100%);
  color: var(--sps-green-900);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.nav-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-item.active .nav-badge {
  background: var(--sps-green-900);
  color: var(--sps-gold-400);
}

.nav-badge.danger {
  background: var(--danger-600);
  color: #fff;
}

.nav-badge.warning {
  background: var(--warning-600);
  color: #fff;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  font-size: 11.5px;
}

.sidebar-footer-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-footer-info strong {
  color: var(--sps-gold-400);
}

/* MAIN AREA */
.erp-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* TOP HEADER */
.erp-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title-group h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.2;
}

.page-title-group p {
  font-size: 12px;
  color: var(--slate-500);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.branch-selector-wrap {
  display: flex;
  align-items: center;
  background: var(--sps-green-50);
  border: 1px solid #b7e4ce;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  gap: 8px;
}

.branch-selector-wrap label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sps-green-800);
  text-transform: uppercase;
}

.branch-select {
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 13px;
  color: var(--sps-green-900);
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.global-search {
  position: relative;
  width: 240px;
}

.global-search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s;
}

.global-search input:focus {
  border-color: var(--sps-green-600);
  box-shadow: 0 0 0 3px rgba(17, 122, 78, 0.12);
}

.global-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  font-size: 13px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7.5px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--sps-green-700);
  color: #fff;
}
.btn-primary:hover {
  background: var(--sps-green-800);
}

.btn-gold {
  background: var(--sps-gold-500);
  color: var(--sps-green-900);
  font-weight: 700;
}
.btn-gold:hover {
  background: var(--sps-gold-400);
}

.btn-outline {
  background: #fff;
  border-color: var(--slate-300);
  color: var(--slate-700);
}
.btn-outline:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
}

.btn-danger {
  background: var(--danger-600);
  color: #fff;
}
.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
}

/* CONTENT BODY */
.erp-content {
  padding: 20px 24px 40px;
  flex: 1;
}

.module-view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.module-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* VALUE CHAIN BANNER */
.value-chain-banner {
  background: linear-gradient(125deg, var(--sps-green-900) 0%, var(--sps-green-700) 65%, #0f7b4c 100%);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  color: #fff;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-md);
  border-left: 6px solid var(--sps-gold-500);
}

.vc-left h3 {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--sps-gold-400);
  margin-bottom: 4px;
}

.vc-left p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 680px;
}

.vc-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vc-node {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  min-width: 135px;
}

.vc-node.center-node {
  background: var(--sps-gold-500);
  color: var(--sps-green-900);
  border-color: #fff;
  font-weight: 800;
}

.vc-node-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
}

.vc-node-val {
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}

.vc-arrow {
  font-size: 16px;
  color: var(--sps-gold-400);
  font-weight: bold;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--sps-green-600);
}

.kpi-card.gold::before { background: var(--sps-gold-500); }
.kpi-card.info::before { background: var(--info-600); }
.kpi-card.danger::before { background: var(--danger-600); }
.kpi-card.purple::before { background: var(--purple-600); }

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-500);
  letter-spacing: 0.3px;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--sps-green-50);
  color: var(--sps-green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.kpi-card.gold .kpi-icon {
  background: #fef3c7;
  color: #b45309;
}

.kpi-card.info .kpi-icon {
  background: #e0f2fe;
  color: #0369a1;
}

.kpi-card.danger .kpi-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.kpi-card.purple .kpi-icon {
  background: #f3e8ff;
  color: #7e22ce;
}

.kpi-value {
  font-size: 21px;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.2;
  margin-bottom: 6px;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-up { color: var(--sps-green-700); font-weight: 700; }
.trend-down { color: var(--danger-600); font-weight: 700; }

/* GRID LAYOUTS */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 18px;
  margin-bottom: 20px;
}

/* CARDS & PANELS */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--slate-500);
  font-weight: 400;
}

.card-body {
  padding: 18px;
}

.card-body.no-pad {
  padding: 0;
}

/* TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.erp-table th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}

.erp-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
  vertical-align: middle;
}

.erp-table tbody tr:hover {
  background-color: var(--sps-green-50);
}

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.font-mono { font-family: 'JetBrains Mono', Consolas, monospace; font-size: 12px; }
.font-bold { font-weight: 700; color: var(--slate-900); }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success { background: var(--sps-green-100); color: var(--sps-green-800); }
.badge-warning { background: var(--warning-100); color: var(--warning-600); }
.badge-danger { background: var(--danger-100); color: var(--danger-600); }
.badge-info { background: var(--info-100); color: var(--info-600); }
.badge-purple { background: var(--purple-100); color: var(--purple-600); }
.badge-gold { background: var(--sps-gold-100); color: #946800; }
.badge-slate { background: var(--slate-200); color: var(--slate-700); }

/* PROGRESS BARS */
.progress-wrap {
  width: 100%;
  background: var(--slate-200);
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: var(--sps-green-600);
  border-radius: 99px;
}

.progress-fill.gold { background: var(--sps-gold-500); }
.progress-fill.danger { background: var(--danger-600); }
.progress-fill.info { background: var(--info-600); }

/* FILTER BAR */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-control, .form-select {
  padding: 7px 11px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--slate-800);
  background: #fff;
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--sps-green-600);
  box-shadow: 0 0 0 2px rgba(17, 122, 78, 0.12);
}

/* SUB-TABS */
.sub-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--slate-200);
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.sub-tab-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--slate-600);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}

.sub-tab-btn:hover {
  background: var(--slate-200);
}

.sub-tab-btn.active {
  background: var(--sps-green-700);
  color: #fff;
}

/* PRODUCT CATALOG CARDS */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
}

.product-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--sps-green-500);
}

.product-brand-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.product-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.product-principal {
  font-size: 11.5px;
  color: var(--slate-500);
  margin-bottom: 12px;
}

.price-matrix-mini {
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11.5px;
  margin-bottom: 12px;
  border: 1px solid var(--slate-200);
}

.price-matrix-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}

.modal-header {
  padding: 16px 20px;
  background: var(--sps-green-900);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--sps-gold-400);
}

.modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate-700);
}

/* PRINT DOCUMENT PREVIEW */
.doc-preview-box {
  border: 2px solid var(--slate-800);
  padding: 24px;
  background: #fff;
  color: #000;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px double var(--sps-green-800);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.doc-logo-side {
  display: flex;
  align-items: center;
  gap: 14px;
}

.doc-logo-side img {
  height: 56px;
  width: auto;
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--slate-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--sps-gold-500);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   AUTHENTICATION & LOGIN SCREEN (ULTRA-MODERN SPLIT-SCREEN & GOOGLE SSO)
   ========================================================================== */
.login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #041f13;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.login-wrapper.hidden {
  display: none !important;
}

.login-split-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  min-height: 600px;
}

/* LEFT SIDE: BRAND & VISUAL SHOWCASE */
.login-hero-side {
  flex: 1.1;
  background: radial-gradient(circle at 15% 20%, rgba(245, 184, 0, 0.18) 0%, transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.22) 0%, transparent 55%),
              linear-gradient(145deg, #021a10 0%, #06311e 50%, #09472c 100%);
  color: #ffffff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.login-hero-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.7;
}

.login-hero-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-hero-logo {
  width: 68px;
  height: 52px;
  background: #ffffff;
  border-radius: 12px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--sps-gold-500);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.login-hero-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-hero-brand h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.2;
}

.login-hero-brand span {
  font-size: 11.5px;
  color: var(--sps-gold-400);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.login-hero-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
  margin: 36px 0;
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 184, 0, 0.15);
  border: 1px solid rgba(245, 184, 0, 0.35);
  color: var(--sps-gold-400);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.login-hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 16px;
  letter-spacing: -0.4px;
}

.login-hero-title span {
  color: var(--sps-gold-400);
  text-shadow: 0 0 24px rgba(245, 184, 0, 0.25);
}

.login-hero-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 28px;
}

/* VISUAL SHOWCASE GALLERY IN LOGIN HERO PANEL */
.login-visual-showcase {
  margin: 20px 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

.gallery-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px;
  gap: 6px;
}

.gallery-tab-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.gallery-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.gallery-tab-btn.active {
  background: var(--sps-gold-500);
  color: var(--sps-green-900);
  box-shadow: 0 2px 8px rgba(245, 184, 0, 0.3);
}

.gallery-view-box {
  position: relative;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: #062316;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.gallery-img:hover {
  transform: scale(1.03);
}

.gallery-overlay-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(4, 31, 19, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gallery-caption-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--sps-gold-400);
  line-height: 1.2;
}

.gallery-caption-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
}

.gallery-pill-tag {
  background: var(--sps-green-700);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-feature-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-feature-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 18px;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.login-feature-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.1);
}

.login-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(245, 184, 0, 0.2);
  color: var(--sps-gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.login-feature-text h4 {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.login-feature-text p {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

.login-hero-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.login-hero-footer strong {
  color: var(--sps-gold-400);
}

/* RIGHT SIDE: AUTH FORM & GOOGLE SSO */
.login-form-side {
  flex: 0.9;
  background: #ffffff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow-y: auto;
}

.login-form-container {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.login-form-header {
  margin-bottom: 24px;
}

.login-form-header h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.login-form-header p {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 6px;
}

/* GOOGLE SSO BUTTON (PREMIUM & CRISP) */
.sso-section {
  margin-bottom: 20px;
}

.btn-google-sso {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate-800);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  font-family: inherit;
  position: relative;
}

.btn-google-sso:hover {
  background: #f8fafc;
  border-color: #4285f4;
  box-shadow: 0 6px 18px rgba(66, 133, 244, 0.16);
  transform: translateY(-1px);
}

.btn-google-sso:active {
  transform: translateY(0);
}

.sso-badge {
  font-size: 10px;
  font-weight: 800;
  background: #e8f0fe;
  color: #1a73e8;
  padding: 2.5px 8px;
  border-radius: 99px;
  margin-left: auto;
  letter-spacing: 0.3px;
}

.sso-hint {
  font-size: 11px;
  color: var(--slate-400);
  text-align: center;
  margin-top: 6px;
}

/* DIVIDER */
.login-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  text-align: center;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--slate-200);
}

.login-divider span {
  padding: 0 12px;
  font-size: 11.5px;
  color: var(--slate-400);
  font-weight: 500;
}

/* INPUTS WITH ICONS */
.mb-3 {
  margin-bottom: 14px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: var(--slate-400);
  pointer-events: none;
}

.input-with-icon .form-control {
  padding-left: 36px;
  padding-right: 36px;
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--slate-300);
  font-size: 13px;
  transition: all 0.15s ease;
}

.input-with-icon .form-control:focus {
  border-color: var(--sps-green-600);
  box-shadow: 0 0 0 3px rgba(17, 122, 78, 0.12);
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--slate-500);
  padding: 4px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.forgot-link {
  font-size: 11.5px;
  color: var(--sps-green-700);
  text-decoration: none;
  font-weight: 600;
}
.forgot-link:hover {
  text-decoration: underline;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 16px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--slate-600);
  cursor: pointer;
  user-select: none;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sps-green-700) 0%, var(--sps-green-900) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(12, 98, 62, 0.3);
}

.btn-lg:hover {
  background: linear-gradient(135deg, var(--sps-green-600) 0%, var(--sps-green-800) 100%);
  box-shadow: 0 6px 18px rgba(12, 98, 62, 0.4);
  transform: translateY(-1px);
}

.btn-arrow {
  margin-left: 6px;
  font-size: 14px;
  transition: transform 0.15s ease;
}
.btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* QUICK DEMO ROLES CHIPS (MODERN & CRISP) */
.quick-roles-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-200);
}

.quick-roles-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.quick-roles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.role-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.role-chip:hover {
  background: var(--sps-green-50);
  border-color: var(--sps-green-500);
  transform: translateY(-1px);
}

.role-icon {
  font-size: 17px;
  flex-shrink: 0;
}

.role-info strong {
  display: block;
  font-size: 12px;
  color: var(--slate-800);
  line-height: 1.2;
}

.role-info small {
  font-size: 10.5px;
  color: var(--slate-500);
}

.login-security-tag {
  margin-top: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* RESPONSIVE SPLIT SCREEN */
@media (max-width: 980px) {
  .login-split-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }
  .login-hero-side {
    padding: 32px 24px;
    flex: none;
  }
  .login-hero-title {
    font-size: 24px;
  }
  .login-form-side {
    padding: 36px 24px;
    flex: none;
  }
}

/* ==========================================================================
   USER MANAGEMENT MODULE (RBAC & ACCESS CONTROL)
   ========================================================================== */
.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.user-row-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name-group strong {
  display: block;
  font-size: 13px;
  color: var(--slate-900);
  line-height: 1.2;
}

.user-name-group span {
  font-size: 11.5px;
  color: var(--slate-500);
}

.perm-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 280px;
}

.perm-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--slate-100);
  color: var(--slate-600);
  padding: 1.5px 6px;
  border-radius: 4px;
  border: 1px solid var(--slate-200);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 99px;
}
.auth-badge.google {
  background: #e8f0fe;
  color: #1967d2;
  border: 1px solid #d2e3fc;
}
.auth-badge.internal {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}

/* USER PROFILE IN TOP HEADER & LOGOUT */
.user-header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 99px;
  margin-left: 8px;
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sps-green-100);
  color: var(--sps-green-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-900);
  white-space: nowrap;
}

.user-sub {
  font-size: 10.5px;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-sso-indicator {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1967d2;
  border: 0.5px solid #d2e3fc;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger-600);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  margin-left: 4px;
}

.btn-logout:hover {
  background: var(--danger-100);
  border-color: var(--danger-600);
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sps-green-100);
  color: var(--sps-green-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-900);
  white-space: nowrap;
}

.user-sub {
  font-size: 10.5px;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-sso-indicator {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1967d2;
  border: 0.5px solid #d2e3fc;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger-600);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  margin-left: 4px;
}

.btn-logout:hover {
  background: var(--danger-100);
  border-color: var(--danger-600);
}

/* ==========================================================================
   GOOGLE SSO ACCOUNT CHOOSER MODAL
   ========================================================================== */
.google-modal-header {
  position: relative;
  text-align: center;
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--slate-200);
}

.google-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-900);
  margin-top: 10px;
}

.google-modal-subtitle {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

.google-accounts-list {
  padding: 10px 16px;
}

.google-acc-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
  margin-bottom: 4px;
}

.google-acc-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.google-acc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.google-acc-info {
  flex: 1;
}

.acc-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-900);
}

.acc-email {
  font-size: 12px;
  color: var(--slate-500);
}

.acc-badge {
  font-size: 10.5px;
  color: var(--sps-green-700);
  font-weight: 600;
  margin-top: 2px;
}

.acc-arrow {
  font-size: 18px;
  color: var(--slate-400);
}

.google-acc-custom {
  padding: 12px 14px;
  border-top: 1px solid var(--slate-100);
  margin-top: 6px;
}

.google-modal-footer {
  padding: 14px 20px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
  font-size: 11px;
  color: var(--slate-500);
  text-align: center;
  line-height: 1.4;
}

/* SIDEBAR TOGGLE ON SMALLER SCREENS */
.btn-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--slate-300);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 16px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .btn-sidebar-toggle {
    display: inline-flex;
  }
  .erp-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .erp-sidebar.open {
    transform: translateX(0);
  }
  .erp-main {
    margin-left: 0;
  }
}

/* BA BLUEPRINT ARCHITECTURE CARDS */
.ba-pillar-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-left: 4px solid var(--sps-green-700);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.ba-pillar-card h4 {
  color: var(--sps-green-900);
  font-size: 13.5px;
  margin-bottom: 6px;
}

@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 {
    grid-template-columns: 1fr;
  }
  .value-chain-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  .erp-sidebar, .erp-header, .modal-header, .modal-footer, #login-screen {
    display: none !important;
  }
  .erp-main {
    margin-left: 0 !important;
  }
}

/* ==========================================================================
   STOCK ANALYSIS & SEPARATION (REAL vs BOOKED vs HOLD vs AVAILABLE ATP)
   ========================================================================== */
.kpi-grid-5 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stock-formula-banner {
  background: linear-gradient(135deg, #062b1b 0%, #09422a 60%, #0c5838 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(245, 184, 0, 0.35);
  box-shadow: var(--shadow-md);
}

.formula-equation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.formula-node {
  flex: 1;
  min-width: 145px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 9px 12px;
  backdrop-filter: blur(6px);
}

.formula-node.real {
  border-left: 4px solid #38bdf8;
}

.formula-node.booked {
  border-left: 4px solid #fbbf24;
  background: rgba(245, 158, 11, 0.14);
}

.formula-node.hold {
  border-left: 4px solid #f87171;
  background: rgba(239, 68, 68, 0.13);
}

.formula-node.atp {
  border: 2px solid #34d399;
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.formula-node.incoming {
  border-left: 4px solid #a78bfa;
  background: rgba(139, 92, 246, 0.15);
}

.formula-node-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.formula-node-val {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

.formula-node-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 1px;
}

.formula-op {
  font-size: 18px;
  font-weight: 900;
  color: var(--sps-gold-400);
  padding: 0 2px;
}

.stock-split-bar {
  width: 100%;
  height: 9px;
  background: var(--slate-200);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  margin: 4px 0;
}

.stock-seg-atp {
  background: #10b981;
  height: 100%;
}

.stock-seg-booked {
  background: #f59e0b;
  height: 100%;
}

.stock-seg-hold {
  background: #ef4444;
  height: 100%;
}

.stock-box-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 8px;
  min-width: 78px;
  font-weight: 800;
  font-size: 13px;
}

.stock-box-pill.real {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.stock-box-pill.booked {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.stock-box-pill.hold {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.stock-box-pill.atp-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1.5px solid #34d399;
}

.stock-box-pill.atp-low {
  background: #fff1f2;
  color: #be123c;
  border: 1.5px solid #fda4af;
}

.stock-box-pill.incoming {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.branch-mini-breakdown {
  font-size: 10.5px;
  color: var(--slate-500);
  font-weight: 600;
  margin-top: 3px;
}

/* ============================================================================
   EXECUTIVE AI PROMPT MODULE (#mod-ai)
   ============================================================================ */
.ai-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 1120px) {
  .ai-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.ai-chat-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 115px);
  min-height: 580px;
  max-height: 820px;
}

.ai-chat-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
  border-bottom: 1px solid var(--slate-200);
}

.ai-avatar-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sps-green-800), var(--sps-green-600));
  color: var(--sps-gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(7, 59, 36, 0.2);
}

.ai-quick-prompts-bar {
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
}

.ai-quick-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-500);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ai-chips-scroll {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ai-chips-scroll::-webkit-scrollbar {
  height: 4px;
}
.ai-chips-scroll::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}

.ai-chip {
  white-space: nowrap;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--slate-700);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.ai-chip:hover {
  background: var(--sps-green-50);
  border-color: var(--sps-green-600);
  color: var(--sps-green-800);
  transform: translateY(-1px);
}

.ai-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-msg {
  display: flex;
  gap: 11px;
  max-width: 90%;
  animation: fadeIn 0.2s ease;
}

.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  flex-shrink: 0;
}

.ai-msg.assistant .ai-msg-avatar {
  background: var(--sps-green-800);
  color: var(--sps-gold-400);
}

.ai-msg.user .ai-msg-avatar {
  background: var(--slate-800);
  color: #ffffff;
}

.ai-msg-bubble {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--slate-800);
  box-shadow: var(--shadow-sm);
}

.ai-msg.user .ai-msg-bubble {
  background: linear-gradient(135deg, var(--sps-green-800), var(--sps-green-700));
  color: #ffffff;
  border-color: var(--sps-green-800);
  font-weight: 500;
}

.ai-msg-meta {
  font-size: 10.5px;
  color: var(--slate-400);
  margin-top: 4px;
  font-weight: 600;
}

.ai-msg.user .ai-msg-meta {
  text-align: right;
}

.ai-mini-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  overflow: hidden;
}

.ai-mini-table th {
  background: var(--slate-100);
  color: var(--slate-700);
  font-weight: 700;
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--slate-200);
}

.ai-mini-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--slate-100);
}

.ai-mini-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.ai-mini-kpi {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 8px 10px;
}

.ai-mini-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
}

.ai-mini-kpi-val {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--slate-900);
  margin-top: 2px;
}

.ai-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--slate-200);
}

.ai-prompt-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid var(--slate-200);
}

.ai-input-wrap {
  position: relative;
  flex: 1;
}

.ai-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
}

.ai-prompt-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--slate-300);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.ai-prompt-input:focus {
  border-color: var(--sps-green-600);
  box-shadow: 0 0 0 3px rgba(17, 122, 78, 0.12);
}

.ai-send-btn {
  padding: 10px 18px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-radar-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  margin-bottom: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-radar-item:last-child {
  margin-bottom: 0;
}

.ai-radar-item:hover {
  border-color: var(--sps-green-600);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.ai-context-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--slate-200);
  font-size: 12px;
}

.ai-context-row:last-child {
  border-bottom: none;
}

/* ============================================================================
   HORUS TECHNOLOGY & ISO ACCREDITATION FOOTER (LOGIN SCREEN)
   ============================================================================ */
.horus-accreditation-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-200);
  text-align: center;
}

.horus-accreditation-footer img {
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
}

@keyframes turnstileSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.turnstile-spin {
  animation: turnstileSpin 0.85s linear infinite;
}

/* ============================================================================
   SETTING MODULES: BRANDING & TEMA + SETUP NOTIFICATION (WA & SENDGRID)
   ============================================================================ */
.theme-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.theme-preset-card {
  border: 2px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.theme-preset-card:hover {
  border-color: var(--sps-green-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-preset-card.active {
  border-color: var(--sps-green-700);
  background: var(--sps-green-50);
  box-shadow: 0 0 0 3px rgba(17, 122, 78, 0.15);
}

.theme-swatches-bar {
  display: flex;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-swatch-segment {
  flex: 1;
  height: 100%;
}

.logo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.logo-gallery-card {
  border: 2px solid var(--slate-200);
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.logo-gallery-card:hover {
  border-color: var(--sps-green-600);
}

.logo-gallery-card.active {
  border-color: var(--sps-green-700);
  background: var(--sps-green-50);
}

.logo-gallery-preview {
  width: 100%;
  height: 54px;
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.logo-gallery-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.code-block-dark {
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid #334155;
  white-space: pre;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 999px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--sps-green-600);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}




